questionBankAllExplain.vue 36 KB

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