|
@@ -186,6 +186,7 @@ export default {
|
|
seqMode: this.seqMode,
|
|
seqMode: this.seqMode,
|
|
});
|
|
});
|
|
this.paperJson = res.data;
|
|
this.paperJson = res.data;
|
|
|
|
+ this.resetClozeSerialNo(this.paperJson);
|
|
this.fieldData = {
|
|
this.fieldData = {
|
|
paperName: res.data.name,
|
|
paperName: res.data.name,
|
|
courseName: `${res.data.course.name}(${res.data.course.code})`,
|
|
courseName: `${res.data.course.name}(${res.data.course.code})`,
|
|
@@ -200,6 +201,21 @@ export default {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ resetClozeSerialNo(paperData) {
|
|
|
|
+ const clozeQuestionTypes = ["CLOZE", "BANKED_CLOZE"];
|
|
|
|
+ paperData.paperDetails.forEach((detail) => {
|
|
|
|
+ detail.paperDetailUnits.forEach((question) => {
|
|
|
|
+ if (!clozeQuestionTypes.includes(question.questionType)) return;
|
|
|
|
+ question.question.quesBody.sections.forEach((section) => {
|
|
|
|
+ section.blocks.forEach((block) => {
|
|
|
|
+ if (block.type !== "cloze") return;
|
|
|
|
+ block.value =
|
|
|
|
+ question.question.subQuestions[block.value - 1].questionSeq;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async seqModeChange() {
|
|
async seqModeChange() {
|
|
await this.getPaperJson();
|
|
await this.getPaperJson();
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -388,14 +404,16 @@ export default {
|
|
`${question.questionSeq}、`
|
|
`${question.questionSeq}、`
|
|
);
|
|
);
|
|
contents.push(...tbodys);
|
|
contents.push(...tbodys);
|
|
|
|
+ const hasNobody = !tbodys.length;
|
|
|
|
|
|
if (question.quesOptions && question.quesOptions.length) {
|
|
if (question.quesOptions && question.quesOptions.length) {
|
|
- question.quesOptions.forEach((op) => {
|
|
|
|
- const obodys = this.parseTitleOption(
|
|
|
|
- op.optionBody,
|
|
|
|
- `${numberToUpperCase(op.number)}、`,
|
|
|
|
- "option"
|
|
|
|
- );
|
|
|
|
|
|
+ question.quesOptions.forEach((op, oIndex) => {
|
|
|
|
+ let noVal = `${numberToUpperCase(op.number)}、`;
|
|
|
|
+ if (hasNobody && !oIndex) {
|
|
|
|
+ // 针对如完形填空的小题做的特殊处理
|
|
|
|
+ noVal = `${question.questionSeq}、${noVal}`;
|
|
|
|
+ }
|
|
|
|
+ const obodys = this.parseTitleOption(op.optionBody, noVal, "option");
|
|
contents.push(...obodys);
|
|
contents.push(...obodys);
|
|
});
|
|
});
|
|
}
|
|
}
|