diff --git a/app/controllers/add_school_applies_controller.rb b/app/controllers/add_school_applies_controller.rb index 22b3d360a..e0a09665d 100644 --- a/app/controllers/add_school_applies_controller.rb +++ b/app/controllers/add_school_applies_controller.rb @@ -1,5 +1,5 @@ class AddSchoolAppliesController < ApplicationController - before_action :require_login, :check_auth + before_action :require_login def create school = CreateAddSchoolApplyService.call(current_user, create_params) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 230e7f387..faad02173 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -914,7 +914,7 @@ class CoursesController < ApplicationController teacher_already_exist = current_user.teacher_of_course_non_active? course unless teacher_already_exist existing_course_message = CourseMessage.find_by(course_id: course.id, course_message_id: current_user.id, - course_message_type: "JoinCourseRequest", status: 0, viewed: false) + course_message_type: "JoinCourseRequest", status: 0) if existing_course_message.blank? course_message = CourseMessage.new(course_id: course.id, user_id: course.tea_id, status: 0, course_message_id: current_user.id, course_message_type: "JoinCourseRequest", @@ -924,10 +924,12 @@ class CoursesController < ApplicationController course_message.save! - role = course_message.content == 2 ? '7' : '9' # 7:老师 9:助教 + role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师 ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role) teacher_role = 1 - message = "#{course_message.content == 2 ? '教师' : '助教'}申请已提交,请等待审核" + message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" + else + message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核" end end end @@ -941,7 +943,7 @@ class CoursesController < ApplicationController end rescue => e uid_logger(e.message) - tip_exception("加入课堂失败") + tip_exception(e.message) raise ActiveRecord::Rollback end end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 4c8d2a729..f92ed8e2e 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -38,7 +38,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("子目录id有误") if !@category.present? @homework_commons = @homework_commons.where(course_second_category_id: params[:category]) elsif @homework_type == 4 - @homework_commons = @homework_commons.where(course_second_category_id: 0) + @homework_commons = @homework_commons end @all_count = @homework_commons.size @@ -540,7 +540,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("补交结束时间必须晚于截止时间") if params[:late_time] <= strf_time(@homework.end_time) tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] > strf_time(@course.end_date.end_of_day) - tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0 + tip_exception("迟交扣分不能小于0") if params[:late_penalty] && params[:late_penalty].to_i < 0 @homework.allow_late = true @homework.late_time = params[:late_time] @@ -560,7 +560,7 @@ class HomeworkCommonsController < ApplicationController tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil? tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil? tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank? - tip_exception("效率分应为正整数") if params[:eff_score] && params[:eff_score].to_i < 0 + tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_i <= 0 tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank? tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank? # tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank? @@ -734,16 +734,16 @@ class HomeworkCommonsController < ApplicationController if !@homework_detail_manual.final_mode tip_exception("教师评分比例不能为空") if params[:te_proportion].blank? te_proportion = params[:te_proportion].to_f.round(2) - tip_exception("教师评分比例不能小于零") if te_proportion < 0 + tip_exception("教师评分比例不能小于0") if te_proportion < 0 tip_exception("助教评分比例不能为空") if params[:ta_proportion].blank? ta_proportion = params[:ta_proportion].to_f.round(2) - tip_exception("助教评分比例不能小于零") if ta_proportion < 0 + tip_exception("助教评分比例不能小于0") if ta_proportion < 0 if !@homework.anonymous_comment tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion) > 1.0 else tip_exception("学生评分比例不能为空") if params[:st_proportion].blank? st_proportion = params[:st_proportion].to_f.round(2) - tip_exception("学生评分比例不能小于零") if st_proportion < 0 + tip_exception("学生评分比例不能小于0") if st_proportion < 0 tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion + st_proportion) > 1.0 end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index fa51de6b7..8c2aeb479 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -199,7 +199,8 @@ module CoursesHelper # 获取课堂的作业数 def get_homework_commons_count(course, type, category_id) - HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size + category_id == 0 ? HomeworkCommon.where(course_id: course.id, homework_type: type).size : + HomeworkCommon.where(course_id: course.id, homework_type: type, course_second_category_id: category_id).size end diff --git a/app/models/user.rb b/app/models/user.rb index 34576db66..f2d9c7fb1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -161,7 +161,7 @@ class User < ApplicationRecord end def git_mail - mail || "#{login}@educoder.net" + mail.blank? ? "#{login}@educoder.net" : mail end # 学号 diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 707c4ba9b..ad7172be5 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -505,7 +505,7 @@ class Coursesleftnav extends Component{ }else if(NavmodalValue.length>20){ this.setState({ NavmodalValuetype:true, - NavmodalValues:"名称不能超过20个字" + NavmodalValues:"名称不能超过60个字" }) return } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 462ec541f..8bb2bbcfd 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1017,6 +1017,7 @@ class Listofworksstudentone extends Component { view_report: result.data.view_report, allow_late:result.data.allow_late, loadingstate: false, + computeTimetype:true, }) this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 3d1aecf5b..b07392153 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -196,8 +196,8 @@ class Trainingjobsetting extends Component { array.push({ course_group_id: result.data.group_settings[i].group_id, course_group_name: result.data.group_settings[i].group_name, - publish_time: result.data.group_settings[i].publish_time, - end_time: result.data.group_settings[i].end_time, + publish_time: moment(result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm'), + end_time: moment(result.data.group_settings[i].end_time).format('YYYY-MM-DD HH:mm'), publish_flag: "", end_flag: "", class_flag: "", @@ -215,8 +215,8 @@ class Trainingjobsetting extends Component { arrays.push({ course_group_id:result.data.group_settings[i].group_id, course_group_name:result.data.group_settings[i].group_name, - publish_time:result.data.group_settings[i].publish_time, - end_time:result.data.group_settings[i].end_time, + publish_time:moment( result.data.group_settings[i].publish_time).format('YYYY-MM-DD HH:mm') , + end_time:moment(result.data.group_settings[i].end_time ).format('YYYY-MM-DD HH:mm'), course_choosed:0, }) @@ -447,8 +447,8 @@ class Trainingjobsetting extends Component { } else { let rulesdata=this.state.rulesdata; - // console.log("pustdate123131312321321321"); - // console.log(rulesdata); + console.log("pustdate123131312321321321"); + console.log(rulesdata); if( rulesdata.length === 0){ this.props.showNotification(`分班发布设置不能为空`); @@ -577,6 +577,8 @@ class Trainingjobsetting extends Component { this.props.showNotification(`没有关卡不能更新设置`); return; } + + if(this.state.unifiedsetting === true){ console.log("统一设置"); data = { @@ -588,23 +590,37 @@ class Trainingjobsetting extends Component { late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 - eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : 0,//占比分 + eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, challenge_settings: array, score_open: this.state.publicwork, } }else{ - //非统一配置 - console.log("非统一设置"); + // //非统一配置 + // console.log("非统一设置"); + let rulesdata=this.state.rulesdata; + + let newlist=[] + + rulesdata.map((item,key)=>{ + + if(item.publish_time==="Invalid date"||item.end_time==="Invalid date"||item.publiend_timesh_time==="Invalid date"){ + + }else{ + newlist.push(item) + } + + }) + data = { unified_setting: this.state.unifiedsetting, //非统一配置 - group_settings: this.state.rulesdata, + group_settings: newlist, allow_late: this.state.allowreplenishment, //补交 late_penalty: parseInt(this.state.latededuction), //迟交扣分 late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 - eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : 0,//占比分 + eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, challenge_settings: array, score_open: this.state.publicwork, @@ -1710,8 +1726,8 @@ class Trainingjobsetting extends Component { } } - console.log(rules) - console.log(datas) + console.log(rules); + console.log(datas); this.setState({ rules, rulesdata:datas, diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 0e95f1a48..fc75961ec 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -469,7 +469,7 @@ class DetailCards extends Component{ { showparagraphkey===key&&showparagraphindex===index?
:"" } diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 6ee2a1de1..408ca6142 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -31,7 +31,7 @@ class LoginRegisterComponent extends Component { seconds: 60, codes: "", getverificationcodes: true, - Phonenumberisnotcobool: false, + Phonenumberisnotcobool: true, Phonenumberisnotco: undefined, Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosmmm: undefined, @@ -109,12 +109,13 @@ class LoginRegisterComponent extends Component { return; } //拖动滑动验证 - if(this.state.dragOk === false){ - this.openNotification("拖动滑块验证"); - return; + if(this.state.pciphone===true) { + if (this.state.dragOk === false) { + this.openNotification("拖动滑块验证"); + return; + } } - if (this.state.getverificationcodes === true) { this.setState({ getverificationcodes: undefined, @@ -508,11 +509,10 @@ class LoginRegisterComponent extends Component { if (!regph.test(this.state.login)) { stringdata = "手机号格式不正确"; this.setState({ - Phonenumberisnotco: stringdata, - Phonenumberisnotcobool: false, + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, Phonenumberisnotcosytdhk:undefined, - dragOk:false, - Whethertoverify: this.state.Whethertoverify === true ? false : true, + dragOk: true, }) } else { this.setState({ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 8da41e0e9..2e506af50 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -206,7 +206,6 @@ class LoginRegisterComponent extends Component { } //是否验证通过 dragOkCallback = () => { - debugger this.setState({ Phonenumberisnotcosytdhk:undefined, }) @@ -217,6 +216,8 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) + console.log("s0"); + return; } // var telephone = $("#telephoneAdd.tianjia_phone").val(); @@ -229,11 +230,11 @@ class LoginRegisterComponent extends Component { if (!regph.test(this.state.logins)) { stringdata = "手机号格式不正确"; this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, }) + console.log("s1"); } else { this.setState({ Phonenumberisnotcos: undefined, @@ -256,9 +257,12 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcobool: true, dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, - }) + }); + console.log("s2"); + return } else { + console.log("s222222"); this.setState({ Phonenumberisnotcos: undefined, Phonenumberisnotcobool: false, @@ -492,6 +496,8 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) + console.log("s5"); + } return; } else if (id === 2) { @@ -501,7 +507,9 @@ class LoginRegisterComponent extends Component { dragOk:false, Whethertoverify:this.state.Whethertoverify===true?false:true, }) - return; + console.log("s6"); + + return; } }else { if (id === 1) { @@ -581,10 +589,12 @@ class LoginRegisterComponent extends Component { }) return; } - if(this.state.dragOk === false){ - this.openNotification("拖动滑块验证"); - return; - } + if(this.state.pciphone===true) { + if (this.state.dragOk === false) { + this.openNotification("拖动滑块验证"); + return; + } + } if (this.state.getverificationcodes === true) { this.setState({