|
@@ -197,7 +197,7 @@
|
|
<div class="qe-part-head-menu">
|
|
<div class="qe-part-head-menu">
|
|
<el-tabs
|
|
<el-tabs
|
|
v-model="filterQuestionType"
|
|
v-model="filterQuestionType"
|
|
- :before-leave="(val) => filterQuestionTypeChange(val, true)"
|
|
|
|
|
|
+ :before-leave="(val) => filterQuestionTypeChange(val)"
|
|
:key="questionKey"
|
|
:key="questionKey"
|
|
>
|
|
>
|
|
<el-tab-pane
|
|
<el-tab-pane
|
|
@@ -224,6 +224,7 @@
|
|
:key="questionKey"
|
|
:key="questionKey"
|
|
:paper="filterPaperData"
|
|
:paper="filterPaperData"
|
|
:course-id="data.importData.courseId"
|
|
:course-id="data.importData.courseId"
|
|
|
|
+ @question-change="questionChange"
|
|
></question-import-paper-edit>
|
|
></question-import-paper-edit>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -420,13 +421,22 @@ export default {
|
|
},
|
|
},
|
|
checkQuestionNormal(question) {
|
|
checkQuestionNormal(question) {
|
|
if (question.subQuestions?.length) {
|
|
if (question.subQuestions?.length) {
|
|
- return (
|
|
|
|
- question.subQuestions.filter((sub) => {
|
|
|
|
- return sub.questionExceptions.length;
|
|
|
|
- }).length === 0
|
|
|
|
- );
|
|
|
|
|
|
+ const haseErrorQuestion = question.subQuestions.filter((sub) => {
|
|
|
|
+ const questionExceptions = sub.ignoreOptionRepeat
|
|
|
|
+ ? sub.questionExceptions.filter(
|
|
|
|
+ (v) => !v.cause.includes("选项内容相同")
|
|
|
|
+ )
|
|
|
|
+ : sub.questionExceptions;
|
|
|
|
+ return questionExceptions.length;
|
|
|
|
+ });
|
|
|
|
+ return haseErrorQuestion.length === 0;
|
|
} else {
|
|
} else {
|
|
- return !question.questionExceptions.length;
|
|
|
|
|
|
+ const questionExceptions = question.ignoreOptionRepeat
|
|
|
|
+ ? question.questionExceptions.filter(
|
|
|
|
+ (v) => !v.cause.includes("选项内容相同")
|
|
|
|
+ )
|
|
|
|
+ : question.questionExceptions;
|
|
|
|
+ return !questionExceptions.length;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
parseQuestionStatData() {
|
|
parseQuestionStatData() {
|
|
@@ -488,7 +498,7 @@ export default {
|
|
const filterQuestionType = this.onlyErrorQuestion
|
|
const filterQuestionType = this.onlyErrorQuestion
|
|
? "all"
|
|
? "all"
|
|
: this.filterQuestionType;
|
|
: this.filterQuestionType;
|
|
- this.filterQuestionTypeChange(filterQuestionType, true);
|
|
|
|
|
|
+ this.filterQuestionTypeChange(filterQuestionType);
|
|
|
|
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
},
|
|
},
|
|
@@ -523,6 +533,10 @@ export default {
|
|
this.paperData = JSON.parse(JSON.stringify(this.paperData));
|
|
this.paperData = JSON.parse(JSON.stringify(this.paperData));
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
this.paperRichJsonGroup = this.getRichTextGroup();
|
|
this.ignoreRepeatExceptionIndexArr.push(exceptionIndex);
|
|
this.ignoreRepeatExceptionIndexArr.push(exceptionIndex);
|
|
|
|
+
|
|
|
|
+ this.parseQuestionStatData();
|
|
|
|
+ this.filterQuestionTypeChange(this.filterQuestionType);
|
|
|
|
+ this.questionKey = randomCode();
|
|
},
|
|
},
|
|
urlToBlob(url, callback) {
|
|
urlToBlob(url, callback) {
|
|
let xhr = new XMLHttpRequest();
|
|
let xhr = new XMLHttpRequest();
|
|
@@ -578,9 +592,18 @@ export default {
|
|
this.getRichTextIndexList();
|
|
this.getRichTextIndexList();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- filterQuestionTypeChange(val, updateModify = false) {
|
|
|
|
- if (updateModify) this.updateCurTagPaperData();
|
|
|
|
-
|
|
|
|
|
|
+ questionChange(data) {
|
|
|
|
+ const qid = `${data.detailNumber}-${data.question.number}`;
|
|
|
|
+ this.paperData.forEach((detail) => {
|
|
|
|
+ detail.questions.forEach((question) => {
|
|
|
|
+ const id = `${detail.number}-${question.number}`;
|
|
|
|
+ if (id === qid) {
|
|
|
|
+ Object.assign(question, data.question);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ filterQuestionTypeChange(val) {
|
|
this.filterQuestionType = val;
|
|
this.filterQuestionType = val;
|
|
|
|
|
|
const onlyErrorValidater = (question) => {
|
|
const onlyErrorValidater = (question) => {
|
|
@@ -879,6 +902,8 @@ export default {
|
|
);
|
|
);
|
|
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.filterQuestionTypeChange(this.filterQuestionType);
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -981,7 +1006,6 @@ export default {
|
|
},
|
|
},
|
|
getImportPaperData() {
|
|
getImportPaperData() {
|
|
if (!this.$refs.QuestionImportPaperEdit) return [];
|
|
if (!this.$refs.QuestionImportPaperEdit) return [];
|
|
- this.updateCurTagPaperData();
|
|
|
|
let paperData = deepCopy(this.paperData);
|
|
let paperData = deepCopy(this.paperData);
|
|
const transformFieldMap = {
|
|
const transformFieldMap = {
|
|
body: "quesBody",
|
|
body: "quesBody",
|