|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view>
|
|
|
|
|
|
|
+ <view class="bigBox">
|
|
|
<view v-if="nowPageData.type === 4" class="contentList">
|
|
<view v-if="nowPageData.type === 4" class="contentList">
|
|
|
<view class="headerTitle">
|
|
<view class="headerTitle">
|
|
|
<view class="leftIcon" v-for="(item, index) in titleS" :key="index" v-if="item.value === nowPageData.type">
|
|
<view class="leftIcon" v-for="(item, index) in titleS" :key="index" v-if="item.value === nowPageData.type">
|
|
|
<span>{{ item.label }}</span>
|
|
<span>{{ item.label }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="right">
|
|
<view class="right">
|
|
|
- 1
|
|
|
|
|
- <span class="lengNum">/10</span>
|
|
|
|
|
|
|
+ {{ numIndex + 1 }}
|
|
|
|
|
+ <span class="lengNum">/{{ list.length }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
@@ -23,18 +23,16 @@
|
|
|
<span>{{ item.label }}</span>
|
|
<span>{{ item.label }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <!-- <view class="content">
|
|
|
|
|
- <view class="contentTitle">{{ nowPageData.jsonStr[indexst].content }}</view>
|
|
|
|
|
- <view class="imageBox" v-if="nowPageData.jsonStr[indexst].imgUrl && nowPageData.jsonStr[indexst].imgUrl !== null">
|
|
|
|
|
- <image :src="$method.splitImgHost(nowPageData.jsonStr[indexst].imgUrl)" mode="aspectFit"></image>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="content">
|
|
|
|
|
+ <view class="contentTitle">{{ itemst.content }}</view>
|
|
|
|
|
+ <view class="imageBox" v-if="itemst.imgUrl && itemst.imgUrl !== null"><image :src="$method.splitImgHost(itemst.imgUrl)" mode="aspectFit"></image></view>
|
|
|
</view>
|
|
</view>
|
|
|
<view
|
|
<view
|
|
|
class="banksChiList"
|
|
class="banksChiList"
|
|
|
- v-for="(items, indexs) in nowPageData.jsonStr[indexst].answer"
|
|
|
|
|
|
|
+ v-for="(items, indexs) in itemst.answer"
|
|
|
:key="indexs"
|
|
:key="indexs"
|
|
|
- :class="replyL.indexOf(indexs) !== -1 ? 'activeListBt' : ''"
|
|
|
|
|
- @click="activeList(items, indexs)"
|
|
|
|
|
|
|
+ @click="activeListSitem(items, indexs, indexst)"
|
|
|
|
|
+ :class="replyL[indexst].selectId.indexOf(indexs) !== -1 ? 'activeListBt' : ''"
|
|
|
>
|
|
>
|
|
|
<view class="leftIndex">{{ alphabet[indexs] }}.</view>
|
|
<view class="leftIndex">{{ alphabet[indexs] }}.</view>
|
|
|
<view class="bankTie">
|
|
<view class="bankTie">
|
|
@@ -42,18 +40,20 @@
|
|
|
<image v-if="items.imgUrl && items.imgUrl !== null" :src="$method.splitImgHost(items.imgUrl)" mode="aspectFit"></image>
|
|
<image v-if="items.imgUrl && items.imgUrl !== null" :src="$method.splitImgHost(items.imgUrl)" mode="aspectFit"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="nowPageData.jsonStr[indexst].type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePD(1)">正确</view>
|
|
|
|
|
- <view v-if="nowPageData.jsonStr[indexst].type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePD(0)">错误</view>
|
|
|
|
|
- <view class="jxTit">
|
|
|
|
|
|
|
+ <view v-if="itemst.type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePDs(1, indexst)">正确</view>
|
|
|
|
|
+ <view v-if="itemst.type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePDs(0, indexst)">错误</view>
|
|
|
|
|
+ <view class="jxTit" style="margin-bottom: 10rpx;" @click="showTitles(indexst)">
|
|
|
<span class="jxSpan">查看解析</span>
|
|
<span class="jxSpan">查看解析</span>
|
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
|
- </view> -->
|
|
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="showJXanli.indexOf(indexst) !== -1 ? true : false" class="jxslis">{{ itemst.analysisContent }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<!-- -案例内容end -->
|
|
<!-- -案例内容end -->
|
|
|
- <view class="jxTit">
|
|
|
|
|
|
|
+ <view class="jxTit" @click="showTitle(nowPageData.questionId)">
|
|
|
<span class="jxSpan">查看解析</span>
|
|
<span class="jxSpan">查看解析</span>
|
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view v-if="showJX.indexOf(nowPageData.questionId) !== -1 ? true : false" class="jxslis">{{ nowPageData.analysisContent }}</view>
|
|
|
<u-button type="primary" @click="submitChi">提交</u-button>
|
|
<u-button type="primary" @click="submitChi">提交</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-else class="contentList">
|
|
<view v-else class="contentList">
|
|
@@ -62,8 +62,8 @@
|
|
|
<span>{{ item.label }}</span>
|
|
<span>{{ item.label }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="right">
|
|
<view class="right">
|
|
|
- 1
|
|
|
|
|
- <span class="lengNum">/10</span>
|
|
|
|
|
|
|
+ {{ numIndex + 1 }}
|
|
|
|
|
+ <span class="lengNum">/{{ list.length }}</span>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
@@ -87,11 +87,12 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePD(1)">正确</view>
|
|
<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePD(1)">正确</view>
|
|
|
<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePD(0)">错误</view>
|
|
<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePD(0)">错误</view>
|
|
|
- <view class="jxTit">
|
|
|
|
|
|
|
+ <view class="jxTit" @click="showTitle(nowPageData.questionId)">
|
|
|
<span class="jxSpan">查看解析</span>
|
|
<span class="jxSpan">查看解析</span>
|
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
<u-icon name="info-circle" color="#999999" size="40"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
- <u-button type="primary" @click="submitChi">提交</u-button>
|
|
|
|
|
|
|
+ <view v-if="showJX.indexOf(nowPageData.questionId) !== -1 ? true : false" class="jxslis">{{ nowPageData.analysisContent }}</view>
|
|
|
|
|
+ <u-button type="primary" @click="submitChi">下一题</u-button>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="footer_tab">
|
|
<view class="footer_tab">
|
|
|
<u-line color="#D6D6DB" />
|
|
<u-line color="#D6D6DB" />
|
|
@@ -114,7 +115,7 @@
|
|
|
</u-col>
|
|
</u-col>
|
|
|
<u-col span="4">
|
|
<u-col span="4">
|
|
|
<view class="box">
|
|
<view class="box">
|
|
|
- <view style="text-align: center;margin-right: 30rpx;position: absolute;right: 20rpx;">
|
|
|
|
|
|
|
+ <view style="text-align: center;margin-right: 30rpx;position: absolute;right: 20rpx;" @click="carryOut">
|
|
|
<image src="/static/jj.png" class="sc"></image>
|
|
<image src="/static/jj.png" class="sc"></image>
|
|
|
<view class="sc_t">交卷</view>
|
|
<view class="sc_t">交卷</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -125,7 +126,7 @@
|
|
|
<u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
|
|
<u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
|
|
|
<view class="popup_box">
|
|
<view class="popup_box">
|
|
|
<scroll-view scroll-y="true" class="popup_list">
|
|
<scroll-view scroll-y="true" class="popup_list">
|
|
|
- <view v-for="(item, index) in list" :key="index" class="btn_num" :class="index % 2 == 0 ? 'btn_bac2' : 'btn_bac1'">
|
|
|
|
|
|
|
+ <view v-for="(item, index) in list" :key="index" class="btn_num" :class="index === numIndex ? 'btn_bac2' : 'btn_bac1'" @click="changeTM(index, 2)">
|
|
|
<text class="">{{ index + 1 }}</text>
|
|
<text class="">{{ index + 1 }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -138,10 +139,15 @@
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- type: 1,
|
|
|
|
|
|
|
+ bankSectionId: null,
|
|
|
|
|
+ examId: null,
|
|
|
|
|
+ typeId: null,
|
|
|
|
|
+ numIndex: 0,
|
|
|
show: false,
|
|
show: false,
|
|
|
list: [],
|
|
list: [],
|
|
|
- nowPageData: {},
|
|
|
|
|
|
|
+ nowPageData: {
|
|
|
|
|
+ jsonStr: []
|
|
|
|
|
+ },
|
|
|
titleS: [
|
|
titleS: [
|
|
|
{
|
|
{
|
|
|
label: '单选',
|
|
label: '单选',
|
|
@@ -162,43 +168,150 @@ export default {
|
|
|
],
|
|
],
|
|
|
alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
|
replyL: [],
|
|
replyL: [],
|
|
|
- isWrong: -1
|
|
|
|
|
|
|
+ isWrong: -1,
|
|
|
|
|
+ answerList: [], //总提交列表
|
|
|
|
|
+ bankId: 0, //题库ID
|
|
|
|
|
+ selects: [], //当前做了哪些题目
|
|
|
|
|
+ showJX: [], // 展开解析列表
|
|
|
|
|
+ showJXanli: [] // 展开案例解析列表
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
this.titleListFn(option);
|
|
this.titleListFn(option);
|
|
|
|
|
+ this.bankId = option.bankId;
|
|
|
|
|
+ this.typeId = option.typeId;
|
|
|
|
|
+ if (option.bankSectionId) {
|
|
|
|
|
+ this.bankSectionId = option.bankSectionId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (option.examId) {
|
|
|
|
|
+ this.examId = option.examId;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
onShow() {},
|
|
onShow() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 查看解析start
|
|
|
|
|
+ showTitle(ids) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (this.showJX.indexOf(ids) !== -1) {
|
|
|
|
|
+ var ats = self.showJX.indexOf(ids);
|
|
|
|
|
+ self.showJX.splice(ats, 1);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.showJX.push(ids);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //案例解析
|
|
|
|
|
+ showTitles(int) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (this.showJXanli.indexOf(int) !== -1) {
|
|
|
|
|
+ var ats = self.showJXanli.indexOf(int);
|
|
|
|
|
+ self.showJXanli.splice(ats, 1);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.showJXanli.push(int);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ changeTM(index, int) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (int === 1) {
|
|
|
|
|
+ this.numIndex = index + 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.numIndex = index;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.initDatas();
|
|
|
|
|
+ this.initLint();
|
|
|
|
|
+ this.getCooieds();
|
|
|
|
|
+ },
|
|
|
|
|
+ initDatas() {
|
|
|
|
|
+ this.isWrong = -1;
|
|
|
|
|
+ this.showJX = [];
|
|
|
|
|
+ this.showJXanli = [];
|
|
|
|
|
+ this.selects = [];
|
|
|
|
|
+ }, //数据清空
|
|
|
|
|
+ getCooieds() {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (this.answerList.length) {
|
|
|
|
|
+ self.answerList.forEach((item, index) => {
|
|
|
|
|
+ if (item.questionId === self.nowPageData.questionId) {
|
|
|
|
|
+ if (self.nowPageData.type === 4) {
|
|
|
|
|
+ self.replyL = item.replyStr;
|
|
|
|
|
+ } else if (self.nowPageData.type === 3) {
|
|
|
|
|
+ self.isWrong = item.isRight;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.replyL = item.selectIds;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(self.replyL);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ initLint() {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ self.replyL = [];
|
|
|
|
|
+ if (self.list[self.numIndex].type === 4) {
|
|
|
|
|
+ for (var i = 0; i < self.list[self.numIndex].jsonStr.length; i++) {
|
|
|
|
|
+ self.replyL.push({ selectId: [] });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ self.nowPageData = self.list[self.numIndex];
|
|
|
|
|
+ },
|
|
|
submitChi() {
|
|
submitChi() {
|
|
|
- var yesList = []; //记录正确项索引
|
|
|
|
|
- this.nowPageData.jsonStr.forEach((item, index) => {
|
|
|
|
|
- if (item.optionAnswer === 1) {
|
|
|
|
|
- yesList.push(index);
|
|
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (self.nowPageData.type === 1 || self.nowPageData.type === 2 || self.nowPageData.type === 3) {
|
|
|
|
|
+ var yesList = []; //记录正确项索引
|
|
|
|
|
+ self.nowPageData.jsonStr.forEach((item, index) => {
|
|
|
|
|
+ if (item.optionAnswer === 1) {
|
|
|
|
|
+ yesList.push(index);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ var strYesList = yesList.sort().toString();
|
|
|
|
|
+ var isRight = strYesList == self.replyL.sort().toString() ? 1 : 0; //记录是否选择正确
|
|
|
|
|
+ if (self.nowPageData.type === 3) {
|
|
|
|
|
+ if (self.isWrong === self.nowPageData.answerQuestion) {
|
|
|
|
|
+ isRight = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ isRight = 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- var strYesList = yesList.sort().toString();
|
|
|
|
|
- var isRight = strYesList == this.replyL.sort().toString(); //记录是否选择正确
|
|
|
|
|
- if (this.nowPageData.type === 3) {
|
|
|
|
|
- if (this.isWrong === this.nowPageData.answerQuestion) {
|
|
|
|
|
- isRight = 1;
|
|
|
|
|
- } else {
|
|
|
|
|
- isRight = 0;
|
|
|
|
|
|
|
+ var objslit = []; //记录选中的选项对象
|
|
|
|
|
+ for (let i = 0; i < self.replyL.length; i++) {
|
|
|
|
|
+ objslit.push(self.nowPageData.jsonStr[self.replyL[i]]);
|
|
|
}
|
|
}
|
|
|
|
|
+ var objList = {
|
|
|
|
|
+ bankId: self.bankId,
|
|
|
|
|
+ questionId: self.nowPageData.questionId,
|
|
|
|
|
+ selectIds: self.replyL,
|
|
|
|
|
+ replyStr: objslit,
|
|
|
|
|
+ isRight: isRight
|
|
|
|
|
+ };
|
|
|
|
|
+ self.answerList[self.numIndex] = objList;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var objslit = []; //记录选中的选项对象
|
|
|
|
|
- for (let i = 0; i < this.replyL.length; i++) {
|
|
|
|
|
- objslit.push(this.nowPageData.jsonStr[this.replyL[i]]);
|
|
|
|
|
|
|
+ if (self.nowPageData.type === 4) {
|
|
|
|
|
+ for (var i = 0; i < self.replyL.length; i++) {
|
|
|
|
|
+ if (self.replyL[i].selectId.length) {
|
|
|
|
|
+ self.replyL[i].selectId = self.replyL[i].selectId;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ var objList = {
|
|
|
|
|
+ bankId: self.bankId,
|
|
|
|
|
+ questionId: self.nowPageData.questionId,
|
|
|
|
|
+ replyStr: self.replyL,
|
|
|
|
|
+ selectIds: self.selects
|
|
|
|
|
+ };
|
|
|
|
|
+ self.answerList[self.numIndex] = objList;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var objList = {
|
|
|
|
|
- questionId: this.nowPageData.questionId,
|
|
|
|
|
- selectIds: this.replyL.toString(),
|
|
|
|
|
- replays: objslit,
|
|
|
|
|
- isRight: isRight
|
|
|
|
|
- };
|
|
|
|
|
- console.log(objList);
|
|
|
|
|
|
|
+ if (self.numIndex === self.list.length - 1) {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '是否确定交卷',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ self.carryOut();
|
|
|
|
|
+ } else if (res.cancel) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ self.changeTM(self.numIndex, 1);
|
|
|
},
|
|
},
|
|
|
titleListFn(option) {
|
|
titleListFn(option) {
|
|
|
if (option.bankSectionId) {
|
|
if (option.bankSectionId) {
|
|
@@ -211,44 +324,191 @@ export default {
|
|
|
examId: option.examId
|
|
examId: option.examId
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(option);
|
|
|
this.$api.questiondetailList(data).then(res => {
|
|
this.$api.questiondetailList(data).then(res => {
|
|
|
if (res.data.rows.length) {
|
|
if (res.data.rows.length) {
|
|
|
|
|
+ let self = this;
|
|
|
res.data.rows.forEach((items, indexs) => {
|
|
res.data.rows.forEach((items, indexs) => {
|
|
|
items.jsonStr = JSON.parse(items.jsonStr);
|
|
items.jsonStr = JSON.parse(items.jsonStr);
|
|
|
});
|
|
});
|
|
|
- this.nowPageData = res.data.rows[3];
|
|
|
|
|
- console.log(this.nowPageData);
|
|
|
|
|
- this.list = res.data.rows;
|
|
|
|
|
|
|
+ if (res.data.rows[self.numIndex].type === 4) {
|
|
|
|
|
+ self.replyL = [];
|
|
|
|
|
+ for (var i = 0; i < res.data.rows[self.numIndex].jsonStr.length; i++) {
|
|
|
|
|
+ self.replyL.push({ selectId: [] });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ self.nowPageData = res.data.rows[self.numIndex];
|
|
|
|
|
+ self.list = res.data.rows;
|
|
|
} else {
|
|
} else {
|
|
|
- uni.showToast({
|
|
|
|
|
- title: '没有内容',
|
|
|
|
|
- icon: 'none',
|
|
|
|
|
- duration: 2000
|
|
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '没有题目',
|
|
|
|
|
+ showCancel: false,
|
|
|
|
|
+ confirmText: '返回上级',
|
|
|
|
|
+ success: function(res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta: 1
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
activeList(data, int) {
|
|
activeList(data, int) {
|
|
|
- if (this.nowPageData.type === 1) {
|
|
|
|
|
- this.replyL = [int];
|
|
|
|
|
- } else if (this.nowPageData.type === 2) {
|
|
|
|
|
- if (this.replyL.indexOf(int) !== -1) {
|
|
|
|
|
- for (var i = 0; i < this.replyL.length; i++) {
|
|
|
|
|
- if (this.replyL[i] === int) {
|
|
|
|
|
- this.replyL.splice(i, 1);
|
|
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (self.nowPageData.type === 1) {
|
|
|
|
|
+ self.replyL = [int];
|
|
|
|
|
+ } else if (self.nowPageData.type === 2) {
|
|
|
|
|
+ if (self.replyL.indexOf(int) !== -1) {
|
|
|
|
|
+ for (var i = 0; i <= self.replyL.length; i++) {
|
|
|
|
|
+ if (self.replyL[i] === int) {
|
|
|
|
|
+ self.replyL.splice(i, 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- this.replyL.push(int);
|
|
|
|
|
|
|
+ self.replyL.push(int);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- console.log(this.replyL);
|
|
|
|
|
},
|
|
},
|
|
|
activePD(int) {
|
|
activePD(int) {
|
|
|
this.isWrong = int;
|
|
this.isWrong = int;
|
|
|
},
|
|
},
|
|
|
|
|
+ activePDs(int, fatInt) {
|
|
|
|
|
+ this.isWrong = int;
|
|
|
|
|
+ if (this.replyL[fatInt] === undefined) {
|
|
|
|
|
+ this.replyL[fatInt] = {};
|
|
|
|
|
+ }
|
|
|
|
|
+ if (int === this.nowPageData.jsonStr[fatInt].answerQuestion) {
|
|
|
|
|
+ this.replyL[fatInt].isRight = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.replyL[fatInt].isRight = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.selects.indexOf(fatInt) === -1) {
|
|
|
|
|
+ this.selects.push(fatInt);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ activeListSitem(data, int, fatInt) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ if (self.replyL[fatInt] === undefined) {
|
|
|
|
|
+ self.replyL[fatInt] = {};
|
|
|
|
|
+ }
|
|
|
|
|
+ if (self.nowPageData.jsonStr[fatInt].type === 1) {
|
|
|
|
|
+ self.replyL[fatInt].selectId = [int];
|
|
|
|
|
+
|
|
|
|
|
+ var objNums = [];
|
|
|
|
|
+ self.nowPageData.jsonStr[fatInt].answer.forEach((itemta, indexta) => {
|
|
|
|
|
+ if (itemta.optionAnswer === 1) {
|
|
|
|
|
+ objNums.push(indexta);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ var strYesList = objNums.sort().toString();
|
|
|
|
|
+ var isRight = strYesList == self.replyL[fatInt].selectId.sort().toString();
|
|
|
|
|
+ if (isRight) {
|
|
|
|
|
+ self.replyL[fatInt].isRight = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.replyL[fatInt].isRight = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ self.replyL[fatInt].repley = [data];
|
|
|
|
|
+
|
|
|
|
|
+ if (self.replyL[fatInt].repley.length) {
|
|
|
|
|
+ if (self.selects.indexOf(fatInt) === -1) {
|
|
|
|
|
+ self.selects.push(fatInt);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (self.nowPageData.jsonStr[fatInt].type === 2) {
|
|
|
|
|
+ if (self.replyL[fatInt].selectId === undefined) {
|
|
|
|
|
+ self.replyL[fatInt].selectId = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ if (self.replyL[fatInt].selectId.indexOf(int) !== -1) {
|
|
|
|
|
+ for (var i = 0; i < self.replyL[fatInt].selectId.length; i++) {
|
|
|
|
|
+ if (self.replyL[fatInt].selectId[i] === int) {
|
|
|
|
|
+ self.replyL[fatInt].selectId.splice(i, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.replyL[fatInt].selectId.push(int);
|
|
|
|
|
+ }
|
|
|
|
|
+ var objNums = [];
|
|
|
|
|
+ self.nowPageData.jsonStr[fatInt].answer.forEach((itemta, indexta) => {
|
|
|
|
|
+ if (itemta.optionAnswer === 1) {
|
|
|
|
|
+ objNums.push(indexta);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ var strYesList = objNums.sort().toString();
|
|
|
|
|
+ var isRight = strYesList == self.replyL[fatInt].selectId.sort().toString();
|
|
|
|
|
+ if (isRight) {
|
|
|
|
|
+ self.replyL[fatInt].isRight = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ self.replyL[fatInt].isRight = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ var objst = [];
|
|
|
|
|
+ for (let i = 0; i < self.replyL[fatInt].selectId.length; i++) {
|
|
|
|
|
+ objst.push(self.nowPageData.jsonStr[fatInt].answer[self.replyL[fatInt].selectId[i]]);
|
|
|
|
|
+ }
|
|
|
|
|
+ self.replyL[fatInt].repley = objst;
|
|
|
|
|
+
|
|
|
|
|
+ if (self.replyL[fatInt].repley.length) {
|
|
|
|
|
+ if (self.selects.indexOf(fatInt) === -1) {
|
|
|
|
|
+ self.selects.push(fatInt);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var numt = self.selects.indexOf(fatInt);
|
|
|
|
|
+ self.selects.splice(numt, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
menu() {
|
|
menu() {
|
|
|
this.show = true;
|
|
this.show = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ //交卷
|
|
|
|
|
+ carryOut() {
|
|
|
|
|
+ this.answerList.forEach((item, index) => {
|
|
|
|
|
+ item.selectIds = item.selectIds.toString();
|
|
|
|
|
+ item.replyStr.forEach((items, indexs) => {
|
|
|
|
|
+ if (items.selectId) {
|
|
|
|
|
+ items.selectId = items.selectId.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ item.replyStr = JSON.stringify(item.replyStr);
|
|
|
|
|
+ });
|
|
|
|
|
+ var data = {
|
|
|
|
|
+ bankId: this.bankId,
|
|
|
|
|
+ type: this.typeId,
|
|
|
|
|
+ answerList: this.answerList
|
|
|
|
|
+ };
|
|
|
|
|
+ if (this.examId !== null) {
|
|
|
|
|
+ data.examId = this.examId;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.simulateId !== null) {
|
|
|
|
|
+ data.simulateId = this.bankSectionId;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.questiondetailrecord(data).then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ if (res.data.code === 200) {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ content: '提交成功返回上级',
|
|
|
|
|
+ showCancel: false,
|
|
|
|
|
+ confirmText: '返回上级',
|
|
|
|
|
+ success: function(ress) {
|
|
|
|
|
+ if (ress.confirm) {
|
|
|
|
|
+ uni.navigateBack({
|
|
|
|
|
+ delta: 1
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '提交失败',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(data);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -265,6 +525,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style scope>
|
|
<style scope>
|
|
|
|
|
+.bigBox > .contentList {
|
|
|
|
|
+ padding-top: 15rpx;
|
|
|
|
|
+ padding-bottom: 96rpx;
|
|
|
|
|
+}
|
|
|
.activeListBt {
|
|
.activeListBt {
|
|
|
border: 2rpx solid #32467b !important;
|
|
border: 2rpx solid #32467b !important;
|
|
|
}
|
|
}
|