questionBankWrongExplain.vue 36 KB

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