questionBankAllExplain.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289
  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. >
  276. 问题{{ tabIndex + 1 }}
  277. </view>
  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>
  348. <view class="pad_8 answer">
  349. <view>题目答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  350. <view
  351. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  352. >
  353. </view>
  354. <view class="pad_8 answerInfos">
  355. <view class="answerTitle">答案解析</view>
  356. <view class="answerContent">
  357. <rich-text :nodes="option.analysisContent"></rich-text>
  358. </view>
  359. </view>
  360. </view>
  361. </template>
  362. <template v-if="ansItem.type == 2">
  363. <view class="pad_8 titBox">
  364. <view class="leftLetters">
  365. <view class="btnType">
  366. <text>多选</text>
  367. </view>
  368. </view>
  369. <view class="titles">
  370. <rich-text :nodes="ansItem.content"></rich-text>
  371. <view v-if="option.imgUrl">
  372. <image
  373. style="width: 600rpx"
  374. mode="widthFix"
  375. :src="$method.splitImgHost(option.imgUrl)"
  376. ></image>
  377. </view>
  378. </view>
  379. <view v-if="!bank.ques[ansIndex]">
  380. <view
  381. v-for="(option, childindex) in ansItem.optionsList"
  382. :key="childindex"
  383. class="lisSty"
  384. >
  385. <view
  386. :class="{ checked: option.checked }"
  387. class="activeTI"
  388. >{{ ast[childindex] }}</view
  389. >
  390. <view class="flex_auto">
  391. <rich-text :nodes="option.content"></rich-text>
  392. <view v-if="option.imgUrl">
  393. <image
  394. style="width: 600rpx"
  395. mode="widthFix"
  396. :src="$method.splitImgHost(option.imgUrl)"
  397. ></image>
  398. </view>
  399. </view>
  400. </view>
  401. </view>
  402. <view v-if="bank.ques && bank.ques[ansIndex]">
  403. <view
  404. v-for="(option, childindex) in ansItem.optionsList"
  405. :key="childindex"
  406. class="lisSty"
  407. >
  408. <text
  409. :class="{
  410. right: right(bankIndex, ansIndex, option),
  411. wrong: wrong(bankIndex, ansIndex, option),
  412. }"
  413. class="activeTI"
  414. >{{ ast[childindex] }}</text
  415. >
  416. <view class="flex_auto">
  417. <rich-text :nodes="option.content"></rich-text>
  418. </view>
  419. </view>
  420. </view>
  421. </view>
  422. <view>
  423. <view class="pad_8 answer">
  424. <view
  425. >题目答案:
  426. <text
  427. :key="ansItemIndex1"
  428. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  429. >{{ ast[ansItem1 - 1] }}</text
  430. >
  431. </view>
  432. <view
  433. >我的答案:
  434. <text
  435. :key="quesItemIndex"
  436. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  437. >{{ ast[quesItem - 1] }}</text
  438. >
  439. </view>
  440. </view>
  441. <view class="pad_8 answerInfos">
  442. <view class="answerTitle">答案解析</view>
  443. <view class="answerContent">
  444. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  445. </view>
  446. </view>
  447. </view>
  448. </template>
  449. <template v-if="ansItem.type == 3">
  450. <view class="pad_8 titBox">
  451. <view class="leftLetters">
  452. <view class="btnType">
  453. <text>判断</text>
  454. </view>
  455. </view>
  456. <view class="titles">
  457. <rich-text :nodes="ansItem.content"></rich-text>
  458. </view>
  459. <view v-if="!bank.ques[ansIndex]">
  460. <view
  461. v-for="(option, childindex) in judge"
  462. :key="childindex"
  463. class="lisSty"
  464. >
  465. <view class="activeTI">{{ ast[childindex] }}</view>
  466. <view class="flex_auto">
  467. {{ option }}
  468. <view v-if="option.imgUrl">
  469. <image
  470. style="width: 600rpx"
  471. mode="widthFix"
  472. :src="$method.splitImgHost(option.imgUrl)"
  473. ></image>
  474. </view>
  475. </view>
  476. </view>
  477. </view>
  478. <view v-if="bank.ques[ansIndex]">
  479. <view
  480. v-for="(option, childindex) in judge"
  481. :key="childindex"
  482. class="lisSty"
  483. >
  484. <text
  485. :class="{
  486. right:
  487. childindex == bank.ques[ansIndex] ||
  488. childindex == bank.ans[ansIndex],
  489. wrong:
  490. childindex == bank.ques[ansIndex] &&
  491. bank.ques[ansIndex] != bank.ans[ansIndex],
  492. }"
  493. class="activeTI"
  494. >{{ ast[childindex] }}</text
  495. >
  496. <view class="flex_auto">
  497. {{ option }}
  498. <view v-if="option.imgUrl">
  499. <image
  500. style="width: 600rpx"
  501. mode="widthFix"
  502. :src="$method.splitImgHost(option.imgUrl)"
  503. ></image>
  504. </view>
  505. </view>
  506. </view>
  507. </view>
  508. </view>
  509. <view>
  510. <view class="pad_8 answer">
  511. <view>题目答案:{{ ast[bank.ans[ansIndex]] }}</view>
  512. <view>我的答案:{{ ast[bank.ques[ansIndex]] || "" }}</view>
  513. </view>
  514. <view class="pad_8 answerInfos">
  515. <view class="answerTitle">答案解析</view>
  516. <view class="answerContent">
  517. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  518. </view>
  519. </view>
  520. </view>
  521. </template>
  522. <!-- 简答题 -->
  523. <template v-if="ansItem.type == 5">
  524. <view class="pad_8 titBox_title">
  525. <view class="leftLetters">
  526. <view class="btnType">
  527. <text>简答</text>
  528. </view>
  529. </view>
  530. <view class="titles">
  531. <rich-text :nodes="ansItem.content"></rich-text>
  532. </view>
  533. </view>
  534. <view class="pad_8 titBox_title">
  535. <view class="ans">
  536. <view class="ans_submit answerInfos">
  537. <view class="answerTitle">我的答案</view>
  538. {{
  539. (bank.ques[ansIndex] && bank.ques[ansIndex].text) || ""
  540. }}
  541. <view
  542. class="imgs"
  543. v-if="
  544. bank.ques[ansIndex] &&
  545. bank.ques[ansIndex].imageList.length
  546. "
  547. >
  548. <image
  549. class="img"
  550. :key="quesIndex"
  551. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  552. .imageList"
  553. :src="$method.splitImgHost(ques, true)"
  554. ></image>
  555. </view>
  556. </view>
  557. </view>
  558. </view>
  559. <view>
  560. <view class="pad_8 answerInfos">
  561. <view class="answerTitle">答案解析</view>
  562. <view class="answerContent">
  563. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  564. </view>
  565. </view>
  566. </view>
  567. </template>
  568. </view>
  569. </template>
  570. <view class="footer_btn">
  571. <view
  572. class="collect"
  573. @click="collect(collectList[bankIndex], bankIndex)"
  574. >
  575. <view>
  576. <image src="/static/icon/collect.png" mode=""></image>
  577. <view>收藏</view>
  578. </view>
  579. </view>
  580. <view class="flex_center" @click="openFooterTab">
  581. <view class="up-icon">
  582. <image src="/static/up.png"></image>
  583. </view>
  584. 答题卡
  585. </view>
  586. <view class="collect" @click="pdsubmit">
  587. <view>
  588. <image src="/static/jj.png" mode=""></image>
  589. <view>交卷</view>
  590. </view>
  591. </view>
  592. </view>
  593. </view>
  594. </swiper-item>
  595. </swiper>
  596. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  597. <view class="popupView">
  598. <view class="popupTops">
  599. <view class="topIcon"></view>
  600. 点击编号即可跳转至对应题目
  601. </view>
  602. <view class="popupContent">
  603. <scroll-view scroll-y="true" style="height: 506rpx">
  604. <view class="boxSty">
  605. <view
  606. v-for="(item, index) in questionList"
  607. :key="index"
  608. @click="changeIndex(index)"
  609. :class="{
  610. isRight: isRight(item, index),
  611. isWrong: isWrong(item, index),
  612. isPart: isPart(item, index),
  613. }"
  614. class="liListSty"
  615. >{{ index + 1 }}</view
  616. >
  617. </view>
  618. </scroll-view>
  619. </view>
  620. </view>
  621. </u-popup>
  622. <view class="dialog" v-if="showDialog">
  623. <view class="text">左右滑动切换上下题</view>
  624. <view class="btn" @click="hideDialog">我知道了</view>
  625. </view>
  626. </view>
  627. </template>
  628. <script>
  629. export default {
  630. data() {
  631. return {
  632. id: "",
  633. current: 0,
  634. questionList: [],
  635. ast: ["A", "B", "C", "D", "E", "F", "G"],
  636. judge: ["错误", "正确"],
  637. show: false,
  638. showDialog: false,
  639. bankList: [],
  640. goodsId: "",
  641. recordId: "",
  642. chapterId: "",
  643. moduleId: "",
  644. courseType: 1, //1题库,2视频 商品类型
  645. };
  646. },
  647. onLoad(option) {
  648. this.id = option.id || "";
  649. this.goodsId = option.goodsid || "";
  650. this.chapterId = option.chapterId || "";
  651. this.moduleId = option.moduleId || "";
  652. this.recordId = option.recordId || "";
  653. this.courseType = option.courseType
  654. let showDialog = uni.getStorageSync("showDialog");
  655. if (showDialog) {
  656. this.showDialog = false;
  657. } else {
  658. this.showDialog = true;
  659. uni.setStorageSync("showDialog", "1");
  660. }
  661. this.goodsQuestionList();
  662. },
  663. onUnload() {},
  664. methods: {
  665. /**
  666. * 是否有上传图片
  667. */
  668. hasImgs(bank) {
  669. return bank.ansText.imageList.length == 0;
  670. },
  671. goodsQuestionList() {
  672. if (this.courseType == 2) {
  673. this.$api.bankReportData(this.recordId).then((res) => {
  674. this.questionList = JSON.parse(res.data.data.historyExamJson)
  675. })
  676. } else {
  677. this.$api.examReport(this.recordId).then((res) => {
  678. this.questionList = JSON.parse(res.data.data.historyExamJson);
  679. });
  680. }
  681. },
  682. openFooterTab() {
  683. this.show = true;
  684. },
  685. hideDialog() {
  686. this.showDialog = false;
  687. },
  688. changeIndex(index) {
  689. this.current = index;
  690. },
  691. swiperChange(e) {
  692. this.current = e.detail.current;
  693. },
  694. isRight(item, index) {
  695. //单选
  696. if (this.questionList[index].ques) {
  697. if (item.type == 1) {
  698. return this.questionList[index].ques == this.questionList[index].ans;
  699. //多选
  700. } else if (item.type == 2) {
  701. //每一项都相等
  702. return this.questionList[index].ans.every((item, i) => {
  703. return item == this.questionList[index].ques[i];
  704. });
  705. //判断
  706. } else if (item.type == 3) {
  707. return this.questionList[index].ques == this.questionList[index].ans;
  708. } else {
  709. return false;
  710. }
  711. } else {
  712. return false;
  713. }
  714. },
  715. right(bankIndex, ansIndex, option) {
  716. if (
  717. this.questionList[bankIndex].ques[ansIndex] &&
  718. this.questionList[bankIndex].ans[ansIndex]
  719. ) {
  720. if (
  721. this.questionList[bankIndex].ques[ansIndex].indexOf(
  722. option.optionsId
  723. ) != -1 ||
  724. this.questionList[bankIndex].ans[ansIndex].indexOf(
  725. option.optionsId
  726. ) != -1
  727. ) {
  728. return true;
  729. } else {
  730. return false;
  731. }
  732. } else {
  733. return false;
  734. }
  735. },
  736. wrong(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. isWrong(item, index) {
  758. if (this.questionList[index].ques) {
  759. //单选
  760. if (item.type == 1) {
  761. return this.questionList[index].ques != this.questionList[index].ans;
  762. //多选
  763. } else if (item.type == 2) {
  764. //每一项都相等
  765. return this.questionList[index].ques.some((item, i) => {
  766. return this.questionList[index].ans.indexOf(item) == -1;
  767. });
  768. //判断
  769. } else if (item.type == 3) {
  770. return this.questionList[index].ques != this.questionList[index].ans;
  771. } else {
  772. return false;
  773. }
  774. } else {
  775. return false;
  776. }
  777. },
  778. isPart(item, index) {
  779. if (this.questionList[index].ques) {
  780. if (item.type == 2) {
  781. let isWrong = this.questionList[index].ques.some((item, i) => {
  782. return this.questionList[index].ans.indexOf(item) == -1;
  783. });
  784. let isRight = this.questionList[index].ans.every((item, i) => {
  785. return item == this.questionList[index].ques[i];
  786. });
  787. if (!isRight && !isWrong) {
  788. return true;
  789. }
  790. }
  791. } else {
  792. return false;
  793. }
  794. },
  795. tabSelect(index, bankindex) {
  796. this.$set(this.questionList[bankindex], "current", index);
  797. },
  798. },
  799. };
  800. </script>
  801. <style lang="scss" scoped>
  802. .questionBank {
  803. width: 100%;
  804. height: 100vh;
  805. display: flex;
  806. flex-direction: column;
  807. }
  808. .swiper {
  809. width: 100%;
  810. flex: 1;
  811. }
  812. .lisSty {
  813. margin-bottom: 16rpx;
  814. display: flex;
  815. align-items: center;
  816. .flex_auto {
  817. flex: 1;
  818. }
  819. }
  820. .activeTI {
  821. vertical-align: middle;
  822. display: inline-block;
  823. border: 1rpx solid #eee;
  824. border-radius: 50rpx;
  825. height: 48rpx;
  826. line-height: 46rpx;
  827. text-align: center;
  828. width: 48rpx;
  829. margin-right: 15rpx;
  830. color: #666;
  831. font-size: 30rpx;
  832. &.right {
  833. color: #fff;
  834. background: #36c75a;
  835. }
  836. &.wrong {
  837. color: #fff;
  838. background: #ff3b30;
  839. }
  840. &.checked {
  841. color: #fff;
  842. background: #007aff;
  843. }
  844. }
  845. .submit_checkbox {
  846. position: fixed;
  847. left: 0;
  848. right: 0;
  849. bottom: 120rpx;
  850. margin: 20rpx auto;
  851. width: 526rpx;
  852. height: 80rpx;
  853. background: rgba(0, 122, 255, 1);
  854. color: #fff;
  855. text-align: center;
  856. line-height: 80rpx;
  857. font-size: 30rpx;
  858. border-radius: 40rpx;
  859. }
  860. .titles {
  861. overflow: hidden;
  862. margin-bottom: 24rpx;
  863. }
  864. .titBox {
  865. padding: 41rpx 25rpx 24rpx 25rpx;
  866. }
  867. .titBox_title {
  868. padding: 21rpx;
  869. }
  870. .tabs {
  871. margin: 10rpx;
  872. display: flex;
  873. .tab {
  874. margin: 0 4rpx;
  875. padding: 10rpx 13rpx;
  876. text-align: center;
  877. color: #007aff;
  878. font-size: 28rpx;
  879. border-radius: 16rpx;
  880. background: #fff;
  881. &.current {
  882. color: #fff;
  883. background: #007aff;
  884. }
  885. }
  886. }
  887. .ans {
  888. margin: 8rpx 8rpx 8rpx;
  889. .ans_input {
  890. border-radius: 16rpx;
  891. background: #fff;
  892. .top {
  893. border-bottom: 1rpx solid #eeeeee;
  894. padding: 16rpx;
  895. display: flex;
  896. align-items: center;
  897. .icon {
  898. margin-right: 20rpx;
  899. width: 40rpx;
  900. height: 38rpx;
  901. }
  902. .progress {
  903. flex: 1;
  904. }
  905. .submit {
  906. width: 168rpx;
  907. height: 48rpx;
  908. line-height: 48rpx;
  909. text-align: center;
  910. color: #fff;
  911. font-size: 30rpx;
  912. background: #007aff;
  913. border-radius: 24rpx;
  914. &.disabled {
  915. opacity: 0.6;
  916. }
  917. }
  918. }
  919. .textarea {
  920. textarea {
  921. width: 100%;
  922. height: 287rpx;
  923. padding: 10rpx;
  924. }
  925. }
  926. .imgs {
  927. overflow: hidden;
  928. display: flex;
  929. width: 100%;
  930. .img {
  931. width: 104rpx;
  932. height: 104rpx;
  933. border-radius: 8rpx;
  934. position: relative;
  935. margin: 20rpx;
  936. text {
  937. position: absolute;
  938. right: -15rpx;
  939. top: -15rpx;
  940. width: 30rpx;
  941. height: 30rpx;
  942. text-align: center;
  943. line-height: 30rpx;
  944. color: #fff;
  945. background: #ff3b30;
  946. border-radius: 50%;
  947. }
  948. image {
  949. width: 100%;
  950. height: 100%;
  951. }
  952. }
  953. }
  954. }
  955. .ans_submit {
  956. padding: 16rpx;
  957. border-radius: 16rpx;
  958. background: #fff;
  959. .imgs {
  960. overflow: hidden;
  961. display: flex;
  962. width: 100%;
  963. .img {
  964. width: 104rpx;
  965. height: 104rpx;
  966. border-radius: 8rpx;
  967. position: relative;
  968. margin: 20rpx;
  969. image {
  970. width: 100%;
  971. height: 100%;
  972. }
  973. }
  974. }
  975. }
  976. }
  977. .leftLetters {
  978. display: flex;
  979. align-items: center;
  980. width: 220rpx;
  981. .btnType {
  982. padding: 5rpx 10rpx;
  983. border: 1rpx solid #007aff;
  984. border-radius: 10rpx;
  985. background-color: rgba(0, 122, 255, 0.1);
  986. font-size: 28rpx;
  987. color: #007aff;
  988. margin-right: 15rpx;
  989. }
  990. }
  991. .firstLetter {
  992. display: flex;
  993. justify-content: space-between;
  994. align-items: center;
  995. margin-bottom: 30rpx;
  996. }
  997. .popupView {
  998. height: 100%;
  999. padding-bottom: 100rpx;
  1000. .popupTops {
  1001. height: 77rpx;
  1002. border-bottom: 1rpx solid #eee;
  1003. text-align: center;
  1004. line-height: 77rpx;
  1005. font-size: 24rpx;
  1006. color: #999;
  1007. position: relative;
  1008. .topIcon {
  1009. position: absolute;
  1010. top: 10rpx;
  1011. left: 50%;
  1012. transform: translateX(-50%);
  1013. width: 80rpx;
  1014. height: 8rpx;
  1015. background-color: #999;
  1016. border-radius: 4rpx;
  1017. }
  1018. }
  1019. .popupContent {
  1020. }
  1021. }
  1022. .pageContent {
  1023. position: relative;
  1024. background-color: #eaeef1;
  1025. height: 100%;
  1026. overflow-y: scroll;
  1027. padding-top: 8rpx;
  1028. padding-bottom: 100rpx;
  1029. }
  1030. .pad_8 {
  1031. background-color: #fff;
  1032. margin: 0rpx 8rpx 8rpx;
  1033. border-radius: 16rpx;
  1034. &.no-margin {
  1035. margin-top: -16rpx;
  1036. border-radius: 0 0 16rpx 16rpx;
  1037. }
  1038. }
  1039. .answer {
  1040. height: 80rpx;
  1041. line-height: 80rpx;
  1042. padding: 0rpx 24rpx;
  1043. display: flex;
  1044. align-items: center;
  1045. justify-content: space-between;
  1046. color: #666;
  1047. font-size: 30rpx;
  1048. }
  1049. .footer_btn {
  1050. background-color: #fff;
  1051. z-index: 10078;
  1052. position: fixed;
  1053. bottom: 0rpx;
  1054. display: flex;
  1055. align-items: center;
  1056. justify-content: space-between;
  1057. width: 100%;
  1058. height: 98rpx;
  1059. padding: 0rpx 38rpx;
  1060. border-top: 1rpx solid #eee;
  1061. .flex_center {
  1062. flex: 1;
  1063. display: flex;
  1064. justify-content: center;
  1065. align-items: center;
  1066. flex-direction: column;
  1067. margin: 0 200rpx;
  1068. font-size: 24rpx;
  1069. color: #999999;
  1070. .up-icon {
  1071. margin-bottom: 18rpx;
  1072. width: 100%;
  1073. display: flex;
  1074. justify-content: center;
  1075. image {
  1076. width: 58rpx;
  1077. height: 21rpx;
  1078. }
  1079. }
  1080. }
  1081. .collect {
  1082. visibility: hidden;
  1083. width: 100rpx;
  1084. &.show {
  1085. visibility: visible;
  1086. }
  1087. > view {
  1088. display: flex;
  1089. flex-direction: column;
  1090. align-items: center;
  1091. justify-content: center;
  1092. image {
  1093. width: 32rpx;
  1094. height: 32rpx;
  1095. margin-bottom: 6rpx;
  1096. }
  1097. view {
  1098. font-size: 24rpx;
  1099. color: #999999;
  1100. }
  1101. }
  1102. }
  1103. }
  1104. .boxSty {
  1105. padding: 44rpx 41rpx 0rpx;
  1106. }
  1107. .liListSty {
  1108. border: 1rpx solid #eeeeee;
  1109. width: 88rpx;
  1110. height: 88rpx;
  1111. border-radius: 32rpx;
  1112. text-align: center;
  1113. line-height: 88rpx;
  1114. color: #333;
  1115. font-size: 32rpx;
  1116. float: left;
  1117. margin: 20rpx 23rpx;
  1118. &.isRight {
  1119. border: 1rpx solid #eeeeee;
  1120. color: #fff;
  1121. background: #36c75a;
  1122. }
  1123. &.isWrong {
  1124. border: 1rpx solid #eeeeee;
  1125. color: #fff;
  1126. background: #ff3b30;
  1127. }
  1128. &.isPart {
  1129. border: 1rpx solid #eeeeee;
  1130. color: #fff;
  1131. background: #ffc53d;
  1132. }
  1133. }
  1134. .answerInfos {
  1135. padding: 25rpx 25rpx 25rpx 23rpx;
  1136. }
  1137. .answerTitle {
  1138. margin-bottom: 28rpx;
  1139. color: #666;
  1140. font-size: 30rpx;
  1141. }
  1142. .answerContent {
  1143. font-size: 30rpx;
  1144. color: #666;
  1145. }
  1146. .textChild {
  1147. display: inline-block;
  1148. vertical-align: middle;
  1149. }
  1150. .dialog {
  1151. position: fixed;
  1152. left: 0;
  1153. top: 0;
  1154. width: 100%;
  1155. height: 100%;
  1156. background-color: rgba(0, 0, 0, 0.8);
  1157. display: flex;
  1158. flex-direction: column;
  1159. align-items: center;
  1160. justify-content: center;
  1161. z-index: 20000;
  1162. .pointer {
  1163. width: 338rpx;
  1164. height: 240rpx;
  1165. }
  1166. .text {
  1167. font-size: 32rpx;
  1168. color: #ffffff;
  1169. text-align: center;
  1170. }
  1171. .btn {
  1172. width: 242rpx;
  1173. height: 82rpx;
  1174. border: 2rpx solid #ffffff;
  1175. border-radius: 16rpx;
  1176. text-align: center;
  1177. line-height: 82rpx;
  1178. margin: 41rpx auto;
  1179. color: #fff;
  1180. font-size: 32rpx;
  1181. }
  1182. }
  1183. .popboxs {
  1184. width: 100%;
  1185. height: 100%;
  1186. display: flex;
  1187. flex-direction: column;
  1188. align-items: center;
  1189. }
  1190. .classTops {
  1191. flex-shrink: 0;
  1192. padding: 39rpx 0rpx 4rpx;
  1193. font-weight: bold;
  1194. color: #333;
  1195. font-size: 30rpx;
  1196. }
  1197. .textStys {
  1198. width: 100%;
  1199. flex: 1;
  1200. padding: 36rpx;
  1201. }
  1202. .classFootsty {
  1203. flex-shrink: 0;
  1204. display: flex;
  1205. align-items: center;
  1206. justify-content: center;
  1207. padding: 10rpx 0rpx 40rpx;
  1208. .btnsty {
  1209. width: 200rpx;
  1210. height: 80rpx;
  1211. border-radius: 40rpx;
  1212. font-weight: bold;
  1213. font-size: 30rpx;
  1214. text-align: center;
  1215. line-height: 80rpx;
  1216. }
  1217. .btns1 {
  1218. background-color: #f5f5f5;
  1219. color: #007aff;
  1220. }
  1221. .btns2 {
  1222. margin-left: 40rpx;
  1223. background-color: #007aff;
  1224. color: #ffffff;
  1225. }
  1226. }
  1227. </style>