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. >
  9. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  10. <view class="pageContent">
  11. <view class="pad_8 titBox">
  12. <view class="firstLetter">
  13. <view class="leftLetters">
  14. <view class="btnType">
  15. <text v-if="bank.type == 1">单选</text>
  16. <text v-if="bank.type == 2">多选</text>
  17. <text v-if="bank.type == 3">判断</text>
  18. <text v-if="bank.type == 4">案例</text>
  19. <text v-if="bank.type == 5">简答</text>
  20. </view>
  21. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  22. </view>
  23. <view style="color: #666; font-size: 28rpx"></view>
  24. <view class="leftLetters"></view>
  25. </view>
  26. <view class="titles">
  27. <rich-text :nodes="bank.content"></rich-text>
  28. </view>
  29. </view>
  30. <template v-if="bank.type == 1">
  31. <view class="pad_8 titBox no-margin">
  32. <view v-if="!bank.ques">
  33. <view
  34. v-for="(item, index) in bank.jsonStr"
  35. :key="index"
  36. class="lisSty"
  37. >
  38. <view class="activeTI">{{ ast[index] }}</view>
  39. <view class="flex_auto">
  40. {{ item.content }}
  41. <view v-if="item.imgUrl">
  42. <image
  43. style="width: 600rpx"
  44. mode="widthFix"
  45. :src="$method.splitImgHost(item.imgUrl)"
  46. ></image>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view v-if="bank.ques">
  52. <view
  53. v-for="(item, index) in bank.jsonStr"
  54. :key="index"
  55. class="lisSty"
  56. >
  57. <text
  58. :class="{
  59. right:
  60. item.optionsId == bank.ques ||
  61. item.optionsId == bank.ans,
  62. wrong:
  63. item.optionsId == bank.ques && bank.ques != bank.ans,
  64. }"
  65. class="activeTI"
  66. >{{ ast[index] }}</text
  67. >
  68. <view class="flex_auto">
  69. {{ item.content }}
  70. <view v-if="item.imgUrl">
  71. <image
  72. style="width: 600rpx"
  73. mode="widthFix"
  74. :src="$method.splitImgHost(item.imgUrl)"
  75. ></image>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view>
  82. <view class="pad_8 answer">
  83. <view>题目答案:{{ ast[bank.ans - 1] }}</view>
  84. <view>我的答案:{{ ast[bank.ques - 1] || "" }}</view>
  85. </view>
  86. <view class="pad_8 answerInfos">
  87. <view class="answerTitle">答案解析</view>
  88. <view class="answerContent">
  89. <rich-text :nodes="bank.analysisContent"></rich-text>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <template v-if="bank.type == 2">
  95. <view class="pad_8 titBox no-margin">
  96. <view v-if="!bank.ques">
  97. <view
  98. v-for="(item, index) in bank.jsonStr"
  99. :key="index"
  100. class="lisSty"
  101. >
  102. <view :class="{ checked: item.checked }" class="activeTI">{{
  103. ast[index]
  104. }}</view>
  105. <view class="flex_auto">
  106. {{ item.content }}
  107. <view v-if="item.imgUrl">
  108. <image
  109. style="width: 600rpx"
  110. mode="widthFix"
  111. :src="$method.splitImgHost(item.imgUrl)"
  112. ></image>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view v-if="bank.ques">
  118. <view
  119. v-for="(item, index) in bank.jsonStr"
  120. :key="index"
  121. class="lisSty"
  122. >
  123. <text
  124. :class="{
  125. right:
  126. (bank.ques &&
  127. bank.ques.indexOf(item.optionsId) != -1) ||
  128. (bank.ans && bank.ans.indexOf(item.optionsId) != -1),
  129. wrong:
  130. bank.ques &&
  131. bank.ques.indexOf(item.optionsId) != -1 &&
  132. bank.ans &&
  133. bank.ans.indexOf(item.optionsId) == -1,
  134. }"
  135. class="activeTI"
  136. >{{ ast[index] }}</text
  137. >
  138. <view class="flex_auto">
  139. {{ item.content }}
  140. <view v-if="item.imgUrl">
  141. <image
  142. style="width: 600rpx"
  143. mode="widthFix"
  144. :src="$method.splitImgHost(item.imgUrl)"
  145. ></image>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <view>
  152. <view class="pad_8 answer">
  153. <view
  154. >题目答案:
  155. <text
  156. :key="ansItemIndex"
  157. v-for="(ansItem, ansItemIndex) in bank.ans"
  158. >{{ ast[ansItem - 1] }}</text
  159. >
  160. </view>
  161. <view
  162. >我的答案:
  163. <text
  164. :key="quesItemIndex"
  165. v-for="(quesItem, quesItemIndex) in bank.ques"
  166. >{{ ast[quesItem - 1] }}</text
  167. >
  168. </view>
  169. </view>
  170. <view class="pad_8 answerInfos">
  171. <view class="answerTitle">答案解析</view>
  172. <view class="answerContent">
  173. <rich-text :nodes="bank.analysisContent"></rich-text>
  174. </view>
  175. </view>
  176. </view>
  177. </template>
  178. <template v-if="bank.type == 3">
  179. <view class="pad_8 titBox no-margin">
  180. <view v-if="!bank.ques">
  181. <view
  182. v-for="(item, index) in judge"
  183. :key="index"
  184. class="lisSty"
  185. >
  186. <view class="activeTI">{{ ast[index] }}</view>
  187. <view class="flex_auto">
  188. {{ item }}
  189. <view v-if="item.imgUrl">
  190. <image
  191. style="width: 600rpx"
  192. mode="widthFix"
  193. :src="$method.splitImgHost(item.imgUrl)"
  194. ></image>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. <view v-if="bank.ques">
  200. <view
  201. v-for="(item, index) in judge"
  202. :key="index"
  203. class="lisSty"
  204. >
  205. <text
  206. :class="{
  207. right: index == bank.ques || index == bank.ans,
  208. wrong: index == bank.ques && bank.ques != bank.ans,
  209. }"
  210. class="activeTI"
  211. >{{ ast[index] }}</text
  212. >
  213. <view class="flex_auto">
  214. {{ item }}
  215. <view v-if="item.imgUrl">
  216. <image
  217. style="width: 600rpx"
  218. mode="widthFix"
  219. :src="$method.splitImgHost(item.imgUrl)"
  220. ></image>
  221. </view>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. <view>
  227. <view class="pad_8 answer">
  228. <view>题目答案:{{ ast[bank.ans] }}</view>
  229. <view>我的答案:{{ ast[bank.ques] || "" }}</view>
  230. </view>
  231. <view class="pad_8 answerInfos">
  232. <view class="answerTitle">答案解析</view>
  233. <view class="answerContent">
  234. <rich-text :nodes="bank.analysisContent"></rich-text>
  235. </view>
  236. </view>
  237. </view>
  238. </template>
  239. <!-- 简答题 -->
  240. <template v-if="bank.type == 5">
  241. <view class="pad_8 titBox">
  242. <view class="ans">
  243. <view class="ans_submit answerInfos">
  244. <view class="answerTitle">我的答案:</view>
  245. {{ bank.ques.text || "" }}
  246. <view class="imgs">
  247. <image
  248. class="img"
  249. v-for="(ques, quesIndex) in bank.ques.imageList"
  250. :key="quesIndex"
  251. :src="$method.splitImgHost(ques, true)"
  252. ></image>
  253. </view>
  254. </view>
  255. </view>
  256. </view>
  257. <view>
  258. <view class="pad_8 answerInfos">
  259. <view class="answerTitle">答案解析:</view>
  260. <view class="answerContent">
  261. <rich-text :nodes="bank.analysisContent"></rich-text>
  262. </view>
  263. </view>
  264. </view>
  265. </template>
  266. <!-- 案例题 -->
  267. <template v-if="bank.type == 4">
  268. <view class="tabs">
  269. <view
  270. class="tab"
  271. :class="{ current: tabIndex == bank.current }"
  272. :key="tabIndex"
  273. v-for="(tab, tabIndex) in bank.jsonStr"
  274. @click="tabSelect(tabIndex, bankIndex)"
  275. >问题{{ tabIndex + 1 }}</view
  276. >
  277. </view>
  278. <view
  279. v-for="(ansItem, ansIndex) in bank.jsonStr"
  280. v-if="bank.current == ansIndex"
  281. :key="ansIndex"
  282. >
  283. <template v-if="ansItem.type == 1">
  284. <view class="pad_8 titBox">
  285. <view class="leftLetters">
  286. <view class="btnType">
  287. <text>单选</text>
  288. </view>
  289. </view>
  290. <view class="titles">
  291. <rich-text :nodes="ansItem.content"></rich-text>
  292. </view>
  293. <view v-if="!bank.ques[ansIndex]">
  294. <view
  295. v-for="(option, childIndex) in ansItem.optionsList"
  296. :key="childIndex"
  297. class="lisSty"
  298. >
  299. <view class="activeTI">{{ ast[childIndex] }}</view>
  300. <view class="flex_auto">
  301. <rich-text
  302. class="textChild"
  303. :nodes="option.content"
  304. ></rich-text>
  305. <view v-if="option.imgUrl">
  306. <image
  307. style="width: 600rpx"
  308. mode="widthFix"
  309. :src="$method.splitImgHost(option.imgUrl)"
  310. ></image>
  311. </view>
  312. </view>
  313. </view>
  314. </view>
  315. <view v-if="bank.ques[ansIndex]">
  316. <view
  317. v-for="(option, childIndex) in ansItem.optionsList"
  318. :key="childIndex"
  319. class="lisSty"
  320. >
  321. <text
  322. :class="{
  323. right:
  324. option.optionsId == bank.ques[ansIndex] ||
  325. option.optionsId == bank.ans[ansIndex],
  326. wrong:
  327. option.optionsId == bank.ques[ansIndex] &&
  328. bank.ques[ansIndex] != bank.ans[ansIndex],
  329. }"
  330. class="activeTI"
  331. >{{ ast[childIndex] }}</text
  332. >
  333. <view class="flex_auto">
  334. <rich-text :nodes="option.content"></rich-text>
  335. <view v-if="option.imgUrl">
  336. <image
  337. style="width: 600rpx"
  338. mode="widthFix"
  339. :src="$method.splitImgHost(option.imgUrl)"
  340. ></image>
  341. </view>
  342. </view>
  343. </view>
  344. </view>
  345. </view>
  346. <view class="pad_8 answer">
  347. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  348. <view
  349. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  350. >
  351. </view>
  352. <view class="pad_8 answerInfos">
  353. <view class="answerTitle">答案解析</view>
  354. <view class="answerContent">
  355. <rich-text :nodes="option.analysisContent"></rich-text>
  356. </view>
  357. </view>
  358. </template>
  359. <template v-if="ansItem.type == 2">
  360. <view class="pad_8 titBox">
  361. <view class="leftLetters">
  362. <view class="btnType">
  363. <text>多选</text>
  364. </view>
  365. </view>
  366. <view class="titles">
  367. <rich-text :nodes="ansItem.content"></rich-text>
  368. </view>
  369. <view v-if="!bank.ques[ansIndex]">
  370. <view
  371. v-for="(option, childindex) in ansItem.optionsList"
  372. :key="childindex"
  373. class="lisSty"
  374. >
  375. <view
  376. :class="{ checked: option.checked }"
  377. class="activeTI"
  378. >{{ ast[childindex] }}</view
  379. >
  380. <view class="flex_auto">
  381. <rich-text :nodes="option.content"></rich-text>
  382. <view v-if="option.imgUrl">
  383. <image
  384. style="width: 600rpx"
  385. mode="widthFix"
  386. :src="$method.splitImgHost(option.imgUrl)"
  387. ></image>
  388. </view>
  389. </view>
  390. </view>
  391. </view>
  392. <view v-if="bank.ques && bank.ques[ansIndex]">
  393. <view
  394. v-for="(option, childindex) in ansItem.optionsList"
  395. :key="childindex"
  396. class="lisSty"
  397. >
  398. <text
  399. :class="{
  400. right: right(bankIndex, ansIndex, option),
  401. wrong: wrong(bankIndex, ansIndex, option),
  402. }"
  403. class="activeTI"
  404. >{{ ast[childindex] }}</text
  405. >
  406. <view class="flex_auto">
  407. <rich-text :nodes="option.content"></rich-text>
  408. <view v-if="option.imgUrl">
  409. <image
  410. style="width: 600rpx"
  411. mode="widthFix"
  412. :src="$method.splitImgHost(option.imgUrl)"
  413. ></image>
  414. </view>
  415. </view>
  416. </view>
  417. </view>
  418. </view>
  419. <view>
  420. <view class="pad_8 answer">
  421. <view
  422. >题目答案:
  423. <text
  424. :key="ansItemIndex1"
  425. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  426. >{{ ast[ansItem1 - 1] }}</text
  427. >
  428. </view>
  429. <view
  430. >我的答案:
  431. <text
  432. :key="quesItemIndex"
  433. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  434. >{{ ast[quesItem - 1] }}</text
  435. >
  436. </view>
  437. </view>
  438. <view class="pad_8 answerInfos">
  439. <view class="answerTitle">答案解析</view>
  440. <view class="answerContent">
  441. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  442. </view>
  443. </view>
  444. </view>
  445. </template>
  446. <template v-if="ansItem.type == 3">
  447. <view class="pad_8 titBox">
  448. <view class="leftLetters">
  449. <view class="btnType">
  450. <text>判断</text>
  451. </view>
  452. </view>
  453. <view class="titles">
  454. <rich-text :nodes="ansItem.content"></rich-text>
  455. </view>
  456. <view v-if="!bank.ques[ansIndex]">
  457. <view
  458. v-for="(option, childindex) in judge"
  459. :key="childindex"
  460. class="lisSty"
  461. >
  462. <view class="activeTI">{{ ast[childindex] }}</view>
  463. <view class="flex_auto">
  464. {{ option }}
  465. <view v-if="option.imgUrl">
  466. <image
  467. style="width: 600rpx"
  468. mode="widthFix"
  469. :src="$method.splitImgHost(option.imgUrl)"
  470. ></image>
  471. </view>
  472. </view>
  473. </view>
  474. </view>
  475. <view v-if="bank.ques[ansIndex]">
  476. <view
  477. v-for="(option, childindex) in judge"
  478. :key="childindex"
  479. class="lisSty"
  480. >
  481. <text
  482. :class="{
  483. right:
  484. childindex == bank.ques[ansIndex] ||
  485. childindex == bank.ans[ansIndex],
  486. wrong:
  487. childindex == bank.ques[ansIndex] &&
  488. bank.ques[ansIndex] != bank.ans[ansIndex],
  489. }"
  490. class="activeTI"
  491. >{{ ast[childindex] }}</text
  492. >
  493. <view class="flex_auto">
  494. {{ option }}
  495. <view v-if="option.imgUrl">
  496. <image
  497. style="width: 600rpx"
  498. mode="widthFix"
  499. :src="$method.splitImgHost(option.imgUrl)"
  500. ></image>
  501. </view>
  502. </view>
  503. </view>
  504. </view>
  505. </view>
  506. <view>
  507. <view class="pad_8 answer">
  508. <view>题目答案:{{ ast[bank.ans[ansIndex]] }}</view>
  509. <view>我的答案:{{ ast[bank.ques[ansIndex]] || "" }}</view>
  510. </view>
  511. <view class="pad_8 answerInfos">
  512. <view class="answerTitle">答案解析</view>
  513. <view class="answerContent">
  514. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  515. </view>
  516. </view>
  517. </view>
  518. </template>
  519. <!-- 简答题 -->
  520. <template v-if="ansItem.type == 5">
  521. <view class="pad_8 titBox_title">
  522. <view class="leftLetters">
  523. <view class="btnType">
  524. <text>简答</text>
  525. </view>
  526. </view>
  527. <view class="titles">
  528. <rich-text :nodes="ansItem.content"></rich-text>
  529. </view>
  530. </view>
  531. <view class="pad_8 titBox_title">
  532. <view class="ans">
  533. <view class="ans_submit answerInfos">
  534. <view class="answerTitle">我的答案</view>
  535. {{ bank.ques[ansIndex].text || "" }}
  536. <view
  537. class="imgs"
  538. v-if="
  539. bank.ques[ansIndex] &&
  540. bank.ques[ansIndex].imageList.length
  541. "
  542. >
  543. <image
  544. class="img"
  545. :key="quesIndex"
  546. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  547. .imageList"
  548. :src="$method.splitImgHost(ques, true)"
  549. ></image>
  550. </view>
  551. </view>
  552. </view>
  553. </view>
  554. <view>
  555. <view class="pad_8 answerInfos">
  556. <view class="answerTitle">答案解析</view>
  557. <view class="answerContent">
  558. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  559. </view>
  560. </view>
  561. </view>
  562. </template>
  563. </view>
  564. </template>
  565. <view class="footer_btn">
  566. <view
  567. class="collect"
  568. @click="collect(collectList[bankIndex], bankIndex)"
  569. >
  570. <view>
  571. <image src="/static/icon/collect.png" mode=""></image>
  572. <view>收藏</view>
  573. </view>
  574. </view>
  575. <view class="flex_center" @click="openFooterTab">
  576. <view class="up-icon">
  577. <image src="/static/up.png"></image>
  578. </view>
  579. 答题卡
  580. </view>
  581. <view class="collect" @click="pdsubmit">
  582. <view>
  583. <image src="/static/jj.png" mode=""></image>
  584. <view>交卷</view>
  585. </view>
  586. </view>
  587. </view>
  588. </view>
  589. </swiper-item>
  590. </swiper>
  591. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  592. <view class="popupView">
  593. <view class="popupTops">
  594. <view class="topIcon"></view>
  595. 点击编号即可跳转至对应题目
  596. </view>
  597. <view class="popupContent">
  598. <scroll-view scroll-y="true" style="height: 506rpx">
  599. <view class="boxSty">
  600. <view
  601. v-for="(item, index) in questionList"
  602. :key="index"
  603. @click="changeIndex(index)"
  604. :class="{
  605. isRight: isRight(item, index),
  606. isWrong: isWrong(item, index),
  607. isPart: isPart(item, index),
  608. }"
  609. class="liListSty"
  610. >{{ index + 1 }}</view
  611. >
  612. </view>
  613. </scroll-view>
  614. </view>
  615. </view>
  616. </u-popup>
  617. <view class="dialog" v-if="showDialog">
  618. <view class="text">左右滑动切换上下题</view>
  619. <view class="btn" @click="hideDialog">我知道了</view>
  620. </view>
  621. </view>
  622. </template>
  623. <script>
  624. export default {
  625. data() {
  626. return {
  627. id: "",
  628. current: 0,
  629. questionList: [],
  630. ast: ["A", "B", "C", "D", "E", "F", "G"],
  631. judge: ["错误", "正确"],
  632. show: false,
  633. showDialog: false,
  634. bankList: [],
  635. goodsId: "",
  636. recordId: "",
  637. chapterId: "",
  638. moduleId: "",
  639. courseType: 1, //1题库,2视频 商品类型
  640. };
  641. },
  642. onLoad(option) {
  643. this.id = option.id || "";
  644. this.goodsId = option.goodsid || "";
  645. this.chapterId = option.chapterId || "";
  646. this.moduleId = option.moduleId || "";
  647. this.recordId = option.recordId || "";
  648. this.courseType = option.courseType
  649. let showDialog = uni.getStorageSync("showDialog");
  650. if (showDialog) {
  651. this.showDialog = false;
  652. } else {
  653. this.showDialog = true;
  654. uni.setStorageSync("showDialog", "1");
  655. }
  656. this.goodsQuestionList();
  657. },
  658. onUnload() {},
  659. methods: {
  660. /**
  661. * 是否有上传图片
  662. */
  663. hasImgs(bank) {
  664. return bank.ansText.imageList.length == 0;
  665. },
  666. goodsQuestionList() {
  667. if (this.courseType == 2) {
  668. this.$api.bankReportData(this.recordId).then((res) => {
  669. let questionList = JSON.parse(res.data.data.historyExamJson)
  670. this.listForEach(questionList)
  671. })
  672. } else {
  673. this.$api.examReport(this.recordId).then((res) => {
  674. let questionList = JSON.parse(res.data.data.historyExamJson)
  675. this.listForEach(questionList)
  676. });
  677. }
  678. },
  679. listForEach(questionList) {
  680. questionList.forEach((json) => {
  681. //只获取类型1,2,3 单选,多选,判断 ,主观题灭有对错
  682. if (json.type == 1 || json.type == 3) {
  683. //单选判断
  684. if (json.ans != json.ques) {
  685. this.questionList.push(json);
  686. }
  687. } else if (json.type == 2) {
  688. //判断是否全对
  689. let isRight = json.ans.every((quesItem, quesIndex) => {
  690. if (json.ques) {
  691. return json.ques[quesIndex] == json.ans[quesIndex];
  692. } else {
  693. return false;
  694. }
  695. });
  696. if (!isRight) {
  697. this.questionList.push(json);
  698. }
  699. }
  700. });
  701. // console.log(this.questionList);
  702. },
  703. openFooterTab() {
  704. this.show = true;
  705. },
  706. hideDialog() {
  707. this.showDialog = false;
  708. },
  709. changeIndex(index) {
  710. this.current = index;
  711. },
  712. swiperChange(e) {
  713. this.current = e.detail.current;
  714. },
  715. isRight(item, index) {
  716. //单选
  717. if (this.questionList[index].ques) {
  718. if (item.type == 1) {
  719. return this.questionList[index].ques == this.questionList[index].ans;
  720. //多选
  721. } else if (item.type == 2) {
  722. //每一项都相等
  723. return this.questionList[index].ans.every((item, i) => {
  724. return item == this.questionList[index].ques[i];
  725. });
  726. //判断
  727. } else if (item.type == 3) {
  728. return this.questionList[index].ques == this.questionList[index].ans;
  729. } else {
  730. return false;
  731. }
  732. } else {
  733. return false;
  734. }
  735. },
  736. right(bankIndex, ansIndex, option) {
  737. if (
  738. this.questionList[bankIndex].ques[ansIndex] &&
  739. this.questionList[bankIndex].ans[ansIndex]
  740. ) {
  741. if (
  742. this.questionList[bankIndex].ques[ansIndex].indexOf(
  743. option.optionsId
  744. ) != -1 ||
  745. this.questionList[bankIndex].ans[ansIndex].indexOf(
  746. option.optionsId
  747. ) != -1
  748. ) {
  749. return true;
  750. } else {
  751. return false;
  752. }
  753. } else {
  754. return false;
  755. }
  756. },
  757. wrong(bankIndex, ansIndex, option) {
  758. if (
  759. this.questionList[bankIndex].ques[ansIndex] &&
  760. this.questionList[bankIndex].ans[ansIndex]
  761. ) {
  762. if (
  763. this.questionList[bankIndex].ques[ansIndex].indexOf(
  764. option.optionsId
  765. ) != -1 &&
  766. this.questionList[bankIndex].ans[ansIndex].indexOf(
  767. option.optionsId
  768. ) == -1
  769. ) {
  770. return true;
  771. } else {
  772. return false;
  773. }
  774. } else {
  775. return false;
  776. }
  777. },
  778. isWrong(item, index) {
  779. if (this.questionList[index].ques) {
  780. //单选
  781. if (item.type == 1) {
  782. return this.questionList[index].ques != this.questionList[index].ans;
  783. //多选
  784. } else if (item.type == 2) {
  785. //每一项都相等
  786. return this.questionList[index].ques.some((item, i) => {
  787. return this.questionList[index].ans.indexOf(item) == -1;
  788. });
  789. //判断
  790. } else if (item.type == 3) {
  791. return this.questionList[index].ques != this.questionList[index].ans;
  792. } else {
  793. return false;
  794. }
  795. } else {
  796. return false;
  797. }
  798. },
  799. isPart(item, index) {
  800. if (this.questionList[index].ques) {
  801. if (item.type == 2) {
  802. let isWrong = this.questionList[index].ques.some((item, i) => {
  803. return this.questionList[index].ans.indexOf(item) == -1;
  804. });
  805. let isRight = this.questionList[index].ans.every((item, i) => {
  806. return item == this.questionList[index].ques[i];
  807. });
  808. if (!isRight && !isWrong) {
  809. return true;
  810. }
  811. }
  812. } else {
  813. return false;
  814. }
  815. },
  816. tabSelect(index, bankindex) {
  817. this.$set(this.questionList[bankindex], "current", index);
  818. },
  819. },
  820. };
  821. </script>
  822. <style lang="scss" scoped>
  823. .questionBank {
  824. width: 100%;
  825. height: 100vh;
  826. display: flex;
  827. flex-direction: column;
  828. }
  829. .swiper {
  830. width: 100%;
  831. flex: 1;
  832. }
  833. .lisSty {
  834. margin-bottom: 16rpx;
  835. display: flex;
  836. .flex_auto {
  837. flex: 1;
  838. word-break: break-all;
  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>