questionBankWrongExplain.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  1. <template>
  2. <view class="questionBank">
  3. <nav-bar title="错题解析"></nav-bar>
  4. <swiper
  5. class="swiper"
  6. :current="current"
  7. @change="swiperChange"
  8. :interval="interval"
  9. >
  10. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  11. <view class="pageContent">
  12. <view class="pad_8 titBox">
  13. <view class="firstLetter">
  14. <view class="leftLetters">
  15. <view class="btnType">
  16. <text v-if="bank.type == 1">单选</text>
  17. <text v-if="bank.type == 2">多选</text>
  18. <text v-if="bank.type == 3">判断</text>
  19. <text v-if="bank.type == 4">案例</text>
  20. <text v-if="bank.type == 5">简答</text>
  21. </view>
  22. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  23. </view>
  24. <view style="color: #666; font-size: 28rpx"></view>
  25. <view class="leftLetters"></view>
  26. </view>
  27. <view class="titles">
  28. <rich-text :nodes="bank.content"></rich-text>
  29. </view>
  30. </view>
  31. <template v-if="bank.type == 1">
  32. <view class="pad_8 titBox no-margin">
  33. <view v-if="!bank.ques">
  34. <view
  35. v-for="(item, index) in bank.jsonStr"
  36. :key="index"
  37. class="lisSty"
  38. >
  39. <view class="activeTI">{{ ast[index] }}</view>
  40. <view class="flex_auto">
  41. {{ item.content }}
  42. <view v-if="item.imgUrl">
  43. <image
  44. style="width: 600rpx"
  45. mode="widthFix"
  46. :src="$method.splitImgHost(item.imgUrl)"
  47. ></image>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <view v-if="bank.ques">
  53. <view
  54. v-for="(item, index) in bank.jsonStr"
  55. :key="index"
  56. class="lisSty"
  57. >
  58. <text
  59. :class="{
  60. right:
  61. item.optionsId == bank.ques ||
  62. item.optionsId == bank.ans,
  63. wrong:
  64. item.optionsId == bank.ques && bank.ques != bank.ans,
  65. }"
  66. class="activeTI"
  67. >{{ ast[index] }}</text
  68. >
  69. <view class="flex_auto">
  70. {{ item.content }}
  71. <view v-if="item.imgUrl">
  72. <image
  73. style="width: 600rpx"
  74. mode="widthFix"
  75. :src="$method.splitImgHost(item.imgUrl)"
  76. ></image>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view>
  83. <view class="pad_8 answer">
  84. <view>题目答案:{{ ast[bank.ans - 1] }}</view>
  85. <view>我的答案:{{ ast[bank.ques - 1] || "" }}</view>
  86. </view>
  87. <view class="pad_8 answerInfos">
  88. <view class="answerTitle">答案解析</view>
  89. <view class="answerContent">
  90. <rich-text :nodes="bank.analysisContent"></rich-text>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <template v-if="bank.type == 2">
  96. <view class="pad_8 titBox no-margin">
  97. <view v-if="!bank.ques">
  98. <view
  99. v-for="(item, index) in bank.jsonStr"
  100. :key="index"
  101. class="lisSty"
  102. >
  103. <view :class="{ checked: item.checked }" class="activeTI">{{
  104. ast[index]
  105. }}</view>
  106. <view class="flex_auto">
  107. {{ item.content }}
  108. <view v-if="item.imgUrl">
  109. <image
  110. style="width: 600rpx"
  111. mode="widthFix"
  112. :src="$method.splitImgHost(item.imgUrl)"
  113. ></image>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view v-if="bank.ques">
  119. <view
  120. v-for="(item, index) in bank.jsonStr"
  121. :key="index"
  122. class="lisSty"
  123. >
  124. <text
  125. :class="{
  126. right:
  127. (bank.ques &&
  128. bank.ques.indexOf(item.optionsId) != -1) ||
  129. (bank.ans && bank.ans.indexOf(item.optionsId) != -1),
  130. wrong:
  131. bank.ques &&
  132. bank.ques.indexOf(item.optionsId) != -1 &&
  133. bank.ans &&
  134. bank.ans.indexOf(item.optionsId) == -1,
  135. }"
  136. class="activeTI"
  137. >{{ ast[index] }}</text
  138. >
  139. <view class="flex_auto">
  140. {{ item.content }}
  141. <view v-if="item.imgUrl">
  142. <image
  143. style="width: 600rpx"
  144. mode="widthFix"
  145. :src="$method.splitImgHost(item.imgUrl)"
  146. ></image>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. <view>
  153. <view class="pad_8 answer">
  154. <view
  155. >题目答案:
  156. <text
  157. :key="ansItemIndex"
  158. v-for="(ansItem, ansItemIndex) in bank.ans"
  159. >{{ ast[ansItem - 1] }}</text
  160. >
  161. </view>
  162. <view
  163. >我的答案:
  164. <text
  165. :key="quesItemIndex"
  166. v-for="(quesItem, quesItemIndex) in bank.ques"
  167. >{{ ast[quesItem - 1] }}</text
  168. >
  169. </view>
  170. </view>
  171. <view class="pad_8 answerInfos">
  172. <view class="answerTitle">答案解析</view>
  173. <view class="answerContent">
  174. <rich-text :nodes="bank.analysisContent"></rich-text>
  175. </view>
  176. </view>
  177. </view>
  178. </template>
  179. <template v-if="bank.type == 3">
  180. <view class="pad_8 titBox no-margin">
  181. <view v-if="!bank.ques">
  182. <view
  183. v-for="(item, index) in judge"
  184. :key="index"
  185. class="lisSty"
  186. >
  187. <view class="activeTI">{{ ast[index] }}</view>
  188. <view class="flex_auto">
  189. {{ item }}
  190. <view v-if="item.imgUrl">
  191. <image
  192. style="width: 600rpx"
  193. mode="widthFix"
  194. :src="$method.splitImgHost(item.imgUrl)"
  195. ></image>
  196. </view>
  197. </view>
  198. </view>
  199. </view>
  200. <view v-if="bank.ques">
  201. <view
  202. v-for="(item, index) in judge"
  203. :key="index"
  204. class="lisSty"
  205. >
  206. <text
  207. :class="{
  208. right: index == bank.ques || index == bank.ans,
  209. wrong: index == bank.ques && bank.ques != bank.ans,
  210. }"
  211. class="activeTI"
  212. >{{ ast[index] }}</text
  213. >
  214. <view class="flex_auto">
  215. {{ item }}
  216. <view v-if="item.imgUrl">
  217. <image
  218. style="width: 600rpx"
  219. mode="widthFix"
  220. :src="$method.splitImgHost(item.imgUrl)"
  221. ></image>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. <view>
  228. <view class="pad_8 answer">
  229. <view>题目答案:{{ ast[bank.ans] }}</view>
  230. <view>我的答案:{{ ast[bank.ques] || "" }}</view>
  231. </view>
  232. <view class="pad_8 answerInfos">
  233. <view class="answerTitle">答案解析</view>
  234. <view class="answerContent">
  235. <rich-text :nodes="bank.analysisContent"></rich-text>
  236. </view>
  237. </view>
  238. </view>
  239. </template>
  240. <!-- 简答题 -->
  241. <template v-if="bank.type == 5">
  242. <view class="pad_8 titBox">
  243. <view class="ans">
  244. <view class="ans_submit answerInfos">
  245. <view class="answerTitle">我的答案:</view>
  246. {{ bank.ques.text || "" }}
  247. <view class="imgs">
  248. <image
  249. class="img"
  250. v-for="(ques, quesIndex) in bank.ques.imageList"
  251. :key="quesIndex"
  252. :src="$method.splitImgHost(ques, true)"
  253. ></image>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <view>
  259. <view class="pad_8 answerInfos">
  260. <view class="answerTitle">答案解析:</view>
  261. <view class="answerContent">
  262. <rich-text :nodes="bank.analysisContent"></rich-text>
  263. </view>
  264. </view>
  265. </view>
  266. </template>
  267. <!-- 案例题 -->
  268. <template v-if="bank.type == 4">
  269. <view class="tabs">
  270. <view
  271. class="tab"
  272. :class="{ current: tabIndex == bank.current }"
  273. :key="tabIndex"
  274. v-for="(tab, tabIndex) in bank.jsonStr"
  275. @click="tabSelect(tabIndex, bankIndex)"
  276. >问题{{ tabIndex + 1 }}</view
  277. >
  278. </view>
  279. <view
  280. v-for="(ansItem, ansIndex) in bank.jsonStr"
  281. v-if="bank.current == ansIndex"
  282. :key="ansIndex"
  283. >
  284. <template v-if="ansItem.type == 1">
  285. <view class="pad_8 titBox">
  286. <view class="leftLetters">
  287. <view class="btnType">
  288. <text>单选</text>
  289. </view>
  290. </view>
  291. <view class="titles">
  292. <rich-text :nodes="ansItem.content"></rich-text>
  293. </view>
  294. <view v-if="!bank.ques[ansIndex]">
  295. <view
  296. v-for="(option, childIndex) in ansItem.optionsList"
  297. :key="childIndex"
  298. class="lisSty"
  299. >
  300. <view class="activeTI">{{ ast[childIndex] }}</view>
  301. <view class="flex_auto">
  302. <rich-text
  303. class="textChild"
  304. :nodes="option.content"
  305. ></rich-text>
  306. <view v-if="option.imgUrl">
  307. <image
  308. style="width: 600rpx"
  309. mode="widthFix"
  310. :src="$method.splitImgHost(option.imgUrl)"
  311. ></image>
  312. </view>
  313. </view>
  314. </view>
  315. </view>
  316. <view v-if="bank.ques[ansIndex]">
  317. <view
  318. v-for="(option, childIndex) in ansItem.optionsList"
  319. :key="childIndex"
  320. class="lisSty"
  321. >
  322. <text
  323. :class="{
  324. right:
  325. option.optionsId == bank.ques[ansIndex] ||
  326. option.optionsId == bank.ans[ansIndex],
  327. wrong:
  328. option.optionsId == bank.ques[ansIndex] &&
  329. bank.ques[ansIndex] != bank.ans[ansIndex],
  330. }"
  331. class="activeTI"
  332. >{{ ast[childIndex] }}</text
  333. >
  334. <view class="flex_auto">
  335. <rich-text :nodes="option.content"></rich-text>
  336. <view v-if="option.imgUrl">
  337. <image
  338. style="width: 600rpx"
  339. mode="widthFix"
  340. :src="$method.splitImgHost(option.imgUrl)"
  341. ></image>
  342. </view>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. <view class="pad_8 answer">
  348. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  349. <view
  350. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  351. >
  352. </view>
  353. <view class="pad_8 answerInfos">
  354. <view class="answerTitle">答案解析</view>
  355. <view class="answerContent">
  356. <rich-text :nodes="option.analysisContent"></rich-text>
  357. </view>
  358. </view>
  359. </template>
  360. <template v-if="ansItem.type == 2">
  361. <view class="pad_8 titBox">
  362. <view class="leftLetters">
  363. <view class="btnType">
  364. <text>多选</text>
  365. </view>
  366. </view>
  367. <view class="titles">
  368. <rich-text :nodes="ansItem.content"></rich-text>
  369. </view>
  370. <view v-if="!bank.ques[ansIndex]">
  371. <view
  372. v-for="(option, childindex) in ansItem.optionsList"
  373. :key="childindex"
  374. class="lisSty"
  375. >
  376. <view
  377. :class="{ checked: option.checked }"
  378. class="activeTI"
  379. >{{ ast[childindex] }}</view
  380. >
  381. <view class="flex_auto">
  382. <rich-text :nodes="option.content"></rich-text>
  383. <view v-if="option.imgUrl">
  384. <image
  385. style="width: 600rpx"
  386. mode="widthFix"
  387. :src="$method.splitImgHost(option.imgUrl)"
  388. ></image>
  389. </view>
  390. </view>
  391. </view>
  392. </view>
  393. <view v-if="bank.ques && bank.ques[ansIndex]">
  394. <view
  395. v-for="(option, childindex) in ansItem.optionsList"
  396. :key="childindex"
  397. class="lisSty"
  398. >
  399. <text
  400. :class="{
  401. right: right(bankIndex, ansIndex, option),
  402. wrong: wrong(bankIndex, ansIndex, option),
  403. }"
  404. class="activeTI"
  405. >{{ ast[childindex] }}</text
  406. >
  407. <view class="flex_auto">
  408. <rich-text :nodes="option.content"></rich-text>
  409. <view v-if="option.imgUrl">
  410. <image
  411. style="width: 600rpx"
  412. mode="widthFix"
  413. :src="$method.splitImgHost(option.imgUrl)"
  414. ></image>
  415. </view>
  416. </view>
  417. </view>
  418. </view>
  419. </view>
  420. <view>
  421. <view class="pad_8 answer">
  422. <view
  423. >题目答案:
  424. <text
  425. :key="ansItemIndex1"
  426. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  427. >{{ ast[ansItem1 - 1] }}</text
  428. >
  429. </view>
  430. <view
  431. >我的答案:
  432. <text
  433. :key="quesItemIndex"
  434. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  435. >{{ ast[quesItem - 1] }}</text
  436. >
  437. </view>
  438. </view>
  439. <view class="pad_8 answerInfos">
  440. <view class="answerTitle">答案解析</view>
  441. <view class="answerContent">
  442. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  443. </view>
  444. </view>
  445. </view>
  446. </template>
  447. <template v-if="ansItem.type == 3">
  448. <view class="pad_8 titBox">
  449. <view class="leftLetters">
  450. <view class="btnType">
  451. <text>判断</text>
  452. </view>
  453. </view>
  454. <view class="titles">
  455. <rich-text :nodes="ansItem.content"></rich-text>
  456. </view>
  457. <view v-if="!bank.ques[ansIndex]">
  458. <view
  459. v-for="(option, childindex) in judge"
  460. :key="childindex"
  461. class="lisSty"
  462. >
  463. <view class="activeTI">{{ ast[childindex] }}</view>
  464. <view class="flex_auto">
  465. {{ option }}
  466. <view v-if="option.imgUrl">
  467. <image
  468. style="width: 600rpx"
  469. mode="widthFix"
  470. :src="$method.splitImgHost(option.imgUrl)"
  471. ></image>
  472. </view>
  473. </view>
  474. </view>
  475. </view>
  476. <view v-if="bank.ques[ansIndex]">
  477. <view
  478. v-for="(option, childindex) in judge"
  479. :key="childindex"
  480. class="lisSty"
  481. >
  482. <text
  483. :class="{
  484. right:
  485. childindex == bank.ques[ansIndex] ||
  486. childindex == bank.ans[ansIndex],
  487. wrong:
  488. childindex == bank.ques[ansIndex] &&
  489. bank.ques[ansIndex] != bank.ans[ansIndex],
  490. }"
  491. class="activeTI"
  492. >{{ ast[childindex] }}</text
  493. >
  494. <view class="flex_auto">
  495. {{ option }}
  496. <view v-if="option.imgUrl">
  497. <image
  498. style="width: 600rpx"
  499. mode="widthFix"
  500. :src="$method.splitImgHost(option.imgUrl)"
  501. ></image>
  502. </view>
  503. </view>
  504. </view>
  505. </view>
  506. </view>
  507. <view>
  508. <view class="pad_8 answer">
  509. <view>题目答案:{{ ast[bank.ans[ansIndex]] }}</view>
  510. <view>我的答案:{{ ast[bank.ques[ansIndex]] || "" }}</view>
  511. </view>
  512. <view class="pad_8 answerInfos">
  513. <view class="answerTitle">答案解析</view>
  514. <view class="answerContent">
  515. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  516. </view>
  517. </view>
  518. </view>
  519. </template>
  520. <!-- 简答题 -->
  521. <template v-if="ansItem.type == 5">
  522. <view class="pad_8 titBox_title">
  523. <view class="leftLetters">
  524. <view class="btnType">
  525. <text>简答</text>
  526. </view>
  527. </view>
  528. <view class="titles">
  529. <rich-text :nodes="ansItem.content"></rich-text>
  530. </view>
  531. </view>
  532. <view class="pad_8 titBox_title">
  533. <view class="ans">
  534. <view class="ans_submit answerInfos">
  535. <view class="answerTitle">我的答案</view>
  536. {{ bank.ques[ansIndex].text || "" }}
  537. <view
  538. class="imgs"
  539. v-if="
  540. bank.ques[ansIndex] &&
  541. bank.ques[ansIndex].imageList.length
  542. "
  543. >
  544. <image
  545. class="img"
  546. :key="quesIndex"
  547. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  548. .imageList"
  549. :src="$method.splitImgHost(ques, true)"
  550. ></image>
  551. </view>
  552. </view>
  553. </view>
  554. </view>
  555. <view>
  556. <view class="pad_8 answerInfos">
  557. <view class="answerTitle">答案解析</view>
  558. <view class="answerContent">
  559. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  560. </view>
  561. </view>
  562. </view>
  563. </template>
  564. </view>
  565. </template>
  566. <view class="footer_btn">
  567. <view
  568. class="collect"
  569. @click="collect(collectList[bankIndex], bankIndex)"
  570. >
  571. <view>
  572. <image src="/static/icon/collect.png" mode=""></image>
  573. <view>收藏</view>
  574. </view>
  575. </view>
  576. <view class="flex_center" @click="openFooterTab">
  577. <view class="up-icon">
  578. <image src="/static/up.png"></image>
  579. </view>
  580. 答题卡
  581. </view>
  582. <view class="collect" @click="pdsubmit">
  583. <view>
  584. <image src="/static/jj.png" mode=""></image>
  585. <view>交卷</view>
  586. </view>
  587. </view>
  588. </view>
  589. </view>
  590. </swiper-item>
  591. </swiper>
  592. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  593. <view class="popupView">
  594. <view class="popupTops">
  595. <view class="topIcon"></view>
  596. 点击编号即可跳转至对应题目
  597. </view>
  598. <view class="popupContent">
  599. <scroll-view scroll-y="true" style="height: 506rpx">
  600. <view class="boxSty">
  601. <view
  602. v-for="(item, index) in questionList"
  603. :key="index"
  604. @click="changeIndex(index)"
  605. :class="{
  606. isRight: isRight(item, index),
  607. isWrong: isWrong(item, index),
  608. isPart: isPart(item, index),
  609. }"
  610. class="liListSty"
  611. >{{ index + 1 }}</view
  612. >
  613. </view>
  614. </scroll-view>
  615. </view>
  616. </view>
  617. </u-popup>
  618. <view class="dialog" v-if="showDialog">
  619. <view class="text">左右滑动切换上下题</view>
  620. <view class="btn" @click="hideDialog">我知道了</view>
  621. </view>
  622. </view>
  623. </template>
  624. <script>
  625. export default {
  626. data() {
  627. return {
  628. id: "",
  629. current: 0,
  630. questionList: [],
  631. ast: ["A", "B", "C", "D", "E", "F", "G"],
  632. judge: ["错误", "正确"],
  633. show: false,
  634. showDialog: false,
  635. bankList: [],
  636. goodsId: "",
  637. recordId: "",
  638. chapterId: "",
  639. moduleId: "",
  640. courseType: 1, //1题库,2视频 商品类型
  641. };
  642. },
  643. onLoad(option) {
  644. this.id = option.id || "";
  645. this.goodsId = option.goodsid || "";
  646. this.chapterId = option.chapterId || "";
  647. this.moduleId = option.moduleId || "";
  648. this.recordId = option.recordId || "";
  649. this.courseType = option.courseType
  650. let showDialog = uni.getStorageSync("showDialog");
  651. if (showDialog) {
  652. this.showDialog = false;
  653. } else {
  654. this.showDialog = true;
  655. uni.setStorageSync("showDialog", "1");
  656. }
  657. this.goodsQuestionList();
  658. },
  659. onUnload() {},
  660. methods: {
  661. /**
  662. * 是否有上传图片
  663. */
  664. hasImgs(bank) {
  665. return bank.ansText.imageList.length == 0;
  666. },
  667. goodsQuestionList() {
  668. if (this.courseType == 2) {
  669. this.$api.bankReportData(this.recordId).then((res) => {
  670. let questionList = JSON.parse(res.data.data.historyExamJson)
  671. this.listForEach(questionList)
  672. })
  673. } else {
  674. this.$api.examReport(this.recordId).then((res) => {
  675. let questionList = JSON.parse(res.data.data.historyExamJson)
  676. this.listForEach(questionList)
  677. });
  678. }
  679. },
  680. listForEach(questionList) {
  681. questionList.forEach((json) => {
  682. //只获取类型1,2,3 单选,多选,判断 ,主观题灭有对错
  683. if (json.type == 1 || json.type == 3) {
  684. //单选判断
  685. if (json.ans != json.ques) {
  686. this.questionList.push(json);
  687. }
  688. } else if (json.type == 2) {
  689. //判断是否全对
  690. let isRight = json.ans.every((quesItem, quesIndex) => {
  691. if (json.ques) {
  692. return json.ques[quesIndex] == json.ans[quesIndex];
  693. } else {
  694. return false;
  695. }
  696. });
  697. if (!isRight) {
  698. this.questionList.push(json);
  699. }
  700. }
  701. });
  702. // console.log(this.questionList);
  703. },
  704. openFooterTab() {
  705. this.show = true;
  706. },
  707. hideDialog() {
  708. this.showDialog = false;
  709. },
  710. changeIndex(index) {
  711. this.current = index;
  712. },
  713. swiperChange(e) {
  714. this.current = e.detail.current;
  715. },
  716. isRight(item, index) {
  717. //单选
  718. if (this.questionList[index].ques) {
  719. if (item.type == 1) {
  720. return this.questionList[index].ques == this.questionList[index].ans;
  721. //多选
  722. } else if (item.type == 2) {
  723. //每一项都相等
  724. return this.questionList[index].ans.every((item, i) => {
  725. return item == this.questionList[index].ques[i];
  726. });
  727. //判断
  728. } else if (item.type == 3) {
  729. return this.questionList[index].ques == this.questionList[index].ans;
  730. } else {
  731. return false;
  732. }
  733. } else {
  734. return false;
  735. }
  736. },
  737. right(bankIndex, ansIndex, option) {
  738. if (
  739. this.questionList[bankIndex].ques[ansIndex] &&
  740. this.questionList[bankIndex].ans[ansIndex]
  741. ) {
  742. if (
  743. this.questionList[bankIndex].ques[ansIndex].indexOf(
  744. option.optionsId
  745. ) != -1 ||
  746. this.questionList[bankIndex].ans[ansIndex].indexOf(
  747. option.optionsId
  748. ) != -1
  749. ) {
  750. return true;
  751. } else {
  752. return false;
  753. }
  754. } else {
  755. return false;
  756. }
  757. },
  758. wrong(bankIndex, ansIndex, option) {
  759. if (
  760. this.questionList[bankIndex].ques[ansIndex] &&
  761. this.questionList[bankIndex].ans[ansIndex]
  762. ) {
  763. if (
  764. this.questionList[bankIndex].ques[ansIndex].indexOf(
  765. option.optionsId
  766. ) != -1 &&
  767. this.questionList[bankIndex].ans[ansIndex].indexOf(
  768. option.optionsId
  769. ) == -1
  770. ) {
  771. return true;
  772. } else {
  773. return false;
  774. }
  775. } else {
  776. return false;
  777. }
  778. },
  779. isWrong(item, index) {
  780. if (this.questionList[index].ques) {
  781. //单选
  782. if (item.type == 1) {
  783. return this.questionList[index].ques != this.questionList[index].ans;
  784. //多选
  785. } else if (item.type == 2) {
  786. //每一项都相等
  787. return this.questionList[index].ques.some((item, i) => {
  788. return this.questionList[index].ans.indexOf(item) == -1;
  789. });
  790. //判断
  791. } else if (item.type == 3) {
  792. return this.questionList[index].ques != this.questionList[index].ans;
  793. } else {
  794. return false;
  795. }
  796. } else {
  797. return false;
  798. }
  799. },
  800. isPart(item, index) {
  801. if (this.questionList[index].ques) {
  802. if (item.type == 2) {
  803. let isWrong = this.questionList[index].ques.some((item, i) => {
  804. return this.questionList[index].ans.indexOf(item) == -1;
  805. });
  806. let isRight = this.questionList[index].ans.every((item, i) => {
  807. return item == this.questionList[index].ques[i];
  808. });
  809. if (!isRight && !isWrong) {
  810. return true;
  811. }
  812. }
  813. } else {
  814. return false;
  815. }
  816. },
  817. tabSelect(index, bankindex) {
  818. this.$set(this.questionList[bankindex], "current", index);
  819. },
  820. },
  821. };
  822. </script>
  823. <style lang="scss" scoped>
  824. .questionBank {
  825. width: 100%;
  826. height: 100vh;
  827. display: flex;
  828. flex-direction: column;
  829. }
  830. .swiper {
  831. width: 100%;
  832. flex: 1;
  833. }
  834. .lisSty {
  835. margin-bottom: 16rpx;
  836. display: flex;
  837. .flex_auto {
  838. flex: 1;
  839. }
  840. }
  841. .activeTI {
  842. vertical-align: middle;
  843. display: inline-block;
  844. border: 1rpx solid #eee;
  845. border-radius: 50rpx;
  846. height: 48rpx;
  847. line-height: 46rpx;
  848. text-align: center;
  849. width: 48rpx;
  850. margin-right: 15rpx;
  851. color: #666;
  852. font-size: 30rpx;
  853. &.right {
  854. color: #fff;
  855. background: #36c75a;
  856. }
  857. &.wrong {
  858. color: #fff;
  859. background: #ff3b30;
  860. }
  861. &.checked {
  862. color: #fff;
  863. background: #007aff;
  864. }
  865. }
  866. .submit_checkbox {
  867. position: fixed;
  868. left: 0;
  869. right: 0;
  870. bottom: 120rpx;
  871. margin: 20rpx auto;
  872. width: 526rpx;
  873. height: 80rpx;
  874. background: rgba(0, 122, 255, 1);
  875. color: #fff;
  876. text-align: center;
  877. line-height: 80rpx;
  878. font-size: 30rpx;
  879. border-radius: 40rpx;
  880. }
  881. .titles {
  882. overflow: hidden;
  883. margin-bottom: 24rpx;
  884. }
  885. .titBox {
  886. padding: 41rpx 25rpx 24rpx 25rpx;
  887. }
  888. .titBox_title {
  889. padding: 21rpx;
  890. }
  891. .tabs {
  892. margin: 10rpx;
  893. display: flex;
  894. .tab {
  895. margin: 0 4rpx;
  896. padding: 10rpx 13rpx;
  897. text-align: center;
  898. color: #007aff;
  899. font-size: 28rpx;
  900. border-radius: 16rpx;
  901. background: #fff;
  902. &.current {
  903. color: #fff;
  904. background: #007aff;
  905. }
  906. }
  907. }
  908. .ans {
  909. margin: 8rpx 8rpx 8rpx;
  910. .ans_input {
  911. border-radius: 16rpx;
  912. background: #fff;
  913. .top {
  914. border-bottom: 1rpx solid #eeeeee;
  915. padding: 16rpx;
  916. display: flex;
  917. align-items: center;
  918. .icon {
  919. margin-right: 20rpx;
  920. width: 40rpx;
  921. height: 38rpx;
  922. }
  923. .progress {
  924. flex: 1;
  925. }
  926. .submit {
  927. width: 168rpx;
  928. height: 48rpx;
  929. line-height: 48rpx;
  930. text-align: center;
  931. color: #fff;
  932. font-size: 30rpx;
  933. background: #007aff;
  934. border-radius: 24rpx;
  935. &.disabled {
  936. opacity: 0.6;
  937. }
  938. }
  939. }
  940. .textarea {
  941. textarea {
  942. width: 100%;
  943. height: 287rpx;
  944. padding: 10rpx;
  945. }
  946. }
  947. .imgs {
  948. overflow: hidden;
  949. display: flex;
  950. width: 100%;
  951. .img {
  952. width: 104rpx;
  953. height: 104rpx;
  954. border-radius: 8rpx;
  955. position: relative;
  956. margin: 20rpx;
  957. text {
  958. position: absolute;
  959. right: -15rpx;
  960. top: -15rpx;
  961. width: 30rpx;
  962. height: 30rpx;
  963. text-align: center;
  964. line-height: 30rpx;
  965. color: #fff;
  966. background: #ff3b30;
  967. border-radius: 50%;
  968. }
  969. image {
  970. width: 100%;
  971. height: 100%;
  972. }
  973. }
  974. }
  975. }
  976. .ans_submit {
  977. padding: 16rpx;
  978. border-radius: 16rpx;
  979. background: #fff;
  980. .imgs {
  981. overflow: hidden;
  982. display: flex;
  983. width: 100%;
  984. .img {
  985. width: 104rpx;
  986. height: 104rpx;
  987. border-radius: 8rpx;
  988. position: relative;
  989. margin: 20rpx;
  990. image {
  991. width: 100%;
  992. height: 100%;
  993. }
  994. }
  995. }
  996. }
  997. }
  998. .leftLetters {
  999. display: flex;
  1000. align-items: center;
  1001. width: 220rpx;
  1002. .btnType {
  1003. padding: 5rpx 10rpx;
  1004. border: 1rpx solid #007aff;
  1005. border-radius: 10rpx;
  1006. background-color: rgba(0, 122, 255, 0.1);
  1007. font-size: 28rpx;
  1008. color: #007aff;
  1009. margin-right: 15rpx;
  1010. }
  1011. }
  1012. .firstLetter {
  1013. display: flex;
  1014. justify-content: space-between;
  1015. align-items: center;
  1016. margin-bottom: 30rpx;
  1017. }
  1018. .popupView {
  1019. height: 100%;
  1020. padding-bottom: 100rpx;
  1021. .popupTops {
  1022. height: 77rpx;
  1023. border-bottom: 1rpx solid #eee;
  1024. text-align: center;
  1025. line-height: 77rpx;
  1026. font-size: 24rpx;
  1027. color: #999;
  1028. position: relative;
  1029. .topIcon {
  1030. position: absolute;
  1031. top: 10rpx;
  1032. left: 50%;
  1033. transform: translateX(-50%);
  1034. width: 80rpx;
  1035. height: 8rpx;
  1036. background-color: #999;
  1037. border-radius: 4rpx;
  1038. }
  1039. }
  1040. .popupContent {
  1041. }
  1042. }
  1043. .pageContent {
  1044. position: relative;
  1045. background-color: #eaeef1;
  1046. height: 100%;
  1047. overflow-y: scroll;
  1048. padding-top: 8rpx;
  1049. padding-bottom: 100rpx;
  1050. }
  1051. .pad_8 {
  1052. background-color: #fff;
  1053. margin: 0rpx 8rpx 8rpx;
  1054. border-radius: 16rpx;
  1055. &.no-margin {
  1056. margin-top: -16rpx;
  1057. border-radius: 0 0 16rpx 16rpx;
  1058. }
  1059. }
  1060. .answer {
  1061. height: 80rpx;
  1062. line-height: 80rpx;
  1063. padding: 0rpx 24rpx;
  1064. display: flex;
  1065. align-items: center;
  1066. justify-content: space-between;
  1067. color: #666;
  1068. font-size: 30rpx;
  1069. }
  1070. .footer_btn {
  1071. background-color: #fff;
  1072. z-index: 10078;
  1073. position: fixed;
  1074. bottom: 0rpx;
  1075. display: flex;
  1076. align-items: center;
  1077. justify-content: space-between;
  1078. width: 100%;
  1079. height: 98rpx;
  1080. padding: 0rpx 38rpx;
  1081. border-top: 1rpx solid #eee;
  1082. .flex_center {
  1083. flex: 1;
  1084. display: flex;
  1085. justify-content: center;
  1086. align-items: center;
  1087. flex-direction: column;
  1088. margin: 0 200rpx;
  1089. font-size: 24rpx;
  1090. color: #999999;
  1091. .up-icon {
  1092. margin-bottom: 18rpx;
  1093. width: 100%;
  1094. display: flex;
  1095. justify-content: center;
  1096. image {
  1097. width: 58rpx;
  1098. height: 21rpx;
  1099. }
  1100. }
  1101. }
  1102. .collect {
  1103. visibility: hidden;
  1104. width: 100rpx;
  1105. &.show {
  1106. visibility: visible;
  1107. }
  1108. > view {
  1109. display: flex;
  1110. flex-direction: column;
  1111. align-items: center;
  1112. justify-content: center;
  1113. image {
  1114. width: 32rpx;
  1115. height: 32rpx;
  1116. margin-bottom: 6rpx;
  1117. }
  1118. view {
  1119. font-size: 24rpx;
  1120. color: #999999;
  1121. }
  1122. }
  1123. }
  1124. }
  1125. .boxSty {
  1126. padding: 44rpx 41rpx 0rpx;
  1127. }
  1128. .liListSty {
  1129. border: 1rpx solid #eeeeee;
  1130. width: 88rpx;
  1131. height: 88rpx;
  1132. border-radius: 32rpx;
  1133. text-align: center;
  1134. line-height: 88rpx;
  1135. color: #333;
  1136. font-size: 32rpx;
  1137. float: left;
  1138. margin: 20rpx 23rpx;
  1139. &.isRight {
  1140. border: 1rpx solid #eeeeee;
  1141. color: #fff;
  1142. background: #36c75a;
  1143. }
  1144. &.isWrong {
  1145. border: 1rpx solid #eeeeee;
  1146. color: #fff;
  1147. background: #ff3b30;
  1148. }
  1149. &.isPart {
  1150. border: 1rpx solid #eeeeee;
  1151. color: #fff;
  1152. background: #ffc53d;
  1153. }
  1154. }
  1155. .answerInfos {
  1156. padding: 25rpx 25rpx 25rpx 23rpx;
  1157. }
  1158. .answerTitle {
  1159. margin-bottom: 28rpx;
  1160. color: #666;
  1161. font-size: 30rpx;
  1162. }
  1163. .answerContent {
  1164. font-size: 30rpx;
  1165. color: #666;
  1166. }
  1167. .textChild {
  1168. display: inline-block;
  1169. vertical-align: middle;
  1170. }
  1171. .dialog {
  1172. position: fixed;
  1173. left: 0;
  1174. top: 0;
  1175. width: 100%;
  1176. height: 100%;
  1177. background-color: rgba(0, 0, 0, 0.8);
  1178. display: flex;
  1179. flex-direction: column;
  1180. align-items: center;
  1181. justify-content: center;
  1182. z-index: 20000;
  1183. .pointer {
  1184. width: 338rpx;
  1185. height: 240rpx;
  1186. }
  1187. .text {
  1188. font-size: 32rpx;
  1189. color: #ffffff;
  1190. text-align: center;
  1191. }
  1192. .btn {
  1193. width: 242rpx;
  1194. height: 82rpx;
  1195. border: 2rpx solid #ffffff;
  1196. border-radius: 16rpx;
  1197. text-align: center;
  1198. line-height: 82rpx;
  1199. margin: 41rpx auto;
  1200. color: #fff;
  1201. font-size: 32rpx;
  1202. }
  1203. }
  1204. .popboxs {
  1205. width: 100%;
  1206. height: 100%;
  1207. display: flex;
  1208. flex-direction: column;
  1209. align-items: center;
  1210. }
  1211. .classTops {
  1212. flex-shrink: 0;
  1213. padding: 39rpx 0rpx 4rpx;
  1214. font-weight: bold;
  1215. color: #333;
  1216. font-size: 30rpx;
  1217. }
  1218. .textStys {
  1219. width: 100%;
  1220. flex: 1;
  1221. padding: 36rpx;
  1222. }
  1223. .classFootsty {
  1224. flex-shrink: 0;
  1225. display: flex;
  1226. align-items: center;
  1227. justify-content: center;
  1228. padding: 10rpx 0rpx 40rpx;
  1229. .btnsty {
  1230. width: 200rpx;
  1231. height: 80rpx;
  1232. border-radius: 40rpx;
  1233. font-weight: bold;
  1234. font-size: 30rpx;
  1235. text-align: center;
  1236. line-height: 80rpx;
  1237. }
  1238. .btns1 {
  1239. background-color: #f5f5f5;
  1240. color: #007aff;
  1241. }
  1242. .btns2 {
  1243. margin-left: 40rpx;
  1244. background-color: #007aff;
  1245. color: #ffffff;
  1246. }
  1247. }
  1248. </style>