|
@@ -2,14 +2,14 @@
|
|
<div class="question-view">
|
|
<div class="question-view">
|
|
<question-body :questionBody="questionBody" :examQuestionId="examQuestion.id"></question-body>
|
|
<question-body :questionBody="questionBody" :examQuestionId="examQuestion.id"></question-body>
|
|
<div class="ops">
|
|
<div class="ops">
|
|
- <div class="score">({{question.questionScore}}分)</div>
|
|
|
|
|
|
+ <div class="score">({{examQuestion.questionScore}}分)</div>
|
|
</div>
|
|
</div>
|
|
<div v-for="(option, index) in studentAnswer.split('##')" :key="examQuestion.id + index" class="option">
|
|
<div v-for="(option, index) in studentAnswer.split('##')" :key="examQuestion.id + index" class="option">
|
|
<span class="question-options">{{index+1}}. </span>
|
|
<span class="question-options">{{index+1}}. </span>
|
|
<input type="text" name="question" class="input-answer" :value="option" @input="inputAnswer" @blur="submitAnswer" />
|
|
<input type="text" name="question" class="input-answer" :value="option" @input="inputAnswer" @blur="submitAnswer" />
|
|
</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>
|
|
@@ -67,11 +67,20 @@ export default {
|
|
"</span>"
|
|
"</span>"
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- async answerQuestion(examQuestionId, studentAnswer) {
|
|
|
|
- await this.$http.put("/api/exam_question/" + examQuestionId, {
|
|
|
|
|
|
+ async answerQuestion(studentAnswer) {
|
|
|
|
+ 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 });
|
|
|
|
},
|
|
},
|
|
inputAnswer: function() {
|
|
inputAnswer: function() {
|
|
const questionNumber = this.question.body.split(/_{5,}/).length - 1;
|
|
const questionNumber = this.question.body.split(/_{5,}/).length - 1;
|
|
@@ -92,7 +101,7 @@ export default {
|
|
submitAnswer() {
|
|
submitAnswer() {
|
|
const realAnswer = this.studentAnswer.replace(/##/g, "").trim() || null;
|
|
const realAnswer = this.studentAnswer.replace(/##/g, "").trim() || null;
|
|
if (realAnswer !== this.examQuestion.studentAnswer) {
|
|
if (realAnswer !== this.examQuestion.studentAnswer) {
|
|
- this.answerQuestion(this.examQuestion.id, realAnswer);
|
|
|
|
|
|
+ this.answerQuestion(realAnswer);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|