wrongBank.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903
  1. <template>
  2. <view id="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. @click="radioSelect(item.optionsId, bankIndex)"
  39. >
  40. <view class="activeTI">{{ ast[index] }}</view>
  41. <view class="flex_auto">
  42. {{ item.content }}
  43. <view v-if="item.imgUrl">
  44. <image
  45. style="width: 600rpx"
  46. mode="widthFix"
  47. :src="$method.splitImgHost(item.imgUrl)"
  48. ></image>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view v-if="bank.ques">
  54. <view
  55. v-for="(item, index) in bank.jsonStr"
  56. :key="index"
  57. class="lisSty"
  58. >
  59. <text
  60. :class="{
  61. right:
  62. item.optionsId == bank.ques ||
  63. item.optionsId == bank.ans,
  64. wrong:
  65. item.optionsId == bank.ques && bank.ques != bank.ans,
  66. }"
  67. class="activeTI"
  68. >{{ ast[index] }}</text
  69. >
  70. <view class="flex_auto">
  71. {{ item.content }}
  72. <view v-if="item.imgUrl">
  73. <image
  74. style="width: 600rpx"
  75. mode="widthFix"
  76. :src="$method.splitImgHost(item.imgUrl)"
  77. ></image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view v-if="bank.ques">
  84. <view class="pad_8 answer">
  85. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  86. <view v-if="!explain">我的答案:{{ ast[bank.ques - 1] }}</view>
  87. </view>
  88. <view class="pad_8 answerInfos">
  89. <view class="answerTitle">答案解析</view>
  90. <view class="answerContent">
  91. <rich-text :nodes="bank.analysisContent"></rich-text>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-if="bank.type == 2">
  97. <view class="pad_8 titBox no-margin">
  98. <view v-if="!bank.ques">
  99. <view
  100. v-for="(item, index) in bank.jsonStr"
  101. :key="index"
  102. class="lisSty"
  103. @click="checkboxSelect(item.optionsId, bankIndex, index)"
  104. >
  105. <view :class="{ checked: item.checked }" class="activeTI">{{
  106. ast[index]
  107. }}</view>
  108. <view class="flex_auto">
  109. {{ item.content }}
  110. <view v-if="item.imgUrl">
  111. <image
  112. style="width: 600rpx"
  113. mode="widthFix"
  114. :src="$method.splitImgHost(item.imgUrl)"
  115. ></image>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view
  121. v-if="!bank.ques"
  122. class="submit_checkbox"
  123. :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
  124. @click="checkboxSubmit(bankIndex)"
  125. >
  126. 确认答案
  127. </view>
  128. <view v-if="bank.ques">
  129. <view
  130. v-for="(item, index) in bank.jsonStr"
  131. :key="index"
  132. class="lisSty"
  133. >
  134. <text
  135. :class="{
  136. right:
  137. bank.ques.indexOf(item.optionsId) != -1 ||
  138. bank.ans.indexOf(item.optionsId) != -1,
  139. wrong:
  140. bank.ques.indexOf(item.optionsId) != -1 &&
  141. bank.ans.indexOf(item.optionsId) == -1,
  142. }"
  143. class="activeTI"
  144. >{{ ast[index] }}</text
  145. >
  146. <view class="flex_auto">
  147. {{ item.content }}
  148. <view v-if="item.imgUrl">
  149. <image
  150. style="width: 600rpx"
  151. mode="widthFix"
  152. :src="$method.splitImgHost(item.imgUrl)"
  153. ></image>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <view v-if="bank.ques">
  160. <view class="pad_8 answer">
  161. <view
  162. >正确答案:
  163. <text
  164. :key="ansIndex"
  165. v-for="(ansItem, ansIndex) in bank.ans"
  166. >{{ ast[ansItem - 1] }}</text
  167. >
  168. </view>
  169. <view v-if="!explain"
  170. >我的答案:
  171. <text v-for="quesItem in bank.ques">{{
  172. ast[quesItem - 1]
  173. }}</text>
  174. </view>
  175. </view>
  176. <view class="pad_8 answerInfos">
  177. <view class="answerTitle">答案解析</view>
  178. <view class="answerContent">
  179. <rich-text :nodes="bank.analysisContent"></rich-text>
  180. </view>
  181. </view>
  182. </view>
  183. </template>
  184. <template v-if="bank.type == 3">
  185. <view class="pad_8 titBox no-margin">
  186. <view v-if="!bank.ques">
  187. <view
  188. v-for="(item, index) in judge"
  189. :key="index"
  190. class="lisSty"
  191. @click="judgeSelect(index, bankIndex)"
  192. >
  193. <view class="activeTI">{{ ast[index] }}</view>
  194. <view class="flex_auto">
  195. {{ item }}
  196. <view v-if="item.imgUrl">
  197. <image
  198. style="width: 600rpx"
  199. mode="widthFix"
  200. :src="$method.splitImgHost(item.imgUrl)"
  201. ></image>
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. <view v-if="bank.ques">
  207. <view
  208. v-for="(item, index) in judge"
  209. :key="index"
  210. class="lisSty"
  211. >
  212. <text
  213. :class="{
  214. right: index == bank.ques || index == bank.ans,
  215. wrong: index == bank.ques && bank.ques != bank.ans,
  216. }"
  217. class="activeTI"
  218. >{{ ast[index] }}</text
  219. >
  220. <view class="flex_auto">
  221. {{ item }}
  222. <view v-if="item.imgUrl">
  223. <image
  224. style="width: 600rpx"
  225. mode="widthFix"
  226. :src="$method.splitImgHost(item.imgUrl)"
  227. ></image>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. <view v-if="bank.ques">
  234. <view class="pad_8 answer">
  235. <view>正确答案:{{ ast[bank.ans] }}</view>
  236. <view v-if="!explain">我的答案:{{ ast[bank.ques] }}</view>
  237. </view>
  238. <view class="pad_8 answerInfos">
  239. <view class="answerTitle">答案解析</view>
  240. <view class="answerContent">
  241. <rich-text :nodes="bank.analysisContent"></rich-text>
  242. </view>
  243. </view>
  244. </view>
  245. </template>
  246. <!-- 简答题 -->
  247. <template v-if="bank.type == 5">
  248. <view class="pad_8 titBox">
  249. <view class="ans">
  250. <view class="ans_input" v-if="!bank.ques">
  251. <view class="top flex">
  252. <image
  253. :data-index="bankIndex"
  254. class="icon"
  255. @click="chooseImg(bankIndex)"
  256. src="/static/08-10_032.jpg"
  257. mode=""
  258. ></image>
  259. <view class="progress"
  260. >{{ bank.ansText.imageList.length || "0" }}/4</view
  261. >
  262. <view class="submit" @click="submitAns(bankIndex)"
  263. >确认答案</view
  264. >
  265. </view>
  266. <view class="textarea">
  267. <textarea
  268. v-model="bank.ansText.text"
  269. placeholder="在此输入答案"
  270. ></textarea>
  271. </view>
  272. <view class="imgs">
  273. <view
  274. class="img"
  275. v-for="(img, imgIndex) in bank.ansText.imageList"
  276. >
  277. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  278. <image :src="$method.splitImgHost(img, true)"></image>
  279. </view>
  280. </view>
  281. </view>
  282. <view
  283. class="ans_submit answerInfos"
  284. v-if="bank.ques && !explain"
  285. >
  286. <view class="answerTitle">我的答案:</view>
  287. {{ bank.ques.text }}
  288. <view class="imgs">
  289. <image
  290. class="img"
  291. :key="quesIndex"
  292. v-for="(ques, quesIndex) in bank.ques.imageList"
  293. :src="$method.splitImgHost(ques, true)"
  294. ></image>
  295. </view>
  296. </view>
  297. </view>
  298. </view>
  299. <view v-if="bank.ques">
  300. <view class="pad_8 answerInfos">
  301. <view class="answerTitle">答案解析:</view>
  302. <view class="answerContent">
  303. <rich-text :nodes="bank.analysisContent"></rich-text>
  304. </view>
  305. </view>
  306. </view>
  307. </template>
  308. <!-- 案例题 -->
  309. <template v-if="bank.type == 4">
  310. <view class="tabs">
  311. <view
  312. class="tab"
  313. :class="{ current: tabIndex == bank.current }"
  314. :key="tabIndex"
  315. v-for="(tab, tabIndex) in bank.jsonStr"
  316. @click="tabSelect(tabIndex, bankIndex)"
  317. >问题{{ tabIndex + 1 }}</view
  318. >
  319. </view>
  320. <view
  321. v-for="(ansItem, ansIndex) in bank.jsonStr"
  322. v-if="bank.current == ansIndex"
  323. :key="ansIndex"
  324. >
  325. <template v-if="ansItem.type == 1">
  326. <view class="pad_8 titBox">
  327. <view class="titles">
  328. <rich-text :nodes="ansItem.content"></rich-text>
  329. </view>
  330. <view v-if="!bank.ques[ansIndex]">
  331. <view
  332. v-for="(option, childIndex) in ansItem.optionsList"
  333. :key="childIndex"
  334. class="lisSty"
  335. @click="
  336. radioSelectChild(option.optionsId, ansIndex, bankIndex)
  337. "
  338. >
  339. <view class="activeTI">{{ ast[childIndex] }}</view>
  340. <view class="flex_auto">
  341. <rich-text
  342. class="textChild"
  343. :nodes="option.content"
  344. ></rich-text>
  345. <view v-if="option.imgUrl">
  346. <image
  347. style="width: 600rpx"
  348. mode="widthFix"
  349. :src="$method.splitImgHost(option.imgUrl)"
  350. ></image>
  351. </view>
  352. </view>
  353. </view>
  354. </view>
  355. <view v-if="bank.ques[ansIndex]">
  356. <view
  357. v-for="(option, childIndex) in ansItem.optionsList"
  358. :key="index"
  359. class="lisSty"
  360. >
  361. <text
  362. :class="{
  363. right:
  364. option.optionsId == bank.ques[ansIndex] ||
  365. option.optionsId == bank.ans[ansIndex],
  366. wrong:
  367. option.optionsId == bank.ques[ansIndex] &&
  368. bank.ques[ansIndex] != bank.ans[ansIndex],
  369. }"
  370. class="activeTI"
  371. >{{ ast[childIndex] }}</text
  372. >
  373. <view class="flex_auto">
  374. <rich-text :nodes="option.content"></rich-text>
  375. <view v-if="option.imgUrl">
  376. <image
  377. style="width: 600rpx"
  378. mode="widthFix"
  379. :src="$method.splitImgHost(option.imgUrl)"
  380. ></image>
  381. </view>
  382. </view>
  383. </view>
  384. </view>
  385. </view>
  386. <view v-if="bank.ques[ansIndex]">
  387. <view class="pad_8 answer">
  388. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  389. <view v-if="!explain"
  390. >我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view
  391. >
  392. </view>
  393. <view class="pad_8 answerInfos">
  394. <view class="answerTitle">答案解析</view>
  395. <view class="answerContent">
  396. <rich-text :nodes="option.analysisContent"></rich-text>
  397. </view>
  398. </view>
  399. </view>
  400. </template>
  401. <template v-if="ansItem.type == 2">
  402. <view class="pad_8 titBox">
  403. <view class="titles">
  404. <rich-text :nodes="ansItem.content"></rich-text>
  405. </view>
  406. <view v-if="!bank.ques[ansIndex]">
  407. <view
  408. v-for="(option, childindex) in ansItem.optionsList"
  409. :key="childindex"
  410. class="lisSty"
  411. @click="
  412. checkboxSelectChild(bankIndex, ansIndex, childindex)
  413. "
  414. >
  415. <view
  416. :class="{ checked: option.checked }"
  417. class="activeTI"
  418. >{{ ast[childindex] }}</view
  419. >
  420. <view class="flex_auto">
  421. <rich-text :nodes="option.content"></rich-text>
  422. <view v-if="option.imgUrl">
  423. <image
  424. style="width: 600rpx"
  425. mode="widthFix"
  426. :src="$method.splitImgHost(option.imgUrl)"
  427. ></image>
  428. </view>
  429. </view>
  430. </view>
  431. </view>
  432. <view
  433. v-if="!bank.ques[ansIndex]"
  434. class="submit_checkbox"
  435. :class="{
  436. disabled: !isCheckboxChecked(ansItem.optionsList),
  437. }"
  438. @click="checkboxSubmitChild(bankIndex, ansIndex)"
  439. >
  440. 确认答案
  441. </view>
  442. <view v-if="bank.ques && bank.ques[ansIndex]">
  443. <view
  444. v-for="(option, childindex) in ansItem.optionsList"
  445. :key="childindex"
  446. class="lisSty"
  447. >
  448. <text
  449. :class="{
  450. right: right(bankIndex, ansIndex, option),
  451. wrong: wrong(bankIndex, ansIndex, option),
  452. }"
  453. class="activeTI"
  454. >{{ ast[childindex] }}</text
  455. >
  456. <view class="flex_auto">
  457. <rich-text :nodes="option.content"></rich-text>
  458. <view v-if="option.imgUrl">
  459. <image
  460. style="width: 600rpx"
  461. mode="widthFix"
  462. :src="$method.splitImgHost(option.imgUrl)"
  463. ></image>
  464. </view>
  465. </view>
  466. </view>
  467. </view>
  468. </view>
  469. <view v-if="bank.ques[ansIndex]">
  470. <view class="pad_8 answer">
  471. <view
  472. >正确答案:
  473. <text
  474. :key="ansItemIndex1"
  475. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  476. >{{ ast[ansItem1 - 1] }}</text
  477. >
  478. </view>
  479. <view v-if="!explain"
  480. >我的答案:
  481. <text
  482. :key="quesItemIndex"
  483. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  484. >{{ ast[quesItem - 1] }}</text
  485. >
  486. </view>
  487. </view>
  488. <view class="pad_8 answerInfos">
  489. <view class="answerTitle">答案解析</view>
  490. <view class="answerContent">
  491. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  492. </view>
  493. </view>
  494. </view>
  495. </template>
  496. <template v-if="ansItem.type == 3">
  497. <view class="pad_8 titBox">
  498. <view class="titles">
  499. <rich-text :nodes="ansItem.content"></rich-text>
  500. </view>
  501. <view v-if="!bank.ques[ansIndex]">
  502. <view
  503. v-for="(option, childindex) in judge"
  504. :key="childindex"
  505. class="lisSty"
  506. @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
  507. >
  508. <view class="activeTI">{{ ast[childindex] }}</view>
  509. <view class="flex_auto">
  510. {{ option }}
  511. <view v-if="option.imgUrl">
  512. <image
  513. style="width: 600rpx"
  514. mode="widthFix"
  515. :src="$method.splitImgHost(option.imgUrl)"
  516. ></image>
  517. </view>
  518. </view>
  519. </view>
  520. </view>
  521. <view v-if="bank.ques[ansIndex]">
  522. <view
  523. v-for="(option, childindex) in judge"
  524. :key="childindex"
  525. class="lisSty"
  526. >
  527. <text
  528. :class="{
  529. right:
  530. childindex == bank.ques[ansIndex] ||
  531. childindex == bank.ans[ansIndex],
  532. wrong:
  533. childindex == bank.ques[ansIndex] &&
  534. bank.ques[ansIndex] != bank.ans[ansIndex],
  535. }"
  536. class="activeTI"
  537. >{{ ast[childindex] }}</text
  538. >
  539. <view class="flex_auto">
  540. {{ option }}
  541. <view v-if="option.imgUrl">
  542. <image
  543. style="width: 600rpx"
  544. mode="widthFix"
  545. :src="$method.splitImgHost(option.imgUrl)"
  546. ></image>
  547. </view>
  548. </view>
  549. </view>
  550. </view>
  551. </view>
  552. <view v-if="bank.ques[ansIndex]">
  553. <view class="pad_8 answer">
  554. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  555. <view v-if="!explain"
  556. >我的答案:{{ ast[bank.ques[ansIndex]] }}</view
  557. >
  558. </view>
  559. <view class="pad_8 answerInfos">
  560. <view class="answerTitle">答案解析</view>
  561. <view class="answerContent">
  562. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  563. </view>
  564. </view>
  565. </view>
  566. </template>
  567. <!-- 简答题 -->
  568. <template v-if="ansItem.type == 5">
  569. <view class="pad_8 titBox_title">
  570. <view class="titles">
  571. <rich-text :nodes="ansItem.content"></rich-text>
  572. </view>
  573. </view>
  574. <view class="pad_8 titBox_title">
  575. <view class="ans">
  576. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  577. <view class="top flex">
  578. <image
  579. class="icon"
  580. @click="chooseImgChild(bankIndex, ansIndex)"
  581. src="/static/08-10_032.jpg"
  582. mode=""
  583. ></image>
  584. <view class="progress"
  585. >{{ ansItem.ansText.imageList.length || "0" }}/4</view
  586. >
  587. <view
  588. class="submit"
  589. @click="submitAnsChild(bankIndex, ansIndex)"
  590. >确认答案</view
  591. >
  592. </view>
  593. <view class="textarea">
  594. <textarea
  595. v-model="ansItem.ansText.text"
  596. placeholder="在此输入答案"
  597. ></textarea>
  598. </view>
  599. <view class="imgs">
  600. <view
  601. class="img"
  602. v-for="(img, imgIndex) in ansItem.ansText.imageList"
  603. :key="imgIndex"
  604. >
  605. <text
  606. @click="
  607. deleteImgChild(imgIndex, bankIndex, ansIndex)
  608. "
  609. >x</text
  610. >
  611. <image :src="$method.splitImgHost(img, true)"></image>
  612. </view>
  613. </view>
  614. </view>
  615. <view
  616. class="ans_submit answerInfos"
  617. v-if="bank.ques[ansIndex] && !explain"
  618. >
  619. <view class="answerTitle">我的答案</view>
  620. {{ bank.ques[ansIndex].text }}
  621. <view class="imgs">
  622. <image
  623. class="img"
  624. :key="quesIndex"
  625. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  626. .imageList"
  627. :src="$method.splitImgHost(ques, true)"
  628. ></image>
  629. </view>
  630. </view>
  631. </view>
  632. </view>
  633. <view v-if="bank.ques[ansIndex]">
  634. <view class="pad_8 answerInfos">
  635. <view class="answerTitle">答案解析</view>
  636. <view class="answerContent">
  637. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  638. </view>
  639. </view>
  640. </view>
  641. </template>
  642. </view>
  643. </template>
  644. <view class="footer_btn">
  645. <view class="flex_center" @click="openFooterTab">
  646. <view class="up-icon">
  647. <image src="/static/up.png"></image>
  648. </view>
  649. 答题卡
  650. </view>
  651. <view class="collect" :class="{ show: !explain }" @click="pdsubmit">
  652. <view>
  653. <image src="/static/jj.png" mode=""></image>
  654. <view>交卷</view>
  655. </view>
  656. </view>
  657. </view>
  658. </view>
  659. </swiper-item>
  660. </swiper>
  661. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  662. <view class="popupView">
  663. <view class="popupTops">
  664. <view class="topIcon"></view>
  665. 点击编号即可跳转至对应题目
  666. </view>
  667. <view class="popupContent">
  668. <scroll-view scroll-y="true" style="height: 506rpx">
  669. <view class="boxSty">
  670. <view
  671. v-for="(item, index) in questionList"
  672. :key="index"
  673. @click="changeIndex(index)"
  674. :class="{
  675. isRight: isRight(item, index),
  676. isWrong: isWrong(item, index),
  677. isPart: isPart(item, index),
  678. }"
  679. class="liListSty"
  680. >{{ index + 1 }}</view
  681. >
  682. </view>
  683. </scroll-view>
  684. </view>
  685. </view>
  686. </u-popup>
  687. <view class="dialog" v-if="showDialog">
  688. <image src="/static/pointer.png" class="pointer" mode=""></image>
  689. <view class="text">左右滑动切换上下题</view>
  690. <view class="btn" @click="hideDialog">我知道了</view>
  691. </view>
  692. </view>
  693. </template>
  694. <script>
  695. export default {
  696. data() {
  697. return {
  698. id: "",
  699. current: 0,
  700. questionList: [],
  701. ast: ["A", "B", "C", "D", "E", "F", "G"],
  702. judge: ["错误", "正确"],
  703. show: false,
  704. showDialog: false,
  705. isFromReport: "", //来自答题报告
  706. bankList: [],
  707. collectList: [],
  708. goodsId: "",
  709. examId: "",
  710. explain: "",
  711. orderGoodsId: "",
  712. };
  713. },
  714. onLoad(option) {
  715. this.orderGoodsId = option.orderGoodsId;
  716. this.id = option.id || "";
  717. this.examId = option.examId || "";
  718. this.isFromReport = option.isFromReport;
  719. this.explain = option.explain || "";
  720. let showDialog = uni.getStorageSync("showDialog");
  721. if (showDialog) {
  722. this.showDialog = false;
  723. } else {
  724. this.showDialog = true;
  725. uni.setStorageSync("showDialog", "1");
  726. }
  727. // if(this.isFromReport) { //通过答题报告查询错题列表
  728. // console.log(2)
  729. // this.wrongRecordList();
  730. // } else { //通过错题集查询错题列表
  731. // console.log(1)
  732. this.wrongRecordExamQuestionList();
  733. // }
  734. },
  735. onUnload() {},
  736. methods: {
  737. /**
  738. * 通过答题报告查询错题列表
  739. */
  740. wrongRecordList() {
  741. this.$api
  742. .wrongRecordList({
  743. recordId: this.id,
  744. })
  745. .then((res) => {
  746. res.data.rows.forEach((item, index) => {
  747. if (typeof item.jsonStr == "string") {
  748. item.jsonStr = JSON.parse(item.jsonStr);
  749. if (item.type == 2) {
  750. //多选
  751. item.jsonStr.forEach((str) => {
  752. str.optionsId = "" + str.optionsId;
  753. });
  754. let arr = item.answerQuestion.split(",");
  755. arr.forEach((a, i) => {
  756. arr[i] = "" + a;
  757. });
  758. item.ans = arr;
  759. if (this.explain) {
  760. item.ques = item.ans;
  761. }
  762. item.analysisContent &&
  763. (item.analysisContent = item.analysisContent.replace(
  764. /<img/gi,
  765. '<img style="max-width:100%;"'
  766. ));
  767. return;
  768. } else if (item.type == 5) {
  769. item.ansText = {
  770. text: "",
  771. imageList: [],
  772. };
  773. item.analysisContent &&
  774. (item.analysisContent = item.analysisContent.replace(
  775. /<img/gi,
  776. '<img style="max-width:100%;"'
  777. ));
  778. if (this.explain) {
  779. item.ques = {
  780. text: item.analysisContent,
  781. };
  782. return;
  783. }
  784. } else if (item.type == 4) {
  785. console.log(item.jsonStr);
  786. item.ques = [];
  787. item.current = 0;
  788. let ansArr = [];
  789. item.jsonStr.forEach((json, index) => {
  790. if (json.type == 1) {
  791. ansArr[index] = json.answerQuestion;
  792. json.content &&
  793. (json.content = json.content.replace(
  794. /<img/gi,
  795. '<img style="max-width:100%;"'
  796. ));
  797. } else if (json.type == 2) {
  798. json.optionsList.forEach((str) => {
  799. str.optionsId = "" + str.optionsId;
  800. });
  801. let arr = json.answerQuestion.split(",");
  802. arr.forEach((a, i) => {
  803. arr[i] = "" + a;
  804. });
  805. ansArr[index] = arr;
  806. json.content &&
  807. (json.content = json.content.replace(
  808. /<img/gi,
  809. '<img style="max-width:100%;"'
  810. ));
  811. } else if (json.type == 3) {
  812. ansArr[index] = json.answerQuestion;
  813. json.content &&
  814. (json.content = json.content.replace(
  815. /<img/gi,
  816. '<img style="max-width:100%;"'
  817. ));
  818. } else if (json.type == 5) {
  819. ansArr[index] = {
  820. text: "",
  821. imageList: [],
  822. };
  823. json.ansText = {
  824. text: "",
  825. imageList: [],
  826. };
  827. json.content &&
  828. (json.content = json.content.replace(
  829. /<img/gi,
  830. '<img style="max-width:100%;"'
  831. ));
  832. }
  833. });
  834. item.ans = ansArr;
  835. item.analysisContent &&
  836. (item.analysisContent = item.analysisContent.replace(
  837. /<img/gi,
  838. '<img style="max-width:100%;"'
  839. ));
  840. if (this.explain) {
  841. item.ques = item.ans;
  842. }
  843. return;
  844. }
  845. item.ans = item.answerQuestion;
  846. if (this.explain) {
  847. item.ques = item.ans;
  848. }
  849. } else {
  850. if (this.explain) {
  851. item.ques = item.ans;
  852. }
  853. }
  854. });
  855. this.questionList = res.data.rows;
  856. });
  857. },
  858. /**
  859. * 通过错题集查询错题列表
  860. */
  861. wrongRecordExamQuestionList() {
  862. this.$api
  863. .wrongRecordExamQuestionList({
  864. examId: this.examId,
  865. recordId: this.id,
  866. })
  867. .then((res) => {
  868. res.data.rows.forEach((item, index) => {
  869. if (typeof item.jsonStr == "string") {
  870. item.jsonStr = JSON.parse(item.jsonStr);
  871. if (item.type == 2) {
  872. //多选
  873. item.jsonStr.forEach((str) => {
  874. str.optionsId = "" + str.optionsId;
  875. });
  876. let arr = item.answerQuestion.split(",");
  877. arr.forEach((a, i) => {
  878. arr[i] = "" + a;
  879. });
  880. item.ans = arr;
  881. item.analysisContent &&
  882. (item.analysisContent = item.analysisContent.replace(
  883. /<img/gi,
  884. '<img style="max-width:100%;"'
  885. ));
  886. item.content &&
  887. (item.content = item.content.replace(
  888. /<img/gi,
  889. '<img style="max-width:100%;"'
  890. ));
  891. if (this.explain) {
  892. item.ques = item.ans;
  893. }
  894. return;
  895. } else if (item.type == 5) {
  896. item.ansText = {
  897. text: "",
  898. imageList: [],
  899. };
  900. item.analysisContent &&
  901. (item.analysisContent = item.analysisContent.replace(
  902. /<img/gi,
  903. '<img style="max-width:100%;"'
  904. ));
  905. item.content &&
  906. (item.content = item.content.replace(
  907. /<img/gi,
  908. '<img style="max-width:100%;"'
  909. ));
  910. if (this.explain) {
  911. item.ques = {
  912. text: item.analysisContent,
  913. };
  914. return;
  915. }
  916. } else if (item.type == 4) {
  917. console.log(item.jsonStr);
  918. item.ques = [];
  919. item.current = 0;
  920. let ansArr = [];
  921. item.jsonStr.forEach((json, index) => {
  922. if (json.type == 1) {
  923. ansArr[index] = json.answerQuestion;
  924. } else if (json.type == 2) {
  925. json.optionsList.forEach((str) => {
  926. str.optionsId = "" + str.optionsId;
  927. });
  928. let arr = json.answerQuestion.split(",");
  929. arr.forEach((a, i) => {
  930. arr[i] = "" + a;
  931. });
  932. ansArr[index] = arr;
  933. } else if (json.type == 3) {
  934. ansArr[index] = json.answerQuestion;
  935. } else if (json.type == 5) {
  936. ansArr[index] = {
  937. text: "",
  938. imageList: [],
  939. };
  940. json.ansText = {
  941. text: "",
  942. imageList: [],
  943. };
  944. }
  945. });
  946. item.ans = ansArr;
  947. item.analysisContent &&
  948. (item.analysisContent = item.analysisContent.replace(
  949. /<img/gi,
  950. '<img style="max-width:100%;"'
  951. ));
  952. item.content &&
  953. (item.content = item.content.replace(
  954. /<img/gi,
  955. '<img style="max-width:100%;"'
  956. ));
  957. if (this.explain) {
  958. item.ques = item.ans;
  959. }
  960. return;
  961. }
  962. item.analysisContent &&
  963. (item.analysisContent = item.analysisContent.replace(
  964. /<img/gi,
  965. '<img style="max-width:100%;"'
  966. ));
  967. item.content &&
  968. (item.content = item.content.replace(
  969. /<img/gi,
  970. '<img style="max-width:100%;"'
  971. ));
  972. item.ans = item.answerQuestion;
  973. if (this.explain) {
  974. item.ques = item.ans;
  975. }
  976. } else {
  977. if (this.explain) {
  978. item.ques = item.ans;
  979. }
  980. }
  981. });
  982. this.questionList = res.data.rows;
  983. });
  984. },
  985. /**
  986. * @param {Object} e单选点击
  987. */
  988. radioSelect(optionsId, bindex) {
  989. if (this.questionList[bindex].ques) return;
  990. this.$set(this.questionList[bindex], "ques", optionsId);
  991. // 回答错误
  992. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  993. } else {
  994. this.$api
  995. .wrongRecordDelete({
  996. examId: this.questionList[bindex].examId,
  997. orderGoodsId: this.questionList[bindex].orderGoodsId,
  998. questionId: this.questionList[bindex].questionId,
  999. })
  1000. .then((res) => {});
  1001. }
  1002. },
  1003. /**
  1004. * @param {Object} e单选点击
  1005. */
  1006. radioSelectChild(optionsId, ansIndex, bindex) {
  1007. if (this.questionList[bindex].ques[ansIndex]) return;
  1008. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1009. },
  1010. /**
  1011. * @param {Object} 多选点击
  1012. */
  1013. checkboxSelect(optionsId, bindex, index) {
  1014. this.$set(
  1015. this.questionList[bindex].jsonStr[index],
  1016. "checked",
  1017. !this.questionList[bindex].jsonStr[index].checked
  1018. );
  1019. },
  1020. /**
  1021. * @param {Object} 多选点击
  1022. */
  1023. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1024. this.$set(
  1025. this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
  1026. "checked",
  1027. !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
  1028. .checked
  1029. );
  1030. },
  1031. isCheckboxChecked(arr) {
  1032. return arr.some((item) => {
  1033. if (item.checked) {
  1034. return true;
  1035. }
  1036. });
  1037. },
  1038. /**
  1039. * @param {Object} 多选确认
  1040. */
  1041. checkboxSubmit(bindex) {
  1042. if (this.questionList[bindex].ques) return;
  1043. let arr = [];
  1044. this.questionList[bindex].jsonStr.forEach((item) => {
  1045. if (item.checked) {
  1046. arr.push(item.optionsId);
  1047. }
  1048. });
  1049. if (!arr.length) {
  1050. uni.showToast({
  1051. title: "请选择答案",
  1052. icon: "none",
  1053. });
  1054. return;
  1055. }
  1056. this.$set(this.questionList[bindex], "ques", arr);
  1057. let isWrong = this.questionList[bindex].ques.some(
  1058. (quesItem, quesIndex) => {
  1059. return (
  1060. this.questionList[bindex].ques[quesIndex] !=
  1061. this.questionList[bindex].ans[quesIndex]
  1062. );
  1063. }
  1064. );
  1065. // 回答错误
  1066. if (isWrong) {
  1067. } else {
  1068. let question = this.questionList.find(
  1069. (item) => item.questionId == this.questionList[bindex].questionId
  1070. );
  1071. if (question) {
  1072. this.$api
  1073. .wrongRecordDelete({
  1074. examId: question.examId,
  1075. orderGoodsId: question.orderGoodsId,
  1076. questionId: question.questionId,
  1077. })
  1078. .then((res) => {});
  1079. }
  1080. }
  1081. },
  1082. /**
  1083. * @param {Object} 多选确认
  1084. */
  1085. checkboxSubmitChild(bindex, ansIndex) {
  1086. if (this.questionList[bindex].ques[ansIndex]) return;
  1087. let arr = [];
  1088. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
  1089. (item) => {
  1090. if (item.checked) {
  1091. arr.push(item.optionsId);
  1092. }
  1093. }
  1094. );
  1095. if (!arr.length) {
  1096. uni.showToast({
  1097. title: "请选择答案",
  1098. icon: "none",
  1099. });
  1100. return;
  1101. }
  1102. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1103. },
  1104. judgeSelect(index, bindex) {
  1105. if (this.questionList[bindex].ques) return;
  1106. this.$set(this.questionList[bindex], "ques", index + "");
  1107. // 回答错误
  1108. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1109. } else {
  1110. this.$api
  1111. .wrongRecordDelete({
  1112. examId: this.questionList[bindex].examId,
  1113. orderGoodsId: this.questionList[bindex].orderGoodsId,
  1114. questionId: this.questionList[bindex].questionId,
  1115. })
  1116. .then((res) => {});
  1117. }
  1118. },
  1119. judgeSelectChild(ansindex, childindex, bindex) {
  1120. if (this.questionList[bindex].ques[ansindex]) return;
  1121. this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
  1122. },
  1123. openFooterTab() {
  1124. this.show = true;
  1125. },
  1126. hideDialog() {
  1127. this.showDialog = false;
  1128. },
  1129. changeIndex(index) {
  1130. this.current = index;
  1131. },
  1132. swiperChange(e) {
  1133. this.current = e.detail.current;
  1134. },
  1135. deleteImg(imgIndex, bankIndex) {
  1136. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1137. },
  1138. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1139. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
  1140. imgIndex,
  1141. 1
  1142. );
  1143. },
  1144. chooseImg(bankindex) {
  1145. uni.chooseImage({
  1146. count: 1, //默认9
  1147. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1148. sourceType: ["album", "camera"], //从相册选择
  1149. success: (res) => {
  1150. let self = this;
  1151. // console.log(JSON.stringify(res.tempFilePaths));
  1152. let img = res.tempFilePaths[0];
  1153. uni.getImageInfo({
  1154. src: img,
  1155. success: async (res) => {
  1156. let canvasWidth = res.width; //图片原始长宽
  1157. let canvasHeight = res.height;
  1158. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1159. uni.compressImage({
  1160. src: img,
  1161. quality: 75,
  1162. width: "50%",
  1163. height: "50%",
  1164. success: async (rest) => {
  1165. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1166. this.questionList[bankindex].ansText.imageList.push(dir);
  1167. },
  1168. });
  1169. } else {
  1170. const dir = await self.uploadFile(img, 0);
  1171. this.questionList[bankindex].ansText.imageList.push(dir);
  1172. }
  1173. },
  1174. });
  1175. },
  1176. });
  1177. },
  1178. chooseImgChild(bankindex, ansindex) {
  1179. uni.chooseImage({
  1180. count: 1, //默认9
  1181. sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
  1182. sourceType: ["album", "camera"], //从相册选择
  1183. success: (res) => {
  1184. let self = this;
  1185. // console.log(JSON.stringify(res.tempFilePaths));
  1186. let img = res.tempFilePaths[0];
  1187. uni.getImageInfo({
  1188. src: img,
  1189. success: async (res) => {
  1190. let canvasWidth = res.width; //图片原始长宽
  1191. let canvasHeight = res.height;
  1192. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1193. uni.compressImage({
  1194. src: img,
  1195. quality: 75,
  1196. width: "50%",
  1197. height: "50%",
  1198. success: async (rest) => {
  1199. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1200. this.questionList[bankindex].jsonStr[
  1201. ansindex
  1202. ].ansText.imageList.push(dir);
  1203. },
  1204. });
  1205. } else {
  1206. const dir = await self.uploadFile(img, 0);
  1207. this.questionList[bankindex].jsonStr[
  1208. ansindex
  1209. ].ansText.imageList.push(dir);
  1210. }
  1211. },
  1212. });
  1213. },
  1214. });
  1215. },
  1216. uploadFile(options, int) {
  1217. var self = this;
  1218. return new Promise((resolve, reject) => {
  1219. var data = {
  1220. imageStatus: int,
  1221. };
  1222. self.$api.aliyunpolicy(data).then((res) => {
  1223. console.log(res.data, 6);
  1224. if (res.data.code != 200) {
  1225. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1226. return;
  1227. }
  1228. var ossToken = res.data.data.resultContent;
  1229. if (ossToken.host == null || ossToken.host == undefined) {
  1230. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1231. return;
  1232. }
  1233. uni.uploadFile({
  1234. url: ossToken.host,
  1235. name: "file",
  1236. filePath: options,
  1237. fileType: "image",
  1238. header: {
  1239. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1240. },
  1241. formData: {
  1242. key: ossToken.dir,
  1243. OSSAccessKeyId: ossToken.accessid,
  1244. policy: ossToken.policy,
  1245. Signature: ossToken.signature,
  1246. callback: ossToken.callback,
  1247. success_action_status: 200,
  1248. },
  1249. success: (result) => {
  1250. if (result.statusCode === 200) {
  1251. resolve(ossToken.dir);
  1252. } else {
  1253. uni.showToast({
  1254. title: "上传失败",
  1255. icon: "none",
  1256. });
  1257. return;
  1258. }
  1259. },
  1260. fail: (error) => {
  1261. uni.showToast({
  1262. title: "上传接口报错" + error,
  1263. icon: "none",
  1264. });
  1265. return;
  1266. },
  1267. });
  1268. });
  1269. });
  1270. },
  1271. submitAns(bankindex) {
  1272. console.log(this.questionList[bankindex]);
  1273. if (
  1274. !this.questionList[bankindex].ansText.text &&
  1275. !this.questionList[bankindex].ansText.imageList.length
  1276. ) {
  1277. uni.showToast({
  1278. title: "请输入内容或上传图片",
  1279. duration: 2000,
  1280. icon: "none",
  1281. });
  1282. return;
  1283. }
  1284. this.$set(this.questionList[bankindex], "ques", {
  1285. imageList: this.questionList[bankindex].ansText.imageList,
  1286. text: this.questionList[bankindex].ansText.text,
  1287. });
  1288. },
  1289. submitAnsChild(bankindex, ansindex) {
  1290. if (
  1291. !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
  1292. !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
  1293. ) {
  1294. uni.showToast({
  1295. title: "请输入内容或上传图片",
  1296. duration: 2000,
  1297. icon: "none",
  1298. });
  1299. return;
  1300. }
  1301. this.$set(this.questionList[bankindex].ques, ansindex, {
  1302. imageList:
  1303. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1304. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  1305. });
  1306. },
  1307. isRight(item, index) {
  1308. //单选
  1309. if (this.questionList[index].ques) {
  1310. if (item.type == 1) {
  1311. return this.questionList[index].ques == this.questionList[index].ans;
  1312. //多选
  1313. } else if (item.type == 2) {
  1314. //每一项都相等
  1315. return this.questionList[index].ans.every((item, i) => {
  1316. return item == this.questionList[index].ques[i];
  1317. });
  1318. //判断
  1319. } else if (item.type == 3) {
  1320. return this.questionList[index].ques == this.questionList[index].ans;
  1321. } else {
  1322. return false;
  1323. }
  1324. } else {
  1325. return false;
  1326. }
  1327. },
  1328. right(bankIndex, ansIndex, option) {
  1329. if (
  1330. this.questionList[bankIndex].ques[ansIndex] &&
  1331. this.questionList[bankIndex].ans[ansIndex]
  1332. ) {
  1333. if (
  1334. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1335. option.optionsId
  1336. ) != -1 ||
  1337. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1338. option.optionsId
  1339. ) != -1
  1340. ) {
  1341. return true;
  1342. } else {
  1343. return false;
  1344. }
  1345. } else {
  1346. return false;
  1347. }
  1348. },
  1349. wrong(bankIndex, ansIndex, option) {
  1350. if (
  1351. this.questionList[bankIndex].ques[ansIndex] &&
  1352. this.questionList[bankIndex].ans[ansIndex]
  1353. ) {
  1354. if (
  1355. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1356. option.optionsId
  1357. ) != -1 &&
  1358. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1359. option.optionsId
  1360. ) == -1
  1361. ) {
  1362. return true;
  1363. } else {
  1364. return false;
  1365. }
  1366. } else {
  1367. return false;
  1368. }
  1369. },
  1370. isWrong(item, index) {
  1371. if (this.questionList[index].ques) {
  1372. //单选
  1373. if (item.type == 1) {
  1374. return this.questionList[index].ques != this.questionList[index].ans;
  1375. //多选
  1376. } else if (item.type == 2) {
  1377. //每一项都相等
  1378. return this.questionList[index].ques.some((item, i) => {
  1379. return this.questionList[index].ans.indexOf(item) == -1;
  1380. });
  1381. //判断
  1382. } else if (item.type == 3) {
  1383. return this.questionList[index].ques != this.questionList[index].ans;
  1384. } else {
  1385. return false;
  1386. }
  1387. } else {
  1388. return false;
  1389. }
  1390. },
  1391. isPart(item, index) {
  1392. if (this.questionList[index].ques) {
  1393. if (item.type == 2) {
  1394. let isWrong = this.questionList[index].ques.some((item, i) => {
  1395. return this.questionList[index].ans.indexOf(item) == -1;
  1396. });
  1397. let isRight = this.questionList[index].ans.every((item, i) => {
  1398. return item == this.questionList[index].ques[i];
  1399. });
  1400. if (!isRight && !isWrong) {
  1401. return true;
  1402. }
  1403. }
  1404. } else {
  1405. return false;
  1406. }
  1407. },
  1408. tabSelect(index, bankindex) {
  1409. this.$set(this.questionList[bankindex], "current", index);
  1410. },
  1411. pdsubmit() {
  1412. uni.showToast({
  1413. icon: "none",
  1414. title: "交卷成功",
  1415. duration: 1000,
  1416. });
  1417. setTimeout(() => {
  1418. uni.navigateBack({
  1419. delta: 1,
  1420. });
  1421. }, 1000);
  1422. },
  1423. },
  1424. };
  1425. </script>
  1426. <style lang="scss" scoped>
  1427. #questionBank {
  1428. width: 100%;
  1429. height: 100vh;
  1430. display: flex;
  1431. flex-direction: column;
  1432. }
  1433. .swiper {
  1434. width: 100%;
  1435. flex: 1;
  1436. }
  1437. .lisSty {
  1438. margin-bottom: 16rpx;
  1439. display: flex;
  1440. align-items: center;
  1441. .flex_auto {
  1442. flex: 1;
  1443. }
  1444. }
  1445. .activeTI {
  1446. vertical-align: middle;
  1447. display: inline-block;
  1448. border: 1rpx solid #eee;
  1449. border-radius: 50rpx;
  1450. height: 48rpx;
  1451. line-height: 46rpx;
  1452. text-align: center;
  1453. width: 48rpx;
  1454. margin-right: 15rpx;
  1455. color: #666;
  1456. font-size: 30rpx;
  1457. &.right {
  1458. color: #fff;
  1459. background: #36c75a;
  1460. }
  1461. &.wrong {
  1462. color: #fff;
  1463. background: #ff3b30;
  1464. }
  1465. &.checked {
  1466. color: #fff;
  1467. background: #007aff;
  1468. }
  1469. }
  1470. .submit_checkbox {
  1471. position: fixed;
  1472. left: 0;
  1473. right: 0;
  1474. bottom: 120rpx;
  1475. margin: 20rpx auto;
  1476. width: 526rpx;
  1477. height: 80rpx;
  1478. background: rgba(0, 122, 255, 1);
  1479. color: #fff;
  1480. text-align: center;
  1481. line-height: 80rpx;
  1482. font-size: 30rpx;
  1483. border-radius: 40rpx;
  1484. &.disabled {
  1485. opacity: 0.6;
  1486. }
  1487. }
  1488. .titles {
  1489. overflow: hidden;
  1490. margin-bottom: 24rpx;
  1491. }
  1492. .titBox {
  1493. padding: 41rpx 25rpx 24rpx 25rpx;
  1494. }
  1495. .titBox_title {
  1496. padding: 21rpx;
  1497. }
  1498. .tabs {
  1499. margin: 10rpx;
  1500. display: flex;
  1501. .tab {
  1502. margin: 0 4rpx;
  1503. padding: 10rpx 13rpx;
  1504. text-align: center;
  1505. color: #007aff;
  1506. font-size: 28rpx;
  1507. border-radius: 16rpx;
  1508. background: #fff;
  1509. &.current {
  1510. color: #fff;
  1511. background: #007aff;
  1512. }
  1513. }
  1514. }
  1515. .ans {
  1516. margin: 8rpx 8rpx 8rpx;
  1517. .ans_input {
  1518. border-radius: 16rpx;
  1519. background: #fff;
  1520. .top {
  1521. border-bottom: 1rpx solid #eeeeee;
  1522. padding: 16rpx;
  1523. display: flex;
  1524. align-items: center;
  1525. .icon {
  1526. margin-right: 20rpx;
  1527. width: 40rpx;
  1528. height: 38rpx;
  1529. }
  1530. .progress {
  1531. flex: 1;
  1532. }
  1533. .submit {
  1534. width: 168rpx;
  1535. height: 48rpx;
  1536. line-height: 48rpx;
  1537. text-align: center;
  1538. color: #fff;
  1539. font-size: 30rpx;
  1540. background: #007aff;
  1541. border-radius: 24rpx;
  1542. }
  1543. }
  1544. .textarea {
  1545. textarea {
  1546. width: 100%;
  1547. height: 287rpx;
  1548. padding: 10rpx;
  1549. }
  1550. }
  1551. .imgs {
  1552. overflow: hidden;
  1553. display: flex;
  1554. width: 100%;
  1555. .img {
  1556. width: 104rpx;
  1557. height: 104rpx;
  1558. border-radius: 8rpx;
  1559. position: relative;
  1560. margin: 20rpx;
  1561. text {
  1562. position: absolute;
  1563. right: -15rpx;
  1564. top: -15rpx;
  1565. width: 30rpx;
  1566. height: 30rpx;
  1567. text-align: center;
  1568. line-height: 30rpx;
  1569. color: #fff;
  1570. background: #ff3b30;
  1571. border-radius: 50%;
  1572. }
  1573. image {
  1574. width: 100%;
  1575. height: 100%;
  1576. }
  1577. }
  1578. }
  1579. }
  1580. .ans_submit {
  1581. padding: 16rpx;
  1582. border-radius: 16rpx;
  1583. background: #fff;
  1584. .imgs {
  1585. overflow: hidden;
  1586. display: flex;
  1587. width: 100%;
  1588. .img {
  1589. width: 104rpx;
  1590. height: 104rpx;
  1591. border-radius: 8rpx;
  1592. position: relative;
  1593. margin: 20rpx;
  1594. image {
  1595. width: 100%;
  1596. height: 100%;
  1597. }
  1598. }
  1599. }
  1600. }
  1601. }
  1602. .firstLetter {
  1603. display: flex;
  1604. justify-content: space-between;
  1605. align-items: center;
  1606. margin-bottom: 30rpx;
  1607. .leftLetters {
  1608. display: flex;
  1609. align-items: center;
  1610. width: 220rpx;
  1611. .btnType {
  1612. padding: 5rpx 10rpx;
  1613. border: 1rpx solid #007aff;
  1614. border-radius: 10rpx;
  1615. background-color: rgba(0, 122, 255, 0.1);
  1616. font-size: 28rpx;
  1617. color: #007aff;
  1618. margin-right: 15rpx;
  1619. }
  1620. }
  1621. }
  1622. .popupView {
  1623. height: 100%;
  1624. padding-bottom: 100rpx;
  1625. .popupTops {
  1626. height: 77rpx;
  1627. border-bottom: 1rpx solid #eee;
  1628. text-align: center;
  1629. line-height: 77rpx;
  1630. font-size: 24rpx;
  1631. color: #999;
  1632. position: relative;
  1633. .topIcon {
  1634. position: absolute;
  1635. top: 10rpx;
  1636. left: 50%;
  1637. transform: translateX(-50%);
  1638. width: 80rpx;
  1639. height: 8rpx;
  1640. background-color: #999;
  1641. border-radius: 4rpx;
  1642. }
  1643. }
  1644. .popupContent {
  1645. }
  1646. }
  1647. .pageContent {
  1648. position: relative;
  1649. background-color: #eaeef1;
  1650. height: 100%;
  1651. overflow-y: scroll;
  1652. padding-top: 8rpx;
  1653. padding-bottom: 100rpx;
  1654. }
  1655. .pad_8 {
  1656. background-color: #fff;
  1657. margin: 0rpx 8rpx 8rpx;
  1658. border-radius: 16rpx;
  1659. &.no-margin {
  1660. margin-top: -16rpx;
  1661. border-radius: 0 0 16rpx 16rpx;
  1662. }
  1663. }
  1664. .answer {
  1665. height: 80rpx;
  1666. line-height: 80rpx;
  1667. padding: 0rpx 24rpx;
  1668. display: flex;
  1669. align-items: center;
  1670. justify-content: space-between;
  1671. color: #666;
  1672. font-size: 30rpx;
  1673. }
  1674. .footer_btn {
  1675. background-color: #fff;
  1676. z-index: 10078;
  1677. position: fixed;
  1678. bottom: 0rpx;
  1679. display: flex;
  1680. align-items: center;
  1681. justify-content: space-between;
  1682. width: 100%;
  1683. height: 98rpx;
  1684. padding: 0rpx 38rpx;
  1685. border-top: 1rpx solid #eee;
  1686. .flex_center {
  1687. flex: 1;
  1688. display: flex;
  1689. justify-content: center;
  1690. align-items: center;
  1691. flex-direction: column;
  1692. margin: 0 200rpx;
  1693. font-size: 24rpx;
  1694. color: #999999;
  1695. .up-icon {
  1696. margin-bottom: 18rpx;
  1697. width: 100%;
  1698. display: flex;
  1699. justify-content: center;
  1700. image {
  1701. width: 58rpx;
  1702. height: 21rpx;
  1703. }
  1704. }
  1705. }
  1706. .collect {
  1707. visibility: hidden;
  1708. &.show {
  1709. visibility: visible;
  1710. }
  1711. > view {
  1712. display: flex;
  1713. flex-direction: column;
  1714. align-items: center;
  1715. justify-content: center;
  1716. image {
  1717. width: 32rpx;
  1718. height: 32rpx;
  1719. margin-bottom: 6rpx;
  1720. }
  1721. view {
  1722. font-size: 24rpx;
  1723. color: #999999;
  1724. }
  1725. }
  1726. }
  1727. }
  1728. .boxSty {
  1729. padding: 44rpx 41rpx 0rpx;
  1730. }
  1731. .liListSty {
  1732. border: 1rpx solid #eeeeee;
  1733. width: 88rpx;
  1734. height: 88rpx;
  1735. border-radius: 32rpx;
  1736. text-align: center;
  1737. line-height: 88rpx;
  1738. color: #333;
  1739. font-size: 32rpx;
  1740. float: left;
  1741. margin: 20rpx 23rpx;
  1742. &.isRight {
  1743. border: 1rpx solid #eeeeee;
  1744. color: #fff;
  1745. background: #36c75a;
  1746. }
  1747. &.isWrong {
  1748. border: 1rpx solid #eeeeee;
  1749. color: #fff;
  1750. background: #ff3b30;
  1751. }
  1752. &.isPart {
  1753. border: 1rpx solid #eeeeee;
  1754. color: #fff;
  1755. background: #FFC53D;
  1756. }
  1757. }
  1758. .answerInfos {
  1759. padding: 25rpx 25rpx 25rpx 23rpx;
  1760. }
  1761. .answerTitle {
  1762. margin-bottom: 28rpx;
  1763. color: #666;
  1764. font-size: 30rpx;
  1765. }
  1766. .answerContent {
  1767. font-size: 30rpx;
  1768. color: #666;
  1769. }
  1770. .textChild {
  1771. display: inline-block;
  1772. vertical-align: middle;
  1773. }
  1774. .dialog {
  1775. position: fixed;
  1776. left: 0;
  1777. top: 0;
  1778. width: 100%;
  1779. height: 100%;
  1780. background-color: rgba(0, 0, 0, 0.8);
  1781. display: flex;
  1782. flex-direction: column;
  1783. align-items: center;
  1784. justify-content: center;
  1785. z-index: 20000;
  1786. .pointer {
  1787. width: 338rpx;
  1788. height: 240rpx;
  1789. }
  1790. .text {
  1791. font-size: 32rpx;
  1792. color: #ffffff;
  1793. text-align: center;
  1794. }
  1795. .btn {
  1796. width: 242rpx;
  1797. height: 82rpx;
  1798. border: 2rpx solid #ffffff;
  1799. border-radius: 16rpx;
  1800. text-align: center;
  1801. line-height: 82rpx;
  1802. margin: 41rpx auto;
  1803. color: #fff;
  1804. font-size: 32rpx;
  1805. }
  1806. }
  1807. </style>