|
@@ -63,6 +63,7 @@
|
|
|
v-for="(item, index) in bank.jsonStr"
|
|
|
:key="index"
|
|
|
class="lisSty"
|
|
|
+ @click="radioSelect(item.optionsId, bankIndex)"
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
@@ -133,6 +134,7 @@
|
|
|
v-for="(item, index) in bank.jsonStr"
|
|
|
:key="index"
|
|
|
class="lisSty"
|
|
|
+ @click="checkboxSelect(item.optionsId, bankIndex, index)"
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
@@ -142,7 +144,7 @@
|
|
|
wrong:
|
|
|
bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 &&
|
|
|
bank.ans.indexOf(item.optionsId) == -1),
|
|
|
- user_choose: bankType == 2 && (bank.ques.indexOf(item.optionsId) != -1),
|
|
|
+ user_choose: bankType == 2 && item.checked,
|
|
|
}"
|
|
|
class="activeTI"
|
|
|
>
|
|
@@ -161,7 +163,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|
|
|
- v-if="!bank.ques"
|
|
|
+ v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
|
|
|
class="submit_checkbox"
|
|
|
:class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
|
|
|
@click="checkboxSubmit(bankIndex)"
|
|
@@ -223,6 +225,7 @@
|
|
|
v-for="(item, index) in judge"
|
|
|
:key="index"
|
|
|
class="lisSty"
|
|
|
+ @click="judgeSelect(index, bankIndex)"
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
@@ -268,8 +271,8 @@
|
|
|
<view
|
|
|
class="ans_input"
|
|
|
v-if="
|
|
|
- !bank.ques ||
|
|
|
- (!bank.ques.imageList.length && !bank.ques.text)
|
|
|
+ bankType == 2 || (bankType == 1 && (!bank.ques ||
|
|
|
+ (!bank.ques.imageList.length && !bank.ques.text)))
|
|
|
"
|
|
|
>
|
|
|
<view class="top flex">
|
|
@@ -398,6 +401,9 @@
|
|
|
v-for="(option, childIndex) in ansItem.optionsList"
|
|
|
:key="childIndex"
|
|
|
class="lisSty"
|
|
|
+ @click="
|
|
|
+ radioSelectChild(option.optionsId, ansIndex, bankIndex)
|
|
|
+ "
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
@@ -478,7 +484,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|
|
|
- v-if="!bank.ques[ansIndex]"
|
|
|
+ v-if="bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])"
|
|
|
class="submit_checkbox"
|
|
|
:class="{
|
|
|
disabled: !isCheckboxChecked(ansItem.optionsList),
|
|
@@ -491,12 +497,15 @@
|
|
|
v-for="(option, childindex) in ansItem.optionsList"
|
|
|
:key="childindex"
|
|
|
class="lisSty"
|
|
|
+ @click="
|
|
|
+ checkboxSelectChild(bankIndex, ansIndex, childindex)
|
|
|
+ "
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
|
right: bankType == 1 && right(bankIndex, ansIndex, option),
|
|
|
wrong: bankType == 1 && wrong(bankIndex, ansIndex, option),
|
|
|
- user_choose: bankType == 2 && (questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1),
|
|
|
+ user_choose: bankType == 2 && option.checked,
|
|
|
}"
|
|
|
class="activeTI"
|
|
|
>
|
|
@@ -578,6 +587,7 @@
|
|
|
v-for="(option, childindex) in judge"
|
|
|
:key="childindex"
|
|
|
class="lisSty"
|
|
|
+ @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
|
|
|
>
|
|
|
<text
|
|
|
:class="{
|
|
@@ -635,9 +645,10 @@
|
|
|
<view
|
|
|
class="ans_input"
|
|
|
v-if="
|
|
|
- !bank.ques[ansIndex] ||
|
|
|
+ bankType == 2 || (bankType == 1 &&
|
|
|
+ (!bank.ques[ansIndex] ||
|
|
|
(!bank.ques[ansIndex].text &&
|
|
|
- !bank.ques[ansIndex].imageList.length)
|
|
|
+ !bank.ques[ansIndex].imageList.length)))
|
|
|
"
|
|
|
>
|
|
|
<view class="top flex">
|
|
@@ -766,10 +777,11 @@
|
|
|
:key="index"
|
|
|
@click="changeIndex(index)"
|
|
|
:class="{
|
|
|
- isRight: isRight(item, index),
|
|
|
- isWrong: isWrong(item, index),
|
|
|
- isPart: isPart(item, index),
|
|
|
- isOver: isOver(item, index),
|
|
|
+ isRight: bankType == 1 && isRight(item, index),
|
|
|
+ isWrong: bankType == 1 && isWrong(item, index),
|
|
|
+ isPart: bankType == 1 && isPart(item, index),
|
|
|
+ isOver: bankType == 1 && isOver(item, index),
|
|
|
+ check_ans: bankType == 2 && isCheck(item, index),
|
|
|
}"
|
|
|
class="liListSty"
|
|
|
>
|
|
@@ -1681,45 +1693,51 @@ export default {
|
|
|
* @param {Object} e单选点击
|
|
|
*/
|
|
|
radioSelect(optionsId, bindex) {
|
|
|
- if (this.questionList[bindex].ques) return;
|
|
|
- this.$set(this.questionList[bindex], "ques", optionsId);
|
|
|
- if ((bindex + 1) < this.questionList.length) {
|
|
|
- this.current = bindex + 1
|
|
|
+ // if (this.questionList[bindex].ques) return;
|
|
|
+ if (this.questionList[bindex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
}
|
|
|
+ this.$set(this.questionList[bindex], "ques", optionsId);
|
|
|
+ // if ((bindex + 1) < this.questionList.length) {
|
|
|
+ // this.current = bindex + 1
|
|
|
+ // }
|
|
|
this.isDoOver();
|
|
|
|
|
|
// 回答错误
|
|
|
- if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
|
|
|
- // /exam/wwrong/record
|
|
|
- this.$api
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.id,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[bindex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- } else {
|
|
|
- // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
- // if(question) {
|
|
|
- // this.$api.wrongRecordDelete({
|
|
|
- // "examId": +this.id,
|
|
|
- // "goodsId": +this.goodsId,
|
|
|
- // "questionId": this.questionList[bindex].questionId,
|
|
|
- // }).then(res => {
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
+ // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
|
|
|
+ // // /exam/wwrong/record
|
|
|
+ // this.$api
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.id,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[bindex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // } else {
|
|
|
+ // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
+ // // if(question) {
|
|
|
+ // // this.$api.wrongRecordDelete({
|
|
|
+ // // "examId": +this.id,
|
|
|
+ // // "goodsId": +this.goodsId,
|
|
|
+ // // "questionId": this.questionList[bindex].questionId,
|
|
|
+ // // }).then(res => {
|
|
|
+ // // })
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* @param {Object} e案例单选点击
|
|
|
*/
|
|
|
radioSelectChild(optionsId, ansIndex, bindex) {
|
|
|
- if (this.questionList[bindex].ques[ansIndex]) return;
|
|
|
+ // if (this.questionList[bindex].ques[ansIndex]) return;
|
|
|
+ if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
|
|
|
this.isDoOver();
|
|
|
},
|
|
@@ -1728,6 +1746,9 @@ export default {
|
|
|
* @param {Object} 多选点击
|
|
|
*/
|
|
|
checkboxSelect(optionsId, bindex, index) {
|
|
|
+ if (this.questionList[bindex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(
|
|
|
this.questionList[bindex].jsonStr[index],
|
|
|
"checked",
|
|
@@ -1739,6 +1760,9 @@ export default {
|
|
|
* @param {Object} 案例多选点击
|
|
|
*/
|
|
|
checkboxSelectChild(bindex, ansIndex, childIndex) {
|
|
|
+ if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(
|
|
|
this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
|
|
|
"checked",
|
|
@@ -1760,7 +1784,10 @@ export default {
|
|
|
*/
|
|
|
checkboxSubmit(bindex) {
|
|
|
// console.log('')
|
|
|
- if (this.questionList[bindex].ques) return;
|
|
|
+ // if (this.questionList[bindex].ques) return;
|
|
|
+ if (this.questionList[bindex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
this.questionList[bindex].jsonStr.forEach((item) => {
|
|
|
if (item.checked) {
|
|
@@ -1769,6 +1796,7 @@ export default {
|
|
|
});
|
|
|
|
|
|
if (!arr.length) {
|
|
|
+ delete this.questionList[bindex].ques
|
|
|
uni.showToast({
|
|
|
title: "请选择答案",
|
|
|
icon: "none",
|
|
@@ -1779,48 +1807,43 @@ export default {
|
|
|
this.$set(this.questionList[bindex], "ques", arr);
|
|
|
this.isDoOver();
|
|
|
|
|
|
- // let isWrong = this.questionList[bindex].ques.some(
|
|
|
- // (quesItem, quesIndex) => {
|
|
|
- // return (
|
|
|
- // this.questionList[bindex].ques[quesIndex] !=
|
|
|
- // this.questionList[bindex].ans[quesIndex]
|
|
|
- // );
|
|
|
- // }
|
|
|
- // );
|
|
|
- let isWrong = this.questionList[bindex].ques.some((item, i) => {
|
|
|
- return this.questionList[bindex].ans.indexOf(item) == -1;
|
|
|
- })
|
|
|
- // 回答错误
|
|
|
- if (isWrong) {
|
|
|
- this.$api
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.id,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[bindex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- } else {
|
|
|
- // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
- // if(question) {
|
|
|
- // this.$api.wrongRecordDelete({
|
|
|
- // "examId": +this.id,
|
|
|
- // "goodsId": +this.goodsId,
|
|
|
- // "questionId": this.questionList[bindex].questionId,
|
|
|
- // }).then(res => {
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
+ // let isWrong = this.questionList[bindex].ques.some((item, i) => {
|
|
|
+ // return this.questionList[bindex].ans.indexOf(item) == -1;
|
|
|
+ // })
|
|
|
+ // // 回答错误
|
|
|
+ // if (isWrong) {
|
|
|
+ // this.$api
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.id,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[bindex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // } else {
|
|
|
+ // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
+ // // if(question) {
|
|
|
+ // // this.$api.wrongRecordDelete({
|
|
|
+ // // "examId": +this.id,
|
|
|
+ // // "goodsId": +this.goodsId,
|
|
|
+ // // "questionId": this.questionList[bindex].questionId,
|
|
|
+ // // }).then(res => {
|
|
|
+ // // })
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* @param {Object} 案例多选确认
|
|
|
*/
|
|
|
checkboxSubmitChild(bindex, ansIndex) {
|
|
|
- if (this.questionList[bindex].ques[ansIndex]) return;
|
|
|
+ // if (this.questionList[bindex].ques[ansIndex]) return;
|
|
|
+ if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
|
|
|
(item) => {
|
|
@@ -1831,6 +1854,7 @@ export default {
|
|
|
);
|
|
|
|
|
|
if (!arr.length) {
|
|
|
+ delete this.questionList[bindex].ques[ansIndex]
|
|
|
uni.showToast({
|
|
|
title: "请选择答案",
|
|
|
icon: "none",
|
|
@@ -1848,33 +1872,36 @@ export default {
|
|
|
* 判断题
|
|
|
*/
|
|
|
judgeSelect(index, bindex) {
|
|
|
- if (this.questionList[bindex].ques) return;
|
|
|
+ // if (this.questionList[bindex].ques) return;
|
|
|
+ if (this.questionList[bindex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[bindex], "ques", index + "");
|
|
|
this.isDoOver();
|
|
|
// 回答错误
|
|
|
- if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
|
|
|
- this.$api
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.id,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[bindex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- } else {
|
|
|
- // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
- // if(question) {
|
|
|
- // this.$api.wrongRecordDelete({
|
|
|
- // "examId": +this.id,
|
|
|
- // "goodsId": +this.goodsId,
|
|
|
- // "questionId": this.questionList[bindex].questionId,
|
|
|
- // }).then(res => {
|
|
|
- // })
|
|
|
- // }
|
|
|
- }
|
|
|
+ // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
|
|
|
+ // this.$api
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.id,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[bindex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // } else {
|
|
|
+ // // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
|
|
|
+ // // if(question) {
|
|
|
+ // // this.$api.wrongRecordDelete({
|
|
|
+ // // "examId": +this.id,
|
|
|
+ // // "goodsId": +this.goodsId,
|
|
|
+ // // "questionId": this.questionList[bindex].questionId,
|
|
|
+ // // }).then(res => {
|
|
|
+ // // })
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1884,7 +1911,10 @@ export default {
|
|
|
* 案例判断题
|
|
|
*/
|
|
|
judgeSelectChild(ansindex, childindex, bindex) {
|
|
|
- if (this.questionList[bindex].ques[ansindex]) return;
|
|
|
+ // if (this.questionList[bindex].ques[ansindex]) return;
|
|
|
+ if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
|
|
|
this.isDoOver();
|
|
|
},
|
|
@@ -2439,7 +2469,11 @@ export default {
|
|
|
});
|
|
|
this.isDoOver();
|
|
|
},
|
|
|
-
|
|
|
+ isCheck(item, index) {
|
|
|
+ if (this.questionList[index].ques) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
isRight(item, index) {
|
|
|
//单选
|
|
|
if (this.questionList[index].ques) {
|
|
@@ -2670,7 +2704,7 @@ export default {
|
|
|
color: #666;
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
- &.right, &.user_choose {
|
|
|
+ &.right {
|
|
|
color: #fff;
|
|
|
background: #36c75a;
|
|
|
}
|
|
@@ -2680,7 +2714,7 @@ export default {
|
|
|
background: #ff3b30;
|
|
|
}
|
|
|
|
|
|
- &.checked {
|
|
|
+ &.checked, &.user_choose {
|
|
|
color: #fff;
|
|
|
background: #007aff;
|
|
|
}
|
|
@@ -3010,6 +3044,11 @@ export default {
|
|
|
color: #fff;
|
|
|
background: blue;
|
|
|
}
|
|
|
+ &.check_ans {
|
|
|
+ border: 1rpx solid #eeeeee;
|
|
|
+ color: #fff;
|
|
|
+ background: #007aff;
|
|
|
+ }
|
|
|
}
|
|
|
.answerInfos {
|
|
|
padding: 25rpx 25rpx 25rpx 23rpx;
|