questionBankWrongExplain.vue 36 KB

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