|
@@ -62,7 +62,6 @@
|
|
|
<view class="flex_auto">{{ item.content }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">确认答案</view>
|
|
|
<view v-if="bank.ques">
|
|
|
<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
|
|
|
<text
|
|
@@ -77,6 +76,7 @@
|
|
|
<view class="flex_auto">{{ item.content }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="!bank.ques" class="submit_checkbox" :class="{disabled:!isCheckboxChecked(bank.jsonStr)}" @click="checkboxSubmit(bankIndex)">确认答案</view>
|
|
|
<view v-if="bank.ques">
|
|
|
<view class="pad_8 answer">
|
|
|
<view>
|
|
@@ -94,6 +94,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<template v-if="bank.type == 3">
|
|
@@ -169,7 +170,7 @@
|
|
|
v-for="(tab, tabIndex) in bank.jsonStr"
|
|
|
@click="tabSelect(tabIndex, bankIndex)"
|
|
|
>
|
|
|
- 问题{{ tabIndex }}
|
|
|
+ 问题{{ tabIndex+1 }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
|
|
@@ -224,7 +225,7 @@
|
|
|
<rich-text :nodes="option.content"></rich-text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
|
|
|
+ <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" :class="{disabled:!isCheckboxChecked(ansItem.optionsList)}" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
|
|
|
<view v-if="bank.ques && bank.ques[ansIndex]">
|
|
|
<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
|
|
|
<text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
|
|
@@ -1206,6 +1207,14 @@ export default {
|
|
|
checkboxSelectChild(bindex, ansIndex, childIndex) {
|
|
|
this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
|
|
|
},
|
|
|
+
|
|
|
+ isCheckboxChecked(arr) {
|
|
|
+ return arr.some(item => {
|
|
|
+ if (item.checked) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
/**
|
|
|
* @param {Object} 多选确认
|
|
@@ -1218,6 +1227,14 @@ export default {
|
|
|
arr.push(item.optionsId);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ if(!arr.length) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'请选择答案',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
this.$set(this.questionList[bindex], 'ques', arr);
|
|
|
this.isDoOver();
|
|
@@ -1261,6 +1278,14 @@ export default {
|
|
|
arr.push(item.optionsId);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ if(!arr.length) {
|
|
|
+ uni.showToast({
|
|
|
+ title:'请选择答案',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
this.$set(this.questionList[bindex].ques, ansIndex, arr);
|
|
|
this.isDoOver();
|
|
@@ -1941,6 +1966,10 @@ export default {
|
|
|
line-height: 80rpx;
|
|
|
font-size: 30rpx;
|
|
|
border-radius: 40rpx;
|
|
|
+
|
|
|
+ &.disabled {
|
|
|
+ opacity: 0.6;
|
|
|
+ }
|
|
|
}
|
|
|
.titles {
|
|
|
overflow: hidden;
|