diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index de707d7c7..203f18b35 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -170,11 +170,12 @@ class GraduationTopicsController < ApplicationController teacher_group = @course.teacher_course_groups.where(:user_id => @graduation_topic.tea_id, :id => params[:group_id]).first unless teacher_group.present? member = @course.course_members.where(:user_id => @graduation_topic.tea_id).first - tip_exception("分班名称不能为空") if params[:course_group_name].blank? - course_group = CourseGroup.find_or_create_by!(:name => params[:course_group_name], :course_id => @course.id) - teacher_group = TeacherCourseGroup.find_or_create_by!(:course_id => @course.id, :course_member_id => member.try(:id), - :user_id => @graduation_topic.tea_id, - :course_group_id => course_group.try(:id)) + if params[:course_group_name].present? + course_group = CourseGroup.find_or_create_by!(:name => params[:course_group_name], :course_id => @course.id) + teacher_group = TeacherCourseGroup.find_or_create_by!(:course_id => @course.id, :course_member_id => member.try(:id), + :user_id => @graduation_topic.tea_id, + :course_group_id => course_group.try(:id)) + end end student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first student_member.update_attributes(:course_group_id => teacher_group.course_group_id) if student_member.present? diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js index eae3fb43d..b0c65009d 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetailTable.js @@ -79,16 +79,15 @@ class GraduateTopicDetailTable extends Component{ }) } sureAgreeTopic=(count)=>{ - if(count > 0){ - let{tableData}=this.props; - let{operationId,classesId}=this.state - let courseId=this.props.match.params.course_id; + let{tableData}=this.props; + let{operationId,classesId}=this.state + let courseId=this.props.match.params.course_id; + + if(classesId!=undefined){ let name=tableData.group_list.filter(item=>item.group_id==classesId)[0].group_name; this.agreeChoose(courseId,operationId,classesId,name); }else{ - this.setState({ - un_choose_notice:"请先添加分班" - }) + this.agreeChoose(courseId,operationId,classesId); } } @@ -205,7 +204,7 @@ class GraduateTopicDetailTable extends Component{ > <div className="newupload_conbox"> <p className="color-grey-9 mb15 edu-txt-center">确认同意学生的选题,将学生加入我的分班</p> - <div className="df"> + { tableData.group_list && tableData.group_list.length===0?"":<div className="df"> <span className="lineh-40 mr10">选择:</span> <div className="flex1"> <Select placeholder="请选择分班" style={{"width":"100%"}} value={classesId} onChange={this.changeClasses}> @@ -220,7 +219,7 @@ class GraduateTopicDetailTable extends Component{ </Select> <p style={{height:"20px",lineHeight:"20px"}}><span className="color-orange-tip">{un_choose_notice}</span></p> </div> - </div> + </div>} <div className="mt20 clearfix edu-txt-center"> <a onClick={this.hideAgreeTopic} className="pop_close task-btn mr30">取消</a> <a className="task-btn task-btn-orange" onClick={()=>this.sureAgreeTopic(tableData.group_list.length)}>确定</a> diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index fee00d4eb..879508ea1 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -363,7 +363,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -757,7 +757,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: "center", @@ -1110,7 +1110,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', @@ -1473,7 +1473,7 @@ class Listofworksstudentone extends Component { ), }, { - title: '截止前完成关卡', + title: '结束前完成关卡', dataIndex: 'completion', key: 'completion', align: 'center', diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 221f90764..de906ad43 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -278,7 +278,7 @@ class Challengesjupyter extends Component { this.setState({ showtime:false }) - }, 500) + }, 800) }else{ this.setState({ @@ -292,7 +292,7 @@ class Challengesjupyter extends Component { }) this.props.showNotification('实训保存失败!'); }) - }, 500) + }, 800) }