Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
daiao 6 years ago
commit c481d86e70

@ -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

@ -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

@ -4021,7 +4021,10 @@
{
var katexHandle = function() {
div.find("." + editormd.classNames.tex).each(function(){
var tex = $(this);
var tex = $(this);
// 和线上的不一样?
// http://editor.md.ipandao.com/examples/html-preview-markdown-to-html-custom-toc-container.html#Editor.md
// katex.render(tex.html().replace(/&lt;/g, "<").replace(/&gt;/g, ">"), tex[0]);
katex.render(tex.text(), tex[0]);
tex.find(".katex").css("font-size", "1.0em");
});

@ -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);

@ -479,8 +479,8 @@ class Trainingjobsetting extends Component {
return;
}
if (this.state.latededuction <= 0) {
this.props.showNotification(`迟交扣分数不能小于等于`);
if (this.state.latededuction <0) {
this.props.showNotification(`迟交扣分数不能小于`);
return;
}
@ -588,7 +588,7 @@ 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,
@ -604,7 +604,7 @@ 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,
@ -1698,14 +1698,14 @@ class Trainingjobsetting extends Component {
if(rules[i].course_group_id instanceof Array ){
datas.push({
group_id:rules[i].course_group_id,
publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') ,
publish_time:rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') ,
});
}else {
datas.push({
group_id:[rules[i].course_group_id],
publish_time: moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time:moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') ,
publish_time: rules[i].publish_time===undefined||rules[i].publish_time===null||rules[i].publish_time===""?"": moment(rules[i].publish_time).format('YYYY-MM-DD HH:mm') ,
end_time:rules[i].end_time===undefined||rules[i].end_time===null||rules[i].end_time===""?"": moment(rules[i].end_time).format('YYYY-MM-DD HH:mm') ,
});
}

@ -31,7 +31,7 @@ class LoginRegisterComponent extends Component {
seconds: 60,
codes: "",
getverificationcodes: true,
Phonenumberisnotcobool: false,
Phonenumberisnotcobool: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosmmm: undefined,
@ -179,7 +179,7 @@ class LoginRegisterComponent extends Component {
}
//找回密码
Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) {
if (this.state.Phonenumberisnotcobool === false&&this.state.Phonenumberisnotco!==undefined) {
this.openNotification(this.state.Phonenumberisnotco);
this.setState({
Whethertoverify:this.state.Whethertoverify===true?false:true,
@ -189,6 +189,9 @@ class LoginRegisterComponent extends Component {
if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") {
this.setState({
Phonenumberisnotco:"账号不能为空",
Phonenumberisnotcobool: false,
dragOk: false,
Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return
}
@ -197,6 +200,8 @@ class LoginRegisterComponent extends Component {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
dragOk: false,
Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return
}
@ -479,12 +484,15 @@ class LoginRegisterComponent extends Component {
//是否验证通过
dragOkCallback = () => {
console.log(this.state.login);
this.setState({
Phonenumberisnotcosytdhk:undefined,
})
if (this.state.login === "" || this.state.login.length === 0) {
this.setState({
Phonenumberisnotco: "账号不能为空",
Phonenumberisnotcobool: false,
Phonenumberisnotcosytdhk:undefined,
dragOk: false,
Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
@ -500,15 +508,16 @@ class LoginRegisterComponent extends Component {
if (!regph.test(this.state.login)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false,
dragOk:false,
Whethertoverify: this.state.Whethertoverify === true ? false : true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
Phonenumberisnotcosytdhk:undefined,
dragOk: true,
})
} else {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true,
Phonenumberisnotcosytdhk:undefined,
dragOk: true,
});

@ -206,14 +206,18 @@ class LoginRegisterComponent extends Component {
}
//是否验证通过
dragOkCallback = () => {
debugger
this.setState({
Phonenumberisnotcosytdhk:undefined,
})
if (this.state.logins.length === 0) {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
dragOk:true,
Phonenumberisnotcos:"账号不能为空",
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
console.log("s0");
return;
}
// var telephone = $("#telephoneAdd.tianjia_phone").val();
@ -226,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,
@ -253,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,
@ -373,21 +380,28 @@ class LoginRegisterComponent extends Component {
// this.openNotification(`请同意服务协议条款`,2);
// return;
// }
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({
Phonenumberisnotcos:"账号不能为空",
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
}
if(this.state.pciphone===true){
if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
}
}
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({
Phonenumberisnotcos:"账号不能为空",
})
return
} else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
// this.openNotification(`请输入验证码`,2);
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空",
@ -482,6 +496,8 @@ class LoginRegisterComponent extends Component {
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
console.log("s5");
}
return;
} else if (id === 2) {
@ -491,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) {

@ -469,7 +469,7 @@ class AccountBasic extends Component {
width:220px;
}
.basicForm .ant-input-suffix {
line-height: 2.2;
line-height: 2.8;
background: transparent !important;
}
`}</style>

Loading…
Cancel
Save