Commit b31444fa26e5e7f013082cbe58bbd2216b72b0da

Authored by 梁保满
1 parent c3cdce9c

复制归档答题卡后续流程

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