questionBankExplainDetail.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744
  1. <template>
  2. <view id="questionBank">
  3. <view class="tabs-top">
  4. <u-tabs :list="list" sticky :current="tabCurrent" @change="tabChange" active-color="#007AFF"></u-tabs>
  5. </view>
  6. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  7. <swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
  8. <view class="pageContent">
  9. <view class="pad_8 titBox" >
  10. <view class="firstLetter">
  11. <view class="leftLetters">
  12. <view class="btnType">
  13. <text v-if="bank.type==1">单选</text>
  14. <text v-if="bank.type==2">多选</text>
  15. <text v-if="bank.type==3">判断</text>
  16. <text v-if="bank.type==4">案例</text>
  17. <text v-if="bank.type==5">简答</text>
  18. </view>
  19. <text>{{bankIndex+1}}/{{questionList.length}}</text>
  20. </view>
  21. <view style="color: #666;font-size: 28rpx;"></view>
  22. <view class="leftLetters"></view>
  23. </view>
  24. <view class="titles">
  25. <rich-text :nodes="bank.content"></rich-text>
  26. </view>
  27. </view>
  28. <template v-if="bank.type == 1">
  29. <view class="pad_8 titBox no-margin">
  30. <view v-if="!bank.ques">
  31. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
  32. <view class="activeTI">{{ ast[index] }}</view>
  33. <view class="flex_auto">{{ item.content }}</view>
  34. </view>
  35. </view>
  36. <view v-if="bank.ques">
  37. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  38. <text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  39. <view class="flex_auto">{{ item.content }}</view>
  40. </view>
  41. </view>
  42. <view v-if="bank.ques">
  43. <view class="pad_8 answer">
  44. <view>正确答案:{{ast[bank.ans-1]}}</view>
  45. <view v-if="!explain">我的答案:{{ast[bank.ques-1]}}</view>
  46. </view>
  47. <view class="pad_8 answerInfos">
  48. <view class="answerTitle">答案解析</view>
  49. <view class="answerContent">
  50. <rich-text :nodes="bank.analysisContent"></rich-text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <template v-if="bank.type == 2">
  57. <view class="pad_8 titBox no-margin">
  58. <view v-if="!bank.ques">
  59. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
  60. <view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
  61. <view class="flex_auto">{{ item.content }}</view>
  62. </view>
  63. </view>
  64. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
  65. 确认答案
  66. </view>
  67. <view v-if="bank.ques">
  68. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  69. <text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}" class="activeTI">{{ ast[index] }}</text>
  70. <view class="flex_auto">{{ item.content }}</view>
  71. </view>
  72. </view>
  73. <view v-if="bank.ques">
  74. <view class="pad_8 answer">
  75. <view>正确答案:
  76. <text :key="ansItemIndex" v-for="(ansItem,ansItemIndex) in bank.ans">{{ast[ansItem-1]}}</text>
  77. </view>
  78. <view v-if="!explain">我的答案:
  79. <text :key="quesItemIndex" v-for="(quesItem,quesItemIndex) in bank.ques">{{ast[quesItem-1]}}</text>
  80. </view>
  81. </view>
  82. <view class="pad_8 answerInfos">
  83. <view class="answerTitle">答案解析</view>
  84. <view class="answerContent">
  85. <rich-text :nodes="bank.analysisContent"></rich-text>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <template v-if="bank.type == 3">
  92. <view class="pad_8 titBox no-margin">
  93. <view v-if="!bank.ques">
  94. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
  95. <view class="activeTI">{{ ast[index] }}</view>
  96. {{ item }}
  97. </view>
  98. </view>
  99. <view v-if="bank.ques">
  100. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  101. <text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  102. {{ item }}
  103. </view>
  104. </view>
  105. <view v-if="bank.ques">
  106. <view class="pad_8 answer">
  107. <view>正确答案:{{ast[bank.ans]}}</view>
  108. <view v-if="!explain">我的答案:{{ast[bank.ques]}}</view>
  109. </view>
  110. <view class="pad_8 answerInfos">
  111. <view class="answerTitle">答案解析</view>
  112. <view class="answerContent">
  113. <rich-text :nodes="bank.analysisContent"></rich-text>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. <!-- 简答题 -->
  120. <template v-if="bank.type == 5">
  121. <view class="pad_8 titBox">
  122. <view class="ans">
  123. <view class="ans_input" v-if="!bank.ques">
  124. <view class="top flex">
  125. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
  126. <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
  127. <view class="submit" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @click="submitAns(bankIndex)" >确认答案</view>
  128. </view>
  129. <view class="textarea">
  130. <textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea>
  131. </view>
  132. <view class="imgs">
  133. <view class="img" v-for="(img,imgIndex) in bank.ansText.imageList" :key="imgIndex" >
  134. <text @click="deleteImg(imgIndex,bankIndex)">x</text>
  135. <image :src="$method.splitImgHost(img, true)"></image>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="ans_submit answerInfos" v-if="bank.ques && !explain">
  140. <view class="answerTitle">我的答案:</view>
  141. {{bank.ques.text}}
  142. <view class="imgs">
  143. <image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques,true)"></image>
  144. </view>
  145. </view>
  146. </view>
  147. <view v-if="bank.ques">
  148. <view class="pad_8 answerInfos">
  149. <view class="answerTitle">答案解析:</view>
  150. <view class="answerContent">
  151. <rich-text :nodes="bank.analysisContent"></rich-text>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. </template>
  157. <!-- 案例题 -->
  158. <template v-if="bank.type == 4">
  159. <view class="pad_8 titBox">
  160. <view class="tabs">
  161. <view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
  162. </view>
  163. <view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  164. <view class="titles">
  165. <rich-text :nodes="ansItem.content"></rich-text>
  166. </view>
  167. <template v-if="ansItem.type == 1">
  168. <view v-if="!bank.ques[ansIndex]">
  169. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
  170. <view class="activeTI">{{ ast[childIndex] }}</view>
  171. <rich-text class="textChild" :nodes="option.content"></rich-text>
  172. </view>
  173. </view>
  174. <view v-if="bank.ques[ansIndex]">
  175. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty">
  176. <text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childIndex] }}</text>
  177. <rich-text :nodes="option.content"></rich-text>
  178. </view>
  179. </view>
  180. <view v-if="bank.ques[ansIndex]">
  181. <view class="pad_8 answer">
  182. <view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
  183. <view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
  184. </view>
  185. <view class="pad_8 answerInfos">
  186. <view class="answerTitle">答案解析</view>
  187. <view class="answerContent">
  188. <rich-text :nodes="option.analysisContent"></rich-text>
  189. </view>
  190. </view>
  191. </view>
  192. </template>
  193. <template v-if="ansItem.type == 2">
  194. <view v-if="!bank.ques[ansIndex]">
  195. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
  196. <view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
  197. <rich-text :nodes="option.content"></rich-text>
  198. </view>
  199. </view>
  200. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
  201. 确认答案
  202. </view>
  203. <view v-if="bank.ques && bank.ques[ansIndex]">
  204. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  205. <text :class="{right:right(bankIndex,ansIndex,option),wrong:wrong(bankIndex,ansIndex,option)}" class="activeTI">{{ ast[childindex] }}</text>
  206. <rich-text :nodes="option.content"></rich-text>
  207. </view>
  208. </view>
  209. <view v-if="bank.ques[ansIndex]">
  210. <view class="pad_8 answer">
  211. <view>正确答案:
  212. <text :key="ansItemIndex1" v-for="(ansItem1,ansItemIndex1) in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
  213. </view>
  214. <view v-if="!explain">我的答案:
  215. <text :key="quesItemIndex" v-for="(quesItem,quesItemIndex) in bank.ques[ansIndex]">{{ast[quesItem-1]}}</text>
  216. </view>
  217. </view>
  218. <view class="pad_8 answerInfos">
  219. <view class="answerTitle">答案解析</view>
  220. <view class="answerContent">
  221. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  222. </view>
  223. </view>
  224. </view>
  225. </template>
  226. <template v-if="ansItem.type == 3">
  227. <view v-if="!bank.ques[ansIndex]">
  228. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
  229. <view class="activeTI">{{ ast[childindex] }}</view>
  230. {{ option }}
  231. </view>
  232. </view>
  233. <view v-if="bank.ques[ansIndex]">
  234. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  235. <text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childindex] }}</text>
  236. {{ option }}
  237. </view>
  238. </view>
  239. <view v-if="bank.ques[ansIndex]">
  240. <view class="pad_8 answer">
  241. <view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
  242. <view v-if="!explain">我的答案:{{ast[bank.ques[ansIndex]]}}</view>
  243. </view>
  244. <view class="pad_8 answerInfos">
  245. <view class="answerTitle">答案解析</view>
  246. <view class="answerContent">
  247. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  248. </view>
  249. </view>
  250. </view>
  251. </template>
  252. <!-- 简答题 -->
  253. <template v-if="ansItem.type == 5">
  254. <view class="ans">
  255. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  256. <view class="top flex">
  257. <image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
  258. <view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
  259. <view class="submit" :class="{disabled:!ansItem.ansText.text && hasImgs(ansItem)}" @click="submitAnsChild(bankIndex,ansIndex)">确认答案</view>
  260. </view>
  261. <view class="textarea">
  262. <textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea>
  263. </view>
  264. <view class="imgs">
  265. <view class="img" v-for="(img,imgIndex) in ansItem.ansText.imageList" :key="imgIndex">
  266. <text @click="deleteImgChild(imgIndex,bankIndex,ansIndex)">x</text>
  267. <image :src="$method.splitImgHost(img, true)"></image>
  268. </view>
  269. </view>
  270. </view>
  271. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex] && !explain">
  272. <view class="answerTitle">答案我的</view>
  273. {{bank.ques[ansIndex].text}}
  274. <view class="imgs">
  275. <image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :src="$method.splitImgHost(ques,true)"></image>
  276. </view>
  277. </view>
  278. </view>
  279. <view v-if="bank.ques[ansIndex]">
  280. <view class="pad_8 answerInfos">
  281. <view class="answerTitle">答案解析</view>
  282. <view class="answerContent">
  283. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  284. </view>
  285. </view>
  286. </view>
  287. </template>
  288. </view>
  289. </view>
  290. </template>
  291. <view class="footer_btn">
  292. <view class="collect" @click="collect(collectList[bankIndex], bankIndex)">
  293. <view v-if="collectList[bankIndex]">
  294. <image src="/static/icon/collected.png" mode=""></image>
  295. <view>取消收藏</view>
  296. </view>
  297. <view v-if="!collectList[bankIndex]">
  298. <image src="/static/icon/collect.png" mode=""></image>
  299. <view>收藏</view>
  300. </view>
  301. </view>
  302. <view class="flex_center" @click="openFooterTab">
  303. <view class="up-icon">
  304. <image src="/static/up.png"></image>
  305. </view>
  306. 答题卡
  307. </view>
  308. <view class="collect" @click="submit">
  309. <view>
  310. <image src="/static/jj.png" mode=""></image>
  311. <view>交卷</view>
  312. </view>
  313. </view>
  314. </view>
  315. </view>
  316. </swiper-item>
  317. </swiper>
  318. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  319. <view class="popupView">
  320. <view class="popupTops">
  321. <view class="topIcon"></view>
  322. 点击编号即可跳转至对应题目
  323. </view>
  324. <view class="popupContent">
  325. <scroll-view scroll-y="true" style="height: 506rpx;">
  326. <view class="boxSty">
  327. <view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
  328. </view>
  329. </scroll-view>
  330. </view>
  331. </view>
  332. </u-popup>
  333. <view class="dialog" v-if="showDialog">
  334. <image class="pointer" src="/static/pointer.png"></image>
  335. <view class="text">左右滑动切换上下题</view>
  336. <view class="btn" @click="hideDialog">我知道了</view>
  337. </view>
  338. </view>
  339. </template>
  340. <script>
  341. export default {
  342. data() {
  343. return {
  344. examId:'',
  345. tabCurrent:0,
  346. current:0,
  347. questionList:[],
  348. ast: ['A', 'B', 'C', 'D','E','F','G'],
  349. judge:['错误','正确'],
  350. show: false,
  351. showDialog:true,
  352. bankList: [],
  353. collectList:[],
  354. goodsId:'',
  355. explain:'1', //是否显示答案
  356. chapterId:'',
  357. moduleId:'',
  358. list:[{
  359. name:'对题'
  360. },{
  361. name:'错题'
  362. }]
  363. };
  364. },
  365. onLoad(option){
  366. this.examId = option.examId;
  367. this.goodsId = option.goodsId;
  368. this.chapterId = option.chapterId;
  369. this.moduleId = option.moduleId;
  370. // this.goodsQuestionList();
  371. if(this.tabCurrent == 0) {
  372. this.examRecordRightList();
  373. } else {
  374. this.examRecordWrongList();
  375. }
  376. },
  377. onUnload() {
  378. },
  379. methods: {
  380. tabChange(e) {
  381. this.tabCurrent = e;
  382. if(this.tabCurrent == 0) {
  383. this.examRecordRightList();
  384. } else {
  385. this.examRecordWrongList();
  386. }
  387. },
  388. /**
  389. * 是否有上传图片
  390. */
  391. hasImgs(bank) {
  392. return bank.ansText.imageList.length == 0;
  393. },
  394. /**
  395. * 获取错题列表
  396. */
  397. examRecordWrongList() {
  398. this.$api.examRecordWrongList({
  399. examId:this.examId,
  400. goodsId:this.goodsId
  401. }).then(res => {
  402. res.data.rows.forEach((item,index) => {
  403. if(typeof item.jsonStr == 'string') {
  404. item.jsonStr = JSON.parse(item.jsonStr)
  405. if(item.type == 2) { //多选
  406. item.jsonStr.forEach(str => {
  407. str.optionsId = ''+str.optionsId;
  408. })
  409. let arr = item.answerQuestion.split(',');
  410. arr.forEach((a,i) => {
  411. arr[i] = ''+a;
  412. })
  413. item.ans = arr;
  414. if(this.explain) {
  415. item.ques = item.ans;
  416. }
  417. return;
  418. } else if(item.type == 5) {
  419. item.ansText = {
  420. text: '',
  421. imageList: []
  422. }
  423. if(this.explain) {
  424. item.ques = {
  425. text:item.analysisContent
  426. }
  427. return;
  428. }
  429. } else if(item.type == 4) {
  430. console.log(item.jsonStr)
  431. item.ques = []
  432. item.current = 0;
  433. let ansArr = [];
  434. item.jsonStr.forEach((json,index) => {
  435. if(json.type == 1) {
  436. ansArr[index] = json.answerQuestion;
  437. } else if(json.type == 2) {
  438. json.optionsList.forEach(str => {
  439. str.optionsId = ''+str.optionsId;
  440. })
  441. let arr = json.answerQuestion.split(',');
  442. arr.forEach((a,i) => {
  443. arr[i] = ''+a;
  444. })
  445. ansArr[index] = arr
  446. } else if(json.type == 3) {
  447. ansArr[index] = json.answerQuestion;
  448. } else if(json.type == 5) {
  449. ansArr[index] = {
  450. text: '',
  451. imageList: []
  452. }
  453. json.ansText = {
  454. text: '',
  455. imageList: []
  456. }
  457. }
  458. })
  459. item.ans = ansArr
  460. if(this.explain) {
  461. item.ques = item.ans;
  462. }
  463. return;
  464. }
  465. item.ans = item.answerQuestion
  466. if(this.explain) {
  467. item.ques = item.ans;
  468. }
  469. } else {
  470. if(this.explain) {
  471. item.ques = item.ans;
  472. }
  473. }
  474. })
  475. this.questionList = res.data.rows;
  476. })
  477. },
  478. /**
  479. * 获取对题列表
  480. */
  481. examRecordRightList() {
  482. this.$api.examRecordRightList({
  483. examId:this.examId,
  484. goodsId:this.goodsId
  485. }).then(res => {
  486. res.data.rows.forEach((item,index) => {
  487. if(typeof item.jsonStr == 'string') {
  488. item.jsonStr = JSON.parse(item.jsonStr)
  489. if(item.type == 2) { //多选
  490. item.jsonStr.forEach(str => {
  491. str.optionsId = ''+str.optionsId;
  492. })
  493. let arr = item.answerQuestion.split(',');
  494. arr.forEach((a,i) => {
  495. arr[i] = ''+a;
  496. })
  497. item.ans = arr;
  498. if(this.explain) {
  499. item.ques = item.ans;
  500. }
  501. return;
  502. } else if(item.type == 5) {
  503. item.ansText = {
  504. text: '',
  505. imageList: []
  506. }
  507. if(this.explain) {
  508. item.ques = {
  509. text:item.analysisContent
  510. }
  511. return;
  512. }
  513. } else if(item.type == 4) {
  514. console.log(item.jsonStr)
  515. item.ques = []
  516. item.current = 0;
  517. let ansArr = [];
  518. item.jsonStr.forEach((json,index) => {
  519. if(json.type == 1) {
  520. ansArr[index] = json.answerQuestion;
  521. } else if(json.type == 2) {
  522. json.optionsList.forEach(str => {
  523. str.optionsId = ''+str.optionsId;
  524. })
  525. let arr = json.answerQuestion.split(',');
  526. arr.forEach((a,i) => {
  527. arr[i] = ''+a;
  528. })
  529. ansArr[index] = arr
  530. } else if(json.type == 3) {
  531. ansArr[index] = json.answerQuestion;
  532. } else if(json.type == 5) {
  533. ansArr[index] = {
  534. text: '',
  535. imageList: []
  536. }
  537. json.ansText = {
  538. text: '',
  539. imageList: []
  540. }
  541. }
  542. })
  543. item.ans = ansArr
  544. if(this.explain) {
  545. item.ques = item.ans;
  546. }
  547. return;
  548. }
  549. item.ans = item.answerQuestion
  550. if(this.explain) {
  551. item.ques = item.ans;
  552. }
  553. } else {
  554. if(this.explain) {
  555. item.ques = item.ans;
  556. }
  557. }
  558. })
  559. this.questionList = res.data.rows;
  560. })
  561. },
  562. /**
  563. * @param {Object} state
  564. * @param {Object} index
  565. * 收藏
  566. */
  567. collect(state, index) {
  568. if (!state) {
  569. this.$api
  570. .collectQuestion({
  571. examId: this.id,
  572. questionId: this.questionList[index].questionId,
  573. goodsId: this.goodsId || ''
  574. })
  575. .then(res => {
  576. if (res.data.code == 200) {
  577. this.$set(this.collectList, index, true);
  578. uni.showToast({
  579. title: '收藏成功',
  580. duration: 2000,
  581. icon: 'none'
  582. });
  583. this.getCollectInfo(index)
  584. }
  585. });
  586. } else {
  587. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  588. if (res.data.code == 200) {
  589. this.$set(this.collectList, index, false);
  590. uni.showToast({
  591. title: '取消收藏成功',
  592. duration: 2000,
  593. icon: 'none'
  594. });
  595. }
  596. });
  597. }
  598. return;
  599. },
  600. goodsQuestionList() {
  601. //继续答题
  602. if(this.isContinue || this.isHistory) {
  603. console.log(this.isHistory,"历史做题")
  604. console.log(this.isContinue,"继续做题")
  605. this.$api.examReport(this.recordId).then(res => {
  606. let json = JSON.parse(res.data.data.historyExamJson)
  607. this.questionList = json;
  608. })
  609. } else { //解析
  610. this.$api.goodsQuestionList({
  611. examId:this.id
  612. }).then(res => {
  613. res.data.data.forEach((item,index) => {
  614. if(typeof item.jsonStr == 'string') {
  615. item.jsonStr = JSON.parse(item.jsonStr)
  616. if(item.type == 2) { //多选
  617. item.jsonStr.forEach(str => {
  618. str.optionsId = ''+str.optionsId;
  619. })
  620. let arr = item.answerQuestion.split(',');
  621. arr.forEach((a,i) => {
  622. arr[i] = ''+a;
  623. })
  624. item.ans = arr;
  625. if(this.explain) {
  626. item.ques = item.ans;
  627. }
  628. return;
  629. } else if(item.type == 5) {
  630. item.ansText = {
  631. text: '',
  632. imageList: []
  633. }
  634. if(this.explain) {
  635. item.ques = {
  636. text:item.analysisContent
  637. }
  638. return;
  639. }
  640. } else if(item.type == 4) {
  641. console.log(item.jsonStr)
  642. item.ques = []
  643. item.current = 0;
  644. let ansArr = [];
  645. item.jsonStr.forEach((json,index) => {
  646. if(json.type == 1) {
  647. ansArr[index] = json.answerQuestion;
  648. } else if(json.type == 2) {
  649. json.optionsList.forEach(str => {
  650. str.optionsId = ''+str.optionsId;
  651. })
  652. let arr = json.answerQuestion.split(',');
  653. arr.forEach((a,i) => {
  654. arr[i] = ''+a;
  655. })
  656. ansArr[index] = arr
  657. } else if(json.type == 3) {
  658. ansArr[index] = json.answerQuestion;
  659. } else if(json.type == 5) {
  660. ansArr[index] = {
  661. text: '',
  662. imageList: []
  663. }
  664. json.ansText = {
  665. text: '',
  666. imageList: []
  667. }
  668. }
  669. })
  670. item.ans = ansArr
  671. if(this.explain) {
  672. item.ques = item.ans;
  673. }
  674. return;
  675. }
  676. item.ans = item.answerQuestion
  677. if(this.explain) {
  678. item.ques = item.ans;
  679. }
  680. } else {
  681. if(this.explain) {
  682. item.ques = item.ans;
  683. }
  684. }
  685. })
  686. this.questionList = res.data.data;
  687. this.getCollectInfo(this.current);
  688. console.log(this.questionList)
  689. })
  690. }
  691. },
  692. /**
  693. * @param {Object} current
  694. * 获取收藏信息
  695. */
  696. getCollectInfo(current) {
  697. this.$api
  698. .getCollectInfo({
  699. examId: this.id,
  700. questionId: this.questionList[current].questionId,
  701. goodsId: this.goodsId
  702. })
  703. .then(res => {
  704. if (res.data.code == 500) {
  705. this.$set(this.collectList, current, false);
  706. } else if (res.data.code == 200) {
  707. this.$set(this.collectList, current, res.data.data);
  708. }
  709. });
  710. },
  711. /**
  712. * @param {Object} e单选点击
  713. */
  714. radioSelect(optionsId,bindex) {
  715. if(this.questionList[bindex].ques) return;
  716. this.$set(this.questionList[bindex],'ques',optionsId)
  717. },
  718. examRecordEdit() {
  719. if(!this.isSubmit) {
  720. let number = 0;
  721. let score = 0;
  722. let doQuestionNum = 0;
  723. this.questionList.length && this.questionList.forEach((item,index) => {
  724. if(item.type == 1) {
  725. if(item.ques == item.ans) {
  726. score += item.score;
  727. number++
  728. }
  729. if (item.ques) {
  730. doQuestionNum++;
  731. }
  732. } else if(item.type == 2) {
  733. let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
  734. return item.ques[quesIndex] == item.ans[quesIndex]
  735. })
  736. if(isRight) {
  737. score += item.score;
  738. number++
  739. }
  740. if (item.ques && item.ques.length) {
  741. doQuestionNum++;
  742. }
  743. } else if(item.type == 3) {
  744. if(item.ques == item.ans) {
  745. score += item.score;
  746. number++
  747. }
  748. if (item.ques) {
  749. doQuestionNum++;
  750. }
  751. } else if (item == 4) {
  752. if (item.ques.length) {
  753. doQuestionNum++;
  754. }
  755. } else if (item.type == 5) {
  756. if (item.ques) {
  757. doQuestionNum++;
  758. }
  759. }
  760. })
  761. this.$api.examRecordEdit({
  762. examId:this.id,
  763. goodsId:this.goodsId,
  764. recordId: this.recordId,
  765. rightQuestionNum:number,
  766. status:0,
  767. moduleExamId:this.moduleId || 0,
  768. chapterExamId:this.chapterId || 0,
  769. doQuestionNum: doQuestionNum,
  770. historyExamJson:JSON.stringify(this.questionList)
  771. }).then(res => {
  772. })
  773. }
  774. },
  775. /**
  776. * @param {Object} e单选点击
  777. */
  778. radioSelectChild(optionsId,ansIndex,bindex) {
  779. if(this.questionList[bindex].ques[ansIndex]) return;
  780. this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
  781. },
  782. /**
  783. * @param {Object} 多选点击
  784. */
  785. checkboxSelect(optionsId,bindex,index) {
  786. this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
  787. },
  788. /**
  789. * @param {Object} 多选点击
  790. */
  791. checkboxSelectChild(bindex,ansIndex,childIndex) {
  792. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
  793. },
  794. /**
  795. * 提交数据
  796. */
  797. submit() {
  798. let score = 0; //计算总分
  799. let reportStatus = 0;
  800. let number = 0;
  801. let allScore = 0;
  802. let passScore = 0;
  803. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  804. let doQuestionIds = []; //做过的题目id
  805. let rightQuestionIds = []; //做对的题目id
  806. this.questionList.forEach((item,index) => {
  807. passScore = item.passScore
  808. if(item.type == 1) {
  809. if(item.ques == item.ans) {
  810. score += item.score;
  811. number++
  812. rightQuestionIds.push(item.questionId)
  813. } else { //错误
  814. doWrongQuestionIds.push(item.questionId)
  815. }
  816. allScore += item.score
  817. if (item.ques) {
  818. doQuestionNum++;
  819. doQuestionIds.push(item.questionId)
  820. }
  821. } else if(item.type == 2) {
  822. let isRight = item.ans && item.ans.every((quesItem,quesIndex) => {
  823. if(item.ques) {
  824. return item.ques[quesIndex] == item.ans[quesIndex]
  825. } else {
  826. return false;
  827. }
  828. })
  829. if(isRight) {
  830. score += item.score;
  831. number++
  832. rightQuestionIds.push(item.questionId)
  833. } else {
  834. let checkboxScore = item.score; //获取单题总分数
  835. item.ques.forEach((ques,quesIndex) => {
  836. //选错一个全扣
  837. if(item.ques) {
  838. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  839. checkboxScore = 0;
  840. }
  841. } else {
  842. checkboxScore = 0;
  843. }
  844. })
  845. console.log(checkboxScore)
  846. //没选错
  847. if(checkboxScore) {
  848. item.ans.forEach((ans,quesIndex) => {
  849. //漏选扣一部分
  850. if(item.ques) {
  851. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  852. checkboxScore -= item.partScore;
  853. }
  854. } else {
  855. checkboxScore = 0;
  856. }
  857. })
  858. }
  859. if(checkboxScore <= 0) { //0分
  860. item.scoreResult = 0;
  861. doWrongQuestionIds.push(item.questionId)
  862. } else { //部分分
  863. number++;
  864. item.scoreResult = checkboxScore;
  865. score += checkboxScore;
  866. rightQuestionIds.push(item.questionId)
  867. }
  868. }
  869. allScore += item.score;
  870. if (item.ques && item.ques.length) {
  871. doQuestionNum++;
  872. doQuestionIds.push(item.questionId)
  873. }
  874. } else if(item.type == 3) {
  875. if(item.ques == item.ans) {
  876. score += item.score;
  877. number++
  878. rightQuestionIds.push(item.questionId)
  879. } else {
  880. doWrongQuestionIds.push(item.questionId)
  881. }
  882. allScore += item.score;
  883. if (item.ques) {
  884. doQuestionNum++;
  885. doQuestionIds.push(item.questionId)
  886. }
  887. } else if (item.type == 4) {
  888. if (item.ques && item.ques.length) {
  889. doQuestionNum++;
  890. }
  891. } else if (item.type == 5) {
  892. if (item.ques) {
  893. doQuestionNum++;
  894. }
  895. }
  896. })
  897. //大于60分及格
  898. if(score >= passScore) {
  899. reportStatus = 1
  900. } else {
  901. reportStatus = 0
  902. }
  903. this.$api.examRecordEdit({
  904. examId:this.id,
  905. goodsId:this.goodsId,
  906. reportStatus:reportStatus,
  907. totalScore:allScore,
  908. recordId: this.recordId,
  909. rightQuestionNum:number,
  910. status:1,
  911. moduleExamId:this.moduleId || 0,
  912. chapterExamId:this.chapterId || 0,
  913. doQuestionIds:doQuestionIds.join(','),
  914. rightQuestionIds:rightQuestionIds.join(','),
  915. doQuestionNum: doQuestionNum,
  916. performance: score,
  917. historyExamJson:JSON.stringify(this.questionList)
  918. }).then(res => {
  919. this.isSubmit = true;
  920. if(res.data.code == 200) {
  921. uni.showToast({
  922. title: '交卷成功',
  923. duration: 2000,
  924. icon:'none'
  925. });
  926. setTimeout(() => {
  927. uni.redirectTo({
  928. url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
  929. })
  930. },2000)
  931. }
  932. })
  933. },
  934. /**
  935. * @param {Object} 多选确认
  936. */
  937. checkboxSubmit(bindex) {
  938. if(this.questionList[bindex].ques) return;
  939. let arr = [];
  940. this.questionList[bindex].jsonStr.forEach(item => {
  941. if(item.checked) {
  942. arr.push(item.optionsId)
  943. }
  944. })
  945. this.$set(this.questionList[bindex],'ques',arr)
  946. },
  947. /**
  948. * @param {Object} 多选确认
  949. */
  950. checkboxSubmitChild(bindex,ansIndex) {
  951. if(this.questionList[bindex].ques[ansIndex]) return;
  952. let arr = [];
  953. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  954. if(item.checked) {
  955. arr.push(item.optionsId)
  956. }
  957. })
  958. this.$set(this.questionList[bindex].ques,ansIndex,arr)
  959. },
  960. judgeSelect(index,bindex) {
  961. if(this.questionList[bindex].ques) return;
  962. this.$set(this.questionList[bindex],'ques',index+'')
  963. },
  964. judgeSelectChild(ansindex,childindex,bindex) {
  965. if(this.questionList[bindex].ques[ansindex]) return;
  966. this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
  967. },
  968. openFooterTab() {
  969. this.show = true;
  970. },
  971. hideDialog() {
  972. this.showDialog = false
  973. },
  974. changeIndex(index) {
  975. this.current = index
  976. },
  977. swiperChange(e) {
  978. this.current = e.detail.current;
  979. },
  980. deleteImg(imgIndex,bankIndex) {
  981. this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
  982. },
  983. deleteImgChild(imgIndex,bankIndex,ansIndex) {
  984. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
  985. },
  986. chooseImg(bankindex) {
  987. uni.chooseImage({
  988. count: 1, //默认9
  989. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  990. sourceType: ['album','camera'], //从相册选择
  991. success: (res) => {
  992. let self = this;
  993. // console.log(JSON.stringify(res.tempFilePaths));
  994. let img = res.tempFilePaths[0];
  995. uni.getImageInfo({
  996. src: img,
  997. success: async res => {
  998. let canvasWidth = res.width; //图片原始长宽
  999. let canvasHeight = res.height;
  1000. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1001. uni.compressImage({
  1002. src: img,
  1003. quality: 75,
  1004. width: '50%',
  1005. height: '50%',
  1006. success: async rest => {
  1007. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1008. this.questionList[bankindex].ansText.imageList.push(dir)
  1009. }
  1010. });
  1011. } else {
  1012. const dir = await self.uploadFile(img, 0);
  1013. this.questionList[bankindex].ansText.imageList.push(dir)
  1014. }
  1015. }
  1016. });
  1017. }
  1018. })
  1019. },
  1020. chooseImgChild(bankindex,ansindex) {
  1021. uni.chooseImage({
  1022. count: 1, //默认9
  1023. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  1024. sourceType: ['album','camera'], //从相册选择
  1025. success: (res) => {
  1026. let self = this;
  1027. // console.log(JSON.stringify(res.tempFilePaths));
  1028. let img = res.tempFilePaths[0];
  1029. uni.getImageInfo({
  1030. src: img,
  1031. success: async res => {
  1032. let canvasWidth = res.width; //图片原始长宽
  1033. let canvasHeight = res.height;
  1034. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1035. uni.compressImage({
  1036. src: img,
  1037. quality: 75,
  1038. width: '50%',
  1039. height: '50%',
  1040. success: async rest => {
  1041. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1042. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  1043. }
  1044. });
  1045. } else {
  1046. const dir = await self.uploadFile(img, 0);
  1047. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  1048. }
  1049. }
  1050. });
  1051. }
  1052. })
  1053. },
  1054. uploadFile(options, int) {
  1055. var self = this;
  1056. return new Promise((resolve, reject) => {
  1057. var data = {
  1058. imageStatus: int
  1059. };
  1060. self.$api.aliyunpolicy(data).then(res => {
  1061. console.log(res.data,6)
  1062. if(res.data.code!=200){
  1063. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  1064. return
  1065. }
  1066. var ossToken = res.data.data.resultContent;
  1067. if(ossToken.host==null||ossToken.host==undefined){
  1068. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  1069. return
  1070. }
  1071. uni.uploadFile({
  1072. url: ossToken.host,
  1073. name: 'file',
  1074. filePath: options,
  1075. fileType: 'image',
  1076. header: {
  1077. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1078. },
  1079. formData: {
  1080. key: ossToken.dir,
  1081. OSSAccessKeyId: ossToken.accessid,
  1082. policy: ossToken.policy,
  1083. Signature: ossToken.signature,
  1084. callback: ossToken.callback,
  1085. success_action_status: 200
  1086. },
  1087. success: result => {
  1088. if (result.statusCode === 200) {
  1089. resolve(ossToken.dir);
  1090. } else {
  1091. uni.showToast({
  1092. title: '上传失败',
  1093. icon: 'none'
  1094. });
  1095. return;
  1096. }
  1097. },
  1098. fail: error => {
  1099. uni.showToast({
  1100. title: '上传接口报错'+error,
  1101. icon: 'none'
  1102. });
  1103. return;
  1104. }
  1105. });
  1106. });
  1107. });
  1108. },
  1109. submitAns(bankindex) {
  1110. console.log(this.questionList[bankindex])
  1111. if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1112. uni.showToast({
  1113. title: '请输入内容或上传图片',
  1114. duration: 2000,
  1115. icon:'none'
  1116. });
  1117. return
  1118. }
  1119. this.$set(this.questionList[bankindex],'ques',{
  1120. imageList:this.questionList[bankindex].ansText.imageList,
  1121. text:this.questionList[bankindex].ansText.text,
  1122. })
  1123. },
  1124. submitAnsChild(bankindex,ansindex) {
  1125. if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1126. uni.showToast({
  1127. title: '请输入内容或上传图片',
  1128. duration: 2000,
  1129. icon:'none'
  1130. });
  1131. return
  1132. }
  1133. this.$set(this.questionList[bankindex].ques,ansindex,{
  1134. imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1135. text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  1136. })
  1137. },
  1138. isRight(item,index) {
  1139. //单选
  1140. if(this.questionList[index].ques) {
  1141. if(item.type == 1) {
  1142. return this.questionList[index].ques == this.questionList[index].ans;
  1143. //多选
  1144. } else if(item.type == 2) {
  1145. //每一项都相等
  1146. return this.questionList[index].ques.every((item,i) => {
  1147. console.log(item == this.questionList[index].ans[i])
  1148. return item == this.questionList[index].ans[i];
  1149. })
  1150. //判断
  1151. } else if(item.type == 3) {
  1152. return this.questionList[index].ques == this.questionList[index].ans;
  1153. } else {
  1154. return false;
  1155. }
  1156. } else {
  1157. return false;
  1158. }
  1159. },
  1160. right(bankIndex,ansIndex,option) {
  1161. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1162. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
  1163. return true
  1164. } else {
  1165. return false;
  1166. }
  1167. } else {
  1168. return false;
  1169. }
  1170. },
  1171. wrong(bankIndex,ansIndex,option) {
  1172. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1173. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
  1174. return true;
  1175. } else {
  1176. return false;
  1177. }
  1178. } else {
  1179. return false;
  1180. }
  1181. },
  1182. isWrong(item,index) {
  1183. if(this.questionList[index].ques) {
  1184. //单选
  1185. if(item.type == 1) {
  1186. return this.questionList[index].ques != this.questionList[index].ans;
  1187. //多选
  1188. } else if(item.type == 2) {
  1189. //每一项都相等
  1190. return this.questionList[index].ques.some((item,i) => {
  1191. return item != this.questionList[index].ans[i];
  1192. })
  1193. //判断
  1194. } else if(item.type == 3) {
  1195. return this.questionList[index].ques != this.questionList[index].ans;
  1196. } else {
  1197. return false;
  1198. }
  1199. } else {
  1200. return false;
  1201. }
  1202. },
  1203. tabSelect(index,bankindex) {
  1204. this.$set(this.questionList[bankindex],'current',index)
  1205. },
  1206. }
  1207. };
  1208. </script>
  1209. <style lang="scss" scoped>
  1210. .tabs-top {
  1211. display: flex;
  1212. justify-content: center;
  1213. margin-bottom:10rpx;
  1214. }
  1215. .swiper {
  1216. width:100%;
  1217. height:calc(100vh - 44px);
  1218. }
  1219. .lisSty {
  1220. margin-bottom: 16rpx;
  1221. display: flex;
  1222. .flex_auto {
  1223. flex:1;
  1224. }
  1225. }
  1226. .activeTI {
  1227. vertical-align: middle;
  1228. display: inline-block;
  1229. border: 1rpx solid #eee;
  1230. border-radius: 50rpx;
  1231. height: 48rpx;
  1232. line-height: 46rpx;
  1233. text-align: center;
  1234. width: 48rpx;
  1235. margin-right: 15rpx;
  1236. color: #666;
  1237. font-size: 30rpx;
  1238. &.right {
  1239. color:#fff;
  1240. background:green;
  1241. }
  1242. &.wrong {
  1243. color:#fff;
  1244. background:red;
  1245. }
  1246. &.checked {
  1247. color:#fff;
  1248. background:blue;
  1249. }
  1250. }
  1251. .submit_checkbox {
  1252. margin:20rpx auto;
  1253. width: 526rpx;
  1254. height: 80rpx;
  1255. background: rgba(0, 122, 255, 1);
  1256. color:#fff;
  1257. text-align: center;
  1258. line-height: 80rpx;
  1259. font-size: 30rpx;
  1260. border-radius: 40rpx;
  1261. }
  1262. .titles {
  1263. overflow: hidden;
  1264. margin-bottom: 24rpx;
  1265. }
  1266. .titBox {
  1267. padding: 41rpx 25rpx 24rpx 25rpx;
  1268. }
  1269. .tabs {
  1270. margin:10rpx;
  1271. display: flex;
  1272. .tab {
  1273. margin:0 10rpx;
  1274. width: 96rpx;
  1275. height: 48rpx;
  1276. line-height: 48rpx;
  1277. text-align: center;
  1278. color:#007AFF;
  1279. font-size: 28rpx;
  1280. border-radius: 16rpx;
  1281. &.current {
  1282. color:#fff;
  1283. background: #007AFF;
  1284. }
  1285. }
  1286. }
  1287. .ans {
  1288. margin:8rpx 8rpx 8rpx;
  1289. .ans_input {
  1290. border-radius: 16rpx;
  1291. background:#fff;
  1292. .top {
  1293. border-bottom:1rpx solid #EEEEEE;
  1294. padding: 16rpx;
  1295. display: flex;
  1296. align-items: center;
  1297. .icon {
  1298. margin-right:20rpx;
  1299. width: 40rpx;
  1300. height: 38rpx;
  1301. }
  1302. .progress {
  1303. flex:1;
  1304. }
  1305. .submit {
  1306. width: 168rpx;
  1307. height: 48rpx;
  1308. line-height: 48rpx;
  1309. text-align: center;
  1310. color:#fff;
  1311. font-size: 30rpx;
  1312. background: #007AFF;
  1313. border-radius: 24rpx;
  1314. &.disabled {
  1315. opacity: 0.6;
  1316. }
  1317. }
  1318. }
  1319. .textarea {
  1320. textarea {
  1321. width:100%;
  1322. height:287rpx;
  1323. padding:10rpx;
  1324. }
  1325. }
  1326. .imgs {
  1327. overflow: hidden;
  1328. display: flex;
  1329. width:100%;
  1330. .img {
  1331. width: 104rpx;
  1332. height: 104rpx;
  1333. border-radius: 8rpx;
  1334. position:relative;
  1335. margin:20rpx;
  1336. text {
  1337. position:absolute;
  1338. right:-15rpx;
  1339. top:-15rpx;
  1340. width:30rpx;
  1341. height:30rpx;
  1342. text-align: center;
  1343. line-height: 30rpx;
  1344. color:#fff;
  1345. background:red;
  1346. border-radius:50%;
  1347. }
  1348. image {
  1349. width:100%;
  1350. height:100%;
  1351. }
  1352. }
  1353. }
  1354. }
  1355. .ans_submit {
  1356. padding:16rpx;
  1357. border-radius: 16rpx;
  1358. background:#fff;
  1359. .imgs {
  1360. overflow: hidden;
  1361. display: flex;
  1362. width:100%;
  1363. .img {
  1364. width: 104rpx;
  1365. height: 104rpx;
  1366. border-radius: 8rpx;
  1367. position:relative;
  1368. margin:20rpx;
  1369. image {
  1370. width:100%;
  1371. height:100%;
  1372. }
  1373. }
  1374. }
  1375. }
  1376. }
  1377. .firstLetter {
  1378. display: flex;
  1379. justify-content: space-between;
  1380. align-items: center;
  1381. margin-bottom: 30rpx;
  1382. .leftLetters {
  1383. display: flex;
  1384. align-items: center;
  1385. width: 220rpx;
  1386. .btnType {
  1387. padding: 5rpx 10rpx;
  1388. border: 1rpx solid #007aff;
  1389. border-radius: 10rpx;
  1390. background-color: rgba(0, 122, 255, 0.1);
  1391. font-size: 28rpx;
  1392. color: #007aff;
  1393. margin-right: 15rpx;
  1394. }
  1395. }
  1396. }
  1397. .popupView {
  1398. height: 100%;
  1399. padding-bottom: 100rpx;
  1400. .popupTops {
  1401. height: 77rpx;
  1402. border-bottom: 1rpx solid #eee;
  1403. text-align: center;
  1404. line-height: 77rpx;
  1405. font-size: 24rpx;
  1406. color: #999;
  1407. position: relative;
  1408. .topIcon {
  1409. position: absolute;
  1410. top: 10rpx;
  1411. left: 50%;
  1412. transform: translateX(-50%);
  1413. width: 80rpx;
  1414. height: 8rpx;
  1415. background-color: #999;
  1416. border-radius: 4rpx;
  1417. }
  1418. }
  1419. .popupContent {
  1420. }
  1421. }
  1422. .pageContent {
  1423. position:relative;
  1424. background-color: #eaeef1;
  1425. height: 100%;
  1426. overflow-y: scroll;
  1427. padding-top: 8rpx;
  1428. padding-bottom: 100rpx;
  1429. }
  1430. .pad_8 {
  1431. background-color: #fff;
  1432. margin: 0rpx 8rpx 8rpx;
  1433. border-radius: 16rpx;
  1434. &.no-margin {
  1435. margin-top:-16rpx;
  1436. border-radius: 0 0 16rpx 16rpx;
  1437. }
  1438. }
  1439. .answer {
  1440. height: 80rpx;
  1441. line-height: 80rpx;
  1442. padding: 0rpx 24rpx;
  1443. display: flex;
  1444. align-items: center;
  1445. justify-content: space-between;
  1446. color: #666;
  1447. font-size: 30rpx;
  1448. }
  1449. .footer_btn {
  1450. background-color: #fff;
  1451. z-index: 10078;
  1452. position: fixed;
  1453. bottom: 0rpx;
  1454. display: flex;
  1455. align-items: center;
  1456. justify-content: space-between;
  1457. width: 100%;
  1458. height: 98rpx;
  1459. padding: 0rpx 38rpx;
  1460. border-top: 1rpx solid #eee;
  1461. .flex_center {
  1462. flex:1;
  1463. display: flex;
  1464. justify-content: center;
  1465. align-items: center;
  1466. flex-direction: column;
  1467. margin:0 200rpx;
  1468. font-size: 24rpx;
  1469. color: #999999;
  1470. .up-icon {
  1471. margin-bottom:18rpx;
  1472. width:100%;
  1473. display: flex;
  1474. justify-content: center;
  1475. image {
  1476. width:58rpx;
  1477. height:21rpx;
  1478. }
  1479. }
  1480. }
  1481. .collect {
  1482. visibility: hidden;
  1483. width:100rpx;
  1484. &.show {
  1485. visibility: visible;
  1486. }
  1487. >view {
  1488. display: flex;
  1489. flex-direction: column;
  1490. align-items: center;
  1491. justify-content: center;
  1492. image {
  1493. width:32rpx;
  1494. height:32rpx;
  1495. margin-bottom:6rpx;
  1496. }
  1497. view {
  1498. font-size: 24rpx;
  1499. color: #999999;
  1500. }
  1501. }
  1502. }
  1503. }
  1504. .boxSty {
  1505. padding: 44rpx 41rpx 0rpx;
  1506. }
  1507. .liListSty {
  1508. border:1rpx solid #EEEEEE;
  1509. width: 88rpx;
  1510. height: 88rpx;
  1511. border-radius: 32rpx;
  1512. text-align: center;
  1513. line-height: 88rpx;
  1514. color: #333;
  1515. font-size: 32rpx;
  1516. float: left;
  1517. margin: 20rpx 23rpx;
  1518. &.isRight {
  1519. border:1rpx solid #EEEEEE;
  1520. color:#fff;
  1521. background: green;
  1522. }
  1523. &.isWrong {
  1524. border:1rpx solid #EEEEEE;
  1525. color:#fff;
  1526. background: red;
  1527. }
  1528. }
  1529. .answerInfos {
  1530. padding: 25rpx 25rpx 25rpx 23rpx;
  1531. }
  1532. .answerTitle {
  1533. margin-bottom: 28rpx;
  1534. color: #666;
  1535. font-size: 30rpx;
  1536. }
  1537. .answerContent {
  1538. font-size: 30rpx;
  1539. color: #666;
  1540. }
  1541. .textChild {
  1542. display: inline-block;
  1543. vertical-align: middle;
  1544. }
  1545. .dialog {
  1546. position: fixed;
  1547. left:0;
  1548. top:0;
  1549. width:100%;
  1550. height:100%;
  1551. background-color: rgba(0,0,0,0.8);
  1552. display: flex;
  1553. flex-direction: column;
  1554. align-items: center;
  1555. justify-content: center;
  1556. z-index: 20000;
  1557. .pointer {
  1558. width:338rpx;
  1559. height:240rpx;
  1560. }
  1561. .text {
  1562. font-size: 32rpx;
  1563. color: #FFFFFF;
  1564. text-align: center;
  1565. }
  1566. .btn {
  1567. width: 242rpx;
  1568. height: 82rpx;
  1569. border: 2rpx solid #FFFFFF;
  1570. border-radius: 16rpx;
  1571. text-align: center;
  1572. line-height: 82rpx;
  1573. margin:41rpx auto;
  1574. color:#fff;
  1575. font-size: 32rpx;
  1576. }
  1577. }
  1578. </style>