ysl 6 years ago
commit a4fb17467a

@ -452,6 +452,11 @@ class CoursesIndex extends Component{
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId"
render={
@ -591,16 +596,29 @@ class CoursesIndex extends Component{
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks"
<Route path="/courses/:coursesId/common_homeworks/" strict
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks"
<Route path="/courses/:coursesId/group_homeworks/" strict
render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />)
}

@ -49,8 +49,19 @@ class Fileslists extends Component{
this.seactall(parseInt(this.props.match.params.Id),1)
}
this.updadatalist();
on('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess=()=>{
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.seactall();
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
}
}
componentDidUpdate = (prevProps) => {
if(prevProps.match.params.main_id != this.props.match.params.main_id){
this.setState({

@ -413,6 +413,7 @@ class TopicDetail extends Component {
// md
editor.setValue && editor.setValue('')
const user = this._getUser();
this.setState({
comments: addNewComment(comments, _id, content, user)
@ -423,6 +424,7 @@ class TopicDetail extends Component {
memo: newMemo2
})
this.refs.editor.showEditor();
this.refs.editor.close();
}
@ -661,11 +663,11 @@ class TopicDetail extends Component {
{/* onClick={ this.createNewComment }
enableReplyTo={true}
*/}
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count">
<span className="labal">全部回复</span>
<span className="count">{memo.total_replies_count}</span>
<span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span>
</div>
<Comments comments={comments} user={current_user}

@ -23,7 +23,12 @@ class ConnectProject extends Component{
}
onSubmit = () => {
const { radioValue } = this.state;
const { radioValue, projects } = this.state;
if (projects.length === 0) {
this.closeConnectionProject()
return;
}
if (!radioValue) {
this.props.showNotification('请先在下面的列表中选择项目')
return;
@ -115,7 +120,7 @@ class ConnectProject extends Component{
>
<div className="newupload_conbox clearfix">
{
projects && projects.length &&
projects && !!projects.length &&
<div>
<Search placeholder="请输入项目名称进行搜索" className="with100"
value={this.state.keyword} onInput={(e) => {this.setState({keyword: e.target.value})}}

@ -14,7 +14,7 @@ import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals'
import NoneData from "../coursesPublic/NoneData"
import Titlesearchsection from '../common/titleSearch/TitleSearchSection';
import { RouteHOC } from './common'
import axios from 'axios';
import _ from 'lodash'
@ -71,6 +71,13 @@ class commonWork extends Component{
sureDelClasses(){
}
componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) {
this.componentDidMount()
}
}
componentDidMount(){
this.setState({
@ -429,4 +436,4 @@ class commonWork extends Component{
)
}
}
export default commonWork;
export default RouteHOC() (commonWork);

@ -276,8 +276,8 @@ class CommonWorkAppraiseReply extends Component{
onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"}
></GraduationTasksappraiseMainEditor> }
</div>
<div className={`padding20 ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} memoReplies commentsDelegateParent course-message`}
{/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */}
<div className={`padding20 memoReplies commentsDelegateParent course-message`}
style={{ paddingTop: '0px', paddingBottom: '0px' }}
>
{/*

@ -13,7 +13,8 @@
/* 评论 */
/* 改宽度 */
.course-message .panel-comment_item .comment_orig_content {
width: 1024px;
/* width: 1024px; */
width: 1046px;
}
/* 子回复按钮 */
.course-message .reply_to_message a.commentsbtn.task-btn-blue {
@ -34,7 +35,7 @@
}
.course-message .comment_item_cont:last-child {
/* 作品评阅需要 */
/* border-bottom: none; */
border-bottom: none;
}
.course-message .memoMore {
@ -44,4 +45,8 @@
.course-message .memoMore .writeCommentBtn {
right: 35px;
top: 2px;
}
}
.panel-comment_item .comment_content {
margin-top: 4px;
}

@ -55,12 +55,12 @@ class CoursesBanner extends Component {
let courseId = this.props.match.params.coursesId;
let url = "/courses/" + courseId + "/top_banner.json"
axios.get(url).then((result) => {
let data = result.data;
this.setState({
coursedata: data
})
// console.log(data)
if( result!=undefined){
let data = result.data;
this.setState({
coursedata: data
})
}
})
}
showeditmenu = () => {

@ -200,7 +200,7 @@ class HomeworkModal extends Component{
{this.props.modaltype===undefined||this.props.modaltype===2||this.props.modaltype===4
|| !course_groups || course_groups.length == 0
|| this.props.usingCheckBeforePost ?"":<ul className="upload_select_box fl clearfix mt20 mb30"
style={{"overflow-y":"auto"}}
style={{"overflow-y":"auto",padding:"10px 0px"}}
id="search_not_members_list"
// onScroll={this.contentViewScroll}
@ -221,8 +221,8 @@ class HomeworkModal extends Component{
{
course_groups.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li style={{ width: '100%'}}>
<div className="clearfix edu-txt-center lineh-40" key={key}>
<li style={{ width: '100%',padding: "0px 10px"}}>
<Checkbox
className="task-hide edu-txt-left"
name="shixun_homework[]"

@ -5,7 +5,7 @@ import ExerciseListItem from './ExerciseListItem'
import axios from 'axios';
import Modals from '../../modals/Modals';
import '../css/members.css'
import { WordsBtn } from 'educoder'
import { WordsBtn,on, off, trigger } from 'educoder'
import '../css/busyWork.css'
import _ from 'lodash';
import moment from 'moment'
@ -54,8 +54,13 @@ class Exercise extends Component{
// 加载列表
componentDidMount(){
this.reloadList();
on('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess=()=>{
this.reloadList();
}
reloadList=()=>{
this.setState({
isSpin:true

@ -73,8 +73,9 @@ class ExerciseReviewAndAnswer extends Component{
setScoreReason:undefined,
setTip:"",
Id:undefined
Id:undefined,
// 试卷总分
exerciseTotalScore:undefined
}
}
componentDidUpdate (prevProps) {
@ -185,7 +186,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_answer_user:result.data.exercise_answer_user,
exercise_questions:result.data.exercise_questions,
user_exercise_status:1,
Id:result.data.exercise_answer_user.user_id
Id:result.data.exercise_answer_user.user_id,
exerciseTotalScore:result.data.exercise_answer_user.score
})
}
}).catch((error)=>{
@ -207,7 +209,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_scores:result.data.exercise_scores,
exercise_questions:result.data.exercise_questions,
user_exercise_status:result.data.exercise.user_exercise_status,
time:result.data.exercise.left_time
time:result.data.exercise.left_time,
exerciseTotalScore:result.data.user_score
})
if(result.data.exercise.left_time != null){
this.remainTime();
@ -490,7 +493,8 @@ class ExerciseReviewAndAnswer extends Component{
modalsBottomval,
ModalCancel,
ModalSave,
Loadtype
Loadtype,
exerciseTotalScore
}=this.state
let isAdmin = this.props.isAdmin();
let isStudent =this.props.isStudent();
@ -579,8 +583,8 @@ class ExerciseReviewAndAnswer extends Component{
exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span>
}
{
exercise_answer_user && !!exercise_answer_user.score &&
<span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exercise_answer_user.score }</span> </span>
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
<span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exerciseTotalScore }</span> </span>
}
</span>
{
@ -656,7 +660,7 @@ class ExerciseReviewAndAnswer extends Component{
return(
<div className="bor-top-greyE pt30 pb30" id={"Anchor_"+parseInt(key+1)}>
<p className="clearfix font-16 pl30 pr30">
<span className="color-blue mr5">{exercise_questions.q_position}{type[item.question_type]}</span><span className="color-grey-9 mr5">({item.question_score})</span>
<span className="color-blue mr5">{item.q_position}{type[item.question_type]}</span><span className="color-grey-9 mr5">({item.question_score})</span>
<span className="fr">
{
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮

@ -65,7 +65,7 @@ class fillEmpty extends Component{
if(array[i].value ==""){ count++; }
}
let k = count==array.length ? 0 : 1;
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.question_number)-1,k);
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.q_position)-1,k);
}
}).catch((error)=>{
console.log(error);
@ -115,11 +115,11 @@ class fillEmpty extends Component{
<input value={item.value} className="input-100-35" style={{backgroundColor: "#F5F5F5",cursor:"default"}} placeholder={ isStudent && item.value ? `请输入填空${key+1}的答案` : "" } readOnly/>
:
<DMDEditor
ref={`md${questionType.question_number}${key}`}
ref={`md${questionType.q_position}${key}`}
toMDMode={this.toMDMode} toShowMode={this.toShowMode}
height={150} className={'optionMdEditor'} watch={false} noStorage={true}
mdID={item.q_id +"_"+ key} placeholder={`输入填空${key+1}的答案`} onChange={(value) => this.onOptionContentChange(value, key)}
initValue={item.value} onCMBlur={()=>this.onBlurEmpty(key,questionType.question_number)}
mdID={questionType.question_id +"_"+ key} placeholder={`输入填空${key+1}的答案`} onChange={(value) => this.onOptionContentChange(value, key)}
initValue={item.value} onCMBlur={()=>this.onBlurEmpty(key,questionType.q_position)}
></DMDEditor>
}
</div>

@ -25,7 +25,7 @@ class Multiple extends Component{
}else{
k=0;
}
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.question_number)-1,k);
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.q_position)-1,k);
}
}).catch((error)=>{
console.log(error);
@ -39,6 +39,7 @@ class Multiple extends Component{
user_exercise_status
}=this.props
let isStudent =this.props.isStudent();
console.log(questionType);
return(
<div className="pl30 pr30">
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} defaultValue={questionType.user_answer}>

@ -269,7 +269,7 @@ class shixunAnswer extends Component{
}
{
item.operation ?
<a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${index+1}`)}>查看</a>
<a className={isAdmin ? "color-blue ml20":"color-blue"} target="_blank" href='javascript:void(0)' onClick={()=>this.scrollToAnchor(`${questionType.question_id}${index+1}`)}>查看</a>
:
<a className={isAdmin ? "color-grey-9 ml20":"color-grey-9"} target="_blank" href='javascript:void(0)'>--</a>
}
@ -292,7 +292,7 @@ class shixunAnswer extends Component{
{
challenge.map((item,key)=>{
return(
<div className="pl30 pr30" id={`challenge_${key+1}`}>
<div className="pl30 pr30" id={`challenge_${questionType.question_id}${key+1}`}>
<p className="clearfix mb20">
<span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF">
<i className="fa fa-code font-16 color_white"></i>

@ -30,7 +30,7 @@ class simpleAnswer extends Component{
// simpleValue:undefined
// })
let k= simpleAnswer == "" ? 0 :1;
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.question_number)-1,k);
this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.q_position)-1,k);
}
}).catch((error)=>{
console.log(error);

@ -1,26 +1,18 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip ,Spin} from "antd";
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import {WordsBtn, on, off, trigger } from 'educoder';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal";
import PathModal from "../coursesPublic/PathModal";
import AddcoursesNav from "../coursesPublic/AddcoursesNav";
import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish'
import ImmediatelyEnd from './pollPublicBtn/ImmediatelyEnd'
import PollListItem from './PollListItem'
import NoneData from '../coursesPublic/NoneData'
import UseBank from '../busyWork/UseBank'
import ImmediatelyPublish from './pollPublicBtn/ImmediatelyPublish';
import ImmediatelyEnd from './pollPublicBtn/ImmediatelyEnd';
import PollListItem from './PollListItem';
import NoneData from '../coursesPublic/NoneData';
import UseBank from '../busyWork/UseBank';
import _ from 'lodash';
import '../css/members.css'
import '../css/busyWork.css'
import { WordsBtn } from 'educoder'
import Modals from '../../modals/Modals'
import axios from 'axios'
import '../css/members.css';
import '../css/busyWork.css';
import Modals from '../../modals/Modals';
import axios from 'axios';
const Search = Input.Search;
@ -144,7 +136,16 @@ class Poll extends Component{
})
let{type,StudentList_value,page}=this.state
this.InitList(type,StudentList_value,page);
on('updateNavSuccess', this.updateNavSuccess)
}
updateNavSuccess=()=>{
this.setState({
isSpin:true
})
let{type,StudentList_value,page}=this.state
this.InitList(type,StudentList_value,page);
}
//切换分页
changePage=(pageNumber)=>{

@ -57,29 +57,52 @@ class ShixunHomework extends Component{
isSpin:false
}
}
updateNavSuccess=()=>{
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.setState({
isSpin:true
})
this.seactall();
if(this.props.isAdmin()===true){
this.updadatalist()
}
}else if(this.props.match.params.category_id){
this.setState({
isSpin:true
})
this.seactall(parseInt(this.props.match.params.category_id))
if(this.props.isAdmin()===true){
this.updadatalist()
}
}
}
componentDidMount() {
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.setState({
isSpin:true
})
this.seactall();
if(this.props.isAdmin()===true){
this.updadatalist()
}
}else if(this.props.match.params.category_id){
this.setState({
isSpin:true
})
this.seactall(parseInt(this.props.match.params.category_id))
if(this.props.isAdmin()===true){
this.updadatalist()
}
}
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.setState({
isSpin:true
})
this.seactall();
if(this.props.isAdmin()===true){
this.updadatalist()
}
}else if(this.props.match.params.category_id){
this.setState({
isSpin:true
})
this.seactall(parseInt(this.props.match.params.category_id))
if(this.props.isAdmin()===true){
this.updadatalist()
}
}
on('updateNavSuccess', this.updateNavSuccess)
}
seactall=(id)=>{
this.setState({

@ -128,7 +128,8 @@ class MemoDetailMDEditor extends Component {
<style>{`
.mockInputWrapper {
display: flex;
padding: 30px 20px 30px 20px;
padding: 20px 30px 20px 30px;
border-bottom: 1px solid #EEEEEE;
}
.mockInputWrapper input {
flex:1;
@ -146,6 +147,9 @@ class MemoDetailMDEditor extends Component {
width: 60px;
margin-right: 0px !important;
}
.commentInput {
border-bottom: 1px solid #EEEEEE;
}
.commentInput .editormd{
width:100%!important;
}
@ -178,10 +182,12 @@ class MemoDetailMDEditor extends Component {
<div className="editor__resize" href="javascript:void(0);">调整高度</div>
{ errorMsg && <span className="fl" style={{color: 'red', marginTop: '6px',
marginLeft: '4px'}}>{errorMsg}</span> }
<a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)"
onClick={this.onCommit} className="commentsbtn task-btn task-btn-blue fr">
{this.props.buttonText || '发送'}
</a>
<div style={{height: "16px"}}>
<a id={`new_message_submit_btn_${memo.id}`} href="javascript:void(0)"
onClick={this.onCommit} className="commentsbtn task-btn task-btn-blue fr">
{this.props.buttonText || '发送'}
</a>
</div>
</div>
</React.Fragment>
);

@ -18,7 +18,7 @@
}
#forum_list .return_btn {
line-height: 38px;
margin-right: 15px;
/* margin-right: 15px; */
font-size: 14px;
cursor: pointer;
}

@ -46,7 +46,8 @@ class Infos extends Component{
type:0,
login:undefined,
isRenders:false,
moduleName:"courses"
moduleName:"courses",
next_gold:undefined
}
}
componentDidMount =()=>{
@ -75,7 +76,8 @@ class Infos extends Component{
data:result.data,
followed:result.data.followed,
sign:result.data.brief_introduction,
id:result.data.id
id:result.data.id,
next_gold:result.data.tomorrow_attendance_gold
})
}
}).catch((error)=>{
@ -133,6 +135,9 @@ class Infos extends Component{
data : update(prevState.data, {attendance_signed: {$set: true} })
})
)
this.setState({
next_gold:result.data.next_gold
})
}
}).catch((error)=>{
console.log(error);
@ -195,7 +200,8 @@ class Infos extends Component{
id,
login,
isRenders,
moduleName
moduleName,
next_gold
}=this.state;
let {username}= this.props.match.params;
@ -291,7 +297,7 @@ class Infos extends Component{
data.attendance_signed ?
<React.Fragment>
<span className="user_default_btn user_grey_btn mb5 fl">已签到</span>
<span id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{data && data.tomorrow_attendance_gold}</font>&nbsp;</span>
<span id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到&nbsp;<font className="color-orange">+{next_gold}</font>&nbsp;</span>
</React.Fragment>
:
<a herf="javascript:void(0);" onClick={this.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
@ -302,7 +308,7 @@ class Infos extends Component{
:
<div className="inline">
<a href="javascript:void(0);" onClick={this.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
<a href={`/users/${login}/message_detail?user_id=${id}`} className="user_default_btn user_private_btn fl">私信</a>
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${login}/message_detail?user_id=${id}`} className="user_default_btn user_private_btn fl">私信</a>
</div>
}
</div>

@ -122,7 +122,7 @@ class InfosProject extends Component{
<div className="square-list clearfix">
{
!isStudent && page == 1 && !category && is_current &&
<Create href={"/projects/new"} name={"新建项目"} index="4"></Create>
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建项目"} index="4"></Create>
}
{
(!data || data.projects.length==0) && (isStudent || category) && <NoneData></NoneData>
@ -130,7 +130,7 @@ class InfosProject extends Component{
{
data && data.projects && data.projects.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`/projects/${item.id}`,item.can_visited)} style={{"cursor": "pointer"}}>
<div className="square-Item" onClick={()=>this.turnToCourses(`${this.props.Headertop && this.props.Headertop.old_url}/projects/${item.id}`,item.can_visited)} style={{"cursor": "pointer"}}>
{
item.is_public==1 &&
<React.Fragment>

Loading…
Cancel
Save