|
@@ -2,13 +2,13 @@
|
|
|
<div>
|
|
|
<div class="container">
|
|
|
<template v-if="paperStruct && examQuestionList">
|
|
|
- <div v-for="(struct, index1) in paperStruct.defaultPaper.questionGroupList" :key="index1" class="section">
|
|
|
+ <div v-for="(struct, section) in paperStruct.defaultPaper.questionGroupList" :key="section" class="section">
|
|
|
<div class="title">{{struct.groupName}} ({{struct.groupScore}}分)</div>
|
|
|
<div class="list">
|
|
|
- <template v-for="(_, index2) in sectionQuestions(index1)">
|
|
|
- <template v-if="isSelectedQuestion(index1, index2)">
|
|
|
- <div :key="index2" :class="itemClass(index1, index2)">
|
|
|
- <router-link :to="{ path: `/online-exam/exam/${$route.params.examId}/examRecordData/${$route.params.examRecordDataId}/order/${getQuestionNum(index1, index2).order}`}">{{index2+1}}</router-link>
|
|
|
+ <template v-for="(_, index2) in sectionQuestions(section)">
|
|
|
+ <template v-if="isSelectedQuestion(section, index2)">
|
|
|
+ <div :key="index2" :class="itemClass(section, index2)">
|
|
|
+ <router-link :to="{ path: `/online-exam/exam/${$route.params.examId}/examRecordData/${$route.params.examRecordDataId}/order/${getQuestionNum(section, index2).order}`}">{{index2+1}}</router-link>
|
|
|
</div>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -22,7 +22,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { createNamespacedHelpers } from "vuex";
|
|
|
-const { mapState } = createNamespacedHelpers("examingHomeModule");
|
|
|
+const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
|
|
|
|
export default {
|
|
|
name: "QuestionNavView",
|
|
@@ -32,7 +32,9 @@ export default {
|
|
|
props: {
|
|
|
paperStruct: Object
|
|
|
},
|
|
|
+ mounted() {},
|
|
|
methods: {
|
|
|
+ ...mapMutations(["updateCurrentQuestionInfo"]),
|
|
|
getQuestionNum: function(section, index) {
|
|
|
if (
|
|
|
!this.paperStruct ||
|
|
@@ -62,8 +64,8 @@ export default {
|
|
|
// console.log(section, index, total + index);
|
|
|
return this.examQuestionList[total + index];
|
|
|
},
|
|
|
- isSelectedQuestion(index1, index2) {
|
|
|
- let q = this.getQuestionNum(index1, index2);
|
|
|
+ isSelectedQuestion(section, index2) {
|
|
|
+ let q = this.getQuestionNum(section, index2);
|
|
|
|
|
|
if (this.questionFilterType === "ALL") return true;
|
|
|
else if (
|
|
@@ -81,15 +83,15 @@ export default {
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
- itemClass(index1, index2) {
|
|
|
+ itemClass(section, index2) {
|
|
|
const isCurrentQuestion =
|
|
|
- this.$route.params.order == this.getQuestionNum(index1, index2).order; // 故意用的 ==
|
|
|
+ this.$route.params.order == this.getQuestionNum(section, index2).order; // 故意用的 ==
|
|
|
return {
|
|
|
item: true,
|
|
|
"current-question": isCurrentQuestion,
|
|
|
- "star-question": this.getQuestionNum(index1, index2).isSign,
|
|
|
+ "star-question": this.getQuestionNum(section, index2).isSign,
|
|
|
"is-answered":
|
|
|
- this.getQuestionNum(index1, index2).studentAnswer !== null
|
|
|
+ this.getQuestionNum(section, index2).studentAnswer !== null
|
|
|
};
|
|
|
},
|
|
|
sectionQuestions(section) {
|