|
@@ -14,6 +14,12 @@
|
|
<template v-if="question.questionType === 'FILL_BLANK_QUESTION'">
|
|
<template v-if="question.questionType === 'FILL_BLANK_QUESTION'">
|
|
<fill-blank-question-view :question="question" :examQuestion="examQuestion" />
|
|
<fill-blank-question-view :question="question" :examQuestion="examQuestion" />
|
|
</template>
|
|
</template>
|
|
|
|
+ <template v-if="question.questionType === 'TEXT_ANSWER_QUESTION'">
|
|
|
|
+ <text-question-view :question="question" :examQuestion="examQuestion" />
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="question.parentQuestion !== null">
|
|
|
|
+ <nested-question-view :question="question" :examQuestion="examQuestion" />
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -22,6 +28,8 @@ import SingleQuestionView from "./SingleQuestionView";
|
|
import MultipleQuestionView from "./MultipleQuestionView";
|
|
import MultipleQuestionView from "./MultipleQuestionView";
|
|
import BooleanQuestionView from "./BooleanQuestionView";
|
|
import BooleanQuestionView from "./BooleanQuestionView";
|
|
import FillBlankQuestionView from "./FillBlankQuestionView";
|
|
import FillBlankQuestionView from "./FillBlankQuestionView";
|
|
|
|
+import TextQuestionView from "./TextQuestionView";
|
|
|
|
+import NestedQuestionView from "./NestedQuestionView";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "QuestionView",
|
|
name: "QuestionView",
|
|
@@ -40,7 +48,8 @@ export default {
|
|
}
|
|
}
|
|
const res = await this.$http.get(
|
|
const res = await this.$http.get(
|
|
"/api/exam_question/question/?question_id=" +
|
|
"/api/exam_question/question/?question_id=" +
|
|
- this.examQuestion.questionId
|
|
|
|
|
|
+ (this.examQuestion.questionId ||
|
|
|
|
+ this.examQuestion.parentQuestion.questionId)
|
|
);
|
|
);
|
|
const question = res.data;
|
|
const question = res.data;
|
|
const examQuestion = this.examQuestion;
|
|
const examQuestion = this.examQuestion;
|
|
@@ -56,12 +65,12 @@ export default {
|
|
.toString()
|
|
.toString()
|
|
.replace(new RegExp("###", "g"), "_______");
|
|
.replace(new RegExp("###", "g"), "_______");
|
|
//将题干中的两个##数字##替换为下划线
|
|
//将题干中的两个##数字##替换为下划线
|
|
- var baseIndex = examQuestion.orders - 1;
|
|
|
|
- repQuestion.body = repQuestion.body
|
|
|
|
- .toString()
|
|
|
|
- .replace(/##(\d+)##/g, function(a, b) {
|
|
|
|
- return "__" + (baseIndex + parseInt(b)) + "__";
|
|
|
|
- });
|
|
|
|
|
|
+ // var baseIndex = examQuestion.orders - 1;
|
|
|
|
+ // repQuestion.body = repQuestion.body
|
|
|
|
+ // .toString()
|
|
|
|
+ // .replace(/##(\d+)##/g, function(a, b) {
|
|
|
|
+ // return "__" + (baseIndex + parseInt(b)) + "__";
|
|
|
|
+ // });
|
|
// repQuestion.body = $sce.trustAsHtml(repQuestion.body);
|
|
// repQuestion.body = $sce.trustAsHtml(repQuestion.body);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -122,7 +131,9 @@ export default {
|
|
SingleQuestionView,
|
|
SingleQuestionView,
|
|
MultipleQuestionView,
|
|
MultipleQuestionView,
|
|
BooleanQuestionView,
|
|
BooleanQuestionView,
|
|
- FillBlankQuestionView
|
|
|
|
|
|
+ FillBlankQuestionView,
|
|
|
|
+ TextQuestionView,
|
|
|
|
+ NestedQuestionView
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|