|
@@ -7,7 +7,12 @@
|
|
</view>
|
|
</view>
|
|
<!-- 第一行 -->
|
|
<!-- 第一行 -->
|
|
<view class="kaoshi-page-title">
|
|
<view class="kaoshi-page-title">
|
|
- <view v-if="activeSt" class="title-types">{{stTypes[activeSt.stTypeId]}}</view>
|
|
|
|
|
|
+ <!-- 倒计时 -->
|
|
|
|
+ <view v-if="!!data.endSecond">
|
|
|
|
+ <text>考试倒计时:</text>
|
|
|
|
+ <uni-countdown :show-day="true" :second="1000" @timeup="onTimeUp" :start="startCountDown"></uni-countdown>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="activeSt" class="title-types">{{dlName}}</view>
|
|
<view>100分钟</view>
|
|
<view>100分钟</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -42,7 +47,6 @@
|
|
<icon class="shiti-num-icon"></icon>
|
|
<icon class="shiti-num-icon"></icon>
|
|
<text class="active-num">{{activeSt ? activeSt.onlyNum: 0}}</text>/<text>{{data.StListForSearch.length}}</text>
|
|
<text class="active-num">{{activeSt ? activeSt.onlyNum: 0}}</text>/<text>{{data.StListForSearch.length}}</text>
|
|
</view>
|
|
</view>
|
|
- <button class="phone-white-btn jx-btn" hover-class="none" type="default" size="mini" @click="handleCheckJiexi">解析</button>
|
|
|
|
</view>
|
|
</view>
|
|
<template v-if="activeSt">
|
|
<template v-if="activeSt">
|
|
<button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-prev" @click="handlePrev" v-if="!isFistStId">上一题</button>
|
|
<button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-prev" @click="handlePrev" v-if="!isFistStId">上一题</button>
|
|
@@ -67,20 +71,20 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-popup>
|
|
</uni-popup>
|
|
- <!--
|
|
|
|
- // 倒计时
|
|
|
|
- <view v-if="!!data.endSecond">
|
|
|
|
- <text>考试倒计时:</text>
|
|
|
|
- <uni-countdown :show-day="false" :second="1000" @timeup="onTimeUp" :start="startCountDown"></uni-countdown>
|
|
|
|
- </view>
|
|
|
|
- -->
|
|
|
|
- <!-- 答案解析 -->
|
|
|
|
- <scoreAndAnswerVue ref="scoreAnswerRef"></scoreAndAnswerVue>
|
|
|
|
- <scoreAndAnswerAdminTiankong ref="scoreAnswerTkRef"></scoreAndAnswerAdminTiankong>
|
|
|
|
|
|
+ <zhuapaiConfirm ref="zhuapaiConfirmRef"
|
|
|
|
+ @success="zpConfirmSuccess"
|
|
|
|
+ @error="zpConfirmError"
|
|
|
|
+ @cancel="zpConfirmCancel"
|
|
|
|
+
|
|
|
|
+ ></zhuapaiConfirm>
|
|
|
|
+ <!-- 抓拍 -->
|
|
|
|
+ <zhuapaiVue ref="zhuapaiRef"
|
|
|
|
+ @error="zpError"
|
|
|
|
+ ></zhuapaiVue>
|
|
|
|
+ <!-- 切屏 -->
|
|
|
|
+ <qiepingVue ref="qiepingRef"></qiepingVue>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -88,8 +92,12 @@
|
|
ref,
|
|
ref,
|
|
reactive,
|
|
reactive,
|
|
computed,
|
|
computed,
|
|
- watch
|
|
|
|
|
|
+ watch,
|
|
|
|
+ nextTick
|
|
} from "vue";
|
|
} from "vue";
|
|
|
|
+ import zhuapaiVue from "@/components/zhuapaiConfirm/zhuapai.vue";
|
|
|
|
+ import qiepingVue from "@/components/zhuapaiConfirm/qieping.vue";
|
|
|
|
+ import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue"
|
|
import {
|
|
import {
|
|
onLoad
|
|
onLoad
|
|
} from "@dcloudio/uni-app";
|
|
} from "@dcloudio/uni-app";
|
|
@@ -98,9 +106,7 @@
|
|
import duoxuan from "@/components/questions/duoxuan.vue";
|
|
import duoxuan from "@/components/questions/duoxuan.vue";
|
|
import tiankong from "@/components/questions/tiankong.vue";
|
|
import tiankong from "@/components/questions/tiankong.vue";
|
|
import panduan from "@/components/questions/panduan.vue";
|
|
import panduan from "@/components/questions/panduan.vue";
|
|
- import scoreAndAnswerVue from "@/components/scoreAndAnswer/scoreAndAnswerAdmin.vue";
|
|
|
|
import {useQuestionTools} from "@/components/questions/useQuestionTools.js";
|
|
import {useQuestionTools} from "@/components/questions/useQuestionTools.js";
|
|
- import scoreAndAnswerAdminTiankong from "@/components/scoreAndAnswer/scoreAndAnswerAdminTiankong.vue";
|
|
|
|
const {
|
|
const {
|
|
checkDanxuanReply,
|
|
checkDanxuanReply,
|
|
checkDuoxuanReply,
|
|
checkDuoxuanReply,
|
|
@@ -109,16 +115,25 @@
|
|
getLetterByIndex
|
|
getLetterByIndex
|
|
} = useQuestionTools();
|
|
} = useQuestionTools();
|
|
|
|
|
|
- const stTypes = {
|
|
|
|
- 1: '单选题',
|
|
|
|
- 2: '多选题',
|
|
|
|
- 3: '判断题',
|
|
|
|
- 4: '填空题',
|
|
|
|
- }
|
|
|
|
|
|
+ onLoad((option) => {
|
|
|
|
+ data.ksId = option.ksId;
|
|
|
|
+ data.zhuapai = option.zhuapai
|
|
|
|
+
|
|
|
|
+ if (data.zhuapai) {
|
|
|
|
+ // 考试前确认摄像头
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ initBeforKaoshi();
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ initKaoshi();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
|
|
const popupRef = ref(null)
|
|
const popupRef = ref(null)
|
|
- const scoreAnswerRef = ref(null)
|
|
|
|
- const scoreAnswerTkRef = ref(null)
|
|
|
|
|
|
+ const zhuapaiRef = ref(null)
|
|
|
|
+ const qiepingRef = ref(null)
|
|
|
|
+ const zhuapaiConfirmRef = ref(null)
|
|
|
|
|
|
const startCountDown = ref(false);
|
|
const startCountDown = ref(false);
|
|
|
|
|
|
@@ -144,6 +159,14 @@
|
|
dlIndex: 0,
|
|
dlIndex: 0,
|
|
dtIndex: 0
|
|
dtIndex: 0
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ const dlName = computed(() => {
|
|
|
|
+ if (data.StListForSearch && activeSt.value) {
|
|
|
|
+ return data.StListForSearch[activeSt.value.onlyNum].paragraphName
|
|
|
|
+ } else {
|
|
|
|
+ return ''
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
|
|
watch(() => data.duanluo, (newVal) => {
|
|
watch(() => data.duanluo, (newVal) => {
|
|
// 计算已答试题数量
|
|
// 计算已答试题数量
|
|
@@ -174,10 +197,40 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- onLoad((option) => {
|
|
|
|
- data.ksId = option.ksId;
|
|
|
|
|
|
+ // 摄像头抓拍相关功能 start
|
|
|
|
+ function zpSuccess() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ function zpError() {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '摄像头唤起异常'
|
|
|
|
+ })
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/client/Kaoshi/list'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 摄像头抓拍相关功能 end
|
|
|
|
+ // 摄像头确认相关功能 start
|
|
|
|
+ function zpConfirmSuccess() {
|
|
initKaoshi();
|
|
initKaoshi();
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ function zpConfirmError() {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '摄像头唤起异常'
|
|
|
|
+ })
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/client/Kaoshi/list'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ function zpConfirmCancel() {
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/client/Kaoshi/list'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 摄像头确认相关功能 end
|
|
|
|
+
|
|
|
|
|
|
function getQaClass(qa) {
|
|
function getQaClass(qa) {
|
|
if (qa.marked && qa.marked === true) {
|
|
if (qa.marked && qa.marked === true) {
|
|
@@ -243,7 +296,7 @@
|
|
|
|
|
|
function handlePrev() {
|
|
function handlePrev() {
|
|
const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
|
|
const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
|
|
- const index = qa.num - 1;
|
|
|
|
|
|
+ const index = qa.onlyNum - 1;
|
|
if (index > 0) {
|
|
if (index > 0) {
|
|
const result = data.StListForSearch[index - 1];
|
|
const result = data.StListForSearch[index - 1];
|
|
progress.dlIndex = result.dlIndex;
|
|
progress.dlIndex = result.dlIndex;
|
|
@@ -254,7 +307,7 @@
|
|
|
|
|
|
function handleNext() {
|
|
function handleNext() {
|
|
const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
|
|
const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
|
|
- const index = qa.num - 1;
|
|
|
|
|
|
+ const index = qa.onlyNum - 1;
|
|
if (index < data.StListForSearch.length) {
|
|
if (index < data.StListForSearch.length) {
|
|
const result = data.StListForSearch[index + 1];
|
|
const result = data.StListForSearch[index + 1];
|
|
progress.dlIndex = result.dlIndex;
|
|
progress.dlIndex = result.dlIndex;
|
|
@@ -263,8 +316,8 @@
|
|
}
|
|
}
|
|
|
|
|
|
function formatDuanluoList(dlData) {
|
|
function formatDuanluoList(dlData) {
|
|
- let uIndex = 0; // 试题num
|
|
|
|
- let iDuanluo = 0; // 段落num
|
|
|
|
|
|
+ let uIndex = 0; // 试题onlyNum
|
|
|
|
+ let iDuanluo = 0; // 段落onlyNum
|
|
let result = [];
|
|
let result = [];
|
|
for (const duanluo of data.duanluo) {
|
|
for (const duanluo of data.duanluo) {
|
|
let paragraph = {
|
|
let paragraph = {
|
|
@@ -280,7 +333,6 @@
|
|
iDanxuan.onlyNum = uIndex + 1;
|
|
iDanxuan.onlyNum = uIndex + 1;
|
|
iDanxuan.order = order;
|
|
iDanxuan.order = order;
|
|
iDanxuan.iQa = iQa;
|
|
iDanxuan.iQa = iQa;
|
|
- iDanxuan.reply = iDanxuan.result;
|
|
|
|
paragraph.qas.push(iDanxuan);
|
|
paragraph.qas.push(iDanxuan);
|
|
uIndex++;
|
|
uIndex++;
|
|
order++;
|
|
order++;
|
|
@@ -291,7 +343,7 @@
|
|
paragraphName: paragraph.name,
|
|
paragraphName: paragraph.name,
|
|
dlIndex: iDuanluo,
|
|
dlIndex: iDuanluo,
|
|
dtIndex: iDanxuan.iQa,
|
|
dtIndex: iDanxuan.iQa,
|
|
- num: iDanxuan.onlyNum
|
|
|
|
|
|
+ onlyNum: iDanxuan.onlyNum
|
|
})
|
|
})
|
|
}
|
|
}
|
|
order = 0;
|
|
order = 0;
|
|
@@ -301,7 +353,6 @@
|
|
iDuoxuan.onlyNum = uIndex + 1;
|
|
iDuoxuan.onlyNum = uIndex + 1;
|
|
iDuoxuan.order = order;
|
|
iDuoxuan.order = order;
|
|
paragraph.qas.push(iDuoxuan);
|
|
paragraph.qas.push(iDuoxuan);
|
|
- iDuoxuan.reply = iDuoxuan.result;
|
|
|
|
iDuoxuan.iQa = iQa;
|
|
iDuoxuan.iQa = iQa;
|
|
uIndex++;
|
|
uIndex++;
|
|
order++;
|
|
order++;
|
|
@@ -312,7 +363,7 @@
|
|
paragraphName: paragraph.name,
|
|
paragraphName: paragraph.name,
|
|
dlIndex: iDuanluo,
|
|
dlIndex: iDuanluo,
|
|
dtIndex: iDuoxuan.iQa,
|
|
dtIndex: iDuoxuan.iQa,
|
|
- num: iDuoxuan.onlyNum
|
|
|
|
|
|
+ onlyNum: iDuoxuan.onlyNum
|
|
})
|
|
})
|
|
}
|
|
}
|
|
order = 0;
|
|
order = 0;
|
|
@@ -322,7 +373,6 @@
|
|
iPanduan.onlyNum = uIndex + 1;
|
|
iPanduan.onlyNum = uIndex + 1;
|
|
iPanduan.order = order;
|
|
iPanduan.order = order;
|
|
paragraph.qas.push(iPanduan);
|
|
paragraph.qas.push(iPanduan);
|
|
- iPanduan.reply = iPanduan.result;
|
|
|
|
iPanduan.iQa = iQa;
|
|
iPanduan.iQa = iQa;
|
|
uIndex++;
|
|
uIndex++;
|
|
order++;
|
|
order++;
|
|
@@ -333,7 +383,7 @@
|
|
paragraphName: paragraph.name,
|
|
paragraphName: paragraph.name,
|
|
dlIndex: iDuanluo,
|
|
dlIndex: iDuanluo,
|
|
dtIndex: iPanduan.iQa,
|
|
dtIndex: iPanduan.iQa,
|
|
- num: iPanduan.onlyNum
|
|
|
|
|
|
+ onlyNum: iPanduan.onlyNum
|
|
})
|
|
})
|
|
}
|
|
}
|
|
order = 0;
|
|
order = 0;
|
|
@@ -343,7 +393,6 @@
|
|
iTiankong.onlyNum = uIndex + 1;
|
|
iTiankong.onlyNum = uIndex + 1;
|
|
iTiankong.order = order;
|
|
iTiankong.order = order;
|
|
paragraph.qas.push(iTiankong);
|
|
paragraph.qas.push(iTiankong);
|
|
- iTiankong.reply = iTiankong.result.map(item => item[0]);
|
|
|
|
iTiankong.iQa = iQa;
|
|
iTiankong.iQa = iQa;
|
|
uIndex++;
|
|
uIndex++;
|
|
order++;
|
|
order++;
|
|
@@ -354,13 +403,13 @@
|
|
paragraphName: paragraph.name,
|
|
paragraphName: paragraph.name,
|
|
dlIndex: iDuanluo,
|
|
dlIndex: iDuanluo,
|
|
dtIndex: iTiankong.iQa,
|
|
dtIndex: iTiankong.iQa,
|
|
- num: iTiankong.onlyNum
|
|
|
|
|
|
+ onlyNum: iTiankong.onlyNum
|
|
})
|
|
})
|
|
}
|
|
}
|
|
iDuanluo++;
|
|
iDuanluo++;
|
|
questionData.value.push(paragraph)
|
|
questionData.value.push(paragraph)
|
|
-
|
|
|
|
- console.log(questionData.value)
|
|
|
|
|
|
+ console.log('1',questionData.value)
|
|
|
|
+ console.log('2',data.StListForSearch)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -368,73 +417,19 @@
|
|
activeSt.value.marked = !activeSt.value.marked;
|
|
activeSt.value.marked = !activeSt.value.marked;
|
|
}
|
|
}
|
|
|
|
|
|
- function handleCheckJiexi() {
|
|
|
|
- const qa = activeSt.value ;
|
|
|
|
- let score = qa.score;
|
|
|
|
- let reply = '';
|
|
|
|
- let result = '';
|
|
|
|
- let answer = qa.answer;
|
|
|
|
- if (qa.stTypeId == 1) {
|
|
|
|
- // 单选题
|
|
|
|
- if (qa.reply && qa.reply.trim() !== '') {
|
|
|
|
- reply = getLetterByIndex(qa.reply)
|
|
|
|
- } else {
|
|
|
|
- reply = '未答'
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (qa.result) {
|
|
|
|
- result = getLetterByIndex(qa.result)
|
|
|
|
- } else {
|
|
|
|
- result = '无答案'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (qa.stTypeId == 2) {
|
|
|
|
- // 多选题
|
|
|
|
-
|
|
|
|
- if (qa.reply && qa.reply.length) {
|
|
|
|
- reply = qa.reply.map(item => {
|
|
|
|
- if (item.trim()) {
|
|
|
|
- return getLetterByIndex(item.trim())
|
|
|
|
- }
|
|
|
|
- }).join(',')
|
|
|
|
- } else {
|
|
|
|
- reply = '未答'
|
|
|
|
- }
|
|
|
|
- if (qa.result) {
|
|
|
|
- result = qa.result.map(item => {
|
|
|
|
- if (item.trim()) {
|
|
|
|
- return getLetterByIndex(item.trim())
|
|
|
|
- }
|
|
|
|
- }).join(',')
|
|
|
|
- } else {
|
|
|
|
- result = '无答案'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (qa.stTypeId == 3) {
|
|
|
|
- // 判断题
|
|
|
|
- if (qa.reply == 0) {
|
|
|
|
- reply = '错误'
|
|
|
|
- }else if (qa.reply == 1) {
|
|
|
|
- reply = '正确'
|
|
|
|
- }
|
|
|
|
- if (qa.result == 0) {
|
|
|
|
- result = '错误'
|
|
|
|
- }else if (qa.result == 1) {
|
|
|
|
- result = '正确'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (qa.stTypeId == 4) {
|
|
|
|
- let reply = qa.reply || [];
|
|
|
|
- let result =qa.result || [];
|
|
|
|
- // 填空题
|
|
|
|
- scoreAnswerTkRef.value.showPopup({score,reply,result,answer})
|
|
|
|
- } else {
|
|
|
|
- scoreAnswerRef.value.showPopup({
|
|
|
|
- score,reply,result,answer
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ function saveKsCache() {}
|
|
|
|
+ function getKsCache() {}
|
|
|
|
+ function removeKsCache() {}
|
|
|
|
+ function formatKaoshiData() {}
|
|
|
|
+
|
|
|
|
+ // 摄像头确认初始化
|
|
|
|
+ function initBeforKaoshi() {
|
|
|
|
+ console.log(zhuapaiConfirmRef.value)
|
|
|
|
+ zhuapaiConfirmRef.value.showDialog()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
function initKaoshi() {
|
|
function initKaoshi() {
|
|
ksApi.getKaoshiInfo({
|
|
ksApi.getKaoshiInfo({
|
|
ksId: data.ksId
|
|
ksId: data.ksId
|
|
@@ -464,6 +459,14 @@
|
|
data.zhuapai = zhuapai;
|
|
data.zhuapai = zhuapai;
|
|
data.duanluo = duanluoList;
|
|
data.duanluo = duanluoList;
|
|
formatDuanluoList(data.duanluo);
|
|
formatDuanluoList(data.duanluo);
|
|
|
|
+
|
|
|
|
+ // 设置缓存
|
|
|
|
+ formatKaoshiData();
|
|
|
|
+ // 设置抓拍监听
|
|
|
|
+ zhuapaiRef.value.init({zhuapai: 1});
|
|
|
|
+ // 设置切屏监听
|
|
|
|
+ // qiepingRef.value.init()
|
|
|
|
+
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
title: data.ksName
|
|
title: data.ksName
|
|
});
|
|
});
|