|
@@ -2,17 +2,17 @@
|
|
<div v-if="exam && examQuestion()" class="container">
|
|
<div v-if="exam && examQuestion()" class="container">
|
|
<div class="header">
|
|
<div class="header">
|
|
<RemainTime></RemainTime>
|
|
<RemainTime></RemainTime>
|
|
- <OverallProgress :exam-question-list="validQuestions"></OverallProgress>
|
|
|
|
- <QuestionFilters :exam-question-list="validQuestions"></QuestionFilters>
|
|
|
|
|
|
+ <OverallProgress :exam-question-list="examQuestionList"></OverallProgress>
|
|
|
|
+ <QuestionFilters :exam-question-list="examQuestionList"></QuestionFilters>
|
|
<Button class="qm-primary-button" @click="submitPaper">交卷</Button>
|
|
<Button class="qm-primary-button" @click="submitPaper">交卷</Button>
|
|
</div>
|
|
</div>
|
|
<div class="main">
|
|
<div class="main">
|
|
<QuestionView :exam-question="examQuestion()"></QuestionView>
|
|
<QuestionView :exam-question="examQuestion()"></QuestionView>
|
|
- <ArrowNavView :previous-exam-question="preExamQuestion" :next-exam-question="nextExamQuestion"></ArrowNavView>
|
|
|
|
|
|
+ <ArrowNavView :previousQuestionOrder="previousQuestionOrder" :nextQuestionOrder="nextQuestionOrder"></ArrowNavView>
|
|
</div>
|
|
</div>
|
|
<div class="side">
|
|
<div class="side">
|
|
<div class="question-nav">
|
|
<div class="question-nav">
|
|
- <QuestionNavView :paperStruct="paperStruct" :validQuestions="validQuestions" />
|
|
|
|
|
|
+ <QuestionNavView :paperStruct="paperStruct" />
|
|
</div>
|
|
</div>
|
|
<div class="camera">
|
|
<div class="camera">
|
|
<!-- <FaceRecognition width="100%" height="100%" :showRecognizeButton="false" /> -->
|
|
<!-- <FaceRecognition width="100%" height="100%" :showRecognizeButton="false" /> -->
|
|
@@ -30,17 +30,15 @@ import ArrowNavView from "./ArrowNavView.vue";
|
|
import QuestionNavView from "./QuestionNavView.vue";
|
|
import QuestionNavView from "./QuestionNavView.vue";
|
|
import FaceRecognition from "../../../components/FaceRecognition/FaceRecognition";
|
|
import FaceRecognition from "../../../components/FaceRecognition/FaceRecognition";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
-const { mapState, mapMutations, mapGetters } = createNamespacedHelpers(
|
|
|
|
- "examingHomeModule"
|
|
|
|
-);
|
|
|
|
|
|
+const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "ExamingHome",
|
|
name: "ExamingHome",
|
|
created() {
|
|
created() {
|
|
this.initData();
|
|
this.initData();
|
|
- if (!this.$route.query.order) {
|
|
|
|
|
|
+ if (!this.$route.params.order) {
|
|
// created can access this.$route?
|
|
// created can access this.$route?
|
|
- this.$router.push(this.$route.fullPath + "&order=" + 4);
|
|
|
|
|
|
+ this.$router.push(this.$route.fullPath + "/order/1");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -55,7 +53,7 @@ export default {
|
|
);
|
|
);
|
|
const paperStruct = await this.$http.get(
|
|
const paperStruct = await this.$http.get(
|
|
"/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
|
|
"/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
|
|
- this.$route.query.examRecordDataId
|
|
|
|
|
|
+ this.$route.params.examRecordDataId
|
|
);
|
|
);
|
|
|
|
|
|
const examQuestionList = await this.$http.get(
|
|
const examQuestionList = await this.$http.get(
|
|
@@ -81,11 +79,6 @@ export default {
|
|
|
|
|
|
next && next();
|
|
next && next();
|
|
if (!this.exam) return;
|
|
if (!this.exam) return;
|
|
- // this.examQuestion = this.examQuestionList.find(
|
|
|
|
- // eq => eq.id == this.$route.query.examQuestionId // number == string
|
|
|
|
- // );
|
|
|
|
- // this.preExamQuestion = this.validQuestions[this.examQuestion.orders - 2];
|
|
|
|
- // this.nextExamQuestion = this.validQuestions[this.examQuestion.orders];
|
|
|
|
},
|
|
},
|
|
async submitPaper() {
|
|
async submitPaper() {
|
|
//FIXME: submit precondition
|
|
//FIXME: submit precondition
|
|
@@ -96,18 +89,27 @@ export default {
|
|
return (
|
|
return (
|
|
this.examQuestionList &&
|
|
this.examQuestionList &&
|
|
this.examQuestionList.find(
|
|
this.examQuestionList.find(
|
|
- eq => eq.order == this.$route.query.order // number == string
|
|
|
|
|
|
+ eq => eq.order == this.$route.params.order // number == string
|
|
)
|
|
)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(["exam", "paperStruct", "examQuestionList"]),
|
|
...mapState(["exam", "paperStruct", "examQuestionList"]),
|
|
- ...mapGetters(["validQuestions"]),
|
|
|
|
- preExamQuestion: vm =>
|
|
|
|
- vm.examQuestion && vm.validQuestions[vm.examQuestion.orders - 2],
|
|
|
|
- nextExamQuestion: vm =>
|
|
|
|
- vm.examQuestion && vm.validQuestions[vm.examQuestion.orders]
|
|
|
|
|
|
+ previousQuestionOrder: vm => {
|
|
|
|
+ if (vm.examQuestion().order > 1) {
|
|
|
|
+ return vm.examQuestion().order - 1;
|
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ nextQuestionOrder: vm => {
|
|
|
|
+ if (vm.examQuestion().order < vm.examQuestionList.length) {
|
|
|
|
+ return vm.examQuestion().order + 1;
|
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
$route: function() {
|
|
$route: function() {
|