|
@@ -34,7 +34,7 @@
|
|
|
<div class="exam-question-describe">
|
|
|
{{
|
|
|
examQuestionList[answerIndex].questionContent ||
|
|
|
- examQuestionList[answerIndex].content
|
|
|
+ examQuestionList[answerIndex].content
|
|
|
}}
|
|
|
</div>
|
|
|
<!-- 答题列表 -->
|
|
@@ -42,8 +42,9 @@
|
|
|
<div
|
|
|
v-if="
|
|
|
examQuestionList[answerIndex].type === questionType.TrueOrFalse ||
|
|
|
- examQuestionList[answerIndex].type === questionType.singleChoice ||
|
|
|
- examQuestionList[answerIndex].type === questionType.multipleChoice
|
|
|
+ examQuestionList[answerIndex].type ===
|
|
|
+ questionType.singleChoice ||
|
|
|
+ examQuestionList[answerIndex].type === questionType.multipleChoice
|
|
|
"
|
|
|
class="exam-question-options"
|
|
|
>
|
|
@@ -54,7 +55,7 @@
|
|
|
'exam-question-options-item': true,
|
|
|
'exam-question-options-item-checked': answerValue.includes(item),
|
|
|
'exam-question-options-false':
|
|
|
- answerValue.includes(item) && answerStatus[answerIndex] === 2,
|
|
|
+ answerValue.includes(item) && answerStatus[answerIndex] === 2
|
|
|
}"
|
|
|
@click="handleExamQuestionOptionsItemFun(item)"
|
|
|
>
|
|
@@ -66,7 +67,7 @@
|
|
|
v-if="examQuestionList[answerIndex].type === questionType.gapFilling"
|
|
|
class="exam-question-gapFilling"
|
|
|
:class="{
|
|
|
- 'exam-question-gapFilling-false': answerStatus[answerIndex] === 2,
|
|
|
+ 'exam-question-gapFilling-false': answerStatus[answerIndex] === 2
|
|
|
}"
|
|
|
>
|
|
|
<textarea
|
|
@@ -351,9 +352,11 @@ export default {
|
|
|
},
|
|
|
// 方法:过滤试题的类型,添加用户作答的字段
|
|
|
setPersonDataFun(httpResultDataItme) {
|
|
|
+ console.log(httpResultDataItme);
|
|
|
let results = this.formatQuestionType(
|
|
|
httpResultDataItme.type,
|
|
|
- httpResultDataItme.content
|
|
|
+ httpResultDataItme.content,
|
|
|
+ httpResultDataItme.finalAnswer
|
|
|
);
|
|
|
httpResultDataItme.typeTxt = results.typeTxt;
|
|
|
httpResultDataItme.questionContent = results.questionContent;
|
|
@@ -362,7 +365,7 @@ export default {
|
|
|
return httpResultDataItme;
|
|
|
},
|
|
|
// 方法:过滤试题的类型、填空题的题目、填空题的回答框个数
|
|
|
- formatQuestionType(type, content) {
|
|
|
+ formatQuestionType(type, content, finalAnswer) {
|
|
|
let typeTxt = "";
|
|
|
let questionContent = "";
|
|
|
let questionInputNum = 0;
|
|
@@ -375,7 +378,7 @@ export default {
|
|
|
break;
|
|
|
case this.questionType.gapFilling:
|
|
|
typeTxt = "填空题";
|
|
|
- questionInputNum = this.getPlaceholderCount(content);
|
|
|
+ questionInputNum = this.getPlaceholderCount(content, finalAnswer);
|
|
|
questionContent = content.replace("$PH$", "()");
|
|
|
break;
|
|
|
case this.questionType.TrueOrFalse:
|
|
@@ -391,13 +394,16 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
// 方法:统计字符串中包含的特定字符个数
|
|
|
- getPlaceholderCount(strSource) {
|
|
|
+ getPlaceholderCount(strSource, finalAnswer) {
|
|
|
// 统计字符串中包含{}或{xxXX}的个数
|
|
|
let countNum = 0;
|
|
|
strSource.replace("$PH$", function(m, i) {
|
|
|
// m为找到的{xx}元素、i为索引
|
|
|
countNum++;
|
|
|
});
|
|
|
+ if (!countNum) {
|
|
|
+ countNum = finalAnswer.length;
|
|
|
+ }
|
|
|
return countNum;
|
|
|
},
|
|
|
// 方法:过滤正确答案的选项的编号
|