|
@@ -5,16 +5,16 @@
|
|
<div class="stu-answer">{{studentAnswer}}</div>
|
|
<div class="stu-answer">{{studentAnswer}}</div>
|
|
<div class="score">({{question.questionScore}}分)</div>
|
|
<div class="score">({{question.questionScore}}分)</div>
|
|
</div>
|
|
</div>
|
|
- <div @click="() => answerQuestion(examQuestion.id, '正确')">
|
|
|
|
|
|
+ <div @click="() => answerQuestion('正确')">
|
|
<input type="radio" name="question" value="正确" :checked="studentAnswer === '正确'" />
|
|
<input type="radio" name="question" value="正确" :checked="studentAnswer === '正确'" />
|
|
<span class="question-options">正确</span>
|
|
<span class="question-options">正确</span>
|
|
</div>
|
|
</div>
|
|
- <div @click="() => answerQuestion(examQuestion.id, '错误')">
|
|
|
|
|
|
+ <div @click="() => answerQuestion('错误')">
|
|
<input type="radio" name="question" value="错误" :checked="studentAnswer === '错误'" />
|
|
<input type="radio" name="question" value="错误" :checked="studentAnswer === '错误'" />
|
|
<span class="question-options">错误</span>
|
|
<span class="question-options">错误</span>
|
|
</div>
|
|
</div>
|
|
<div class="reset">
|
|
<div class="reset">
|
|
- <i-button type="warning" size="large" @click="() => answerQuestion(examQuestion.id, null)">重置答案</i-button>
|
|
|
|
|
|
+ <i-button type="warning" size="large" @click="() => answerQuestion(null)">重置答案</i-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -49,19 +49,28 @@ export default {
|
|
["checkbox", "radio"].includes(document.activeElement.type))
|
|
["checkbox", "radio"].includes(document.activeElement.type))
|
|
) {
|
|
) {
|
|
if ("KeyY" === e.code) {
|
|
if ("KeyY" === e.code) {
|
|
- this.answerQuestion(this.examQuestion.id, "正确");
|
|
|
|
|
|
+ this.answerQuestion("正确");
|
|
}
|
|
}
|
|
if ("KeyN" === e.code) {
|
|
if ("KeyN" === e.code) {
|
|
- this.answerQuestion(this.examQuestion.id, "错误");
|
|
|
|
|
|
+ this.answerQuestion("错误");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async answerQuestion(examQuestionId, studentAnswer) {
|
|
|
|
|
|
+ async answerQuestion(studentAnswer) {
|
|
if (studentAnswer !== this.examQuestion.studentAnswer) {
|
|
if (studentAnswer !== this.examQuestion.studentAnswer) {
|
|
- await this.$http.put("/api/exam_question/" + examQuestionId, {
|
|
|
|
|
|
+ await this.$http.post(
|
|
|
|
+ "/api/ecs_oe_student/examQuestion/submitQuestionAnswer",
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ order: this.examQuestion.order,
|
|
|
|
+ studentAnswer: studentAnswer
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
|
|
+ this.updateExamQuestion({
|
|
|
|
+ order: this.$route.params.order,
|
|
studentAnswer
|
|
studentAnswer
|
|
});
|
|
});
|
|
- this.updateExamQuestion({ examQuestionId, studentAnswer });
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|