|
|
|
@ -48,6 +48,22 @@ class ExerciceNew extends Component{
|
|
|
|
|
editMode: !this.props.match.params.Id,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 已发布试卷修改答案确认修改分数
|
|
|
|
|
sureChangeScore = (question_id,answerArray) =>{
|
|
|
|
|
let url=`/exercise_questions/${question_id}/update_scores.json`
|
|
|
|
|
axios.post((url),{
|
|
|
|
|
standard_answers:answerArray
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result){
|
|
|
|
|
this.props.showNotification(`${result.data.message}`);
|
|
|
|
|
this.addSuccess();
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchExercise = () => {
|
|
|
|
|
const Id = this.props.match.params.Id
|
|
|
|
|
this.isEdit = !!Id
|
|
|
|
@ -507,7 +523,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} ></SingleEditor>
|
|
|
|
|
return <SingleEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></SingleEditor>
|
|
|
|
|
} else {
|
|
|
|
|
return <SingleDisplay {...this.props} {...item} index={index} {...commonHandler}
|
|
|
|
|
displayCount={exercise_questions.length}
|
|
|
|
@ -515,13 +531,13 @@ class ExerciceNew extends Component{
|
|
|
|
|
}
|
|
|
|
|
} else if (item.question_type == 2) {
|
|
|
|
|
if (item.isNew) {
|
|
|
|
|
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler} ></JudgeEditor>
|
|
|
|
|
return <JudgeEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></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} ></NullEditor>
|
|
|
|
|
return <NullEditor {...this.props} {...item} index={index} {...commonHandler} sureChangeScore={this.sureChangeScore}></NullEditor>
|
|
|
|
|
} else {
|
|
|
|
|
return <NullDisplay {...this.props} {...item} index={index} {...commonHandler} ></NullDisplay>
|
|
|
|
|
}
|
|
|
|
|