|
@@ -19,6 +19,16 @@
|
|
|
"
|
|
|
></beforeSubmitMask>
|
|
|
<submitMask v-if="submitVisible" :correctScore="correctScore"></submitMask>
|
|
|
+ <correctAnswerMask
|
|
|
+ :explainJq="list[listIndex].explainJq"
|
|
|
+ :explainJs="list[listIndex].explainJs"
|
|
|
+ @close="
|
|
|
+ () => {
|
|
|
+ correctAnswer = false;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ v-if="correctAnswer"
|
|
|
+ ></correctAnswerMask>
|
|
|
<div class="box">
|
|
|
<div class="main">
|
|
|
<div class="container1">
|
|
@@ -29,11 +39,11 @@
|
|
|
<div class="student">
|
|
|
<div class="student-header">考生信息</div>
|
|
|
<div class="mt10">
|
|
|
- <img class="driver" :src="headimg" />
|
|
|
+ <img class="driver" :src="headImage" />
|
|
|
<div class="driverInfo">
|
|
|
- <div>姓名:{{ username }}</div>
|
|
|
+ <div>姓名:{{ nickName }}</div>
|
|
|
<div>性别:{{ sex }}</div>
|
|
|
- <div>类型:{{ carType }}</div>
|
|
|
+ <div>类型:{{ vehicle }}</div>
|
|
|
<div>科目:{{ subject }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -72,7 +82,8 @@
|
|
|
class="answer-list-item"
|
|
|
@click="selectExamAnswer(item)"
|
|
|
:class="{
|
|
|
- answer_selected: list[listIndex].userAnswer == item,
|
|
|
+ answer_selected:
|
|
|
+ list[listIndex].userAnswer.includes(item),
|
|
|
}"
|
|
|
>
|
|
|
{{ letter[index] }}
|
|
@@ -85,7 +96,9 @@
|
|
|
<div class="container2-row2">
|
|
|
<div class="operate">
|
|
|
<div class="w-half">
|
|
|
- <div class="left-line1">操作提示:判断题</div>
|
|
|
+ <div class="left-line1">
|
|
|
+ 操作提示:{{ list[listIndex].questionType | questionType }}
|
|
|
+ </div>
|
|
|
<div class="left-line2">
|
|
|
请在备选答案中选择你认为正确的答案!
|
|
|
</div>
|
|
@@ -162,25 +175,30 @@
|
|
|
</td>
|
|
|
</tr> -->
|
|
|
|
|
|
- <tr class="coll-table-topicTr" :key="index" v-for="(item, index) in list.length / 10">
|
|
|
+ <tr
|
|
|
+ class="coll-table-topicTr"
|
|
|
+ :key="index"
|
|
|
+ v-for="(item, index) in list.length / rowNum"
|
|
|
+ >
|
|
|
<!-- <td class="coll-table-topic-item bg-498ef5">
|
|
|
<div style="white-space: nowrap">{{ index + 1 }}行</div>
|
|
|
</td> -->
|
|
|
<td
|
|
|
- v-for="(_item, _index) in 10"
|
|
|
+ class="coll-table-topicTr-td"
|
|
|
+ v-for="(_item, _index) in rowNum"
|
|
|
:class="{
|
|
|
- collselected: index * 10 + _index == listIndex,
|
|
|
+ collselected: index * rowNum + _index == listIndex,
|
|
|
}"
|
|
|
- :data-key="index * 10 + _index + 1"
|
|
|
+ :data-key="index * rowNum + _index + 1"
|
|
|
:key="_index"
|
|
|
@click="changeListIndex"
|
|
|
>
|
|
|
<div
|
|
|
style="white-space: nowrap"
|
|
|
- :data-key="index * 10 + _index + 1"
|
|
|
+ :data-key="index * rowNum + _index + 1"
|
|
|
class="coll-table-topic-item"
|
|
|
>
|
|
|
- {{ index * 10 + _index + 1 }}
|
|
|
+ {{ index * rowNum + _index + 1 }}
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -213,16 +231,20 @@
|
|
|
import api from "@/api/index.js";
|
|
|
import beforeSubmitMask from "./components/beforeSubmitMask.vue";
|
|
|
import submitMask from "./components/submitMask.vue";
|
|
|
+import correctAnswerMask from "./components/correctAnswerMask.vue";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
sex: "男",
|
|
|
+ vehicle: "",
|
|
|
+ rowNum: 10,
|
|
|
beforeSubmitVisible: false,
|
|
|
submitVisible: false,
|
|
|
- username: "",
|
|
|
+ correctAnswer: false,
|
|
|
+ nickName: "",
|
|
|
subject: "",
|
|
|
subjectMap: ["科目零", "科目一", "科目二", "科目三", "科目四"],
|
|
|
- headimg: "",
|
|
|
+ headImage: "",
|
|
|
carType: "",
|
|
|
listIndex: 0,
|
|
|
letter: ["A", "B", "C", "D", "E", "F"],
|
|
@@ -702,6 +724,25 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ filters: {
|
|
|
+ questionType: function (questionType) {
|
|
|
+ questionType = Number(questionType);
|
|
|
+ let questionTypeName = "";
|
|
|
+ switch (questionType) {
|
|
|
+ case 1:
|
|
|
+ questionTypeName = "判断题";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ questionTypeName = "选择题";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ questionTypeName = "多选题";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return questionTypeName;
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
getTimeStr(timeStrap) {
|
|
|
let timer = new Date(timeStrap);
|
|
@@ -728,10 +769,33 @@ export default {
|
|
|
this.listIndex = this.listIndex + 1;
|
|
|
},
|
|
|
selectExamAnswer(item) {
|
|
|
- this.$set(this.list, this.listIndex, {
|
|
|
- ...this.list[this.listIndex],
|
|
|
- userAnswer: item,
|
|
|
- });
|
|
|
+ if (this.list[this.listIndex].isComplete) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.list[this.listIndex].questionType < 3) {
|
|
|
+ this.correctAnswer = this.list[this.listIndex].answer !== item;
|
|
|
+ this.$set(this.list[this.listIndex], "isComplete", true);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.list[this.listIndex].questionType < 3) {
|
|
|
+ this.$set(this.list, this.listIndex, {
|
|
|
+ ...this.list[this.listIndex],
|
|
|
+ userAnswer: item,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let userAnswer = [];
|
|
|
+ userAnswer = [...this.list[this.listIndex].userAnswer];
|
|
|
+ userAnswer.includes(item)
|
|
|
+ ? (userAnswer = userAnswer.filter((_item) => {
|
|
|
+ return item !== _item;
|
|
|
+ }))
|
|
|
+ : userAnswer.push(item);
|
|
|
+ this.$set(this.list, this.listIndex, {
|
|
|
+ ...this.list[this.listIndex],
|
|
|
+ userAnswer: userAnswer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// this.list[this.listIndex] = { ...this.list[this.listIndex], userAnswer: item };
|
|
|
// console.log(list.value[listIndex.value], item);
|
|
|
},
|
|
@@ -754,20 +818,26 @@ export default {
|
|
|
components: {
|
|
|
beforeSubmitMask,
|
|
|
submitMask,
|
|
|
+ correctAnswerMask,
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- this.username = decodeURIComponent(option.username);
|
|
|
- this.headimg = decodeURIComponent(option.headimg);
|
|
|
+ this.nickName =
|
|
|
+ uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").nickName;
|
|
|
+ this.headImage =
|
|
|
+ uni.getStorageSync("userInfo") &&
|
|
|
+ uni.getStorageSync("userInfo").headImage;
|
|
|
+ this.rowNum = option.subject == 1 ? 10 : 5;
|
|
|
this.carType = option.carType;
|
|
|
this.subject = this.subjectMap[Number(option.subject)];
|
|
|
this.carType = this.carTypeMap[option.type];
|
|
|
+ this.vehicle = option.vehicle;
|
|
|
api.open
|
|
|
- .questionInfoSelectTestQuestionInfo ({
|
|
|
+ .questionInfoSelectTestQuestionInfo({
|
|
|
subject: Number(option.subject),
|
|
|
- liceBus: option.type == "liceBus" ? "1" : "",
|
|
|
- liceCar: option.type == "liceCar" ? "1" : "",
|
|
|
- liceTruck: option.type == "liceTruck" ? "1" : "",
|
|
|
- liceMoto: option.type == "liceMoto" ? "1" : "",
|
|
|
+ liceBus: option.liceBus,
|
|
|
+ liceCar: option.liceCar,
|
|
|
+ liceTruck: option.liceTruck,
|
|
|
+ liceMoto: option.liceMoto,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
res.rows.forEach((item) => {
|
|
@@ -779,7 +849,6 @@ export default {
|
|
|
});
|
|
|
|
|
|
//开始倒计时
|
|
|
-
|
|
|
this.countdownTimer = setInterval(() => {
|
|
|
this.beginTimeStrap = this.beginTimeStrap - 1000;
|
|
|
this.countdownTime = this.getTimeStr(this.beginTimeStrap);
|
|
@@ -874,7 +943,7 @@ export default {
|
|
|
width: 100%;
|
|
|
align-content: center;
|
|
|
align-items: center;
|
|
|
- border-top: 1rpx solid #b8c0cc;
|
|
|
+ border-top: 1rpx solid #b8c0cc;
|
|
|
border-left: 1rpx solid #b8c0cc;
|
|
|
text-align: left;
|
|
|
font-size: 11rpx;
|
|
@@ -958,7 +1027,6 @@ export default {
|
|
|
border-right: 1rpx solid #b8c0cc;
|
|
|
font-size: 10rpx;
|
|
|
white-space: nowrap;
|
|
|
-
|
|
|
}
|
|
|
// .coll-header1-row_border{
|
|
|
// border-bottom: 1px solid #fff;
|
|
@@ -998,7 +1066,14 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
flex-wrap: wrap;
|
|
|
- width: 185rpx;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .coll-table-topicTr-td {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
}
|
|
|
.coll-table-topicTd {
|
|
|
width: 20rpx;
|
|
@@ -1012,7 +1087,7 @@ export default {
|
|
|
|
|
|
div {
|
|
|
font-size: 8rpx;
|
|
|
- width: 18rpx;
|
|
|
+
|
|
|
height: 20rpx;
|
|
|
line-height: 20rpx;
|
|
|
text-align: center;
|