Merge branch 'dev_aliyun' into dev_cxt2

dev_local_2
cxt 5 years ago
commit 2986586865

@ -1103,6 +1103,7 @@ class ExercisesController < ApplicationController
ActiveRecord::Base.transaction do
begin
can_commit_exercise = false
user_left_time = nil
if @user_course_identity > Course::ASSISTANT_PROFESSOR #为学生时
if params[:commit_method].to_i == 2 #自动提交时
user_left_time = get_exercise_left_time(@exercise,current_user)
@ -1131,7 +1132,7 @@ class ExercisesController < ApplicationController
CommitExercsieNotifyJobJob.perform_later(@exercise.id, current_user.id)
normal_status(0,"试卷提交成功!")
else
normal_status(-1,"提交失败,未到截止时间!")
normal_status(-2,"#{user_left_time.to_i}")
end
else
normal_status(-1,"提交失败,当前用户不为课堂学生!")

@ -167,7 +167,12 @@ class CommonWorkSetting extends Component{
}
on('commonwork_fetch_all', this.fetchAllListener)
}
if(this.props.isAdmin()===true){
this.setState({startEditFlag: true})
}
}
componentWillUnmount() {
off('commonwork_fetch_all', this.fetchAllListener)
}

@ -96,8 +96,8 @@ class ExerciseReviewAndAnswer extends Component{
//window.addEventListener('scroll', this.handleScroll);
}
remainTime=()=>{
let { time } = this.state;
remainTime=(time)=>{
// let { time } = this.state;
let h=moment(parseInt(time)*1000).hour()-8;
let m=moment(parseInt(time)*1000).minutes();
let s=moment(parseInt(time)*1000).seconds();
@ -133,15 +133,21 @@ class ExerciseReviewAndAnswer extends Component{
commit_method:2
}).then((result)=>{
if(result){
this.setState({
Modalstype:true,
Modalstopval:'答题结束了,系统已自动提交试卷',
modalsBottomval:"不能再修改答题",
ModalCancel:undefined,
ModalSave:this.sureCommit,
Loadtype:true
})
this.props.showNotification(`${result.data.message}`);
if(result.data.status===0){
this.setState({
Modalstype:true,
Modalstopval:'答题结束了,系统已自动提交试卷',
modalsBottomval:"不能再修改答题",
ModalCancel:undefined,
ModalSave:this.sureCommit,
Loadtype:true
})
this.props.showNotification(`${result.data.message}`);
}
if(result.data.status===-2){
this.remainTime(parseInt(result.data.message))
}
}
}).catch((error)=>{
console.log(error);
@ -238,7 +244,7 @@ class ExerciseReviewAndAnswer extends Component{
isSpin:false
})
if(result.data.exercise.left_time != null){
this.remainTime();
this.remainTime(result.data.exercise.left_time);
}
}
}).catch((error)=>{

@ -44,9 +44,9 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces
showNotification('保存成功')
onChangeRoleSuccess()
trigger('updatabanner')
if (fetchUser && record.user_id == getUserId) {
fetchUser()
trigger('updatabanner')
}
}

@ -649,6 +649,7 @@ class studentsList extends Component{
combineArray = this.state.application_list
}
const isAdminOrTeacher = this.props.isAdminOrTeacher()
const isAdminOrCreator = this.props.isAdminOrCreator()
const isSuperAdmin = this.props.isSuperAdmin()
const hasGraduationModule = this.hasGraduationModule()
const coursesId = this.props.match.params.coursesId
@ -685,7 +686,7 @@ class studentsList extends Component{
{/* { isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addTeacher()}></WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addStudent()}>添加学生</WordsBtn> } */}
{ isAdmin && <WordsBtn style="blue" className="fr" onClick={()=>this.showChangeAdminModal()}>更换管理员</WordsBtn>}
{ isAdminOrCreator && <WordsBtn style="blue" className="fr" onClick={()=>this.showChangeAdminModal()}>更换管理员</WordsBtn>}
</React.Fragment>
}

Loading…
Cancel
Save