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

dev_hs
cxt 6 years ago
commit 0e1ee19f0e

@ -558,7 +558,7 @@ module ExercisesHelper
standard_answer = standard_answer.first.to_s.split("").map(&:to_i)
end
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
if user_answer_content == standard_answer.sort #答案一致,多选或单选才给分,答案不对不给分
if standard_answer.size > 0
q_score_1 = q.question_score
else

@ -49,6 +49,20 @@ class ExerciceNew extends Component{
}
}
// 已发布试卷编辑保存的确认弹框
changeScore = (question_id,answerArray) =>{
this.props.confirm({
content:'修改了标准答案',
subContent:"是否重新计算学生答题的成绩?",
onOk:()=>{
this.sureChangeScore(question_id,answerArray)
},
onCancel:()=>{
this.addSuccess();
}
})
}
// 已发布试卷修改答案确认修改分数
sureChangeScore = (question_id,answerArray) =>{
let url=`/exercise_questions/${question_id}/update_scores.json`
@ -398,6 +412,7 @@ class ExerciceNew extends Component{
addSuccess: this.addSuccess,
addQuestion: this.addQuestion,
onEditorCancel: this.onEditorCancel,
changeScore:this.changeScore,
editQestion: this.editQestion,
onSortDown: this.onSortDown,
onSortUp: this.onSortUp,
@ -523,7 +538,7 @@ class ExerciceNew extends Component{
{ exercise_questions.map((item, index) => {
if (item.question_type == 0 || item.question_type == 1) {
if (item.isNew) {
return <SingleEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></SingleEditor>
return <SingleEditor {...this.props} {...item} index={index} {...commonHandler}></SingleEditor>
} else {
return <SingleDisplay {...this.props} {...item} index={index} {...commonHandler}
displayCount={exercise_questions.length}
@ -531,13 +546,13 @@ class ExerciceNew extends Component{
}
} else if (item.question_type == 2) {
if (item.isNew) {
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></JudgeEditor>
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler}></JudgeEditor>
} else {
return <JudgeDisplay {...this.props} {...item} index={index} {...commonHandler} ></JudgeDisplay>
}
} else if (item.question_type == 3) {
if (item.isNew) {
return <NullEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></NullEditor>
return <NullEditor {...this.props} {...item} index={index} {...commonHandler}></NullEditor>
} else {
return <NullDisplay {...this.props} {...item} index={index} {...commonHandler} ></NullDisplay>
}

@ -97,16 +97,8 @@ class SingleEditor extends Component{
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
this.props.confirm({
content:'修改了标准答案',
subContent:"是否重新计算学生答题的成绩?",
onOk:()=>{
this.props.sureChangeScore(question_id,answerArray)
},
onCancel:()=>{
this.props.addSuccess();
}
})
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.catch(function (error) {

@ -137,16 +137,8 @@ class NullEditor extends Component{
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
this.props.confirm({
content:'修改了标准答案',
subContent:"是否重新计算学生答题的成绩?",
onOk:()=>{
this.props.sureChangeScore(question_id,answerArray)
},
onCancel:()=>{
this.props.addSuccess();
}
})
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.catch(function (error) {

@ -135,16 +135,8 @@ class SingleEditor extends Component{
if (response.data.status == 0) {
this.props.addSuccess()
}else if(response.data.status == 3){
this.props.confirm({
content:'修改了标准答案',
subContent:"是否重新计算学生答题的成绩?",
onOk:()=>{
this.props.sureChangeScore(question_id,answerArray)
},
onCancel:()=>{
this.props.addSuccess();
}
})
// 已发布试卷编辑保存
this.props.changeScore(question_id,answerArray);
}
})
.catch(function (error) {

Loading…
Cancel
Save