|
@@ -578,6 +578,7 @@ export default {
|
|
},
|
|
},
|
|
resetData({ richText, detailInfo }) {
|
|
resetData({ richText, detailInfo }) {
|
|
this.paperData = deepCopy(detailInfo);
|
|
this.paperData = deepCopy(detailInfo);
|
|
|
|
+ this.updatePaperData();
|
|
this.paperRichJson = this.buildRichText(deepCopy(richText));
|
|
this.paperRichJson = this.buildRichText(deepCopy(richText));
|
|
this.transformDataInfo();
|
|
this.transformDataInfo();
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
@@ -873,6 +874,28 @@ export default {
|
|
});
|
|
});
|
|
return { sections };
|
|
return { sections };
|
|
},
|
|
},
|
|
|
|
+ updatePaperData() {
|
|
|
|
+ const getQuestionInfo = (question) => {
|
|
|
|
+ return {
|
|
|
|
+ id: randomCode(),
|
|
|
|
+ courseId: this.courseId,
|
|
|
|
+ sourceDetailId: question.customizeQuestionType?.id,
|
|
|
|
+ sourceDetailName: question.customizeQuestionType?.name,
|
|
|
|
+ score: question.score || 0,
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+ this.paperData.forEach((detail) => {
|
|
|
|
+ detail.questions.forEach((question) => {
|
|
|
|
+ Object.assign(question, getQuestionInfo(question));
|
|
|
|
+
|
|
|
|
+ if (question.subQuestions && question.subQuestions.length) {
|
|
|
|
+ question.subQuestions.forEach((subq) => {
|
|
|
|
+ Object.assign(subq, getQuestionInfo(subq));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
async toParse() {
|
|
async toParse() {
|
|
if (isAnEmptyRichText(this.paperRichJson)) {
|
|
if (isAnEmptyRichText(this.paperRichJson)) {
|
|
this.$message.error("请输入试卷内容!");
|
|
this.$message.error("请输入试卷内容!");
|
|
@@ -899,10 +922,11 @@ export default {
|
|
res.data.detailInfo,
|
|
res.data.detailInfo,
|
|
cacheData
|
|
cacheData
|
|
);
|
|
);
|
|
|
|
+ this.updatePaperData();
|
|
this.paperRichJson = this.buildRichText(deepCopy(res.data.richText));
|
|
this.paperRichJson = this.buildRichText(deepCopy(res.data.richText));
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
this.parseQuestionStatData();
|
|
this.parseQuestionStatData();
|
|
- this.filterQuestionTypeChange(this.filterQuestionType);
|
|
|
|
|
|
+ this.filterQuestionTypeChange("all");
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|