diff --git a/src/views/duoji/erji.vue b/src/views/duoji/erji.vue
deleted file mode 100644
index ad9a4b1..0000000
--- a/src/views/duoji/erji.vue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 无限级菜单测试======二级页面
-
-
-
-
-
-
diff --git a/src/views/duoji/sanji.vue b/src/views/duoji/sanji.vue
deleted file mode 100644
index 96b82d0..0000000
--- a/src/views/duoji/sanji.vue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 无限级菜单测试======三级页面
-
-
-
-
-
-
diff --git a/src/views/duoji/siji.vue b/src/views/duoji/siji.vue
deleted file mode 100644
index e2d114a..0000000
--- a/src/views/duoji/siji.vue
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 无限级菜单测试======四级页面
-
-
-
-
-
-
diff --git a/src/views/examinationPaper/edit.vue b/src/views/examinationPaper/edit.vue
index 0e4f5cc..12df424 100644
--- a/src/views/examinationPaper/edit.vue
+++ b/src/views/examinationPaper/edit.vue
@@ -71,26 +71,38 @@
>
- {{ option }}
+ {{ option }}
+
- {{ option }}
+ {{ option }}
+
diff --git a/src/views/setUp/conglomerate.vue b/src/views/setUp/conglomerate.vue
index 1177ff2..82adf13 100644
--- a/src/views/setUp/conglomerate.vue
+++ b/src/views/setUp/conglomerate.vue
@@ -1,13 +1,16 @@
- 集团管理
+
+
+
+ 学校管理
+
+
+
\ No newline at end of file
diff --git a/src/views/test/index.vue b/src/views/test/index.vue
index b2dcfd1..a53d477 100644
--- a/src/views/test/index.vue
+++ b/src/views/test/index.vue
@@ -1,5 +1,5 @@
-
+
即时测-数据报表
@@ -253,13 +253,201 @@
>
-
+
+
+
+
+ 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
+
+
{{ setSubPro(formAns.qusType) }}:
+
+
+
+
+
+ ✓
+ ✗
+
+
+ {{ option }}
+ ,
+
+
+ {{ option }}
+
+ x
+
+
+
+
@@ -271,7 +459,17 @@ export default {
role: "",
loading: false,
dialogVisible: false,
- form: { questionList: [] },
+ diaSetAns: false,
+ form: {},
+ questionList: [],
+ formAns: {
+ listIndex: 0, //大题位置
+ endIndex: 0, //相同题目最后一位题目的questionIndex
+ qusType: "", //题目类型
+ subNum: 0, //数量
+ answerOptions: [], //答案选项
+ answerList: "", //答案列表-字符串
+ },
date: "", //今天-昨天-本周
query: {
//搜索条件
@@ -308,7 +506,7 @@ export default {
score: 1,
partScore: 0,
selectNum: 4,
- answerOptions: ["A", "B", "C", "D"],
+ answerOptions: "A, B, C, D",
correctAnswer: "B",
},
{
@@ -317,29 +515,101 @@ export default {
score: 1,
partScore: 0,
selectNum: 4,
- answerOptions: ["A", "B", "C", "D", "E", "F"],
+ answerOptions: "A, B, C, D,E,F",
correctAnswer: "A",
},
{
- questionIndex: 2,
+ questionIndex: 3,
+ questionType: 2,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "A",
+ },
+ {
+ questionIndex: 4,
+ questionType: 2,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "A",
+ },
+ {
+ questionIndex: 5,
+ questionType: 2,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "A",
+ },
+ {
+ questionIndex: 6,
questionType: 3,
score: 1,
partScore: 0,
selectNum: 4,
- answerOptions: ["A", "B", "C", "D", "E", "F"],
+ answerOptions: "A, B, C, D,E,F",
correctAnswer: "AB",
},
{
- questionIndex: 2,
+ questionIndex: 7,
+ questionType: 4,
+ score: 1,
+ partScore: 0,
+ selectNum: 0,
+ answerOptions: [],
+ correctAnswer: "1",
+ },
+ {
+ questionIndex: 8,
questionType: 3,
score: 1,
partScore: 0,
selectNum: 4,
- answerOptions: ["A", "B", "C", "D", "E", "F"],
+ answerOptions: "A, B, C, D,E,F",
correctAnswer: "AB",
},
{
- questionIndex: 3,
+ questionIndex: 9,
+ questionType: 3,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "AB",
+ },
+ {
+ questionIndex: 10,
+ questionType: 3,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "AB",
+ },
+ {
+ questionIndex: 11,
+ questionType: 3,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "AB",
+ },
+ {
+ questionIndex: 12,
+ questionType: 3,
+ score: 1,
+ partScore: 0,
+ selectNum: 4,
+ answerOptions: "A, B, C, D,E,F",
+ correctAnswer: "AB",
+ },
+ {
+ questionIndex: 13,
questionType: 4,
score: 1,
partScore: 0,
@@ -396,7 +666,7 @@ export default {
},
],
answerList: [
- //设置多卷内容供tabel表格数据用
+ //设置多卷内容供tableStage表格数据用
{
title: "周测卷20221130",
totalScore: 6,
@@ -438,7 +708,52 @@ export default {
},
});
},
+ setSubPro(type) {
+ let tit;
+ switch (type) {
+ case 2:
+ tit = "单选题";
+ break;
+ case 3:
+ tit = "多选题";
+ break;
+ case 4:
+ tit = "判断题";
+ break;
+ case 5:
+ tit = "主观题";
+ break;
+ }
+ return tit;
+ },
+ setBigNum(num) {
+ let txt = "";
+ let bigNum = [
+ "一",
+ "二",
+ "三",
+ "四",
+ "五",
+ "六",
+ "七",
+ "八",
+ "九",
+ "十",
+ "十一",
+ "十二",
+ "十三",
+ "十四",
+ "十五",
+ "十六",
+ "十七",
+ "十八",
+ "十九",
+ "二十",
+ ];
+ txt = bigNum[num];
+ return txt;
+ },
setDate(index) {
const that = this;
this.date = index == this.date ? "" : index;
@@ -507,17 +822,169 @@ export default {
}
}
},
+ keydownAnswer(event) {
+ //快速答案设置禁止输入
+ if (
+ event.key == "Meta" ||
+ event.key == "CapsLock" ||
+ event.key == "Shift" ||
+ event.key == "Enter" ||
+ event.key == "Alt" ||
+ event.key == "Backspace" ||
+ event.key == "Delete" ||
+ event.key == "ArrowUp" ||
+ event.key == "ArrowDown" ||
+ event.key == "ArrowLeft" ||
+ event.key == "v" ||
+ event.key == "V" ||
+ event.key == "ArrowRight"
+ ) {
+ return;
+ } else {
+ event.returnValue = "";
+ }
+ },
+ setAnswer(type, ans) {
+ let txt = "";
+ if (type == 2) {
+ txt = ans;
+ } else if (type == 3) {
+ txt = ans + ",";
+ } else if (type == 4) {
+ txt = ans == 1 ? "✓" : "✗";
+ }
+ return txt;
+ },
+ setMultiple(obj, answer) {
+ //多选答案设置
+ obj.answerList += answer;
+ let str = obj.answerList;
+ let str2 = checkAnswer(
+ str,
+ 3,
+ obj.answerOptions.split(",").length,
+ obj.answerList.length
+ );
+ obj.answerList = str2;
+ },
edit(item) {
+ //修改答案
this.form = deepClone(item);
+ this.questionList = deepClone(item?.questionList || []);
+ this.questionList?.map((item) => {
+ let types = [{}];
+ let addndex = 0;
+ item.subQuestions.map((sub, index) => {
+ if (!!sub.questionType) {
+ if (sub.questionType == types[addndex].qusType) {
+ //同类型批量答案+1
+ types[addndex].subNum += 1;
+ if (
+ types[addndex].answerOptions.length < sub.answerOptions.length
+ ) {
+ types[addndex].answerOptions = sub.answerOptions;
+ }
+ types[addndex].answerList += this.setAnswer(
+ sub.questionType,
+ sub.correctAnswer
+ );
+ if (index == item.subQuestions.length - 1) {
+ //循环最后类型数量大于等于5,保存批量答案
+ if (types[addndex].subNum && types[addndex].subNum >= 5) {
+ types[addndex].endIndex = sub.questionIndex;
+ types[addndex].index = index;
+ }
+ }
+ } else {
+ if (types[addndex].subNum && types[addndex].subNum >= 5) {
+ //不同类型时如果原有类型数量大于等于5,保存批量答案
+ types[addndex].endIndex =
+ item.subQuestions[index - 1].questionIndex;
+ types[addndex].index = index;
+ addndex += 1;
+ types[addndex] = {};
+ }
+ //不同类型初始化批量答案
+ types[addndex].qusType = sub.questionType;
+ types[addndex].subNum = 1;
+ types[addndex].answerOptions = sub.answerOptions;
+ types[addndex].answerList = this.setAnswer(
+ sub.questionType,
+ sub.correctAnswer
+ );
+ }
+ }
+ });
+ for (let i = 0; i < types.length; i++) {
+ if (types[i].qusType == 3) {
+ types[i].answerList = types[i].answerList.slice(0, -1);
+ }
+ if (types[i].subNum >= 5) {
+ item.subQuestions.splice(
+ types[i].index + i,
+ 0,
+ deepClone(types[i])
+ );
+ }
+ }
+ });
this.dialogVisible = true;
},
- cancel() {
- this.dialogVisible = false;
+ setFormAns(index, indexs) {
+ //初始化要修改的答案
+ this.formAns = { ...this.questionList[index].subQuestions[indexs] };
+ this.formAns.listIndex = index;
+ this.diaSetAns = true;
},
- handleSuccess() {
- this.dialogVisible = false;
- this._QueryData();
+ saveFormAns() {
+ //批量修改答案
+ let EndIndex;
+ let subNum = this.formAns.subNum - 1;
+ this.questionList[this.formAns.listIndex].subQuestions.some(
+ (item, index) => {
+ if (this.formAns.endIndex == item.questionIndex) {
+ EndIndex = index;
+ return;
+ }
+ }
+ );
+ for (let i = 0; i <= subNum; i++) {
+ let correctAnswer = "";
+ if (this.formAns.qusType == 2) {
+ correctAnswer = this.formAns.answerList[subNum - i];
+ } else if (this.formAns.qusType == 3) {
+ correctAnswer = this.formAns.answerList.split(",")[subNum - i];
+
+ console.log(this.formAns.answerList.split(",")[subNum - i]);
+ } else if (this.formAns.qusType == 4) {
+ correctAnswer = this.formAns.answerList[subNum - i] == "✓" ? 1 : 2;
+ }
+ this.questionList[this.formAns.listIndex].subQuestions[
+ EndIndex - i
+ ].correctAnswer = correctAnswer;
+ }
+ this.diaSetAns = false;
},
+ async saveAnswer() {
+ //保存答案
+ for (let i = 0; i < this.questionList.length; i++) {
+ for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
+ if (this.questionList[i].subQuestions[j].qusType) {
+ this.questionList[i].subQuestions.splice(j, 1);
+ }
+ }
+ }
+ const { data, status, message } = await this.$request.modifyPaper({
+ paperId: this.form.id,
+ questionList: [...this.questionList],
+ });
+ if (status == 0) {
+ this._QueryData();
+ } else {
+ this.$message.error(message);
+ }
+ },
+
async changClazz() {
await this._QuerySubjectList();
await this.setDate(1);
@@ -548,13 +1015,13 @@ export default {
label: item,
};
}) || [];
- if (this.role == "ROLE_BANZHUREN") {
+ if (this.role == "ROLE_BANZHUREN") {
this.subjectList.unshift({
value: "",
label: "全部",
});
this.query.subjectId = [this.subjectList[0]?.value];
- }else{
+ } else {
this.query.subjectId = this.subjectList[0]?.value;
}
} else {
@@ -611,16 +1078,11 @@ export default {
.dia-tips {
padding-bottom: 10px;
}
-.dia-question-box {
- padding: 16px 16px 1px;
- background: #f8f8f8;
- border-radius: 10px;
-
- .answer-s {
- width: 36px;
- height: 28px;
- cursor: pointer;
- }
+.answer-s {
+ width: 32px;
+ height: 28px;
+ cursor: pointer;
+ user-select: none;
}
.set-questions {
display: flex;
@@ -630,16 +1092,17 @@ export default {
flex-shrink: 0;
margin-right: 10px;
}
- .qs-options {
- flex: 1;
- .ipt {
- margin-bottom: 5px;
- }
+}
+.qs-options {
+ flex: 1;
+ .ipt {
+ margin-bottom: 5px;
}
.delButton {
border-color: #ff6868;
background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
background-size: 19px;
+ cursor: pointer;
color: transparent;
}
.ac {
@@ -651,4 +1114,138 @@ export default {
.down {
padding-top: 16px;
}
+.page-container {
+ position: relative;
+}
+.edit-dia {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ width: 100%;
+ height: calc(100vh - 80px);
+ background: #fff;
+ overflow-y: auto;
+ z-index: 10;
+ .back {
+ width: 100%;
+ height: 56px;
+ border-bottom: 1px solid #e2e2e2;
+ display: flex;
+ align-items: center;
+ padding: 0 20px;
+ box-sizing: border-box;
+ .back-l {
+ display: flex;
+ align-items: center;
+ cursor: pointer;
+ flex-shrink: 0;
+ font-size: 18px;
+ font-weight: 500;
+ }
+ .fa-mail-reply-all {
+ font-size: 28px;
+ color: #b3b3b3;
+ margin-right: 12px;
+ }
+ }
+ .form-box {
+ padding: 20px;
+ }
+ .answer-title {
+ text-align: center;
+ font-size: 20px;
+ color: #333;
+ font-weight: 700;
+ padding-bottom: 20px;
+ .totals {
+ font-size: 16px;
+ color: #888;
+ font-weight: normal;
+ }
+ }
+ .question-title {
+ line-height: 40px;
+ .ipt {
+ width: 300px;
+ margin: 0 16px 0 10px;
+ :deep(.el-input__inner) {
+ border-radius: 20px;
+ border-color: #667ffd;
+ background: rgba($color: #667ffd, $alpha: 0.05);
+ }
+ }
+ .delete {
+ margin-right: 8px;
+ }
+ .title-txt {
+ margin-right: 20px;
+ font-size: 16px;
+ font-weight: 700;
+ }
+ }
+ .questions-ul {
+ border-left: 1px solid #e2e2e2;
+ border-top: 1px solid #e2e2e2;
+ margin: 12px 0;
+ }
+ .sub-questions {
+ width: 100%;
+ display: flex;
+ border-bottom: 1px solid #e2e2e2;
+ & > div {
+ min-height: 40px;
+ padding: 5px;
+ flex-shrink: 0;
+ border-right: 1px solid #e2e2e2;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ .qs-num {
+ width: 80px;
+ }
+ .qs-type {
+ width: 160px;
+ }
+ .qs-score,
+ .qs-partScore {
+ width: 160px;
+ }
+ .qs-options {
+ flex: 1;
+ }
+ .qs-set {
+ width: 80px;
+ }
+ .qs-options2 {
+ text-align: left;
+ justify-content: flex-start;
+ padding-left: 20px;
+ .answer-s {
+ cursor: pointer;
+ }
+ }
+ :deep(.el-select) {
+ .el-input__inner {
+ border-radius: 20px;
+ border-color: #667ffd;
+ width: 150px;
+ height: 32px;
+ line-height: 32px;
+ background: rgba($color: #667ffd, $alpha: 0.05);
+ }
+ .el-input__icon {
+ line-height: 32px;
+ }
+ }
+ }
+ .set-ans-btn {
+ width: 100%;
+ padding: 10px 0 10px 630px;
+ box-sizing: border-box;
+ border-bottom: 1px solid #e2e2e2;
+ }
+}
\ No newline at end of file