|
@@ -843,384 +843,6 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
//specify
|
|
|
- query(newValue, oldValue) {
|
|
|
- let that = this;
|
|
|
- uni.showLoading({
|
|
|
- title: "加载题目中",
|
|
|
- mask: true,
|
|
|
- });
|
|
|
- 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;
|
|
|
- }
|
|
|
- // 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();
|