|
@@ -38,7 +38,11 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="qe-part-body">
|
|
<div class="qe-part-body">
|
|
- <v-editor v-model="paperRichJson"></v-editor>
|
|
|
|
|
|
+ <v-editor
|
|
|
|
+ v-model="paperRichJson"
|
|
|
|
+ :enable-formula="false"
|
|
|
|
+ :enable-audio="false"
|
|
|
|
+ ></v-editor>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -205,18 +209,19 @@ export default {
|
|
if (!res) return;
|
|
if (!res) return;
|
|
|
|
|
|
const cacheData = this.getCachePaperInfo(
|
|
const cacheData = this.getCachePaperInfo(
|
|
- this.paperData,
|
|
|
|
|
|
+ this.getImportPaperData(),
|
|
questionInfoField
|
|
questionInfoField
|
|
);
|
|
);
|
|
|
|
+ console.log(cacheData);
|
|
this.paperData = this.assignCachePaperData(res.data, cacheData);
|
|
this.paperData = this.assignCachePaperData(res.data, cacheData);
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
},
|
|
},
|
|
getCachePaperInfo(paperData, cacheFields = []) {
|
|
getCachePaperInfo(paperData, cacheFields = []) {
|
|
let cachePaperInfo = {};
|
|
let cachePaperInfo = {};
|
|
- paperData.forEach((detail) => {
|
|
|
|
- detail.questions.forEach((question) => {
|
|
|
|
|
|
+ paperData.forEach((detail, dIndex) => {
|
|
|
|
+ detail.questionInfo.forEach((question) => {
|
|
let info = {};
|
|
let info = {};
|
|
- let k = `${detail.number}_${question.number}`;
|
|
|
|
|
|
+ let k = `${dIndex + 1}_${question.number}`;
|
|
if (cacheFields.length) {
|
|
if (cacheFields.length) {
|
|
cacheFields.forEach((field) => {
|
|
cacheFields.forEach((field) => {
|
|
info[field] = question[field];
|
|
info[field] = question[field];
|
|
@@ -231,11 +236,11 @@ export default {
|
|
return cachePaperInfo;
|
|
return cachePaperInfo;
|
|
},
|
|
},
|
|
assignCachePaperData(paperData, cacheData) {
|
|
assignCachePaperData(paperData, cacheData) {
|
|
- paperData.forEach((detail) => {
|
|
|
|
|
|
+ paperData.forEach((detail, dIndex) => {
|
|
detail.questions.forEach((question) => {
|
|
detail.questions.forEach((question) => {
|
|
Object.assign(
|
|
Object.assign(
|
|
question,
|
|
question,
|
|
- cacheData[`${detail.number}_${question.number}`] || {}
|
|
|
|
|
|
+ cacheData[`${dIndex + 1}_${question.number}`] || {}
|
|
);
|
|
);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -273,7 +278,7 @@ export default {
|
|
totalScore: calcSum(questionInfo.map((q) => q.score || 0)),
|
|
totalScore: calcSum(questionInfo.map((q) => q.score || 0)),
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- console.log(detailInfo);
|
|
|
|
|
|
+ // console.log(detailInfo);
|
|
return detailInfo;
|
|
return detailInfo;
|
|
},
|
|
},
|
|
checkImportPaperData(paperData) {
|
|
checkImportPaperData(paperData) {
|
|
@@ -432,7 +437,7 @@ export default {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
|
const res = await questionImportPaperSave({
|
|
const res = await questionImportPaperSave({
|
|
- courseId: this.courseId,
|
|
|
|
|
|
+ ...this.data.importData,
|
|
paperData,
|
|
paperData,
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
|
|
|
|
@@ -467,8 +472,11 @@ export default {
|
|
if (!res) return;
|
|
if (!res) return;
|
|
this.$message.success("下载成功!");
|
|
this.$message.success("下载成功!");
|
|
},
|
|
},
|
|
- answerUploaded(answerData) {
|
|
|
|
- const cacheData = this.getCachePaperInfo(answerData, questionInfoField);
|
|
|
|
|
|
+ answerUploaded(res) {
|
|
|
|
+ const cacheData = this.getCachePaperInfo(
|
|
|
|
+ res.data.detailInfo,
|
|
|
|
+ questionInfoField
|
|
|
|
+ );
|
|
this.paperData = this.assignCachePaperData(this.paperData, cacheData);
|
|
this.paperData = this.assignCachePaperData(this.paperData, cacheData);
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
},
|
|
},
|