Commit b31444fa26e5e7f013082cbe58bbd2216b72b0da

Authored by 梁保满
1 parent c3cdce9c

复制归档答题卡后续流程

src/views/examinationPaper/add.vue
... ... @@ -1070,8 +1070,8 @@ export default {
1070 1070 }
1071 1071 },
1072 1072 methods: {
  1073 + //上传截图
1073 1074 openStem(obj, type, index, indexs) {
1074   - //上传截图
1075 1075 this.stem.type = type;
1076 1076 this.stem.index = index;
1077 1077 this.stem.indexs = indexs;
... ... @@ -1088,18 +1088,18 @@ export default {
1088 1088 }
1089 1089 this.dialogStem = true;
1090 1090 },
  1091 + //难度,知识点
1091 1092 openTag(obj, type, index, indexs) {
1092   - //难度,知识点
1093 1093 this.stem = { ...this.stem, obj };
1094 1094 this.stem.type = type;
1095 1095 this.stem.index = index;
1096 1096 this.stem.indexs = indexs;
1097   - this.stem.knowledge = obj.knowledge&&obj.knowledge.split(",") || [];
  1097 + this.stem.knowledge = (obj.knowledge && obj.knowledge.split(",")) || [];
1098 1098 this.stem.difficultyFactor = obj.difficultyFactor || "";
1099 1099 this.dialogTag = true;
1100 1100 },
  1101 + //图片上传成功
1101 1102 upSuccess(res, file) {
1102   - //图片上传成功
1103 1103 if (res && res.status == 0) {
1104 1104 let keys = this.stem.type == 1 ? "screenshot" : "answerScreenshot";
1105 1105 this.stem[keys + "Src"] = res.data.url;
... ... @@ -1115,8 +1115,8 @@ export default {
1115 1115 this.$message.error(res.info);
1116 1116 }
1117 1117 },
  1118 + //保存难度、知识点
1118 1119 setKnowledge() {
1119   - //保存难度、知识点
1120 1120 this.form.questionList[this.stem.index].subQuestions[
1121 1121 this.stem.indexs
1122 1122 ].knowledge = this.stem.knowledge.join(",");
... ... @@ -1222,12 +1222,12 @@ export default {
1222 1222  
1223 1223 return txt;
1224 1224 },
  1225 + //切换题型清空答案
1225 1226 setQuestionForm(val) {
1226   - //切换题型清空答案
1227 1227 this.questionForm.answerList = "";
1228 1228 },
  1229 + //减少题数设置答案
1229 1230 changeQesNum(val) {
1230   - //减少题数设置答案
1231 1231 if (
1232 1232 this.questionForm.questionType == 2 ||
1233 1233 this.questionForm.questionType == 4
... ... @@ -1243,8 +1243,8 @@ export default {
1243 1243 .join(",");
1244 1244 }
1245 1245 },
  1246 + //初始化要修改的答案
1246 1247 setFormAns(indexs, index) {
1247   - //初始化要修改的答案
1248 1248 this.formAns = { ...this.form.questionList[index].subQuestions[indexs] };
1249 1249 this.formAns.listIndex = index;
1250 1250 let startIndex = this.formAns.index + 1 - this.formAns.subNum; //批量设置大难开始位置
... ... @@ -1283,8 +1283,8 @@ export default {
1283 1283 };
1284 1284 }
1285 1285 },
  1286 + //多选答案设置
1286 1287 setMultiple(obj, answer, type) {
1287   - //多选答案设置
1288 1288 let elements =
1289 1289 type == 1
1290 1290 ? this.$refs["formAnsIpt2"].$el.children[0]
... ... @@ -1311,8 +1311,8 @@ export default {
1311 1311 elements.focus();
1312 1312 elements.selectionStart = resault.startPos;
1313 1313 },
  1314 + //批量修改答案
1314 1315 saveFormAns() {
1315   - //批量修改答案
1316 1316 let EndIndex;
1317 1317 let subNum = this.formAns.subNum - 1;
1318 1318 this.form.questionList[this.formAns.listIndex].subQuestions.some(
... ... @@ -1413,6 +1413,10 @@ export default {
1413 1413 this.step = 1;
1414 1414 },
1415 1415 setStep1() {
  1416 + if (this.subjectList.length == 0) {
  1417 + this.$message.warning("暂无绑定年级信息,请先联系管理员设置。");
  1418 + return;
  1419 + }
1416 1420 this.$refs["forms"].validate((valid) => {
1417 1421 // 验证通过:保存
1418 1422 if (valid) {
... ... @@ -1496,8 +1500,8 @@ export default {
1496 1500 this.step = 2;
1497 1501 return;
1498 1502 },
  1503 + //删除批量操作数据
1499 1504 formatQuestionList() {
1500   - //删除批量操作数据
1501 1505 for (let i = 0; i < this.form.questionList.length; i++) {
1502 1506 for (
1503 1507 let j = 0;
... ... @@ -1514,8 +1518,8 @@ export default {
1514 1518 this.questionForm = { ...questionForm };
1515 1519 this.addQuestionVisible = true;
1516 1520 },
  1521 + //添加大题
1517 1522 addQuestion() {
1518   - //添加大题
1519 1523 let subQuestions = [];
1520 1524 let questionsOptions = {
1521 1525 ...subQuesOptions,
... ... @@ -1572,8 +1576,8 @@ export default {
1572 1576 });
1573 1577 this.addQuestionVisible = false;
1574 1578 },
  1579 + //删除小题
1575 1580 delTabData(subIndex, index) {
1576   - //删除小题
1577 1581 this.form.questionList[index].subQuestions.splice(subIndex, 1);
1578 1582 },
1579 1583 setScore(question) {
... ... @@ -1612,8 +1616,8 @@ export default {
1612 1616 this.addSubQuestionsType = "";
1613 1617 }
1614 1618 },
  1619 + //切换多题型-小题题型
1615 1620 changeSubQuestions(val, subQuestions) {
1616   - //切换多题型-小题题型
1617 1621 const that = this;
1618 1622 subQuestions.score = 1;
1619 1623 subQuestions.partScore = 0;
... ... @@ -1639,8 +1643,8 @@ export default {
1639 1643 break;
1640 1644 }
1641 1645 },
  1646 + //添加选项
1642 1647 addOptions(subQuestions) {
1643   - //添加选项
1644 1648 let length = subQuestions.answerOptions.split(",").length;
1645 1649 if (length > 6) return;
1646 1650 subQuestions.selectNum = length + 1;
... ... @@ -1648,8 +1652,8 @@ export default {
1648 1652 .slice(0, subQuestions.selectNum)
1649 1653 .join(",");
1650 1654 },
  1655 + //删除选项
1651 1656 removeOptions(subQuestions) {
1652   - //删除选项
1653 1657 let length = subQuestions.answerOptions.split(",").length;
1654 1658 if (length < 3) return;
1655 1659 subQuestions.selectNum = length - 1;
... ... @@ -1661,8 +1665,8 @@ export default {
1661 1665 subQuestions.selectNum
1662 1666 );
1663 1667 },
  1668 + //设置多选答案
1664 1669 changAnswer(sub, option) {
1665   - //设置多选答案
1666 1670 let str = new RegExp(option, "g");
1667 1671 if (sub.correctAnswer?.includes(option)) {
1668 1672 sub.correctAnswer = sub.correctAnswer.replace(str, "");
... ... @@ -1830,6 +1834,9 @@ export default {
1830 1834 },
1831 1835 async _QuerySubjectList(grade) {
1832 1836 //查询科目列表
  1837 + if (!grade) {
  1838 + return;
  1839 + }
1833 1840 let query = {};
1834 1841 let fetchSubjectList =
1835 1842 this.role == "ROLE_PERSONAL"
... ... @@ -1866,11 +1873,20 @@ export default {
1866 1873 if (status == 0) {
1867 1874 this.form.title = data.title + "_副本";
1868 1875 this.form.tagId = data.tagId === 0 ? "" : data.tagId;
1869   - this.form.subjectName = data.subjectName;
  1876 +
  1877 + this.form.subjectName = this.subjectList.length
  1878 + ? this.subjectList.filter((item) => {
  1879 + return item.label == data.subjectName;
  1880 + })?.value
  1881 + : "";
1870 1882 this.form.examsDuration = data.examsDuration;
1871 1883 if (this.role != "ROLE_PERSONAL") {
1872 1884 this.form.sharingType = data.sharingType;
1873   - this.form.gradeName = data.gradeName;
  1885 + this.form.gradeName = this.gradeList.length
  1886 + ? this.gradeList.filter((item) => {
  1887 + return item == data.gradeName;
  1888 + })
  1889 + : "";
1874 1890 }
1875 1891 this.form.questionList = data.questionList?.map((item) => {
1876 1892 let subQuestions =
... ...
src/views/examinationPaper/archiving.vue
... ... @@ -91,7 +91,7 @@
91 91 type="info"
92 92 size="mini"
93 93 circle
94   - icon="fa fa-archive-copy"
  94 + icon="el-icon-copy-document"
95 95 @click="toAdd(item)"
96 96 ></el-button>
97 97 </el-tooltip>
... ... @@ -183,7 +183,7 @@ export default {
183 183  
184 184 const { data, status, info } = await fetchTypeNames({
185 185 classId: this.query.classId,
186   - status:1,
  186 + status: 1,
187 187 type: 0,
188 188 });
189 189 if (status === 0) {
... ...