questionBankAllExplain.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  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. >
  277. 问题{{ tabIndex + 1 }}
  278. </view>
  279. </view>
  280. <view
  281. v-for="(ansItem, ansIndex) in bank.jsonStr"
  282. v-if="bank.current == ansIndex"
  283. :key="ansIndex"
  284. >
  285. <template v-if="ansItem.type == 1">
  286. <view class="pad_8 titBox">
  287. <view class="leftLetters">
  288. <view class="btnType">
  289. <text>单选</text>
  290. </view>
  291. </view>
  292. <view class="titles">
  293. <rich-text :nodes="ansItem.content"></rich-text>
  294. </view>
  295. <view v-if="!bank.ques[ansIndex]">
  296. <view
  297. v-for="(option, childIndex) in ansItem.optionsList"
  298. :key="childIndex"
  299. class="lisSty"
  300. >
  301. <view class="activeTI">{{ ast[childIndex] }}</view>
  302. <view class="flex_auto">
  303. <rich-text
  304. class="textChild"
  305. :nodes="option.content"
  306. ></rich-text>
  307. <view v-if="option.imgUrl">
  308. <image
  309. style="width: 600rpx"
  310. mode="widthFix"
  311. :src="$method.splitImgHost(option.imgUrl)"
  312. ></image>
  313. </view>
  314. </view>
  315. </view>
  316. </view>
  317. <view v-if="bank.ques[ansIndex]">
  318. <view
  319. v-for="(option, childIndex) in ansItem.optionsList"
  320. :key="childIndex"
  321. class="lisSty"
  322. >
  323. <text
  324. :class="{
  325. right:
  326. option.optionsId == bank.ques[ansIndex] ||
  327. option.optionsId == bank.ans[ansIndex],
  328. wrong:
  329. option.optionsId == bank.ques[ansIndex] &&
  330. bank.ques[ansIndex] != bank.ans[ansIndex],
  331. }"
  332. class="activeTI"
  333. >{{ ast[childIndex] }}</text
  334. >
  335. <view class="flex_auto">
  336. <rich-text :nodes="option.content"></rich-text>
  337. <view v-if="option.imgUrl">
  338. <image
  339. style="width: 600rpx"
  340. mode="widthFix"
  341. :src="$method.splitImgHost(option.imgUrl)"
  342. ></image>
  343. </view>
  344. </view>
  345. </view>
  346. </view>
  347. </view>
  348. <view>
  349. <view class="pad_8 answer">
  350. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  351. <view
  352. >我的答案:{{ ast[bank.ques[ansIndex] - 1] || "" }}</view
  353. >
  354. </view>
  355. <view class="pad_8 answerInfos">
  356. <view class="answerTitle">答案解析</view>
  357. <view class="answerContent">
  358. <rich-text :nodes="option.analysisContent"></rich-text>
  359. </view>
  360. </view>
  361. </view>
  362. </template>
  363. <template v-if="ansItem.type == 2">
  364. <view class="pad_8 titBox">
  365. <view class="leftLetters">
  366. <view class="btnType">
  367. <text>多选</text>
  368. </view>
  369. </view>
  370. <view class="titles">
  371. <rich-text :nodes="ansItem.content"></rich-text>
  372. <view v-if="option.imgUrl">
  373. <image
  374. style="width: 600rpx"
  375. mode="widthFix"
  376. :src="$method.splitImgHost(option.imgUrl)"
  377. ></image>
  378. </view>
  379. </view>
  380. <view v-if="!bank.ques[ansIndex]">
  381. <view
  382. v-for="(option, childindex) in ansItem.optionsList"
  383. :key="childindex"
  384. class="lisSty"
  385. >
  386. <view
  387. :class="{ checked: option.checked }"
  388. class="activeTI"
  389. >{{ ast[childindex] }}</view
  390. >
  391. <view class="flex_auto">
  392. <rich-text :nodes="option.content"></rich-text>
  393. <view v-if="option.imgUrl">
  394. <image
  395. style="width: 600rpx"
  396. mode="widthFix"
  397. :src="$method.splitImgHost(option.imgUrl)"
  398. ></image>
  399. </view>
  400. </view>
  401. </view>
  402. </view>
  403. <view v-if="bank.ques && bank.ques[ansIndex]">
  404. <view
  405. v-for="(option, childindex) in ansItem.optionsList"
  406. :key="childindex"
  407. class="lisSty"
  408. >
  409. <text
  410. :class="{
  411. right: right(bankIndex, ansIndex, option),
  412. wrong: wrong(bankIndex, ansIndex, option),
  413. }"
  414. class="activeTI"
  415. >{{ ast[childindex] }}</text
  416. >
  417. <view class="flex_auto">
  418. <rich-text :nodes="option.content"></rich-text>
  419. </view>
  420. </view>
  421. </view>
  422. </view>
  423. <view>
  424. <view class="pad_8 answer">
  425. <view
  426. >正确答案:
  427. <text
  428. :key="ansItemIndex1"
  429. v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
  430. >{{ ast[ansItem1 - 1] }}</text
  431. >
  432. </view>
  433. <view
  434. >我的答案:
  435. <text
  436. :key="quesItemIndex"
  437. v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
  438. >{{ ast[quesItem - 1] }}</text
  439. >
  440. </view>
  441. </view>
  442. <view class="pad_8 answerInfos">
  443. <view class="answerTitle">答案解析</view>
  444. <view class="answerContent">
  445. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  446. </view>
  447. </view>
  448. </view>
  449. </template>
  450. <template v-if="ansItem.type == 3">
  451. <view class="pad_8 titBox">
  452. <view class="leftLetters">
  453. <view class="btnType">
  454. <text>判断</text>
  455. </view>
  456. </view>
  457. <view class="titles">
  458. <rich-text :nodes="ansItem.content"></rich-text>
  459. </view>
  460. <view v-if="!bank.ques[ansIndex]">
  461. <view
  462. v-for="(option, childindex) in judge"
  463. :key="childindex"
  464. class="lisSty"
  465. >
  466. <view class="activeTI">{{ ast[childindex] }}</view>
  467. <view class="flex_auto">
  468. {{ option }}
  469. <view v-if="option.imgUrl">
  470. <image
  471. style="width: 600rpx"
  472. mode="widthFix"
  473. :src="$method.splitImgHost(option.imgUrl)"
  474. ></image>
  475. </view>
  476. </view>
  477. </view>
  478. </view>
  479. <view v-if="bank.ques[ansIndex]">
  480. <view
  481. v-for="(option, childindex) in judge"
  482. :key="childindex"
  483. class="lisSty"
  484. >
  485. <text
  486. :class="{
  487. right:
  488. childindex == bank.ques[ansIndex] ||
  489. childindex == bank.ans[ansIndex],
  490. wrong:
  491. childindex == bank.ques[ansIndex] &&
  492. bank.ques[ansIndex] != bank.ans[ansIndex],
  493. }"
  494. class="activeTI"
  495. >{{ ast[childindex] }}</text
  496. >
  497. <view class="flex_auto">
  498. {{ option }}
  499. <view v-if="option.imgUrl">
  500. <image
  501. style="width: 600rpx"
  502. mode="widthFix"
  503. :src="$method.splitImgHost(option.imgUrl)"
  504. ></image>
  505. </view>
  506. </view>
  507. </view>
  508. </view>
  509. </view>
  510. <view>
  511. <view class="pad_8 answer">
  512. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  513. <view>我的答案:{{ ast[bank.ques[ansIndex]] || "" }}</view>
  514. </view>
  515. <view class="pad_8 answerInfos">
  516. <view class="answerTitle">答案解析</view>
  517. <view class="answerContent">
  518. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  519. </view>
  520. </view>
  521. </view>
  522. </template>
  523. <!-- 简答题 -->
  524. <template v-if="ansItem.type == 5">
  525. <view class="pad_8 titBox_title">
  526. <view class="leftLetters">
  527. <view class="btnType">
  528. <text>简答</text>
  529. </view>
  530. </view>
  531. <view class="titles">
  532. <rich-text :nodes="ansItem.content"></rich-text>
  533. </view>
  534. </view>
  535. <view class="pad_8 titBox_title">
  536. <view class="ans">
  537. <view class="ans_submit answerInfos">
  538. <view class="answerTitle">我的答案</view>
  539. {{
  540. (bank.ques[ansIndex] && bank.ques[ansIndex].text) || ""
  541. }}
  542. <view
  543. class="imgs"
  544. v-if="
  545. bank.ques[ansIndex] &&
  546. bank.ques[ansIndex].imageList.length
  547. "
  548. >
  549. <image
  550. class="img"
  551. :key="quesIndex"
  552. v-for="(ques, quesIndex) in bank.ques[ansIndex]
  553. .imageList"
  554. :src="$method.splitImgHost(ques, true)"
  555. ></image>
  556. </view>
  557. </view>
  558. </view>
  559. </view>
  560. <view>
  561. <view class="pad_8 answerInfos">
  562. <view class="answerTitle">答案解析</view>
  563. <view class="answerContent">
  564. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  565. </view>
  566. </view>
  567. </view>
  568. </template>
  569. </view>
  570. </template>
  571. <view class="footer_btn">
  572. <view
  573. class="collect"
  574. @click="collect(collectList[bankIndex], bankIndex)"
  575. >
  576. <view>
  577. <image src="/static/icon/collect.png" mode=""></image>
  578. <view>收藏</view>
  579. </view>
  580. </view>
  581. <view class="flex_center" @click="openFooterTab">
  582. <view class="up-icon">
  583. <image src="/static/up.png"></image>
  584. </view>
  585. 答题卡
  586. </view>
  587. <view class="collect" @click="pdsubmit">
  588. <view>
  589. <image src="/static/jj.png" mode=""></image>
  590. <view>交卷</view>
  591. </view>
  592. </view>
  593. </view>
  594. </view>
  595. </swiper-item>
  596. </swiper>
  597. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  598. <view class="popupView">
  599. <view class="popupTops">
  600. <view class="topIcon"></view>
  601. 点击编号即可跳转至对应题目
  602. </view>
  603. <view class="popupContent">
  604. <scroll-view scroll-y="true" style="height: 506rpx">
  605. <view class="boxSty">
  606. <view
  607. v-for="(item, index) in questionList"
  608. :key="index"
  609. @click="changeIndex(index)"
  610. :class="{
  611. isRight: isRight(item, index),
  612. isWrong: isWrong(item, index),
  613. isPart: isPart(item, index),
  614. }"
  615. class="liListSty"
  616. >{{ index + 1 }}</view
  617. >
  618. </view>
  619. </scroll-view>
  620. </view>
  621. </view>
  622. </u-popup>
  623. <view class="dialog" v-if="showDialog">
  624. <view class="text">左右滑动切换上下题</view>
  625. <view class="btn" @click="hideDialog">我知道了</view>
  626. </view>
  627. </view>
  628. </template>
  629. <script>
  630. export default {
  631. data() {
  632. return {
  633. id: "",
  634. current: 0,
  635. questionList: [],
  636. ast: ["A", "B", "C", "D", "E", "F", "G"],
  637. judge: ["错误", "正确"],
  638. show: false,
  639. showDialog: false,
  640. bankList: [],
  641. goodsId: "",
  642. recordId: "",
  643. chapterId: "",
  644. moduleId: "",
  645. courseType: 1, //1题库,2视频 商品类型
  646. };
  647. },
  648. onLoad(option) {
  649. this.id = option.id || "";
  650. this.goodsId = option.goodsid || "";
  651. this.chapterId = option.chapterId || "";
  652. this.moduleId = option.moduleId || "";
  653. this.recordId = option.recordId || "";
  654. this.courseType = option.courseType
  655. let showDialog = uni.getStorageSync("showDialog");
  656. if (showDialog) {
  657. this.showDialog = false;
  658. } else {
  659. this.showDialog = true;
  660. uni.setStorageSync("showDialog", "1");
  661. }
  662. this.goodsQuestionList();
  663. },
  664. onUnload() {},
  665. methods: {
  666. /**
  667. * 是否有上传图片
  668. */
  669. hasImgs(bank) {
  670. return bank.ansText.imageList.length == 0;
  671. },
  672. goodsQuestionList() {
  673. if (this.courseType == 2) {
  674. this.$api.bankReportData(this.recordId).then((res) => {
  675. this.questionList = JSON.parse(res.data.data.historyExamJson)
  676. })
  677. } else {
  678. this.$api.examReport(this.recordId).then((res) => {
  679. this.questionList = JSON.parse(res.data.data.historyExamJson);
  680. });
  681. }
  682. },
  683. openFooterTab() {
  684. this.show = true;
  685. },
  686. hideDialog() {
  687. this.showDialog = false;
  688. },
  689. changeIndex(index) {
  690. this.current = index;
  691. },
  692. swiperChange(e) {
  693. this.current = e.detail.current;
  694. },
  695. isRight(item, index) {
  696. //单选
  697. if (this.questionList[index].ques) {
  698. if (item.type == 1) {
  699. return this.questionList[index].ques == this.questionList[index].ans;
  700. //多选
  701. } else if (item.type == 2) {
  702. //每一项都相等
  703. return this.questionList[index].ans.every((item, i) => {
  704. return item == this.questionList[index].ques[i];
  705. });
  706. //判断
  707. } else if (item.type == 3) {
  708. return this.questionList[index].ques == this.questionList[index].ans;
  709. } else {
  710. return false;
  711. }
  712. } else {
  713. return false;
  714. }
  715. },
  716. right(bankIndex, ansIndex, option) {
  717. if (
  718. this.questionList[bankIndex].ques[ansIndex] &&
  719. this.questionList[bankIndex].ans[ansIndex]
  720. ) {
  721. if (
  722. this.questionList[bankIndex].ques[ansIndex].indexOf(
  723. option.optionsId
  724. ) != -1 ||
  725. this.questionList[bankIndex].ans[ansIndex].indexOf(
  726. option.optionsId
  727. ) != -1
  728. ) {
  729. return true;
  730. } else {
  731. return false;
  732. }
  733. } else {
  734. return false;
  735. }
  736. },
  737. wrong(bankIndex, ansIndex, option) {
  738. if (
  739. this.questionList[bankIndex].ques[ansIndex] &&
  740. this.questionList[bankIndex].ans[ansIndex]
  741. ) {
  742. if (
  743. this.questionList[bankIndex].ques[ansIndex].indexOf(
  744. option.optionsId
  745. ) != -1 &&
  746. this.questionList[bankIndex].ans[ansIndex].indexOf(
  747. option.optionsId
  748. ) == -1
  749. ) {
  750. return true;
  751. } else {
  752. return false;
  753. }
  754. } else {
  755. return false;
  756. }
  757. },
  758. isWrong(item, index) {
  759. if (this.questionList[index].ques) {
  760. //单选
  761. if (item.type == 1) {
  762. return this.questionList[index].ques != this.questionList[index].ans;
  763. //多选
  764. } else if (item.type == 2) {
  765. //每一项都相等
  766. return this.questionList[index].ques.some((item, i) => {
  767. return this.questionList[index].ans.indexOf(item) == -1;
  768. });
  769. //判断
  770. } else if (item.type == 3) {
  771. return this.questionList[index].ques != this.questionList[index].ans;
  772. } else {
  773. return false;
  774. }
  775. } else {
  776. return false;
  777. }
  778. },
  779. isPart(item, index) {
  780. if (this.questionList[index].ques) {
  781. if (item.type == 2) {
  782. let isWrong = this.questionList[index].ques.some((item, i) => {
  783. return this.questionList[index].ans.indexOf(item) == -1;
  784. });
  785. let isRight = this.questionList[index].ans.every((item, i) => {
  786. return item == this.questionList[index].ques[i];
  787. });
  788. if (!isRight && !isWrong) {
  789. return true;
  790. }
  791. }
  792. } else {
  793. return false;
  794. }
  795. },
  796. tabSelect(index, bankindex) {
  797. this.$set(this.questionList[bankindex], "current", index);
  798. },
  799. },
  800. };
  801. </script>
  802. <style lang="scss" scoped>
  803. .questionBank {
  804. width: 100%;
  805. height: 100vh;
  806. display: flex;
  807. flex-direction: column;
  808. }
  809. .swiper {
  810. width: 100%;
  811. flex: 1;
  812. }
  813. .lisSty {
  814. margin-bottom: 16rpx;
  815. display: flex;
  816. align-items: center;
  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>