|
@@ -6,10 +6,35 @@
|
|
|
<span>返回</span>
|
|
|
</div>
|
|
|
<div class="question-info">
|
|
|
- <div class="round">
|
|
|
- <SvgIcon icon-class="list" />
|
|
|
- <span>{{ curQuestionIndex + 1 }} / {{ questionList.length }}</span>
|
|
|
- </div>
|
|
|
+ <el-popover
|
|
|
+ v-model="isShowQuestionList"
|
|
|
+ :width="200"
|
|
|
+ :disabled="isStart"
|
|
|
+ trigger="click"
|
|
|
+ popper-class="question-wrapper"
|
|
|
+ >
|
|
|
+ <ul class="question-list">
|
|
|
+ <li
|
|
|
+ v-for="({ id, type: question_type }, i) in questionList"
|
|
|
+ :key="id"
|
|
|
+ :class="[{ active: i === curQuestionIndex }]"
|
|
|
+ @click="selectQuestion(i)"
|
|
|
+ >
|
|
|
+ <span>{{ i + 1 }}.</span>
|
|
|
+ <span>{{ exerciseNames[question_type] }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <div
|
|
|
+ slot="reference"
|
|
|
+ :style="{ backgroundColor: isShowQuestionList ? '#E9E8EA' : '' }"
|
|
|
+ class="round question-index"
|
|
|
+ >
|
|
|
+ <SvgIcon icon-class="list" />
|
|
|
+ <span>{{ curQuestionIndex + 1 }} / {{ questionList.length }}</span>
|
|
|
+ <span>{{ curQuestionIndex < 0 ? '' : exerciseNames[questionList[curQuestionIndex].type] }}</span>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
<div v-if="!isTeacherAnnotations" class="round primary">
|
|
|
<SvgIcon icon-class="hourglass" />{{ secondFormatConversion(time) }}
|
|
|
</div>
|
|
@@ -18,12 +43,7 @@
|
|
|
|
|
|
<main class="main">
|
|
|
<StartQuestion
|
|
|
- v-if="
|
|
|
- curQuestionIndex === -1 &&
|
|
|
- !(user_answer_record_info.is_exist_answer_record === 'true') &&
|
|
|
- !isShow &&
|
|
|
- !isSubmit
|
|
|
- "
|
|
|
+ v-if="isStart"
|
|
|
:question-length="questionList.length"
|
|
|
:answer-time-limit-minute="answer_time_limit_minute"
|
|
|
@startAnswer="startAnswer"
|
|
@@ -146,6 +166,7 @@ import {
|
|
|
} from '@/api/exercise';
|
|
|
import { subjectiveQuestionList } from './answer';
|
|
|
import { fileUpload } from '@/api/app';
|
|
|
+import { exerciseNames } from '@/views/exercise_questions/data/questionType';
|
|
|
|
|
|
import StartQuestion from './components/StartQuestion.vue';
|
|
|
import AnswerReport from './components/AnswerReport.vue';
|
|
@@ -219,9 +240,19 @@ export default {
|
|
|
},
|
|
|
question_list: [],
|
|
|
}, // 答题报告
|
|
|
+ exerciseNames,
|
|
|
+ isShowQuestionList: false, // 是否显示题目列表
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ isStart() {
|
|
|
+ return (
|
|
|
+ this.curQuestionIndex === -1 &&
|
|
|
+ !(this.user_answer_record_info.is_exist_answer_record === 'true') &&
|
|
|
+ !this.isShow &&
|
|
|
+ !this.isSubmit
|
|
|
+ );
|
|
|
+ },
|
|
|
// 是否教师批改
|
|
|
isTeacherAnnotations() {
|
|
|
return this.question_index >= 0 && this.isTeacher && this.type !== 'show';
|
|
@@ -532,8 +563,10 @@ export default {
|
|
|
},
|
|
|
|
|
|
selectQuestion(i) {
|
|
|
- this.isSubmit = false;
|
|
|
- this.isView = true;
|
|
|
+ if (this.isSubmit) {
|
|
|
+ this.isSubmit = false;
|
|
|
+ this.isView = true;
|
|
|
+ }
|
|
|
this.curQuestionIndex = i;
|
|
|
},
|
|
|
upload(file) {
|
|
@@ -591,6 +624,10 @@ export default {
|
|
|
.question-info {
|
|
|
display: flex;
|
|
|
column-gap: 12px;
|
|
|
+
|
|
|
+ .question-index {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -735,4 +772,28 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.question-wrapper {
|
|
|
+ max-height: 60vh;
|
|
|
+ padding: 8px;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 2px 8px 0 #00000040;
|
|
|
+
|
|
|
+ .question-list {
|
|
|
+ li {
|
|
|
+ display: flex;
|
|
|
+ column-gap: 8px;
|
|
|
+ align-items: center;
|
|
|
+ padding: 8px 16px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ color: $main-color;
|
|
|
+ background-color: #f4f8ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|