|
@@ -43,7 +43,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { SaveQuestion } from '@/api/exercise';
|
|
|
+import { SaveQuestion, GetExerciseScore } from '@/api/exercise';
|
|
|
import { timeFormatConversion } from '@/utils/transform';
|
|
|
import { exerciseTypeList } from '@/views/exercise_questions/data/questionType';
|
|
|
|
|
@@ -84,6 +84,7 @@ export default {
|
|
|
recognition: this.recognition,
|
|
|
};
|
|
|
},
|
|
|
+ inject: ['exercise_id'],
|
|
|
props: {
|
|
|
curIndex: {
|
|
|
type: Number,
|
|
@@ -97,16 +98,13 @@ export default {
|
|
|
type: Boolean,
|
|
|
required: true,
|
|
|
},
|
|
|
- totalScore: {
|
|
|
- type: Number,
|
|
|
- required: true,
|
|
|
- },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
exerciseTypeList,
|
|
|
timer: null,
|
|
|
curSaveDate: '',
|
|
|
+ totalScore: 0, // 当前卷面分
|
|
|
exerciseComponents: {
|
|
|
select: SelectQuestion,
|
|
|
judge: JudgeQuestion,
|
|
@@ -141,6 +139,9 @@ export default {
|
|
|
return this.exerciseComponents[this.indexList[this.curIndex].type];
|
|
|
},
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getExerciseScore();
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.resetSaveDate();
|
|
|
},
|
|
@@ -222,10 +223,16 @@ export default {
|
|
|
if (this.curSaveDate !== curDate) {
|
|
|
this.curSaveDate = curDate;
|
|
|
}
|
|
|
+ this.getExerciseScore();
|
|
|
} catch (err) {
|
|
|
console.log(err);
|
|
|
}
|
|
|
},
|
|
|
+ getExerciseScore() {
|
|
|
+ GetExerciseScore({ exercise_id: this.exercise_id }).then(({ score }) => {
|
|
|
+ this.totalScore = score;
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 智能识别
|
|
|
* @param {String} text
|