From 98f6a547200a840b52df71bdd96995dd04e59b9f Mon Sep 17 00:00:00 2001
From: 梁保满
Date: Mon, 20 Feb 2023 14:19:25 +0800
Subject: [PATCH] 创建答题卡,统计答题信息
---
src/views/examinationPaper/add.vue | 52 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 9 deletions(-)
diff --git a/src/views/examinationPaper/add.vue b/src/views/examinationPaper/add.vue
index e27f74b..fa48be3 100644
--- a/src/views/examinationPaper/add.vue
+++ b/src/views/examinationPaper/add.vue
@@ -222,8 +222,15 @@
icon="el-icon-delete"
>
+
+ 每题{{
+ question.subQuestions && question.subQuestions[0].score
+ }}分
+
共:{{ question.subQuestions.length }}题
- 共:{{ setScore(question) }}分
+ 共:{{ setScore(question) }}分
@@ -321,7 +328,13 @@
>{{ option }}
-
+
{{ setBigNum(index) }}、
{{ question.questionTitle }}
共:{{ setNums(question.subQuestions) }}题
- 共:{{ setScore(question) }} 分
+ 共:{{ setScore(question) }} 分
-
@@ -921,7 +934,7 @@ export default {
formAns: {
listIndex: 0, //大题位置
endIndex: 0, //相同题目最后一位题目的questionIndex
- index:0,//相同题目最后一位题目的位置
+ index: 0, //相同题目最后一位题目的位置
qusType: "", //题目类型
subNum: 0, //数量
answerOptions: [], //答案选项
@@ -1059,7 +1072,7 @@ export default {
//初始化要修改的答案
this.formAns = { ...this.form.questionList[index].subQuestions[indexs] };
this.formAns.listIndex = index;
- let startIndex = (this.formAns.index+1) - this.formAns.subNum;//批量设置大难开始位置
+ let startIndex = this.formAns.index + 1 - this.formAns.subNum; //批量设置大难开始位置
this.formAns.answerList = [];
let answerList = "";
this.form.questionList[index].subQuestions.map((item, subIdx) => {
@@ -1283,7 +1296,10 @@ export default {
let addndex = 0;
item.subQuestions.map((sub, index) => {
if (!!sub.questionType) {
- if (sub.questionType == types[addndex].qusType && sub.questionType != 5) {
+ if (
+ sub.questionType == types[addndex].qusType &&
+ sub.questionType != 5
+ ) {
//同类型批量答案+1
types[addndex].subNum += 1;
if (
@@ -1427,6 +1443,21 @@ export default {
}, 0);
return Number(score).toFixed(2);
},
+ equalScore(question) {
+ let score = 0;
+ let bools = true;
+ for (let i = 0; i < question.subQuestions.length; i++) {
+ if (i == 0) {
+ score = question.subQuestions[i].score;
+ } else {
+ if (score != question.subQuestions[i].score) {
+ bools = false;
+ break;
+ }
+ }
+ }
+ return bools;
+ },
changeAddSubQuestions(val, question) {
if (val) {
let questionsOptions = {
@@ -1501,7 +1532,10 @@ export default {
subQuestions.answerOptions = this.rightOptions
.slice(0, subQuestions.selectNum)
.join(",");
- subQuestions.correctAnswer = subQuestions.correctAnswer.slice(0, subQuestions.selectNum)
+ subQuestions.correctAnswer = subQuestions.correctAnswer.slice(
+ 0,
+ subQuestions.selectNum
+ );
},
changAnswer(sub, option) {
//设置多选答案
@@ -1691,7 +1725,7 @@ export default {
return {
questionTitle: item.questionTitle,
subQuestions: subQuestions,
- show:false
+ show: false,
};
});
} else {
@@ -1829,7 +1863,7 @@ export default {
align-items: center;
margin-bottom: 12px;
.m20 {
- margin: 0 20px;
+ margin-left: 20px;
}
.ipt {
width: 300px;
--
libgit2 0.21.4