|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="questionBank">
|
|
<view class="questionBank">
|
|
|
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
|
|
|
|
|
|
|
+ <uni-nav-bar class="navbar" @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
|
|
|
<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
|
|
<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
|
|
|
<swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
|
|
<swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
|
|
|
<view class="pageContent">
|
|
<view class="pageContent">
|
|
@@ -62,7 +62,7 @@
|
|
|
<view class="flex_auto">{{ item.content }}</view>
|
|
<view class="flex_auto">{{ item.content }}</view>
|
|
|
</view>
|
|
</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" class="submit_checkbox" :class="{disabled:!isCheckboxChecked(bank.jsonStr)}" @click="checkboxSubmit(bankIndex)">确认答案</view>
|
|
|
<view v-if="bank.ques">
|
|
<view v-if="bank.ques">
|
|
|
<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
|
|
<view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
|
|
|
<text
|
|
<text
|
|
@@ -101,7 +101,10 @@
|
|
|
<view v-if="!bank.ques">
|
|
<view v-if="!bank.ques">
|
|
|
<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
|
|
<view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
|
|
|
<view class="activeTI">{{ ast[index] }}</view>
|
|
<view class="activeTI">{{ ast[index] }}</view>
|
|
|
- {{ item }}
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ {{ item }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="bank.ques">
|
|
<view v-if="bank.ques">
|
|
@@ -109,7 +112,9 @@
|
|
|
<text :class="{ right: index == bank.ques || index == bank.ans, wrong: index == bank.ques && bank.ques != bank.ans }" class="activeTI">
|
|
<text :class="{ right: index == bank.ques || index == bank.ans, wrong: index == bank.ques && bank.ques != bank.ans }" class="activeTI">
|
|
|
{{ ast[index] }}
|
|
{{ ast[index] }}
|
|
|
</text>
|
|
</text>
|
|
|
- {{ item }}
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ {{ item }}
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -150,7 +155,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="bank.ques">
|
|
|
|
|
|
|
+ <view v-if="bank.ques && (bank.ques.text || bank.ques.imageList.length)">
|
|
|
<view class="pad_8 answerInfos">
|
|
<view class="pad_8 answerInfos">
|
|
|
<view class="answerTitle">答案解析:</view>
|
|
<view class="answerTitle">答案解析:</view>
|
|
|
<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
|
|
<view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
|
|
@@ -174,6 +179,11 @@
|
|
|
<view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
|
|
<view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
|
|
|
<template v-if="ansItem.type == 1">
|
|
<template v-if="ansItem.type == 1">
|
|
|
<view class="pad_8 titBox">
|
|
<view class="pad_8 titBox">
|
|
|
|
|
+ <view class="leftLetters">
|
|
|
|
|
+ <view class="btnType">
|
|
|
|
|
+ <text>单选</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<view class="titles">
|
|
<view class="titles">
|
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
@@ -185,7 +195,10 @@
|
|
|
@click="radioSelectChild(option.optionsId, ansIndex, bankIndex)"
|
|
@click="radioSelectChild(option.optionsId, ansIndex, bankIndex)"
|
|
|
>
|
|
>
|
|
|
<view class="activeTI">{{ ast[childIndex] }}</view>
|
|
<view class="activeTI">{{ ast[childIndex] }}</view>
|
|
|
- <rich-text class="textChild" :nodes="option.content"></rich-text>
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ <rich-text class="textChild" :nodes="option.content"></rich-text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="bank.ques[ansIndex]">
|
|
<view v-if="bank.ques[ansIndex]">
|
|
@@ -199,7 +212,10 @@
|
|
|
>
|
|
>
|
|
|
{{ ast[childIndex] }}
|
|
{{ ast[childIndex] }}
|
|
|
</text>
|
|
</text>
|
|
|
- <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -217,6 +233,11 @@
|
|
|
|
|
|
|
|
<template v-if="ansItem.type == 2">
|
|
<template v-if="ansItem.type == 2">
|
|
|
<view class="pad_8 titBox">
|
|
<view class="pad_8 titBox">
|
|
|
|
|
+ <view class="leftLetters">
|
|
|
|
|
+ <view class="btnType">
|
|
|
|
|
+ <text>多选</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<view class="titles">
|
|
<view class="titles">
|
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
@@ -228,16 +249,22 @@
|
|
|
@click="checkboxSelectChild(bankIndex, ansIndex, childindex)"
|
|
@click="checkboxSelectChild(bankIndex, ansIndex, childindex)"
|
|
|
>
|
|
>
|
|
|
<view :class="{ checked: option.checked }" class="activeTI">{{ ast[childindex] }}</view>
|
|
<view :class="{ checked: option.checked }" class="activeTI">{{ ast[childindex] }}</view>
|
|
|
- <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" :class="{disabled:isCheckboxChecked(bank.jsonStr)}" @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-if="bank.ques && bank.ques[ansIndex]">
|
|
|
<view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
|
|
<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">
|
|
<text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
|
|
|
{{ ast[childindex] }}
|
|
{{ ast[childindex] }}
|
|
|
</text>
|
|
</text>
|
|
|
- <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ <rich-text :nodes="option.content"></rich-text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -261,13 +288,21 @@
|
|
|
|
|
|
|
|
<template v-if="ansItem.type == 3">
|
|
<template v-if="ansItem.type == 3">
|
|
|
<view class="pad_8 titBox">
|
|
<view class="pad_8 titBox">
|
|
|
|
|
+ <view class="leftLetters">
|
|
|
|
|
+ <view class="btnType">
|
|
|
|
|
+ <text>判断</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
<view class="titles">
|
|
<view class="titles">
|
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="!bank.ques[ansIndex]">
|
|
<view v-if="!bank.ques[ansIndex]">
|
|
|
<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex, childindex, bankIndex)">
|
|
<view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex, childindex, bankIndex)">
|
|
|
<view class="activeTI">{{ ast[childindex] }}</view>
|
|
<view class="activeTI">{{ ast[childindex] }}</view>
|
|
|
- {{ option }}
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ {{ option }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="bank.ques[ansIndex]">
|
|
<view v-if="bank.ques[ansIndex]">
|
|
@@ -281,7 +316,9 @@
|
|
|
>
|
|
>
|
|
|
{{ ast[childindex] }}
|
|
{{ ast[childindex] }}
|
|
|
</text>
|
|
</text>
|
|
|
- {{ option }}
|
|
|
|
|
|
|
+ <view class="flex_auto">
|
|
|
|
|
+ {{ option }}
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -300,7 +337,12 @@
|
|
|
<!-- 简答题 -->
|
|
<!-- 简答题 -->
|
|
|
<template v-if="ansItem.type == 5">
|
|
<template v-if="ansItem.type == 5">
|
|
|
<view class="pad_8 titBox_title">
|
|
<view class="pad_8 titBox_title">
|
|
|
- <view>
|
|
|
|
|
|
|
+ <view class="leftLetters">
|
|
|
|
|
+ <view class="btnType">
|
|
|
|
|
+ <text>简答</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="titles">
|
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
<rich-text :nodes="ansItem.content"></rich-text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -391,6 +433,12 @@
|
|
|
<view class="text">左右滑动切换上下题</view>
|
|
<view class="text">左右滑动切换上下题</view>
|
|
|
<view class="btn" @click="hideDialog">我知道了</view>
|
|
<view class="btn" @click="hideDialog">我知道了</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="dialog-arrow" v-if="showArrow">
|
|
|
|
|
+ <image class="pointer" src="/static/arrow-left.png" mode=""></image>
|
|
|
|
|
+ <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
|
|
|
|
|
+ <view class="btn" @click="showArrow = false">我知道了</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
<view class="dialog_wrap" v-if="testOver">
|
|
<view class="dialog_wrap" v-if="testOver">
|
|
|
<view class="bg"></view>
|
|
<view class="bg"></view>
|
|
@@ -508,6 +556,7 @@ export default {
|
|
|
lastCount: 0, //剩余没有回答的题目数
|
|
lastCount: 0, //剩余没有回答的题目数
|
|
|
chapterId: 0,
|
|
chapterId: 0,
|
|
|
moduleId: 0,
|
|
moduleId: 0,
|
|
|
|
|
+ showArrow:false, //退出提示
|
|
|
isFromVideo:'',
|
|
isFromVideo:'',
|
|
|
gradeId:'',
|
|
gradeId:'',
|
|
|
courseId:0,
|
|
courseId:0,
|
|
@@ -547,6 +596,7 @@ export default {
|
|
|
for (var k in globalData.bankData) {
|
|
for (var k in globalData.bankData) {
|
|
|
this[k] = globalData.bankData[k];
|
|
this[k] = globalData.bankData[k];
|
|
|
}
|
|
}
|
|
|
|
|
+ this.showArrow = true;
|
|
|
|
|
|
|
|
//需要拍没拍过直接弹出摄像头
|
|
//需要拍没拍过直接弹出摄像头
|
|
|
if(this.needPhoto && !this.isTakePhoto) {
|
|
if(this.needPhoto && !this.isTakePhoto) {
|
|
@@ -581,6 +631,11 @@ export default {
|
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if(this.needPhoto && !this.isTakePhoto) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//考试试卷 阻止ios手势返回,自动跳回答题页
|
|
//考试试卷 阻止ios手势返回,自动跳回答题页
|
|
|
if (this.needBack) {
|
|
if (this.needBack) {
|
|
|
let app = getApp();
|
|
let app = getApp();
|
|
@@ -780,6 +835,14 @@ export default {
|
|
|
* 点击后退按钮
|
|
* 点击后退按钮
|
|
|
*/
|
|
*/
|
|
|
clickLeft() {
|
|
clickLeft() {
|
|
|
|
|
+ //需要拍照没有拍直接返回
|
|
|
|
|
+ if(this.needPhoto && !this.isTakePhoto) {
|
|
|
|
|
+ this.isSubmit = true;
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta:1
|
|
|
|
|
+ })
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (this.bankType == 1) {
|
|
if (this.bankType == 1) {
|
|
|
let ansCount = this.questionOverNum(); //已答题数
|
|
let ansCount = this.questionOverNum(); //已答题数
|
|
|
this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
@@ -900,9 +963,16 @@ export default {
|
|
|
uni.navigateBack({
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
delta: 1
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ //需要拍照没有拍,返回不扣次数
|
|
|
|
|
+ if(this.needPhoto && !this.isTakePhoto) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
let score = 0; //计算总分
|
|
let score = 0; //计算总分
|
|
|
let reportStatus = 0;
|
|
let reportStatus = 0;
|
|
|
let number = 0;
|
|
let number = 0;
|
|
|
|
|
+ let doQuestionIds = []; //做过的题目id
|
|
|
|
|
+ let doQuestionNum = 0; //做过的题目数量
|
|
|
let passScore = 0;
|
|
let passScore = 0;
|
|
|
let allScore = 0; //总分
|
|
let allScore = 0; //总分
|
|
|
this.questionList.forEach((item, index) => {
|
|
this.questionList.forEach((item, index) => {
|
|
@@ -916,6 +986,11 @@ export default {
|
|
|
|
|
|
|
|
item.scoreResult = 0;
|
|
item.scoreResult = 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (item.ques) {
|
|
|
|
|
+ doQuestionNum++;
|
|
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
|
|
+ }
|
|
|
allScore += item.score;
|
|
allScore += item.score;
|
|
|
} else if (item.type == 2) {
|
|
} else if (item.type == 2) {
|
|
|
let isRight =
|
|
let isRight =
|
|
@@ -948,7 +1023,7 @@ export default {
|
|
|
if(item.ques) {
|
|
if(item.ques) {
|
|
|
|
|
|
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
|
- checkboxScore -= item.partScore;
|
|
|
|
|
|
|
+ checkboxScore = item.partScore;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
checkboxScore = 0;
|
|
@@ -966,6 +1041,11 @@ export default {
|
|
|
score += checkboxScore;
|
|
score += checkboxScore;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (item.ques && item.ques.length) {
|
|
|
|
|
+ doQuestionNum++;
|
|
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
|
|
+ }
|
|
|
allScore += item.score;
|
|
allScore += item.score;
|
|
|
} else if (item.type == 3) {
|
|
} else if (item.type == 3) {
|
|
|
if (item.ques == item.ans) {
|
|
if (item.ques == item.ans) {
|
|
@@ -976,6 +1056,12 @@ export default {
|
|
|
|
|
|
|
|
item.scoreResult = 0;
|
|
item.scoreResult = 0;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (item.ques) {
|
|
|
|
|
+ doQuestionNum++;
|
|
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
|
|
+ }
|
|
|
|
|
+ allScore += item.score;
|
|
|
|
|
+ } else {
|
|
|
allScore += item.score;
|
|
allScore += item.score;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -996,7 +1082,9 @@ export default {
|
|
|
courseId:this.courseId,
|
|
courseId:this.courseId,
|
|
|
reportStatus:reportStatus,
|
|
reportStatus:reportStatus,
|
|
|
rightQuestionNum: number,
|
|
rightQuestionNum: number,
|
|
|
|
|
+ doQuestionNum:doQuestionNum,
|
|
|
status: 1,
|
|
status: 1,
|
|
|
|
|
+ doQuestionIds:doQuestionIds.join(','),
|
|
|
gradeId:this.gradeId,
|
|
gradeId:this.gradeId,
|
|
|
performance: score,
|
|
performance: score,
|
|
|
totalScore: allScore,
|
|
totalScore: allScore,
|
|
@@ -1063,7 +1151,7 @@ export default {
|
|
|
if(item.ques) {
|
|
if(item.ques) {
|
|
|
|
|
|
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
|
- checkboxScore -= item.partScore;
|
|
|
|
|
|
|
+ checkboxScore = item.partScore;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
checkboxScore = 0;
|
|
@@ -1077,7 +1165,7 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
item.scoreResult = checkboxScore;
|
|
item.scoreResult = checkboxScore;
|
|
|
score += checkboxScore;
|
|
score += checkboxScore;
|
|
|
- number++;
|
|
|
|
|
|
|
+ // number++;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1152,7 +1240,7 @@ export default {
|
|
|
.goodsQuestionList({
|
|
.goodsQuestionList({
|
|
|
examId: this.id
|
|
examId: this.id
|
|
|
})
|
|
})
|
|
|
- .then(res => {
|
|
|
|
|
|
|
+ .then(async res => {
|
|
|
if (!res.data.data.length) {
|
|
if (!res.data.data.length) {
|
|
|
this.hideDialog();
|
|
this.hideDialog();
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
@@ -1183,6 +1271,8 @@ export default {
|
|
|
arr[i] = '' + a;
|
|
arr[i] = '' + a;
|
|
|
});
|
|
});
|
|
|
item.ans = arr;
|
|
item.ans = arr;
|
|
|
|
|
+ item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
|
|
+ item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
return;
|
|
return;
|
|
|
} else if (item.type == 5) {
|
|
} else if (item.type == 5) {
|
|
|
//简答题
|
|
//简答题
|
|
@@ -1195,6 +1285,8 @@ export default {
|
|
|
text: '',
|
|
text: '',
|
|
|
imageList: []
|
|
imageList: []
|
|
|
}
|
|
}
|
|
|
|
|
+ item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
|
|
+ item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
} else if (item.type == 4) {
|
|
} else if (item.type == 4) {
|
|
|
//案例题
|
|
//案例题
|
|
|
console.log(item.jsonStr);
|
|
console.log(item.jsonStr);
|
|
@@ -1204,6 +1296,7 @@ export default {
|
|
|
item.jsonStr.forEach((json, index) => {
|
|
item.jsonStr.forEach((json, index) => {
|
|
|
if (json.type == 1) {
|
|
if (json.type == 1) {
|
|
|
ansArr[index] = json.answerQuestion;
|
|
ansArr[index] = json.answerQuestion;
|
|
|
|
|
+ json.content && (json.content = json.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
} else if (json.type == 2) {
|
|
} else if (json.type == 2) {
|
|
|
json.optionsList.forEach(str => {
|
|
json.optionsList.forEach(str => {
|
|
|
str.optionsId = '' + str.optionsId;
|
|
str.optionsId = '' + str.optionsId;
|
|
@@ -1213,8 +1306,10 @@ export default {
|
|
|
arr[i] = '' + a;
|
|
arr[i] = '' + a;
|
|
|
});
|
|
});
|
|
|
ansArr[index] = arr;
|
|
ansArr[index] = arr;
|
|
|
|
|
+ json.content && (json.content = json.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
} else if (json.type == 3) {
|
|
} else if (json.type == 3) {
|
|
|
ansArr[index] = json.answerQuestion;
|
|
ansArr[index] = json.answerQuestion;
|
|
|
|
|
+ json.content && (json.content = json.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
} else if (json.type == 5) {
|
|
} else if (json.type == 5) {
|
|
|
ansArr[index] = {
|
|
ansArr[index] = {
|
|
|
text: '',
|
|
text: '',
|
|
@@ -1224,73 +1319,87 @@ export default {
|
|
|
text: '',
|
|
text: '',
|
|
|
imageList: []
|
|
imageList: []
|
|
|
};
|
|
};
|
|
|
|
|
+ json.content && (json.content = json.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
|
|
+ item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
item.ans = ansArr;
|
|
item.ans = ansArr;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
|
|
|
item.ans = item.answerQuestion;
|
|
item.ans = item.answerQuestion;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.questionList = res.data.data;
|
|
this.questionList = res.data.data;
|
|
|
this.lastCount = this.questionList.length;
|
|
this.lastCount = this.questionList.length;
|
|
|
- this.examRecord();
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ await this.examRecord();
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
- * 记录总题数
|
|
|
|
|
|
|
+ * 记录总题数,获取recordId
|
|
|
* hasSpecial (是否包含简答和案例) true 包含 false 不包含
|
|
* hasSpecial (是否包含简答和案例) true 包含 false 不包含
|
|
|
*/
|
|
*/
|
|
|
examRecord(hasSpecial) {
|
|
examRecord(hasSpecial) {
|
|
|
- let self = this
|
|
|
|
|
- let questionList = 0;
|
|
|
|
|
- if(!hasSpecial) {
|
|
|
|
|
- this.questionList.forEach((item, index) => {
|
|
|
|
|
- if(item.type == 1 || item.type == 2 || item.type == 3) {
|
|
|
|
|
- questionList++;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- questionList = this.questionList.length;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.$api
|
|
|
|
|
- .bankRecord({
|
|
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
|
|
- examId: this.id,
|
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
|
- gradeId:this.gradeId,
|
|
|
|
|
- totalQuestionNum: questionList
|
|
|
|
|
- })
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.recordId = res.data.data;
|
|
|
|
|
- if(self.needPhoto){
|
|
|
|
|
- self.photoPopup = true; //拍照
|
|
|
|
|
- } else {
|
|
|
|
|
- if(this.lastTime) {
|
|
|
|
|
- this.timer = setInterval(() => {
|
|
|
|
|
- if (this.lastTime <= 0) {
|
|
|
|
|
- clearInterval(this.timer);
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- icon:'none',
|
|
|
|
|
- mask:true,
|
|
|
|
|
- title:'考试时间已到,系统将自动交卷',
|
|
|
|
|
- duration:10000
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
|
+ let self = this
|
|
|
|
|
+ let questionList = 0;
|
|
|
|
|
+ if(!hasSpecial) {
|
|
|
|
|
+ this.questionList.forEach((item, index) => {
|
|
|
|
|
+ if(item.type == 1 || item.type == 2 || item.type == 3) {
|
|
|
|
|
+ questionList++;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ questionList = this.questionList.length;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$api
|
|
|
|
|
+ .bankRecord({
|
|
|
|
|
+ chapterExamId: this.chapterId || 0,
|
|
|
|
|
+ moduleExamId: this.moduleId || 0,
|
|
|
|
|
+ examId: this.id,
|
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
|
+ gradeId:this.gradeId,
|
|
|
|
|
+ totalQuestionNum: questionList
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.recordId = res.data.data;
|
|
|
|
|
+
|
|
|
|
|
+ if(self.needPhoto){
|
|
|
|
|
+ self.photoPopup = true; //拍照
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if(this.lastTime) {
|
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
|
|
+ clearInterval(this.timer);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon:'none',
|
|
|
|
|
+ mask:true,
|
|
|
|
|
+ title:'考试时间已到,系统将自动交卷',
|
|
|
|
|
+ duration:10000
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ this.submit();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.lastTime--;
|
|
|
|
|
+ }, 1000);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.submit();
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.lastTime--;
|
|
|
|
|
- }, 1000);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ resolve()
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -1424,16 +1533,35 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
pdsubmit() {
|
|
pdsubmit() {
|
|
|
- if (this.bankType == 1) {
|
|
|
|
|
- let ansCount = this.questionOverNum(); //已答题数
|
|
|
|
|
- this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
|
|
|
- //没有答完
|
|
|
|
|
- if (this.lastCount !== 0) {
|
|
|
|
|
- this.cgType = 6;
|
|
|
|
|
- this.showpopups = true;
|
|
|
|
|
|
|
+ let ansCount = this.questionOverNum(true); //已答题数
|
|
|
|
|
+ this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
|
|
|
|
|
+ //没有答完
|
|
|
|
|
+ if (this.lastCount !== 0) {
|
|
|
|
|
+ this.cgType = 6;
|
|
|
|
|
+ this.showpopups = true;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(this.bankType == 2) {
|
|
|
|
|
+ if(this.lastTime > 0) {
|
|
|
|
|
+ let lastTime = this.countdown(this.lastTime)
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title:'提示',
|
|
|
|
|
+ content:`时间还剩余${lastTime},确定交卷吗?`,
|
|
|
|
|
+ confirmText:'交卷',
|
|
|
|
|
+ cancelText:'继续答题',
|
|
|
|
|
+ success:(res) => {
|
|
|
|
|
+ if(res.confirm) { //确定
|
|
|
|
|
+ this.submit();
|
|
|
|
|
+ } else { //取消
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
this.submit();
|
|
this.submit();
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -1506,7 +1634,7 @@ export default {
|
|
|
if(item.ques) {
|
|
if(item.ques) {
|
|
|
|
|
|
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
|
|
|
- checkboxScore -= item.partScore;
|
|
|
|
|
|
|
+ checkboxScore = item.partScore;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
checkboxScore = 0;
|
|
checkboxScore = 0;
|
|
@@ -1519,10 +1647,11 @@ export default {
|
|
|
item.scoreResult = 0;
|
|
item.scoreResult = 0;
|
|
|
doWrongQuestionIds.push(item.questionId)
|
|
doWrongQuestionIds.push(item.questionId)
|
|
|
} else { //部分分
|
|
} else { //部分分
|
|
|
- number++;
|
|
|
|
|
|
|
+ // number++;
|
|
|
|
|
+ doWrongQuestionIds.push(item.questionId)
|
|
|
item.scoreResult = checkboxScore;
|
|
item.scoreResult = checkboxScore;
|
|
|
score += checkboxScore;
|
|
score += checkboxScore;
|
|
|
- rightQuestionIds.push(item.questionId)
|
|
|
|
|
|
|
+ // rightQuestionIds.push(item.questionId)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
allScore += item.score;
|
|
allScore += item.score;
|
|
@@ -1546,12 +1675,16 @@ export default {
|
|
|
doQuestionIds.push(item.questionId)
|
|
doQuestionIds.push(item.questionId)
|
|
|
}
|
|
}
|
|
|
} else if (item.type == 4) {
|
|
} else if (item.type == 4) {
|
|
|
|
|
+ allScore += item.score;
|
|
|
if (item.ques && item.ques.length) {
|
|
if (item.ques && item.ques.length) {
|
|
|
doQuestionNum++;
|
|
doQuestionNum++;
|
|
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
}
|
|
}
|
|
|
} else if (item.type == 5) {
|
|
} else if (item.type == 5) {
|
|
|
- if (item.ques) {
|
|
|
|
|
|
|
+ allScore += item.score;
|
|
|
|
|
+ if (item.ques && (item.ques.imageList || item.ques.text)) {
|
|
|
doQuestionNum++;
|
|
doQuestionNum++;
|
|
|
|
|
+ doQuestionIds.push(item.questionId)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1574,9 +1707,9 @@ export default {
|
|
|
reportStatus:reportStatus,
|
|
reportStatus:reportStatus,
|
|
|
recordId: this.recordId,
|
|
recordId: this.recordId,
|
|
|
courseId:this.courseId,
|
|
courseId:this.courseId,
|
|
|
- // rightQuestionNum: number,
|
|
|
|
|
|
|
+ rightQuestionNum: number,
|
|
|
status: 1,
|
|
status: 1,
|
|
|
- // doQuestionIds:doQuestionIds.join(','),
|
|
|
|
|
|
|
+ doQuestionIds:doQuestionIds.join(','),
|
|
|
// rightQuestionIds:rightQuestionIds.join(','),
|
|
// rightQuestionIds:rightQuestionIds.join(','),
|
|
|
// doQuestionNum: doQuestionNum,
|
|
// doQuestionNum: doQuestionNum,
|
|
|
performance: score,
|
|
performance: score,
|
|
@@ -1820,8 +1953,8 @@ export default {
|
|
|
//多选
|
|
//多选
|
|
|
} else if (item.type == 2) {
|
|
} else if (item.type == 2) {
|
|
|
//每一项都相等
|
|
//每一项都相等
|
|
|
- return this.questionList[index].ques.every((item, i) => {
|
|
|
|
|
- return item == this.questionList[index].ans[i];
|
|
|
|
|
|
|
+ return this.questionList[index].ans.every((item, i) => {
|
|
|
|
|
+ return item == this.questionList[index].ques[i];
|
|
|
});
|
|
});
|
|
|
//判断
|
|
//判断
|
|
|
} else if (item.type == 3) {
|
|
} else if (item.type == 3) {
|
|
@@ -1872,8 +2005,8 @@ export default {
|
|
|
//多选
|
|
//多选
|
|
|
} else if (item.type == 2) {
|
|
} else if (item.type == 2) {
|
|
|
//每一项都相等
|
|
//每一项都相等
|
|
|
- return this.questionList[index].ques.some((item, index) => {
|
|
|
|
|
- return item != this.questionList[index].ans;
|
|
|
|
|
|
|
+ return this.questionList[index].ans.some((item, i) => {
|
|
|
|
|
+ return item != this.questionList[index].ques[i];
|
|
|
});
|
|
});
|
|
|
//判断
|
|
//判断
|
|
|
} else if (item.type == 3) {
|
|
} else if (item.type == 3) {
|
|
@@ -1945,6 +2078,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.navbar {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 20000;
|
|
|
|
|
+}
|
|
|
.questionBank {
|
|
.questionBank {
|
|
|
width:100%;
|
|
width:100%;
|
|
|
height:100vh;
|
|
height:100vh;
|
|
@@ -1978,12 +2115,12 @@ export default {
|
|
|
|
|
|
|
|
&.right {
|
|
&.right {
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: green;
|
|
|
|
|
|
|
+ background: #36C75A;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.wrong {
|
|
&.wrong {
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: red;
|
|
|
|
|
|
|
+ background: #FF3B30;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.checked {
|
|
&.checked {
|
|
@@ -1993,6 +2130,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.submit_checkbox {
|
|
.submit_checkbox {
|
|
|
|
|
+ position:fixed;
|
|
|
|
|
+ left:0;
|
|
|
|
|
+ right:0;
|
|
|
|
|
+ bottom:120rpx;
|
|
|
margin: 20rpx auto;
|
|
margin: 20rpx auto;
|
|
|
width: 526rpx;
|
|
width: 526rpx;
|
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
@@ -2104,7 +2245,7 @@ export default {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
line-height: 30rpx;
|
|
line-height: 30rpx;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: red;
|
|
|
|
|
|
|
+ background: #FF3B30;
|
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2140,25 +2281,25 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+.leftLetters {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 220rpx;
|
|
|
|
|
+ .btnType {
|
|
|
|
|
+ padding: 5rpx 10rpx;
|
|
|
|
|
+ border: 1rpx solid #007aff;
|
|
|
|
|
+ border-radius: 10rpx;
|
|
|
|
|
+ background-color: rgba(0, 122, 255, 0.1);
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ color: #007aff;
|
|
|
|
|
+ margin-right: 15rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
.firstLetter {
|
|
.firstLetter {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
margin-bottom: 30rpx;
|
|
margin-bottom: 30rpx;
|
|
|
- .leftLetters {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- width: 220rpx;
|
|
|
|
|
- .btnType {
|
|
|
|
|
- padding: 5rpx 10rpx;
|
|
|
|
|
- border: 1rpx solid #007aff;
|
|
|
|
|
- border-radius: 10rpx;
|
|
|
|
|
- background-color: rgba(0, 122, 255, 0.1);
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- color: #007aff;
|
|
|
|
|
- margin-right: 15rpx;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
.popupView {
|
|
.popupView {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -2293,13 +2434,13 @@ export default {
|
|
|
&.isRight {
|
|
&.isRight {
|
|
|
border: 1rpx solid #eeeeee;
|
|
border: 1rpx solid #eeeeee;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: green;
|
|
|
|
|
|
|
+ background: #36C75A;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.isWrong {
|
|
&.isWrong {
|
|
|
border: 1rpx solid #eeeeee;
|
|
border: 1rpx solid #eeeeee;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
- background: red;
|
|
|
|
|
|
|
+ background: #FF3B30;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.answerInfos {
|
|
.answerInfos {
|
|
@@ -2352,6 +2493,42 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.dialog-arrow {
|
|
|
|
|
+ padding-top:124rpx;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.8);
|
|
|
|
|
+ z-index: 20000;
|
|
|
|
|
+
|
|
|
|
|
+ .pointer {
|
|
|
|
|
+ margin-left:87rpx;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ width:95rpx;
|
|
|
|
|
+ height:98rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .text {
|
|
|
|
|
+ padding-left:177rpx;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .btn {
|
|
|
|
|
+ width: 242rpx;
|
|
|
|
|
+ height: 82rpx;
|
|
|
|
|
+ border: 2rpx solid #ffffff;
|
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ line-height: 82rpx;
|
|
|
|
|
+ margin: 500rpx auto 0;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.dialog_wrap {
|
|
.dialog_wrap {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
left: 0;
|
|
left: 0;
|