diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 203f18b35..9b3021994 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -140,8 +140,8 @@ class GraduationTopicsController < ApplicationController update_graduation_topic_status # 拒绝后将该学生移动到未分班中 - student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first - student_member.update_attributes(:course_group_id => 0) if student_member.present? + # student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first + # student_member.update_attributes(:course_group_id => 0) if student_member.present? student_graduation_topic.tidings.update_all(:status => 1) Tiding.create(:user_id => student_graduation_topic.user_id, :trigger_user_id => current_user.id, @@ -175,10 +175,10 @@ class GraduationTopicsController < ApplicationController 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)) + 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? 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? student_graduation_topic.tidings.update_all(:status => 1) Tiding.create(:user_id => student_graduation_topic.user_id, :trigger_user_id => current_user.id, diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 38238fea7..353833ee2 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -5,6 +5,7 @@ class HackUserLastestCodesController < ApplicationController before_action :update_user_hack_status, only: [:code_debug, :code_submit] before_action :require_auth_identity, only: [:add_notes] before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code] + skip_before_action :check_sign, only: [:listen_result] def show @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 diff --git a/db/migrate/20200102030946_modify_course_group_for_courses.rb b/db/migrate/20200102030946_modify_course_group_for_courses.rb index 8df0943b3..e4a5d62ee 100644 --- a/db/migrate/20200102030946_modify_course_group_for_courses.rb +++ b/db/migrate/20200102030946_modify_course_group_for_courses.rb @@ -11,7 +11,7 @@ class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2] cg.attachment_group_settings.update_all(course_group_id: g.id) cg.homework_group_reviews.update_all(course_group_id: g.id) cg.homework_group_settings.update_all(course_group_id: g.id) - cg.teacher_course_groups.update_all(course_group_id: g.id) + #cg.teacher_course_groups.update_all(course_group_id: g.id) cg.destroy! end end diff --git a/public/images/educoder/RepositoryNoneData.png b/public/images/educoder/RepositoryNoneData.png new file mode 100644 index 000000000..5abfe0e59 Binary files /dev/null and b/public/images/educoder/RepositoryNoneData.png differ diff --git a/public/react/src/modules/courses/busyWork/PublishRightnow.js b/public/react/src/modules/courses/busyWork/PublishRightnow.js index cd1b72633..1b9c8b0f1 100644 --- a/public/react/src/modules/courses/busyWork/PublishRightnow.js +++ b/public/react/src/modules/courses/busyWork/PublishRightnow.js @@ -96,6 +96,7 @@ class PublishRightnow extends Component{ } homeworkstartend=(arg_group_ids,endtime)=>{ + debugger if (this.usingCheckBeforePost && this.props.checkBeforePost) { const goOn = this.props.checkBeforePost(); if (!goOn) { @@ -103,6 +104,7 @@ class PublishRightnow extends Component{ return; } } + debugger const isPublish = this.props.isPublish; let group_ids = arg_group_ids if (this.usingCheckBeforePost) { @@ -110,13 +112,16 @@ class PublishRightnow extends Component{ return item.id }) } - if (this.state.course_groups.length && (!group_ids || group_ids.length == 0)) { - this.props.showNotification('请至少选择一个分班'); - return; + debugger + if(this.state.course_groups.length>0){ + if (this.state.course_groups.length && (!group_ids || group_ids&&group_ids.length == 0)) { + this.props.showNotification('请至少选择一个分班'); + return; + } } let data={} - if(arg_group_ids.length===0){ + if(arg_group_ids&&arg_group_ids.length===0){ data = { homework_ids: this.props.checkBoxValues, end_time: endtime==="Invalid date"?undefined:endtime, diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index f535c01bb..65fcf4d19 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -41,7 +41,7 @@ class GraduationTasksSubmitedit extends Component{ componentDidMount(){ - + this.props.form.validateFields(); let workId=this.props.match.params.work_Id; let url = "/graduation_works/"+workId+"/edit.json"; @@ -367,7 +367,6 @@ class GraduationTasksSubmitedit extends Component{ let {fileList,selectmemberslist,workslist}=this.state; - this.Commoninterface(fileList,selectmemberslist,workslist); // setTimeout(function () { // GraduationTasksnewtype=true @@ -380,27 +379,37 @@ class GraduationTasksSubmitedit extends Component{ let workId=this.props.match.params.work_Id; let userids=[]; + // for(var list of selectmemberslist){ + // if(list.user_id!=undefined&&list.user_id!=null){ + // userids.push(list.user_id) + // } + // } + if(selectmemberslist!=undefined&&selectmemberslist.length>0){ + selectmemberslist.map((list,key)=>{ + if(list.user_id!=undefined&&list.user_id!=null){ + userids.push(list.user_id) + } + }) + } - for(var list of selectmemberslist){ - if(list.user_id!=undefined&&list.user_id!=null){ - userids.push(list.user_id) - } - } let listid=[]; - for(var list of fileList){ - listid.push(list.response == undefined ? list.id : list.response.id) + // for(var list of fileList){ + // listid.push(list.response == undefined ? list.id : list.response.id) + // } + if(fileList!=undefined&&fileList.length>0){ + fileList.map((list,key)=>{ + listid.push(list.response == undefined ? list.id : list.response.id) + }) } - console.log(userids) - this.props.form.validateFields((err, values) => { + this.props.form.validateFields((err, values) => { // console.log(fileList); if(values.description===undefined||values.description===""){ this.scrollToAnchor("valuestypes"); - // debugger return } @@ -593,7 +602,7 @@ class GraduationTasksSubmitedit extends Component{ {description&&description?
- {/*
*/} +