|
@@ -49,7 +49,10 @@
|
|
|
</div>
|
|
|
<!-- 描述 -->
|
|
|
<div class="exam-question-describe">
|
|
|
- {{ examQuestionList[answerIndex].content }}
|
|
|
+ {{
|
|
|
+ examQuestionList[answerIndex].questionContent ||
|
|
|
+ examQuestionList[answerIndex].content
|
|
|
+ }}
|
|
|
</div>
|
|
|
<!-- 答题列表 -->
|
|
|
<!-- 单选题、多选题的选项区域 -->
|
|
@@ -81,7 +84,7 @@
|
|
|
ref="questionInputRef"
|
|
|
v-model="inputValue"
|
|
|
maxlength="200"
|
|
|
- rows="5"
|
|
|
+ rows="1"
|
|
|
@change="handleExamQuestionOptionsItemFun(inputValue)"
|
|
|
/>
|
|
|
</div>
|
|
@@ -220,15 +223,18 @@ export default {
|
|
|
},
|
|
|
// 方法:过滤试题的类型,添加用户作答的字段
|
|
|
setPersonDataFun(httpResultDataItme) {
|
|
|
- httpResultDataItme.typeTxt = this.formatQuestionType(
|
|
|
- httpResultDataItme.type
|
|
|
+ let results = this.formatQuestionType(
|
|
|
+ httpResultDataItme.type,
|
|
|
+ httpResultDataItme.content
|
|
|
);
|
|
|
+ httpResultDataItme.typeTxt = results.typeTxt;
|
|
|
+ httpResultDataItme.questionContent = results.questionContent;
|
|
|
httpResultDataItme.userAnswer = [];
|
|
|
return httpResultDataItme;
|
|
|
},
|
|
|
// 获取:考试限定的时间点
|
|
|
getExamTimeFun() {
|
|
|
- let tarTime = this.getTimeHoursMinuteSecondsFun(
|
|
|
+ let tarTime = this.getTimeHoursMinuteSecondsTogetherFun(
|
|
|
this.examItem.examTimeMins
|
|
|
);
|
|
|
let curTime = new Date();
|
|
@@ -250,7 +256,7 @@ export default {
|
|
|
this.endTimeSeconds = curTime.getTime(); // 赋值结束时间的秒数
|
|
|
},
|
|
|
// 方法:分别获取时 分 秒
|
|
|
- getTimeHoursMinuteSecondsFun(e) {
|
|
|
+ getTimeHoursMinuteSecondsTogetherFun(e) {
|
|
|
let time = e;
|
|
|
let len = time.split(":");
|
|
|
if (len.length === 3) {
|
|
@@ -303,9 +309,10 @@ export default {
|
|
|
}
|
|
|
}, 1000);
|
|
|
},
|
|
|
- // 方法:过滤试题的类型
|
|
|
- formatQuestionType(type) {
|
|
|
+ // 方法:过滤试题的类型、填空题的题目
|
|
|
+ formatQuestionType(type, content) {
|
|
|
let typeTxt = "";
|
|
|
+ let questionContent = "";
|
|
|
switch (type) {
|
|
|
case this.questionType.singleChoice:
|
|
|
typeTxt = "单选题";
|
|
@@ -315,15 +322,15 @@ export default {
|
|
|
break;
|
|
|
case this.questionType.gapFilling:
|
|
|
typeTxt = "填空题";
|
|
|
+ this.questionContent = content.replace("$PH$", "()");
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- return typeTxt;
|
|
|
- },
|
|
|
- // 方法:过滤选项的编号
|
|
|
- formatQuestionIndex(index) {
|
|
|
- return String.fromCharCode(index + 65);
|
|
|
+ return {
|
|
|
+ typeTxt: typeTxt,
|
|
|
+ questionContent: questionContent
|
|
|
+ };
|
|
|
},
|
|
|
// 操作:点击了某个题序
|
|
|
handleExamQuestionItemFun(item, index) {
|
|
@@ -378,7 +385,6 @@ export default {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- this.handleNextFun(); // 方法:下一题
|
|
|
},
|
|
|
// 方法:下一题
|
|
|
handleNextFun() {
|
|
@@ -394,6 +400,7 @@ export default {
|
|
|
// 操作:确定
|
|
|
handleSureFun() {
|
|
|
this.examQuestionList[this.answerIndex].userAnswer = this.answerValue;
|
|
|
+ this.handleNextFun();
|
|
|
},
|
|
|
// 操作:交卷 isAuto:true(时间到了的自动交卷) false(手动交卷)
|
|
|
handleSubmitFun() {
|