|
@@ -123,21 +123,23 @@
|
|
|
|
|
|
<!-- 底部按钮 -->
|
|
|
<view class="button-group">
|
|
|
- <button
|
|
|
+ <view
|
|
|
v-if="parindex >= 1"
|
|
|
- class="prev-btn"
|
|
|
+ class="prev-btn button"
|
|
|
@tap="handlePage(item, parindex, 'prevPage')"
|
|
|
>
|
|
|
上一题
|
|
|
- </button>
|
|
|
- <button
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
v-if="parindex + 1 < total"
|
|
|
- class="next-btn"
|
|
|
+ class="next-btn button"
|
|
|
@tap="handlePage(item, parindex, 'nextPage')"
|
|
|
>
|
|
|
下一题
|
|
|
- </button>
|
|
|
- <button v-if="parindex + 1 === total" @click="examEnd">交卷</button>
|
|
|
+ </view>
|
|
|
+ <view class="button" v-if="parindex + 1 === total" @click="examEnd"
|
|
|
+ >交卷</view
|
|
|
+ >
|
|
|
</view>
|
|
|
</template>
|
|
|
</template>
|
|
@@ -278,11 +280,16 @@ const props = defineProps({
|
|
|
const onBeforePageChange = (index) => {
|
|
|
// 保存用户答题
|
|
|
const item = data.value[nowIndex.value];
|
|
|
+ if (!item.selectAns.length) {
|
|
|
+ nowIndex.value = index;
|
|
|
+ return;
|
|
|
+ }
|
|
|
request(
|
|
|
"api/question_bank/question_reception/real_topic/save_user_real_topic",
|
|
|
{
|
|
|
+ user_real_paper_id: props.real_topic_id,
|
|
|
catalogue_id: getRoute().params.id,
|
|
|
- real_topic_id: props.real_topic_id,
|
|
|
+ real_topic_id: item.id,
|
|
|
is_correct: item.isRight ? 1 : 0,
|
|
|
answer: item.selectAns.join(","),
|
|
|
},
|