questionBankAllExplain.vue 36 KB

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