|
@@ -139,7 +139,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
size="small"
|
|
size="small"
|
|
- @click="openEditExamPaperRemark"
|
|
|
|
|
|
+ @click="toEditExamRemark"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
@@ -153,8 +153,7 @@
|
|
<!-- 循环大题 -->
|
|
<!-- 循环大题 -->
|
|
<div
|
|
<div
|
|
v-for="(paperDetail, detailIndex) in paper.paperDetails"
|
|
v-for="(paperDetail, detailIndex) in paper.paperDetails"
|
|
- v-show="paperDetailShow(paperDetail)"
|
|
|
|
- :key="detailIndex"
|
|
|
|
|
|
+ :key="paperDetail.id"
|
|
class="edit-part-list"
|
|
class="edit-part-list"
|
|
>
|
|
>
|
|
<div class="edit-part">
|
|
<div class="edit-part">
|
|
@@ -178,57 +177,54 @@
|
|
></rich-text>
|
|
></rich-text>
|
|
<div class="edit-cont-action">
|
|
<div class="edit-cont-action">
|
|
<el-button
|
|
<el-button
|
|
- v-show="parentView == 'gen_paper'"
|
|
|
|
|
|
+ v-show="parentView === 'gen_paper'"
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="selectQues(paperDetail.id)"
|
|
|
|
|
|
+ @click="toSelectPaperDetailQues(paperDetail)"
|
|
>选题
|
|
>选题
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="openEditPaperDetail(paperDetail)"
|
|
|
|
|
|
+ @click="toEditPaperDetail(paperDetail)"
|
|
>编辑
|
|
>编辑
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-if="showUp(paperDetail)"
|
|
|
|
|
|
+ v-if="!detailIndex"
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="movePaperDetail(paperDetail, 'up')"
|
|
|
|
|
|
+ @click="toMovePaperDetail(paperDetail, 'up')"
|
|
>上移
|
|
>上移
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-if="showDown(paperDetail)"
|
|
|
|
|
|
+ v-if="detailIndex < paper.paperDetails.length - 1"
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="movePaperDetail(paperDetail, 'down')"
|
|
|
|
|
|
+ @click="toMovePaperDetail(paperDetail, 'down')"
|
|
>下移
|
|
>下移
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="danger"
|
|
type="danger"
|
|
- @click="deletePaperDetail(paperDetail.id)"
|
|
|
|
|
|
+ @click="toDeletePaperDetail(paperDetail)"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-show="showButtons[detailIndex].up"
|
|
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- icon="el-icon-arrow-up"
|
|
|
|
- @click.stop="hideContent(detailIndex)"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-show="!showButtons[detailIndex].up"
|
|
|
|
- size="small"
|
|
|
|
- icon="el-icon-arrow-down"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click.stop="showContent(detailIndex)"
|
|
|
|
|
|
+ :icon="
|
|
|
|
+ paperDetail.showQuestions
|
|
|
|
+ ? 'el-icon-arrow-up'
|
|
|
|
+ : 'el-icon-arrow-down'
|
|
|
|
+ "
|
|
|
|
+ @click.stop="
|
|
|
|
+ paperDetail.showQuestions = !paperDetail.showQuestions
|
|
|
|
+ "
|
|
></el-button>
|
|
></el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -252,15 +248,11 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 循环小题 -->
|
|
<!-- 循环小题 -->
|
|
- <div
|
|
|
|
- v-show="showQuestions[detailIndex].is_show"
|
|
|
|
- class="edit-paper-questions"
|
|
|
|
- >
|
|
|
|
|
|
+ <div v-show="paperDetail.showQuestions" class="edit-paper-questions">
|
|
<template
|
|
<template
|
|
v-for="(paperDetailUnit, unitIndex) in paperDetail.paperDetailUnits"
|
|
v-for="(paperDetailUnit, unitIndex) in paperDetail.paperDetailUnits"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
- v-show="quesShow(paperDetailUnit.id)"
|
|
|
|
:key="`question-${unitIndex}`"
|
|
:key="`question-${unitIndex}`"
|
|
:class="[
|
|
:class="[
|
|
'edit-part',
|
|
'edit-part',
|
|
@@ -310,69 +302,56 @@
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="checkDuplicateQuestion(paperDetailUnit.question.id)"
|
|
|
|
|
|
+ @click="
|
|
|
|
+ toCheckDuplicateQuestion(paperDetailUnit.question.id)
|
|
|
|
+ "
|
|
>进入查重
|
|
>进入查重
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
- @click="editQues(paperDetailUnit, paperDetailUnit.question)"
|
|
|
|
|
|
+ @click="toEditQues(paperDetailUnit)"
|
|
>编辑
|
|
>编辑
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-if="showUnitUp(paperDetail, paperDetailUnit.id)"
|
|
|
|
|
|
+ v-if="!unitIndex"
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
@click="
|
|
@click="
|
|
- movePaperDetailUnit(
|
|
|
|
- paperDetail.id,
|
|
|
|
- paperDetailUnit.id,
|
|
|
|
- 'up'
|
|
|
|
- )
|
|
|
|
|
|
+ toMoveQues(paperDetail.id, paperDetailUnit.id, 'up')
|
|
"
|
|
"
|
|
>上移
|
|
>上移
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-if="showUnitDown(paperDetail, paperDetailUnit.id)"
|
|
|
|
|
|
+ v-if="unitIndex < paperDetail.paperDetailUnits.length"
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
plain
|
|
plain
|
|
@click="
|
|
@click="
|
|
- movePaperDetailUnit(
|
|
|
|
- paperDetail.id,
|
|
|
|
- paperDetailUnit.id,
|
|
|
|
- 'down'
|
|
|
|
- )
|
|
|
|
|
|
+ toMoveQues(paperDetail.id, paperDetailUnit.id, 'down')
|
|
"
|
|
"
|
|
>下移
|
|
>下移
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
type="danger"
|
|
type="danger"
|
|
size="small"
|
|
size="small"
|
|
- @click="deleteQues(paperDetailUnit)"
|
|
|
|
|
|
+ @click="toDeleteQues(paperDetailUnit)"
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
- v-show="
|
|
|
|
- isNested(paperDetailUnit.questionType) &&
|
|
|
|
- showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
- "
|
|
|
|
|
|
+ v-if="isNested(paperDetailUnit.questionType)"
|
|
size="small"
|
|
size="small"
|
|
- icon="el-icon-arrow-up"
|
|
|
|
- @click.stop="hideSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
- ></el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-show="
|
|
|
|
- isNested(paperDetailUnit.questionType) &&
|
|
|
|
- !showSubButtons[detailIndex + '-' + unitIndex]
|
|
|
|
|
|
+ :icon="
|
|
|
|
+ paperDetailUnit.showSubQuestions
|
|
|
|
+ ? 'el-icon-arrow-up'
|
|
|
|
+ : 'el-icon-arrow-down'
|
|
|
|
+ "
|
|
|
|
+ @click.stop="
|
|
|
|
+ paperDetailUnit.showSubQuestions =
|
|
|
|
+ !paperDetailUnit.showSubQuestions
|
|
"
|
|
"
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- icon="el-icon-arrow-down"
|
|
|
|
- @click.stop="showSubContent(detailIndex + '-' + unitIndex)"
|
|
|
|
></el-button>
|
|
></el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -397,14 +376,14 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
- v-show="showSubQuestions[detailIndex + '-' + unitIndex]"
|
|
|
|
|
|
+ v-if="isNested(paperDetailUnit.questionType)"
|
|
|
|
+ v-show="paperDetailUnit.showSubQuestions"
|
|
:key="`question-sub-${unitIndex}`"
|
|
:key="`question-sub-${unitIndex}`"
|
|
class="edit-paper-question-subs"
|
|
class="edit-paper-question-subs"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
v-for="(subQuestion, subIndex) in paperDetailUnit.question
|
|
v-for="(subQuestion, subIndex) in paperDetailUnit.question
|
|
.subQuestions"
|
|
.subQuestions"
|
|
- v-show="quesShow(subQuestion.id)"
|
|
|
|
:key="subIndex"
|
|
:key="subIndex"
|
|
class="edit-part"
|
|
class="edit-part"
|
|
>
|
|
>
|
|
@@ -438,43 +417,6 @@
|
|
<question-answer :data="subQuestion"></question-answer>
|
|
<question-answer :data="subQuestion"></question-answer>
|
|
<!-- <rich-text :text-json="subQuestion.quesAnswer"></rich-text> -->
|
|
<!-- <rich-text :text-json="subQuestion.quesAnswer"></rich-text> -->
|
|
</div>
|
|
</div>
|
|
- <div class="edit-cont-action">
|
|
|
|
- <el-button
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="editQues(paperDetailUnit, subQuestion)"
|
|
|
|
- >编辑
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-if="showUnitSubUp(paperDetailUnit, subQuestion.id)"
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="
|
|
|
|
- movePaperDetailUnitSub(
|
|
|
|
- paperDetailUnit.id,
|
|
|
|
- subQuestion.id,
|
|
|
|
- 'up'
|
|
|
|
- )
|
|
|
|
- "
|
|
|
|
- >上移
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-if="showUnitSubDown(paperDetailUnit, subQuestion.id)"
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="
|
|
|
|
- movePaperDetailUnitSub(
|
|
|
|
- paperDetailUnit.id,
|
|
|
|
- subQuestion.id,
|
|
|
|
- 'down'
|
|
|
|
- )
|
|
|
|
- "
|
|
|
|
- >下移
|
|
|
|
- </el-button>
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
<div v-show="quesTagShow" class="edit-property">
|
|
<div v-show="quesTagShow" class="edit-property">
|
|
<div class="edit-property-box">
|
|
<div class="edit-property-box">
|
|
@@ -501,6 +443,19 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <!-- 编辑考试说明 -->
|
|
|
|
+ <modify-rich-text
|
|
|
|
+ ref="ModifyRichText"
|
|
|
|
+ :content="paper.examRemark"
|
|
|
|
+ @modified="examRemarkModified"
|
|
|
|
+ ></modify-rich-text>
|
|
|
|
+ <!-- 编辑大题弹框 -->
|
|
|
|
+ <modify-detail-struct
|
|
|
|
+ ref="ModifyDetailStruct"
|
|
|
|
+ :detail="curDetail"
|
|
|
|
+ only-name
|
|
|
|
+ @modified="detailModified"
|
|
|
|
+ ></modify-detail-struct>
|
|
<!-- 基础构成 -->
|
|
<!-- 基础构成 -->
|
|
<paper-base-info ref="PaperBaseInfo" :paper-id="paperId"></paper-base-info>
|
|
<paper-base-info ref="PaperBaseInfo" :paper-id="paperId"></paper-base-info>
|
|
<!-- 题型分布 -->
|
|
<!-- 题型分布 -->
|
|
@@ -523,13 +478,25 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { paperDetailInfoApi, paperSaveApi, paperDeleteApi } from "../api";
|
|
|
|
|
|
+import {
|
|
|
|
+ paperDetailInfoApi,
|
|
|
|
+ paperSaveApi,
|
|
|
|
+ paperDeleteApi,
|
|
|
|
+ paperDetailUpdateApi,
|
|
|
|
+ paperDetailMoveApi,
|
|
|
|
+ paperDetailDeleteApi,
|
|
|
|
+ paperQuestionMoveApi,
|
|
|
|
+ paperQuestionDeleteApi,
|
|
|
|
+ paperQuestionUnitDeleteApi,
|
|
|
|
+} from "../api";
|
|
import { QUESTION_API } from "@/constants/constants";
|
|
import { QUESTION_API } from "@/constants/constants";
|
|
|
|
|
|
import PaperBaseInfo from "../components/PaperBaseInfo.vue";
|
|
import PaperBaseInfo from "../components/PaperBaseInfo.vue";
|
|
import PaperQuestypeInfo from "../components/PaperQuestypeInfo.vue";
|
|
import PaperQuestypeInfo from "../components/PaperQuestypeInfo.vue";
|
|
import PaperBlueInfo from "../components/PaperBlueInfo.vue";
|
|
import PaperBlueInfo from "../components/PaperBlueInfo.vue";
|
|
import PaperAuditInfo from "../components/PaperAuditInfo.vue";
|
|
import PaperAuditInfo from "../components/PaperAuditInfo.vue";
|
|
|
|
+import ModifyDetailStruct from "../components/ModifyDetailStruct.vue";
|
|
|
|
+import ModifyRichText from "@/components/ModifyRichText.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "EditPaper",
|
|
name: "EditPaper",
|
|
@@ -538,6 +505,8 @@ export default {
|
|
PaperQuestypeInfo,
|
|
PaperQuestypeInfo,
|
|
PaperAuditInfo,
|
|
PaperAuditInfo,
|
|
PaperBlueInfo,
|
|
PaperBlueInfo,
|
|
|
|
+ ModifyDetailStruct,
|
|
|
|
+ ModifyRichText,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -557,6 +526,7 @@ export default {
|
|
checkDuplicateBtnShow: false,
|
|
checkDuplicateBtnShow: false,
|
|
quesTagShow: false,
|
|
quesTagShow: false,
|
|
quesAnswerShow: false,
|
|
quesAnswerShow: false,
|
|
|
|
+ curDetail: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -693,6 +663,223 @@ export default {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // header-action ----end
|
|
|
|
+ // 考试说明
|
|
|
|
+ toEditExamRemark() {
|
|
|
|
+ this.$refs.ModifyRichText.open();
|
|
|
|
+ },
|
|
|
|
+ examRemarkModified(content) {
|
|
|
|
+ this.paper.examRemark = content;
|
|
|
|
+ this.toSavePaper();
|
|
|
|
+ },
|
|
|
|
+ // detail-action
|
|
|
|
+ toSelectPaperDetailQues(detail) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path:
|
|
|
|
+ "/select_question/" +
|
|
|
|
+ this.paper.id +
|
|
|
|
+ "/" +
|
|
|
|
+ this.paper.course.id +
|
|
|
|
+ "/" +
|
|
|
|
+ detail.id +
|
|
|
|
+ "/" +
|
|
|
|
+ this.parentView,
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 大题编辑
|
|
|
|
+ toEditPaperDetail(detail) {
|
|
|
|
+ this.curDetail = detail;
|
|
|
|
+ this.$refs.ModifyDetailStruct.open();
|
|
|
|
+ },
|
|
|
|
+ async detailModified(detail) {
|
|
|
|
+ const res = await paperDetailUpdateApi(this.paperId, detail).catch(
|
|
|
|
+ (error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("修改成功!");
|
|
|
|
+
|
|
|
|
+ const paperDetail = this.paper.paperDetails.find(
|
|
|
|
+ (item) => item.id === detail.id
|
|
|
|
+ );
|
|
|
|
+ if (!paperDetail) return;
|
|
|
|
+ paperDetail.name = detail.name;
|
|
|
|
+ paperDetail.description = detail.description;
|
|
|
|
+ },
|
|
|
|
+ // 移动大题
|
|
|
|
+ async toMovePaperDetail(detail, vector) {
|
|
|
|
+ const vectorStr = vector == "up" ? "上移" : "下移";
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `确定要${vectorStr}该大题吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const res = await paperDetailMoveApi({
|
|
|
|
+ paperId: this.paperId,
|
|
|
|
+ detailId: detail.id,
|
|
|
|
+ vector,
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ this.initPaper();
|
|
|
|
+ },
|
|
|
|
+ // 删除大题
|
|
|
|
+ async toDeletePaperDetail(detail) {
|
|
|
|
+ if (detail.paperDetailUnits.length) {
|
|
|
|
+ this.$message.error("大题下还有小题,不可删除!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const confirm = await this.$confirm(`确定要删除该大题吗?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const res = await paperDetailDeleteApi({
|
|
|
|
+ paperId: this.paperId,
|
|
|
|
+ detailId: detail.id,
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ this.initPaper();
|
|
|
|
+ },
|
|
|
|
+ // detail-action ----end
|
|
|
|
+ // question-action
|
|
|
|
+ toCheckDuplicateQuestion(questionId) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "check_duplicate_info",
|
|
|
|
+ query: {
|
|
|
|
+ quesId: questionId,
|
|
|
|
+ basePaperId: this.paperId,
|
|
|
|
+ from: "paper",
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ toEditQues() {},
|
|
|
|
+ // 移动小题
|
|
|
|
+ async toMoveQues(detailId, unitid, vector) {
|
|
|
|
+ const vectorStr = vector == "up" ? "上移" : "下移";
|
|
|
|
+ const confirm = await this.$confirm(
|
|
|
|
+ `确定要${vectorStr}该小题吗?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ const res = await paperQuestionMoveApi({
|
|
|
|
+ detailId,
|
|
|
|
+ unitid,
|
|
|
|
+ vector,
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ this.initPaper();
|
|
|
|
+ },
|
|
|
|
+ // 删除小题
|
|
|
|
+ async toDeleteQues(paperDetailUnit) {
|
|
|
|
+ const confirm = await this.$confirm(`确定要删除该题吗?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
|
|
+ if (this.paper.paperType == "GENERATE") {
|
|
|
|
+ const res = await paperQuestionDeleteApi(paperDetailUnit.id).catch(
|
|
|
|
+ (error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (!res) return;
|
|
|
|
+ } else {
|
|
|
|
+ let questionId = paperDetailUnit.question.id;
|
|
|
|
+ const res = await paperQuestionUnitDeleteApi({
|
|
|
|
+ unitid: paperDetailUnit.id,
|
|
|
|
+ questionId,
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: error.response.data.desc,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ if (!res) return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$message.success("操作成功!");
|
|
|
|
+ this.initPaper();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // other
|
|
|
|
+ isNested(questionType) {
|
|
|
|
+ if (
|
|
|
|
+ questionType == "PARAGRAPH_MATCHING" ||
|
|
|
|
+ questionType == "BANKED_CLOZE" ||
|
|
|
|
+ questionType == "CLOZE" ||
|
|
|
|
+ questionType == "READING_COMPREHENSION" ||
|
|
|
|
+ questionType == "LISTENING_QUESTION"
|
|
|
|
+ ) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ isMatchingQuestion(questionType) {
|
|
|
|
+ if (
|
|
|
|
+ questionType == "PARAGRAPH_MATCHING" ||
|
|
|
|
+ questionType == "BANKED_CLOZE"
|
|
|
|
+ ) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ isInOtherSelect(optIndex, quesModel) {
|
|
|
|
+ if (quesModel.parentQuesParam.matchingMode != 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!quesModel.optionsSelected) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!quesModel.optionsSelected[optIndex + 1]) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ quesModel.optionsSelected[optIndex + 1].includes(quesModel.subNumber)
|
|
|
|
+ ) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|