diff --git a/src/views/examinationPaper/add.vue b/src/views/examinationPaper/add.vue index c5d4f68..7da6a3b 100644 --- a/src/views/examinationPaper/add.vue +++ b/src/views/examinationPaper/add.vue @@ -326,6 +326,8 @@
漏选得分
选项设置
提干
+
题目解析
+
知识点
操作
  • @@ -381,22 +383,44 @@ " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}

    -
    - -
    - - -

    重新选择图片

    -
    - -
    -
    +
    @@ -489,20 +513,44 @@ 保存
    - +
    - + + - {{ + {{ stem.screenshot && !stem.screenshot.includes('html') ? "重新上传" : "选择照片" }} + {{ + stem.answerScreenshot && !stem.answerScreenshot.includes('html') ? "重新上传" : "选择照片" + }}
    确定
    + +
    + + + + + +
    +
    + 取 消 + 确 定 +
    +
    @@ -526,6 +574,7 @@ const subQuesOptions = { answerOptions: "A,B,C,D", correctAnswer: "", }; +import knowledgeList from "assets/js/knowledgeList.js"; export default { computed: { allScore: function () { @@ -537,6 +586,24 @@ export default { }, 0); return Number(score).toFixed(2); }, + // 知识点列表 根据学段-科目筛选 + knowledgeData: function () { + let jsons = [] + if (this.form.gradeName && this.form.subjectName) { + let sectionName = "" + this.gradeClassList.map(item => { + if (this.form.gradeName == item.gradeName) { + sectionName = item.sectionName + } + }) + if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { + if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { + jsons = this.knowledgeList[sectionName][this.form.subjectName] + } + } + } + return jsons + }, }, watch: { step: function () { @@ -549,6 +616,7 @@ export default { return { role: "", step: 0, //步骤 + gradeClassList: [], //年级-班级数据 gradeList: [], //年级 subjectList: [], //科目 answerTypeList: [], //测验类型 @@ -617,12 +685,17 @@ export default { addSubQuestionsType: "", //v1.5 + knowledgeList: { ...knowledgeList }, isUpload: false, dialogStem: false, //截图开关 + dialogKnowledge: false, //知识点开关 stem: { + type: 1, index: 0, //大题位置 indexs: 0, //小题位置 screenshot: "", //题干图片地址 + answerScreenshot: "", //题目解析图片地址 + knowledge: [], //知识点 }, }; }, @@ -655,26 +728,52 @@ export default { methods: { // v1.5 //上传截图 - openStem(obj, index, indexs) { + openStem(obj, index, indexs, type) { this.stem.index = index; this.stem.indexs = indexs; - this.stem.screenshot = obj.screenshot || ""; + this.stem.type = type; + if (type == 1) { + this.stem.screenshot = obj.screenshot || ""; + this.stem.answerScreenshot = ""; + } else { + this.stem.answerScreenshot = obj.answerScreenshot || ""; + this.stem.screenshot = ""; + } + this.dialogStem = true; }, - //图片上传成功 - upSuccess(res, file) { + // 知识点 + openKnowledge(obj, index, indexs) { + this.stem.index = index; + this.stem.indexs = indexs; + this.stem.knowledge = (obj.knowledge && obj.knowledge.split(",")) || []; + this.dialogKnowledge = true; + }, + // 图片上传成功 + upSuccess(res) { if (res && res.status == 0) { - this.stem.screenshot = res.data.url; - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot; + if (this.stem.type == 1) { + this.stem.screenshot = res.data.url; + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot; + } else { + this.stem.answerScreenshot = res.data.url; + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot; + } this.$message.success("上传成功"); } else { this.$message.error(res.info); } }, - upError(res) { this.$message.error("上传失败"); }, + // 知识点 + setKnowledge() { + this.form.questionList[this.stem.index].subQuestions[ + this.stem.indexs + ].knowledge = this.stem.knowledge.join(","); + this.dialogKnowledge = false; + }, //end //取消创建 @@ -849,7 +948,7 @@ export default { return this.formAns.endIndex == item.questionIndex } ); - console.log(EndIndex) + console.log(EndIndex) for (let i = 0; i <= subNum; i++) { let correctAnswer = ""; if (this.formAns.qusType == 2) { @@ -1349,9 +1448,24 @@ export default { }, async _GradeList() { //查询年级列表 - const { data, status, info } = await this.$request.fetchGradeList(); + // const { data, status, info } = await this.$request.fetchGradeList(); + // 查找班级 + + let fetchClassList = + this.role == "ROLE_PERSONAL" + ? this.$request.pClassList + : this.$request.fetchClassList; + + const { data, status, info } = await fetchClassList(); if (status == 0) { - this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; + this.gradeClassList = data.list?.map((item) => { + console.log(!this.gradeList.includes(item.gradeName)) + if (!this.gradeList.includes(item.gradeName)) { + this.gradeList.push(item.gradeName) + } + return item + }) + // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; if (this.type != 2) { this.form.gradeName = this.gradeList[0]; } diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue index 402d088..d7df5f3 100644 --- a/src/views/examinationPaper/index.vue +++ b/src/views/examinationPaper/index.vue @@ -12,18 +12,15 @@
    - 备题 - 组卷 + 备题 + 组卷

    - + 导入课件 - + 添加试卷 导入试卷 @@ -54,9 +51,9 @@

    - 我自编的 ({{ totalCount.my + 我自编的 ({{ totalCount.my }}) - 年级共享的 ({{ totalCount.share + 年级共享的 ({{ totalCount.share }})

      @@ -102,7 +99,7 @@ 修改分享范围 - 复制 + 复制 放入回收站 @@ -133,7 +130,7 @@
    - +

    第一步:导出菁优网试卷或 模板下载 。 @@ -163,6 +160,7 @@ export default { subjectName: "", title: "", type: 1, //试卷类型 + share: 0, //分享类型 }, classList: [], subjectList: [], @@ -187,7 +185,6 @@ export default { share: 0, }, diaUp: false,//上传word弹窗开关 - examinationPaperType: 1,//题型类型 url: "/api_html/common/paper/upload",//上传文档地址 }; }, @@ -217,6 +214,7 @@ export default { path: "/examinationPaperArchiving", }); }, + //去备题 toAdd(query) { if (!this.query.classId) { this.$message.warning("没有任课班级,请先设置。"); @@ -228,6 +226,18 @@ export default { query ? (routerItem["query"] = { ...query }) : ""; this.$router.push(routerItem); }, + //去组卷 + toAddAsk(query) { + if (!this.query.classId) { + this.$message.warning("没有任课班级,请先设置。"); + return; + } + let routerItem = { + path: "/examinationPaperAddAsk", + }; + query ? (routerItem["query"] = { ...query }) : ""; + this.$router.push(routerItem); + }, toEdit(item) { this.$router.push({ path: "/examinationPaperEdit", @@ -255,6 +265,10 @@ export default { break; } }, + changPaperType(type) { + this.query.type = type + this.changShare(1) + }, changePage(page) { this.page = page; this._QueryData(this.query.title); @@ -295,18 +309,20 @@ export default { }, //根据试卷名称查找 async getData(bool) { + this.page = 1; this._QueryData(bool); this._QueryTotal(); }, //切换班级 async changClazz() { + this.page = 1; await this._QuerySubjectList(); this._QueryData(false); this._QueryTotal(); }, //切换类型 - async changType(type) { - this.query.type = type + async changShare(share) { + this.query.share = share this.page = 1; this._QueryData(false); }, @@ -380,14 +396,10 @@ export default { let query = {}; if (!type) { this.query.title = ""; - query = { ...this.query }; - } else { - query = { title: this.query.title }; } - query.classId = this.query.classId; - query.subjectName = this.query.subjectName; + query = { ...this.query }; for (let key in query) { - if (!query[key]) { + if (!query[key] && query[key] !== 0) { delete query[key] } } @@ -451,7 +463,11 @@ export default { }); this.diaUp = false; let params = JSON.stringify(res.data) - this.toAdd({ params, isUpload: 1 }) + if (this.query.type == 2) { + this.toAdd({ params, isUpload: 1 }) + } else { + this.toAddAsk({ params }) + } } }, handleAdd(value) {