|
@@ -41,10 +41,15 @@
|
|
|
>背题模式</view
|
|
|
>
|
|
|
<view
|
|
|
- style="opacity: 0"
|
|
|
:class="{
|
|
|
- 'mode-item_select': mode == 3,
|
|
|
+ 'mode-item_select': isAutoReadTopics,
|
|
|
}"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ isAutoReadTopics = !isAutoReadTopics;
|
|
|
+ isAutoReadTopics ? playCurrentIssue() : stopAudio();
|
|
|
+ }
|
|
|
+ "
|
|
|
class="mode-item"
|
|
|
>自动读题</view
|
|
|
>
|
|
@@ -175,7 +180,7 @@
|
|
|
>
|
|
|
</van-checkbox>
|
|
|
</van-checkbox-group>
|
|
|
- <view class="flex-center mt30">
|
|
|
+ <view class="flex-center mt30 pb16">
|
|
|
<van-button
|
|
|
@click="confirmMult"
|
|
|
color="#498ef5"
|
|
@@ -374,7 +379,7 @@
|
|
|
>
|
|
|
</m-checkbox>
|
|
|
</m-checkbox-group>
|
|
|
- <view class="flex-center">
|
|
|
+ <view class="flex-center pb16">
|
|
|
<van-button
|
|
|
@click="confirmMult"
|
|
|
color="#498ef5"
|
|
@@ -422,6 +427,28 @@
|
|
|
<text class="problem-opAnswer">{{ item.value }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <view
|
|
|
+ v-if="problemList[problemListIndex].isCompleted && !hiddenAnswer"
|
|
|
+ class="answer"
|
|
|
+ >
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType == 1 &&
|
|
|
+ problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 答案:{{ judgMap[problemList[problemListIndex].answer] }}
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-if="
|
|
|
+ problemList[problemListIndex].questionType > 1 &&
|
|
|
+ problemList[problemListIndex].isCompleted
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 答案: {{ problemList[problemListIndex].answer }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<funList
|
|
|
:midFunc="midFunc"
|
|
|
v-if="!hiddenFunction"
|
|
@@ -432,6 +459,7 @@
|
|
|
"
|
|
|
:problemListItem="problemList[problemListIndex]"
|
|
|
></funList>
|
|
|
+
|
|
|
<!-- #endif -->
|
|
|
<!-- <view v-if="!hiddenFunction" class="function-list">
|
|
|
<div @click="collectTopics" class="function-item">
|
|
@@ -736,6 +764,7 @@ export default {
|
|
|
return {
|
|
|
//topic
|
|
|
//isCollect
|
|
|
+ isAutoReadTopics: false,
|
|
|
mode: 0,
|
|
|
problemList: [
|
|
|
{
|
|
@@ -809,128 +838,409 @@ export default {
|
|
|
explainJsVisible: false,
|
|
|
trueNum: 0,
|
|
|
falseNum: 0,
|
|
|
+ errQuestionIds: [],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
+ //specify
|
|
|
query(newValue, oldValue) {
|
|
|
let that = this;
|
|
|
uni.showLoading({
|
|
|
title: "加载题目中",
|
|
|
mask: true,
|
|
|
});
|
|
|
- if (this.type == "wrong") {
|
|
|
- api.exam
|
|
|
- .studentQuestionInfoGetQuestionInfoByIds({
|
|
|
- ids: newValue.questionIds,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- res.rows.forEach((element) => {
|
|
|
- element.optsArr = [];
|
|
|
- element.isCollect = false;
|
|
|
- element.opts.split("-").forEach((item, index) => {
|
|
|
- if (element.questionType == 3) {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: element.answer.split("-").includes(item),
|
|
|
- });
|
|
|
- } else {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: item === element.answer,
|
|
|
- });
|
|
|
- }
|
|
|
+ switch (that.type) {
|
|
|
+ case "specify":
|
|
|
+ api.open
|
|
|
+ .questionInfoGetQuestionInfoByIds({
|
|
|
+ ids: newValue.questionIds,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.isCollect = false;
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
});
|
|
|
- element.isCompleted = false;
|
|
|
- element.userAnswer = [];
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+
|
|
|
+ that.problemList = res.rows;
|
|
|
+
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
- that.problemListTotal = res.total;
|
|
|
- origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
|
|
- that.problemList = res.rows;
|
|
|
+ break;
|
|
|
+ case "exam":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionInfoSelectTestQuestionInfo({
|
|
|
+ gs: "xc",
|
|
|
+ subject: 1,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.isCollect = false;
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
|
|
- that.$emit("update:problemListTotal", res.total);
|
|
|
- uni.hideLoading();
|
|
|
- });
|
|
|
- } else if (this.type === "exam") {
|
|
|
- api.exam
|
|
|
- .studentQuestionInfoSelectTestQuestionInfo({
|
|
|
- gs: "xc",
|
|
|
- subject: 1,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- res.rows.forEach((element) => {
|
|
|
- element.optsArr = [];
|
|
|
- element.isCollect = false;
|
|
|
- element.opts.split("-").forEach((item, index) => {
|
|
|
- if (element.questionType == 3) {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: element.answer.split("-").includes(item),
|
|
|
- });
|
|
|
- } else {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: item === element.answer,
|
|
|
- });
|
|
|
- }
|
|
|
+ that.problemList = res.rows;
|
|
|
+
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "free":
|
|
|
+ api.open
|
|
|
+ .questionInfoSelectFreeQuestionInfo({
|
|
|
+ ...this.query,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
});
|
|
|
- element.isCompleted = false;
|
|
|
- element.userAnswer = [];
|
|
|
+ that.problemList = res.rows;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
- that.problemListTotal = res.total;
|
|
|
- origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
|
|
|
- that.problemList = res.rows;
|
|
|
+ break;
|
|
|
+ case "wrong":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionWrongWrongByUser({
|
|
|
+ carType: this.gsMap[this.query.gs],
|
|
|
+ km: this.query.subject === "1" ? "科目一" : "科目四",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.data.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.data;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.data));
|
|
|
+ that.$emit("update:problemListTotal", res.data.length);
|
|
|
|
|
|
- that.$emit("update:problemListTotal", res.total);
|
|
|
- uni.hideLoading();
|
|
|
- });
|
|
|
- } else {
|
|
|
- api.exam
|
|
|
- .studentQuestionInfoList({
|
|
|
- ...this.query,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- res.rows.forEach((element) => {
|
|
|
- element.optsArr = [];
|
|
|
- element.opts.split("-").forEach((item, index) => {
|
|
|
- if (element.questionType == 3) {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: element.answer.split("-").includes(item),
|
|
|
- });
|
|
|
- } else {
|
|
|
- element.optsArr.push({
|
|
|
- selected: false,
|
|
|
- value: item,
|
|
|
- index: index,
|
|
|
- isAnswer: item === element.answer,
|
|
|
- });
|
|
|
- }
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "collect":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionCollectionCollectionByUser({
|
|
|
+ carType: this.gsMap[this.query.gs],
|
|
|
+ km: this.query.subject === "1" ? "科目一" : "科目四",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.data.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
});
|
|
|
- element.isCompleted = false;
|
|
|
- element.userAnswer = [];
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.data;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.data));
|
|
|
+ that.$emit("update:problemListTotal", res.data.length);
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
});
|
|
|
- that.problemListTotal = res.total;
|
|
|
- that.problemList = res.rows;
|
|
|
- origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
- that.$emit("update:problemListTotal", res.total);
|
|
|
- uni.hideLoading();
|
|
|
- });
|
|
|
+
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionInfoList({
|
|
|
+ ...this.query,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.rows;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // if (this.type == "specify") {
|
|
|
+ // api.open
|
|
|
+ // .questionInfoGetQuestionInfoByIds({
|
|
|
+ // ids: newValue.questionIds,
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // res.rows.forEach((element) => {
|
|
|
+ // element.optsArr = [];
|
|
|
+ // element.isCollect = false;
|
|
|
+ // element.opts.split("-").forEach((item, index) => {
|
|
|
+ // if (element.questionType == 3) {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: element.answer.split("-").includes(item),
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: item === element.answer,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // element.isCompleted = false;
|
|
|
+ // element.userAnswer = [];
|
|
|
+ // });
|
|
|
+ // that.problemListTotal = res.total;
|
|
|
+ // origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+
|
|
|
+ // that.problemList = res.rows;
|
|
|
+
|
|
|
+ // that.$emit("update:problemListTotal", res.total);
|
|
|
+ // uni.hideLoading();
|
|
|
+ // });
|
|
|
+ // } else if (this.type === "exam") {
|
|
|
+ // api.exam
|
|
|
+ // .studentQuestionInfoSelectTestQuestionInfo({
|
|
|
+ // gs: "xc",
|
|
|
+ // subject: 1,
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // res.rows.forEach((element) => {
|
|
|
+ // element.optsArr = [];
|
|
|
+ // element.isCollect = false;
|
|
|
+ // element.opts.split("-").forEach((item, index) => {
|
|
|
+ // if (element.questionType == 3) {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: element.answer.split("-").includes(item),
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: item === element.answer,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // element.isCompleted = false;
|
|
|
+ // element.userAnswer = [];
|
|
|
+ // });
|
|
|
+ // that.problemListTotal = res.total;
|
|
|
+ // origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+
|
|
|
+ // that.problemList = res.rows;
|
|
|
+
|
|
|
+ // that.$emit("update:problemListTotal", res.total);
|
|
|
+ // uni.hideLoading();
|
|
|
+ // });
|
|
|
+ // } else if (this.type === "free") {
|
|
|
+ // api.open
|
|
|
+ // .questionInfoSelectFreeQuestionInfo({
|
|
|
+ // ...this.query,
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // res.rows.forEach((element) => {
|
|
|
+ // element.optsArr = [];
|
|
|
+ // element.opts.split("-").forEach((item, index) => {
|
|
|
+ // if (element.questionType == 3) {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: element.answer.split("-").includes(item),
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: item === element.answer,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // element.isCompleted = false;
|
|
|
+ // element.userAnswer = [];
|
|
|
+ // });
|
|
|
+ // that.problemList = res.rows;
|
|
|
+ // origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ // that.problemListTotal = res.total;
|
|
|
+ // uni.hideLoading();
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // api.exam
|
|
|
+ // .studentQuestionInfoList({
|
|
|
+ // ...this.query,
|
|
|
+ // })
|
|
|
+ // .then((res) => {
|
|
|
+ // res.rows.forEach((element) => {
|
|
|
+ // element.optsArr = [];
|
|
|
+ // element.opts.split("-").forEach((item, index) => {
|
|
|
+ // if (element.questionType == 3) {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: element.answer.split("-").includes(item),
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // element.optsArr.push({
|
|
|
+ // selected: false,
|
|
|
+ // value: item,
|
|
|
+ // index: index,
|
|
|
+ // isAnswer: item === element.answer,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // element.isCompleted = false;
|
|
|
+ // element.userAnswer = [];
|
|
|
+ // });
|
|
|
+ // that.problemListTotal = res.total;
|
|
|
+ // that.problemList = res.rows;
|
|
|
+ // origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ // that.$emit("update:problemListTotal", res.total);
|
|
|
+ // uni.hideLoading();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ problemListIndex(newValue, oldValue) {
|
|
|
+ if (this.isAutoReadTopics) {
|
|
|
+ let audio = utils.wxUtils.getGlobAudio();
|
|
|
+ audio.stop();
|
|
|
+ audio.src = this.problemList[this.problemListIndex].issuemp3;
|
|
|
+ audio.play();
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ stopAudio() {
|
|
|
+ let audio = utils.wxUtils.getGlobAudio();
|
|
|
+ audio.stop();
|
|
|
+ },
|
|
|
+ playCurrentIssue() {
|
|
|
+ let audio = utils.wxUtils.getGlobAudio();
|
|
|
+ audio.stop();
|
|
|
+ audio.src = this.problemList[this.problemListIndex].issuemp3;
|
|
|
+ audio.play();
|
|
|
+ },
|
|
|
createCompleteProblemList() {
|
|
|
if (this.mode == 2) {
|
|
|
return;
|
|
@@ -1039,6 +1349,8 @@ export default {
|
|
|
utils.mapToUrlQuery({
|
|
|
score,
|
|
|
useTime,
|
|
|
+ questionIds: that.errQuestionIds.join(","),
|
|
|
+ type: that.type,
|
|
|
...that.query,
|
|
|
}),
|
|
|
});
|
|
@@ -1119,6 +1431,12 @@ export default {
|
|
|
} else {
|
|
|
this.falseNum++;
|
|
|
this.$emit("update:falseNum", this.falseNum);
|
|
|
+ this.errQuestionIds.includes(this.problemList[this.problemListIndex].id)
|
|
|
+ ? ""
|
|
|
+ : this.errQuestionIds.push(
|
|
|
+ this.problemList[this.problemListIndex].id
|
|
|
+ );
|
|
|
+
|
|
|
api.exam.studentQuestionWrong({
|
|
|
questionId: this.problemList[this.problemListIndex].id,
|
|
|
carType: this.gsMap[this.query.gs],
|
|
@@ -1181,6 +1499,7 @@ export default {
|
|
|
// this.falseNum = this.falseNum + 1;
|
|
|
// this.$emit("update:falseNum", this.falseNum);
|
|
|
// }
|
|
|
+ //score=1&useTime=NaN%3ANaN&questionIds=&type=&cert=C1%2FC2%2FC3&vehicle=%E8%BD%BF%E8%BD%A6&subject=1&title=%E9%A1%BA%E5%BA%8F%E7%BB%83%E4%B9%A0&liceCar=1&liceTruck=&liceBus=&liceMoto=&name=%E7%A7%91%E7%9B%AE%E4%B8%80&gs=xc&sort=3&sequeIssueName=%E7%BB%83%E4%B9%A0%E4%B8%80&__id__=3
|
|
|
},
|
|
|
changeRadioGroup(e) {
|
|
|
console.log(e, "changeRadioGroup");
|
|
@@ -1197,6 +1516,12 @@ export default {
|
|
|
km: this.query.subject === "4" ? "科目四" : "科目一",
|
|
|
});
|
|
|
this.$emit("update:falseNum", this.falseNum);
|
|
|
+ this.errQuestionIds.includes(this.problemList[this.problemListIndex].id)
|
|
|
+ ? ""
|
|
|
+ : this.errQuestionIds.push(
|
|
|
+ this.problemList[this.problemListIndex].id
|
|
|
+ );
|
|
|
+ console.log(this.errQuestionIds);
|
|
|
}
|
|
|
this.$set(
|
|
|
this.problemList[this.problemListIndex],
|
|
@@ -1245,6 +1570,11 @@ export default {
|
|
|
} else {
|
|
|
this.falseNum = this.falseNum + 1;
|
|
|
this.$emit("update:falseNum", this.falseNum);
|
|
|
+ this.errQuestionIds.includes(this.problemList[this.problemListIndex].id)
|
|
|
+ ? ""
|
|
|
+ : this.errQuestionIds.push(
|
|
|
+ this.problemList[this.problemListIndex].id
|
|
|
+ );
|
|
|
api.exam.studentQuestionWrong({
|
|
|
questionId: this.problemList[this.problemListIndex].id,
|
|
|
carType: this.gsMap[this.query.gs],
|
|
@@ -1299,6 +1629,10 @@ export default {
|
|
|
return [];
|
|
|
},
|
|
|
},
|
|
|
+ hiddenAnswer: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
hiddenFunction: {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
@@ -1326,10 +1660,255 @@ export default {
|
|
|
default: 0,
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ let that =this
|
|
|
+ switch (that.type) {
|
|
|
+ case "specify":
|
|
|
+ api.open
|
|
|
+ .questionInfoGetQuestionInfoByIds({
|
|
|
+ ids: newValue.questionIds,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.isCollect = false;
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+
|
|
|
+ that.problemList = res.rows;
|
|
|
+
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "exam":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionInfoSelectTestQuestionInfo({
|
|
|
+ gs: "xc",
|
|
|
+ subject: 1,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.isCollect = false;
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+
|
|
|
+ that.problemList = res.rows;
|
|
|
+
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "free":
|
|
|
+ api.open
|
|
|
+ .questionInfoSelectFreeQuestionInfo({
|
|
|
+ ...this.query,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemList = res.rows;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "wrong":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionWrongWrongByUser({
|
|
|
+ carType: this.gsMap[this.query.gs],
|
|
|
+ km: this.query.subject === "1" ? "科目一" : "科目四",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.data.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.data;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.data));
|
|
|
+ that.$emit("update:problemListTotal", res.data.length);
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "collect":
|
|
|
+ api.exam
|
|
|
+ .studentQuestionCollectionCollectionByUser({
|
|
|
+ carType: this.gsMap[this.query.gs],
|
|
|
+ km: this.query.subject === "1" ? "科目一" : "科目四",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.data.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.data;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.data));
|
|
|
+ that.$emit("update:problemListTotal", res.data.length);
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ api.exam
|
|
|
+ .studentQuestionInfoList({
|
|
|
+ ...this.query,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((element) => {
|
|
|
+ element.optsArr = [];
|
|
|
+ element.opts.split("-").forEach((item, index) => {
|
|
|
+ if (element.questionType == 3) {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: element.answer.split("-").includes(item),
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ element.optsArr.push({
|
|
|
+ selected: false,
|
|
|
+ value: item,
|
|
|
+ index: index,
|
|
|
+ isAnswer: item === element.answer,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ element.isCompleted = false;
|
|
|
+ element.userAnswer = [];
|
|
|
+ });
|
|
|
+ that.problemListTotal = res.total;
|
|
|
+ that.problemList = res.rows;
|
|
|
+ origProblemList = JSON.parse(JSON.stringify(res.rows));
|
|
|
+ that.$emit("update:problemListTotal", res.total);
|
|
|
+ uni.hideLoading();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.answer {
|
|
|
+ padding-left: 16rpx;
|
|
|
+ padding-bottom: 16rpx;
|
|
|
+ padding-top: 16rpx;
|
|
|
+ > view {
|
|
|
+ padding-left: 16rpx;
|
|
|
+ background: #d8d8d8;
|
|
|
+ padding-bottom: 8rpx;
|
|
|
+ padding-top: 8rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+.pb16 {
|
|
|
+ padding-bottom: 16rpx;
|
|
|
+}
|
|
|
.mode {
|
|
|
display: flex;
|
|
|
padding: 20rpx 30rpx;
|