index.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642
  1. <template>
  2. <div class="course-exam">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <!-- <el-breadcrumb separator="/">
  8. <el-breadcrumb-item
  9. v-for="(item, index) in $route.matched"
  10. :key="index"
  11. :to="{ path: item.path }"
  12. >{{ item.name }}</el-breadcrumb-item
  13. >
  14. </el-breadcrumb> -->
  15. </div>
  16. <div class="section__body">
  17. <div class="explain-record">
  18. <div class="explain-record__body clearfix">
  19. <div class="left-box">
  20. <Header-tab-box
  21. :num="questionOverNum(true)"
  22. @prevQuestion="prevQuestion"
  23. @nextQuestion="nextQuestion"
  24. ></Header-tab-box>
  25. <div class="left-box__body">
  26. <template v-for="(question, questionIndex) in questionList">
  27. <div
  28. class="question"
  29. v-if="question.type == 1 && current == questionIndex"
  30. :key="questionIndex"
  31. >
  32. <div class="question__title">
  33. {{ questionIndex + 1 }}、单选题
  34. </div>
  35. <div
  36. class="question__desc"
  37. v-html="question.content"
  38. ></div>
  39. <div class="question__content">
  40. <div class="question-list" v-if="!question.ques">
  41. <div
  42. class="radio"
  43. v-for="(item, index) in question.jsonStr"
  44. :key="index"
  45. >
  46. <div>
  47. {{ ast[index] }}. {{ item.content }}
  48. <div v-if="item.imgUrl">
  49. <img
  50. style="max-width: 100%"
  51. :src="$tools.splitImgHost(item.imgUrl)"
  52. alt=""
  53. />
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="question-list" v-if="question.ques">
  59. <div
  60. class="radio"
  61. :class="{
  62. right:
  63. item.optionsId == question.ques ||
  64. item.optionsId == question.ans,
  65. wrong:
  66. item.optionsId == question.ques &&
  67. question.ques != question.ans,
  68. }"
  69. v-for="(item, index) in question.jsonStr"
  70. :key="index"
  71. >
  72. <div>
  73. {{ ast[index] }}. {{ item.content }}
  74. <div v-if="item.imgUrl">
  75. <img
  76. style="max-width: 100%"
  77. :src="$tools.splitImgHost(item.imgUrl)"
  78. alt=""
  79. />
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="answer-list">
  85. <div class="answer-list__left">
  86. 题目答案:{{ ast[question.ans - 1] }}
  87. </div>
  88. <div class="answer-list__left">
  89. 我的答案:{{ ast[question.ques - 1] }}
  90. </div>
  91. </div>
  92. <div class="explain-list">
  93. <div class="explain-list__header">答案解析:</div>
  94. <div
  95. class="explain-list__body"
  96. v-html="question.analysisContent"
  97. ></div>
  98. </div>
  99. </div>
  100. <div class="question__btns">
  101. <!-- <div class="collect" @click="collect"></div> -->
  102. </div>
  103. </div>
  104. <div
  105. class="question"
  106. v-if="question.type == 2 && current == questionIndex"
  107. :key="questionIndex"
  108. >
  109. <div class="question__title">
  110. {{ questionIndex + 1 }}、多选题
  111. </div>
  112. <div
  113. class="question__desc"
  114. v-html="question.content"
  115. ></div>
  116. <div class="question__content">
  117. <div class="question-list" v-if="!question.ques">
  118. <el-checkbox
  119. disabled
  120. class="checkbox"
  121. v-for="(item, index) in question.jsonStr"
  122. :key="index"
  123. :label="item.optionsId"
  124. v-model="item.checked"
  125. >
  126. <div>
  127. {{ ast[index] }}. {{ item.content }}
  128. <div v-if="item.imgUrl">
  129. <img
  130. style="max-width: 100%"
  131. :src="$tools.splitImgHost(item.imgUrl)"
  132. alt=""
  133. />
  134. </div>
  135. </div>
  136. </el-checkbox>
  137. </div>
  138. <div class="question-list" v-if="question.ques">
  139. <el-checkbox
  140. disabled
  141. class="checkbox"
  142. :class="{
  143. right:
  144. question.ques.indexOf(item.optionsId) != -1 ||
  145. question.ans.indexOf(item.optionsId) != -1,
  146. wrong:
  147. question.ques.indexOf(item.optionsId) != -1 &&
  148. question.ans.indexOf(item.optionsId) == -1,
  149. }"
  150. v-for="(item, index) in question.jsonStr"
  151. :key="index"
  152. :label="item.optionsId"
  153. v-model="item.checked"
  154. >
  155. <div>
  156. {{ ast[index] }}. {{ item.content }}
  157. <div v-if="item.imgUrl">
  158. <img
  159. style="max-width: 100%"
  160. :src="$tools.splitImgHost(item.imgUrl)"
  161. alt=""
  162. />
  163. </div>
  164. </div>
  165. </el-checkbox>
  166. </div>
  167. <div class="answer-list">
  168. <div class="answer-list__left">
  169. 题目答案:
  170. <template v-for="ansItem in question.ans">{{
  171. ast[ansItem - 1]
  172. }}</template>
  173. </div>
  174. <div class="answer-list__left">
  175. 我的答案:
  176. <template v-for="quesItem in question.ques">{{
  177. ast[quesItem - 1]
  178. }}</template>
  179. </div>
  180. </div>
  181. <div class="explain-list">
  182. <div class="explain-list__header">答案解析:</div>
  183. <div
  184. class="explain-list__body"
  185. v-html="question.analysisContent"
  186. ></div>
  187. </div>
  188. </div>
  189. <div class="question__btns">
  190. <!-- <div class="collect" @click="collect"></div> -->
  191. </div>
  192. </div>
  193. <div
  194. class="question"
  195. v-if="question.type == 3 && current == questionIndex"
  196. :key="questionIndex"
  197. >
  198. <div class="question__title">
  199. {{ questionIndex + 1 }}、判断题
  200. </div>
  201. <div
  202. class="question__desc"
  203. v-html="question.content"
  204. ></div>
  205. <div class="question__content">
  206. <div class="question-list" v-if="!question.ques">
  207. <div
  208. class="radio"
  209. v-for="(item, index) in judge"
  210. :key="index"
  211. >
  212. <div>
  213. {{ ast[index] }}. {{ item }}
  214. <div v-if="item.imgUrl">
  215. <img
  216. style="max-width: 100%"
  217. :src="$tools.splitImgHost(item.imgUrl)"
  218. alt=""
  219. />
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. <div class="question-list" v-if="question.ques">
  225. <div
  226. class="radio"
  227. :class="{
  228. right:
  229. index == question.ques || index == question.ans,
  230. wrong:
  231. index == question.ques &&
  232. question.ques != question.ans,
  233. }"
  234. v-for="(item, index) in judge"
  235. :key="index"
  236. >
  237. <div>
  238. {{ ast[index] }}. {{ item }}
  239. <div v-if="item.imgUrl">
  240. <img
  241. style="max-width: 100%"
  242. :src="$tools.splitImgHost(item.imgUrl)"
  243. alt=""
  244. />
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="answer-list">
  250. <div class="answer-list__left">
  251. 题目答案:{{ ast[question.ans] }}
  252. </div>
  253. <div class="answer-list__left">
  254. 我的答案:{{ ast[question.ques] }}
  255. </div>
  256. </div>
  257. <div class="explain-list">
  258. <div class="explain-list__header">答案解析:</div>
  259. <div
  260. class="explain-list__body"
  261. v-html="question.analysisContent"
  262. ></div>
  263. </div>
  264. </div>
  265. <div class="question__btns">
  266. <!-- <div class="collect" @click="collect"></div> -->
  267. </div>
  268. </div>
  269. <div
  270. class="question"
  271. v-if="question.type == 4 && current == questionIndex"
  272. :key="questionIndex"
  273. >
  274. <div class="question__title">
  275. {{ questionIndex + 1 }}、案例题
  276. </div>
  277. <div
  278. class="question__desc"
  279. v-html="question.content"
  280. ></div>
  281. <div class="question__content">
  282. <el-tabs v-model="question.tabIndex">
  283. <el-tab-pane
  284. v-for="(json, jsonIndex) in question.jsonStr"
  285. :label="'问题' + (jsonIndex + 1)"
  286. :name="jsonIndex + ''"
  287. :key="jsonIndex"
  288. >
  289. <div
  290. class="question"
  291. v-if="json.type == 1"
  292. :key="questionIndex"
  293. >
  294. <div class="question__title">
  295. {{ jsonIndex + 1 }}、单选题
  296. </div>
  297. <div
  298. class="question__desc"
  299. v-html="json.content"
  300. ></div>
  301. <div class="question__content">
  302. <div
  303. class="question-list"
  304. v-if="!question.ques[jsonIndex]"
  305. >
  306. <div
  307. class="radio"
  308. v-for="(item, index) in json.optionsList"
  309. :key="index"
  310. >
  311. <div>
  312. {{ ast[index] }}. {{ item.content }}
  313. <div v-if="item.imgUrl">
  314. <img
  315. style="max-width: 100%"
  316. :src="
  317. $tools.splitImgHost(item.imgUrl)
  318. "
  319. alt=""
  320. />
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <div
  326. class="question-list"
  327. v-if="question.ques[jsonIndex]"
  328. >
  329. <div
  330. class="radio"
  331. :class="{
  332. right:
  333. item.optionsId ==
  334. question.ques[jsonIndex] ||
  335. item.optionsId ==
  336. question.ans[jsonIndex],
  337. wrong:
  338. item.optionsId ==
  339. question.ques[jsonIndex] &&
  340. question.ques[jsonIndex] !=
  341. question.ans[jsonIndex],
  342. }"
  343. v-for="(item, index) in json.optionsList"
  344. :key="index"
  345. >
  346. <div>
  347. {{ ast[index] }}. {{ item.content }}
  348. <div v-if="item.imgUrl">
  349. <img
  350. style="max-width: 100%"
  351. :src="
  352. $tools.splitImgHost(item.imgUrl)
  353. "
  354. alt=""
  355. />
  356. </div>
  357. </div>
  358. </div>
  359. </div>
  360. <div class="answer-list">
  361. <div class="answer-list__left">
  362. 题目答案:{{
  363. ast[question.ans[jsonIndex] - 1]
  364. }}
  365. </div>
  366. <div class="answer-list__left">
  367. 我的答案:{{
  368. ast[question.ques[jsonIndex] - 1]
  369. }}
  370. </div>
  371. </div>
  372. <div class="explain-list">
  373. <div class="explain-list__header">
  374. 答案解析:
  375. </div>
  376. <div
  377. class="explain-list__body"
  378. v-html="json.analysisContent"
  379. ></div>
  380. </div>
  381. </div>
  382. <div class="question__btns"></div>
  383. </div>
  384. <div
  385. class="question"
  386. v-if="json.type == 2"
  387. :key="jsonIndex"
  388. >
  389. <div class="question__title">
  390. {{ jsonIndex + 1 }}、多选题
  391. </div>
  392. <div
  393. class="question__desc"
  394. v-html="json.content"
  395. ></div>
  396. <div class="question__content">
  397. <div
  398. class="question-list"
  399. v-if="!question.ques[jsonIndex]"
  400. >
  401. <el-checkbox
  402. disabled
  403. class="checkbox"
  404. v-for="(item, index) in json.optionsList"
  405. :key="index"
  406. :label="item.optionsId"
  407. v-model="item.checked"
  408. >
  409. <div>
  410. {{ ast[index] }}. {{ item.content }}
  411. <div v-if="item.imgUrl">
  412. <img
  413. style="max-width: 100%"
  414. :src="
  415. $tools.splitImgHost(item.imgUrl)
  416. "
  417. alt=""
  418. />
  419. </div>
  420. </div>
  421. </el-checkbox>
  422. </div>
  423. <div
  424. class="question-list"
  425. v-if="question.ques[jsonIndex]"
  426. >
  427. <el-checkbox
  428. disabled
  429. class="checkbox"
  430. :class="{
  431. right:
  432. question.ques[jsonIndex].indexOf(
  433. item.optionsId
  434. ) != -1 ||
  435. question.ans[jsonIndex].indexOf(
  436. item.optionsId
  437. ) != -1,
  438. wrong:
  439. question.ques[jsonIndex].indexOf(
  440. item.optionsId
  441. ) != -1 &&
  442. question.ans[jsonIndex].indexOf(
  443. item.optionsId
  444. ) == -1,
  445. }"
  446. v-for="(item, index) in json.optionsList"
  447. :key="index"
  448. :label="item.optionsId"
  449. v-model="item.checked"
  450. >
  451. <div>
  452. {{ ast[index] }}. {{ item.content }}
  453. <div v-if="item.imgUrl">
  454. <img
  455. style="max-width: 100%"
  456. :src="
  457. $tools.splitImgHost(item.imgUrl)
  458. "
  459. alt=""
  460. />
  461. </div>
  462. </div>
  463. </el-checkbox>
  464. </div>
  465. <div class="answer-list">
  466. <div class="answer-list__left">
  467. 题目答案:
  468. <template
  469. v-for="ansItem in question.ans[jsonIndex]"
  470. >{{ ast[ansItem - 1] }}</template
  471. >
  472. </div>
  473. <div class="answer-list__left">
  474. 我的答案:
  475. <template
  476. v-for="quesItem in question.ques[
  477. jsonIndex
  478. ]"
  479. >{{ ast[quesItem - 1] }}</template
  480. >
  481. </div>
  482. </div>
  483. <div class="explain-list">
  484. <div class="explain-list__header">
  485. 答案解析:
  486. </div>
  487. <div
  488. class="explain-list__body"
  489. v-html="json.analysisContent"
  490. ></div>
  491. </div>
  492. </div>
  493. <div class="question__btns"></div>
  494. </div>
  495. <div
  496. class="question"
  497. v-if="json.type == 3"
  498. :key="jsonIndex"
  499. >
  500. <div class="question__title">
  501. {{ jsonIndex + 1 }}、判断题
  502. </div>
  503. <div
  504. class="question__desc"
  505. v-html="json.content"
  506. ></div>
  507. <div class="question__content">
  508. <div
  509. class="question-list"
  510. v-if="!question.ques[jsonIndex]"
  511. >
  512. <div
  513. class="radio"
  514. v-for="(item, index) in judge"
  515. :key="index"
  516. >
  517. <div>
  518. {{ ast[index] }}. {{ item }}
  519. <div v-if="item.imgUrl">
  520. <img
  521. style="max-width: 100%"
  522. :src="
  523. $tools.splitImgHost(item.imgUrl)
  524. "
  525. alt=""
  526. />
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. <div
  532. class="question-list"
  533. v-if="question.ques[jsonIndex]"
  534. >
  535. <div
  536. class="radio"
  537. :class="{
  538. right:
  539. index == question.ques[jsonIndex] ||
  540. index == question.ans[jsonIndex],
  541. wrong:
  542. index == question.ques[jsonIndex] &&
  543. question.ques[jsonIndex] !=
  544. question.ans[jsonIndex],
  545. }"
  546. v-for="(item, index) in judge"
  547. :key="index"
  548. >
  549. <div>
  550. {{ ast[index] }}. {{ item }}
  551. <div v-if="item.imgUrl">
  552. <img
  553. style="max-width: 100%"
  554. :src="
  555. $tools.splitImgHost(item.imgUrl)
  556. "
  557. alt=""
  558. />
  559. </div>
  560. </div>
  561. </div>
  562. </div>
  563. <div class="answer-list">
  564. <div class="answer-list__left">
  565. 题目答案:{{ ast[question.ans[jsonIndex]] }}
  566. </div>
  567. <div class="answer-list__left">
  568. 我的答案:{{
  569. ast[question.ques[jsonIndex]]
  570. }}
  571. </div>
  572. </div>
  573. <div class="explain-list">
  574. <div class="explain-list__header">
  575. 答案解析:
  576. </div>
  577. <div
  578. class="explain-list__body"
  579. v-html="json.analysisContent"
  580. ></div>
  581. </div>
  582. </div>
  583. <div class="question__btns"></div>
  584. </div>
  585. <div
  586. class="question"
  587. v-if="json.type == 5"
  588. :key="jsonIndex"
  589. >
  590. <div class="question__title">
  591. {{ jsonIndex + 1 }}、简答题
  592. </div>
  593. <div
  594. class="question__desc"
  595. v-html="json.content"
  596. ></div>
  597. <div class="question__content">
  598. <div class="explain-list">
  599. <div class="explain-list__header">
  600. 我的答案:
  601. </div>
  602. <div class="explain-list__body">
  603. <div>
  604. {{
  605. question.ques[jsonIndex] &&
  606. question.ques[jsonIndex].text
  607. }}
  608. </div>
  609. <div class="upload clearfix">
  610. <div
  611. class="upload__imgs"
  612. v-for="(img, imgIndex) in question.ques[
  613. jsonIndex
  614. ] && question.ques[jsonIndex].imageList"
  615. :key="imgIndex"
  616. >
  617. <img
  618. :src="$tools.splitImgHost(img, true)"
  619. alt=""
  620. />
  621. </div>
  622. </div>
  623. </div>
  624. <div class="explain-list__header">
  625. 答案解析:
  626. </div>
  627. <div
  628. class="explain-list__body"
  629. v-html="question.analysisContent"
  630. ></div>
  631. </div>
  632. </div>
  633. <div class="question__btns"></div>
  634. </div>
  635. </el-tab-pane>
  636. </el-tabs>
  637. </div>
  638. <div class="question__btns">
  639. <!-- <div class="collect" @click="collect"></div> -->
  640. </div>
  641. </div>
  642. <div
  643. class="question"
  644. v-if="question.type == 5 && current == questionIndex"
  645. :key="questionIndex"
  646. >
  647. <div class="question__title">
  648. {{ questionIndex + 1 }}、简答题
  649. </div>
  650. <div
  651. class="question__desc"
  652. v-html="question.content"
  653. ></div>
  654. <div class="question__content">
  655. <div class="explain-list">
  656. <div class="explain-list__header">我的答案:</div>
  657. <div class="explain-list__body">
  658. <div>{{ question.ques.text }}</div>
  659. <div class="upload clearfix">
  660. <div
  661. class="upload__imgs"
  662. v-for="(img, imgIndex) in question.ques
  663. .imageList"
  664. :key="imgIndex"
  665. >
  666. <img
  667. :src="$tools.splitImgHost(img, true)"
  668. alt=""
  669. />
  670. </div>
  671. </div>
  672. </div>
  673. <div class="explain-list__header">答案解析:</div>
  674. <div
  675. class="explain-list__body"
  676. v-html="question.analysisContent"
  677. ></div>
  678. </div>
  679. </div>
  680. <div class="question__btns">
  681. <!-- <div class="collect" @click="collect"></div> -->
  682. </div>
  683. </div>
  684. </template>
  685. </div>
  686. </div>
  687. <div class="right-box">
  688. <div class="right-box__header">
  689. <el-button
  690. type="primary"
  691. round
  692. plain
  693. size="small"
  694. class="back-btn"
  695. @click="$router.back(-1)"
  696. >返回</el-button
  697. >
  698. </div>
  699. <div class="right-box__header">答题卡</div>
  700. <div class="right-box__body">
  701. <div class="card">
  702. <div class="card__note">
  703. <div class="item">
  704. <div class="box green"></div>
  705. 正确
  706. </div>
  707. <div class="item">
  708. <div class="box red"></div>
  709. 错误
  710. </div>
  711. <div class="item">
  712. <div class="box blue"></div>
  713. 已做未评改
  714. </div>
  715. <div class="item">
  716. <div class="box yellow"></div>
  717. 少选
  718. </div>
  719. <div class="item">
  720. <div class="box white"></div>
  721. 未做
  722. </div>
  723. </div>
  724. <div class="card__content">
  725. <ul class="list">
  726. <li
  727. class="item white"
  728. v-for="(item, index) in questionList"
  729. :key="index"
  730. :class="{
  731. green: isRight(item, index),
  732. red: isWrong(item, index),
  733. yellow: isPart(item, index),
  734. blue: isOver(item, index),
  735. }"
  736. @click="changeIndex(index)"
  737. >
  738. {{ index + 1 }}
  739. </li>
  740. </ul>
  741. </div>
  742. </div>
  743. </div>
  744. </div>
  745. </div>
  746. </div>
  747. </div>
  748. </div>
  749. </section>
  750. <ToolBar></ToolBar>
  751. <Footer></Footer>
  752. </div>
  753. </template>
  754. <script>
  755. import Footer from "@/components/footer/index";
  756. import Header from "@/components/header/index";
  757. import ToolBar from "@/components/toolbar/index";
  758. import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
  759. import { mapMutations } from "vuex";
  760. export default {
  761. name: "BankExplain",
  762. components: {
  763. Footer,
  764. Header,
  765. ToolBar,
  766. HeaderTabBox
  767. },
  768. data() {
  769. return {
  770. recordId: 0,
  771. questionIndex: 0,
  772. checked: false,
  773. questionList: [],
  774. judge: ["错误", "正确"],
  775. ast: [
  776. "A",
  777. "B",
  778. "C",
  779. "D",
  780. "E",
  781. "F",
  782. "G",
  783. "H",
  784. "I",
  785. "J",
  786. "K",
  787. "L",
  788. "M",
  789. "N",
  790. "O",
  791. "P",
  792. "Q",
  793. "R",
  794. "S",
  795. "T",
  796. "U",
  797. "V",
  798. "W",
  799. "X",
  800. "Y",
  801. "Z",
  802. ],
  803. lastCount: 0,
  804. examId: 0,
  805. goodsId: 0,
  806. courseId: 0,
  807. gradeId: 0,
  808. moduleId: 0,
  809. chapterId: 0,
  810. current: 0,
  811. };
  812. },
  813. async mounted() {
  814. this.recordId = this.$route.params.recordId;
  815. this.examId = this.$route.query.examId;
  816. this.goodsQuestionList();
  817. },
  818. methods: {
  819. ...mapMutations(["setExamResult"]),
  820. toFixed(num) {
  821. if (num) {
  822. let str = String(num).indexOf(".");
  823. if (str != -1) {
  824. return +num.toFixed(2);
  825. } else {
  826. return num;
  827. }
  828. } else {
  829. return 0;
  830. }
  831. },
  832. changeIndex(index) {
  833. this.current = index;
  834. },
  835. /**
  836. * 请求题目列表
  837. */
  838. goodsQuestionList() {
  839. this.$request.mockReport(this.recordId).then(async (res) => {
  840. this.questionList = JSON.parse(res.data.historyExamJson);
  841. });
  842. },
  843. nextQuestion() {
  844. if (this.current >= this.questionList.length - 1) {
  845. this.$message({
  846. type: "warning",
  847. message: "已经是最后一题了!",
  848. });
  849. return;
  850. }
  851. this.current++;
  852. },
  853. prevQuestion() {
  854. if (this.current == 0) {
  855. this.$message({
  856. type: "warning",
  857. message: "已经是第一题了!",
  858. });
  859. return;
  860. } else {
  861. this.current--;
  862. }
  863. },
  864. isOver(item, index) {
  865. if (this.questionList[index].ques) {
  866. if (item.type == 4) {
  867. //案例题
  868. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  869. if (
  870. jsonItem.type == 1 ||
  871. jsonItem.type == 2 ||
  872. jsonItem.type == 3
  873. ) {
  874. if (item.ques[indexs]) {
  875. return true;
  876. } else {
  877. return false;
  878. }
  879. } else if (jsonItem.type == 5) {
  880. // if (
  881. // item.ques[indexs] &&
  882. // (item.ques[indexs].text || item.ques[indexs].imageList.length)
  883. // ) {
  884. // console.log("chil");
  885. // return true;
  886. // } else {
  887. // return false;
  888. // }
  889. }
  890. });
  891. if (isOver) {
  892. return true;
  893. } else {
  894. return false;
  895. }
  896. } else if (item.type == 5) {
  897. //简答题
  898. //每一项都相等
  899. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  900. return true;
  901. }
  902. //判断
  903. } else {
  904. return false;
  905. }
  906. } else {
  907. return false;
  908. }
  909. },
  910. isRight(item, index) {
  911. //单选
  912. if (this.questionList[index].ques) {
  913. if (item.type == 1) {
  914. console.log(
  915. this.questionList[index].ques == this.questionList[index].ans
  916. );
  917. return this.questionList[index].ques == this.questionList[index].ans;
  918. //多选
  919. } else if (item.type == 2) {
  920. //每一项都相等
  921. return this.questionList[index].ans.every((item, i) => {
  922. return item == this.questionList[index].ques[i];
  923. });
  924. //判断
  925. } else if (item.type == 3) {
  926. return this.questionList[index].ques == this.questionList[index].ans;
  927. } else {
  928. return false;
  929. }
  930. } else {
  931. return false;
  932. }
  933. },
  934. isWrong(item, index) {
  935. if (this.questionList[index].ques) {
  936. //单选
  937. if (item.type == 1) {
  938. return this.questionList[index].ques != this.questionList[index].ans;
  939. //多选
  940. } else if (item.type == 2) {
  941. //每一项都相等
  942. return this.questionList[index].ques.some((item, i) => {
  943. return this.questionList[index].ans.indexOf(item) == -1;
  944. });
  945. //判断
  946. } else if (item.type == 3) {
  947. return this.questionList[index].ques != this.questionList[index].ans;
  948. } else {
  949. return false;
  950. }
  951. } else {
  952. return false;
  953. }
  954. },
  955. isPart(item, index) {
  956. if (this.questionList[index].ques) {
  957. if (item.type == 2) {
  958. let isWrong = this.questionList[index].ques.some((item, i) => {
  959. return this.questionList[index].ans.indexOf(item) == -1;
  960. });
  961. let isRight = this.questionList[index].ans.every((item, i) => {
  962. return item == this.questionList[index].ques[i];
  963. });
  964. if (!isRight && !isWrong) {
  965. return true;
  966. }
  967. }
  968. } else {
  969. return false;
  970. }
  971. },
  972. right(bankIndex, ansIndex, option) {
  973. if (
  974. this.questionList[bankIndex].ques[ansIndex] &&
  975. this.questionList[bankIndex].ans[ansIndex]
  976. ) {
  977. if (
  978. this.questionList[bankIndex].ques[ansIndex].indexOf(
  979. option.optionsId
  980. ) != -1 ||
  981. this.questionList[bankIndex].ans[ansIndex].indexOf(
  982. option.optionsId
  983. ) != -1
  984. ) {
  985. return true;
  986. } else {
  987. return false;
  988. }
  989. } else {
  990. return false;
  991. }
  992. },
  993. wrong(bankIndex, ansIndex, option) {
  994. if (
  995. this.questionList[bankIndex].ques[ansIndex] &&
  996. this.questionList[bankIndex].ans[ansIndex]
  997. ) {
  998. if (
  999. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1000. option.optionsId
  1001. ) != -1 &&
  1002. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1003. option.optionsId
  1004. ) == -1
  1005. ) {
  1006. return true;
  1007. } else {
  1008. return false;
  1009. }
  1010. } else {
  1011. return false;
  1012. }
  1013. },
  1014. /**
  1015. * 获取已经回答的题目数
  1016. * hasSpecail (是否包含简答和案例)
  1017. */
  1018. questionOverNum(hasSpecail) {
  1019. let count = 0;
  1020. this.questionList.forEach((item) => {
  1021. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1022. if (item.ques) {
  1023. count++;
  1024. }
  1025. } else if (item.type == 4) {
  1026. //案例题
  1027. if (hasSpecail) {
  1028. let isOver = item.jsonStr.every((jsonItem, index) => {
  1029. if (
  1030. jsonItem.type == 1 ||
  1031. jsonItem.type == 2 ||
  1032. jsonItem.type == 3
  1033. ) {
  1034. if (item.ques[index]) {
  1035. return true;
  1036. } else {
  1037. return false;
  1038. }
  1039. } else if (jsonItem.type == 5) {
  1040. // if (
  1041. // item.ques[index] &&
  1042. // (item.ques[index].text || item.ques[index].imageList.length)
  1043. // ) {
  1044. // return true;
  1045. // } else {
  1046. // return false;
  1047. // }
  1048. }
  1049. });
  1050. if (isOver) {
  1051. count++;
  1052. console.log(item, 444);
  1053. }
  1054. }
  1055. } else if (item.type == 5) {
  1056. //简答题
  1057. if (hasSpecail) {
  1058. // if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1059. // console.log(5, item);
  1060. // count++;
  1061. // }
  1062. }
  1063. }
  1064. });
  1065. return count;
  1066. },
  1067. collect() {
  1068. this.$message({
  1069. message: "试做题目,不支持收藏~",
  1070. type: "warning",
  1071. });
  1072. return;
  1073. },
  1074. },
  1075. };
  1076. </script>
  1077. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1078. <style scoped lang="scss">
  1079. .course-exam {
  1080. .section {
  1081. overflow: hidden;
  1082. &__header {
  1083. height: 20px;
  1084. margin-top: 20px;
  1085. }
  1086. &__body {
  1087. .explain-record {
  1088. &__header {
  1089. }
  1090. &__body {
  1091. margin-bottom: 20px;
  1092. border: 1px solid #eee;
  1093. .left-box {
  1094. float: left;
  1095. width: 970px;
  1096. min-height: 630px;
  1097. border: 1px solid #eee;
  1098. &__body {
  1099. .question {
  1100. padding: 12px 0 0 12px;
  1101. &__title {
  1102. padding-left: 12px;
  1103. font-size: 16px;
  1104. font-family: Microsoft YaHei;
  1105. font-weight: bold;
  1106. color: #333333;
  1107. line-height: 24px;
  1108. }
  1109. &__desc {
  1110. padding-left: 12px;
  1111. margin-top: 20px;
  1112. font-size: 16px;
  1113. font-family: Microsoft YaHei;
  1114. font-weight: 400;
  1115. color: #666666;
  1116. line-height: 24px;
  1117. /deep/ img {
  1118. max-width: 100% !important;
  1119. }
  1120. }
  1121. &__content {
  1122. /deep/ .el-tabs__item {
  1123. height: 40px;
  1124. line-height: 40px;
  1125. }
  1126. .question__content {
  1127. height: auto;
  1128. overflow: auto;
  1129. }
  1130. .question-list {
  1131. padding: 24px 0 0 24px;
  1132. .checkbox,
  1133. .radio {
  1134. cursor: pointer;
  1135. margin-right: 24px;
  1136. padding: 0 24px;
  1137. display: flex;
  1138. align-items: center;
  1139. margin-top: 2px;
  1140. min-height: 40px;
  1141. padding-top: 10px;
  1142. padding-bottom: 10px;
  1143. background: #f5f9ff;
  1144. border-radius: 8px;
  1145. box-sizing: border-box;
  1146. &.right {
  1147. background: #37c65b;
  1148. }
  1149. &.wrong {
  1150. background: #ff3a30;
  1151. }
  1152. }
  1153. &.textarea {
  1154. margin-right: 12px;
  1155. .upload {
  1156. margin-top: 10px;
  1157. &__imgs {
  1158. margin-right: 10px;
  1159. width: 80px;
  1160. height: 80px;
  1161. background: #ffffff;
  1162. border: 1px solid #eeeeee;
  1163. border-radius: 4px;
  1164. position: relative;
  1165. display: flex;
  1166. float: left;
  1167. align-items: center;
  1168. justify-content: center;
  1169. img {
  1170. max-width: 100%;
  1171. max-height: 100%;
  1172. }
  1173. }
  1174. &__btn {
  1175. margin-right: 10px;
  1176. width: 80px;
  1177. height: 80px;
  1178. background: #ffffff;
  1179. border: 1px solid #eeeeee;
  1180. border-radius: 4px;
  1181. position: relative;
  1182. display: flex;
  1183. float: left;
  1184. align-items: center;
  1185. justify-content: center;
  1186. flex-direction: column;
  1187. .icon {
  1188. font-size: 20px;
  1189. color: #3f8dfd;
  1190. }
  1191. p {
  1192. font-size: 12px;
  1193. font-family: Microsoft YaHei;
  1194. font-weight: 400;
  1195. color: #999999;
  1196. line-height: 24px;
  1197. }
  1198. input {
  1199. position: absolute;
  1200. left: 0;
  1201. top: 0;
  1202. display: block;
  1203. width: 100%;
  1204. height: 100%;
  1205. opacity: 0;
  1206. }
  1207. }
  1208. }
  1209. }
  1210. /deep/
  1211. .el-checkbox__input.is-checked
  1212. + .el-checkbox__label {
  1213. color: #000 !important;
  1214. }
  1215. /deep/
  1216. .el-checkbox__input.is-disabled
  1217. + span.el-checkbox__label {
  1218. color: #000;
  1219. }
  1220. /deep/ .el-checkbox {
  1221. white-space: normal;
  1222. }
  1223. }
  1224. .answer-list {
  1225. height: 40px;
  1226. border-top: 1px solid #eee;
  1227. border-bottom: 1px solid #eee;
  1228. margin-top: 24px;
  1229. display: flex;
  1230. align-items: center;
  1231. justify-content: space-between;
  1232. padding: 0 24px;
  1233. &__left {
  1234. font-size: 16px;
  1235. font-family: Microsoft YaHei;
  1236. font-weight: 400;
  1237. color: #333333;
  1238. line-height: 24px;
  1239. }
  1240. &__right {
  1241. font-size: 16px;
  1242. font-family: Microsoft YaHei;
  1243. font-weight: 400;
  1244. color: #333333;
  1245. line-height: 24px;
  1246. }
  1247. }
  1248. .explain-list {
  1249. padding: 12px 24px;
  1250. &__header {
  1251. font-size: 16px;
  1252. font-family: Microsoft YaHei;
  1253. font-weight: bold;
  1254. color: #666666;
  1255. line-height: 24px;
  1256. }
  1257. &__body {
  1258. margin-top: 12px;
  1259. font-size: 16px;
  1260. font-family: Microsoft YaHei;
  1261. font-weight: 400;
  1262. color: #666666;
  1263. line-height: 24px;
  1264. }
  1265. .upload {
  1266. margin-top: 10px;
  1267. &__imgs {
  1268. margin-right: 10px;
  1269. width: 80px;
  1270. height: 80px;
  1271. background: #ffffff;
  1272. border: 1px solid #eeeeee;
  1273. border-radius: 4px;
  1274. position: relative;
  1275. display: flex;
  1276. float: left;
  1277. align-items: center;
  1278. justify-content: center;
  1279. img {
  1280. max-width: 100%;
  1281. max-height: 100%;
  1282. }
  1283. }
  1284. }
  1285. }
  1286. }
  1287. &__btns {
  1288. position: relative;
  1289. height: 32px;
  1290. .submit {
  1291. cursor: pointer;
  1292. margin: 0 auto;
  1293. width: 140px;
  1294. height: 32px;
  1295. background: #3f8dfd;
  1296. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1297. border-radius: 16px;
  1298. text-align: center;
  1299. line-height: 32px;
  1300. color: #fff;
  1301. font-size: 16px;
  1302. }
  1303. .collect {
  1304. cursor: pointer;
  1305. position: absolute;
  1306. right: 0;
  1307. top: 5px;
  1308. font-size: 12px;
  1309. font-family: Microsoft YaHei;
  1310. font-weight: 400;
  1311. color: #3f8dfd;
  1312. line-height: 24px;
  1313. }
  1314. }
  1315. }
  1316. }
  1317. &__footer {
  1318. height: 40px;
  1319. display: flex;
  1320. justify-content: space-around;
  1321. align-items: center;
  1322. .btn {
  1323. cursor: pointer;
  1324. width: 140px;
  1325. height: 32px;
  1326. background: #ffffff;
  1327. border: 1px solid #3f8dfd;
  1328. border-radius: 16px;
  1329. line-height: 32px;
  1330. text-align: center;
  1331. color: #3f8dfd;
  1332. }
  1333. }
  1334. }
  1335. .right-box {
  1336. float: right;
  1337. width: 299px;
  1338. border-right: 1px solid #eee;
  1339. &__header {
  1340. height: 40px;
  1341. line-height: 40px;
  1342. font-size: 16px;
  1343. font-family: Microsoft YaHei;
  1344. font-weight: bold;
  1345. color: #333333;
  1346. text-align: center;
  1347. border-bottom: 1px solid #eeeeee;
  1348. .back-btn {
  1349. display: block;
  1350. margin: 0 auto;
  1351. width: 160px;
  1352. }
  1353. }
  1354. &__body {
  1355. height: 510px;
  1356. border-bottom: 1px solid #eee;
  1357. .card {
  1358. &__note {
  1359. display: flex;
  1360. height: 64px;
  1361. align-items: center;
  1362. border-bottom: 1px solid #eee;
  1363. flex-wrap: wrap;
  1364. .item {
  1365. display: flex;
  1366. align-items: center;
  1367. margin-left: 10px;
  1368. width: 84px;
  1369. font-size: 12px;
  1370. .box {
  1371. margin-right: 5px;
  1372. width: 16px;
  1373. height: 16px;
  1374. border-radius: 4px;
  1375. &.white {
  1376. background: #ffffff;
  1377. border: 1px solid #eeeeee;
  1378. }
  1379. &.green {
  1380. background: #37c65b;
  1381. }
  1382. &.red {
  1383. background: #ff3a30;
  1384. }
  1385. &.yellow {
  1386. background: #ffc53d;
  1387. }
  1388. &.blue {
  1389. background: #3f8dfd;
  1390. }
  1391. }
  1392. }
  1393. }
  1394. &__content {
  1395. height: 440px;
  1396. overflow-y: scroll;
  1397. &::-webkit-scrollbar {
  1398. width: 6px;
  1399. }
  1400. &::-webkit-scrollbar-track {
  1401. background-color: #fff;
  1402. -webkit-border-radius: 2em;
  1403. -moz-border-radius: 2em;
  1404. border-radius: 2em;
  1405. }
  1406. &::-webkit-scrollbar-thumb {
  1407. background-color: #eeeeee;
  1408. -webkit-border-radius: 2em;
  1409. -moz-border-radius: 2em;
  1410. border-radius: 2em;
  1411. }
  1412. .list {
  1413. display: flex;
  1414. flex-wrap: wrap;
  1415. .item {
  1416. width: 40px;
  1417. height: 40px;
  1418. border-radius: 10px;
  1419. text-align: center;
  1420. line-height: 40px;
  1421. margin-left: 16px;
  1422. margin-top: 16px;
  1423. cursor: pointer;
  1424. &.white {
  1425. line-height: 38px;
  1426. color: #333333;
  1427. background: #ffffff;
  1428. border: 1px solid #eeeeee;
  1429. }
  1430. &.green {
  1431. color: #fff;
  1432. background: #37c65b;
  1433. }
  1434. &.red {
  1435. color: #fff;
  1436. background: #ff3a30;
  1437. }
  1438. &.blue {
  1439. border: 1rpx solid #eeeeee;
  1440. color: #fff;
  1441. background: #3f8dfd;
  1442. }
  1443. &.yellow {
  1444. background: #ffc53d;
  1445. }
  1446. &.disabled {
  1447. cursor: not-allowed;
  1448. line-height: 38px;
  1449. color: #eeeeee;
  1450. background: #ffffff;
  1451. border: 1px solid #eeeeee;
  1452. }
  1453. }
  1454. }
  1455. }
  1456. }
  1457. }
  1458. &__footer {
  1459. border-bottom: 1px solid #eee;
  1460. height: 40px;
  1461. display: flex;
  1462. align-items: center;
  1463. justify-content: center;
  1464. .submit {
  1465. cursor: pointer;
  1466. width: 140px;
  1467. height: 32px;
  1468. background: #3f8dfd;
  1469. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1470. border-radius: 16px;
  1471. line-height: 32px;
  1472. text-align: center;
  1473. color: #fff;
  1474. font-size: 16px;
  1475. }
  1476. }
  1477. }
  1478. }
  1479. }
  1480. }
  1481. &__footer {
  1482. height: 20px;
  1483. margin-top: 20px;
  1484. }
  1485. }
  1486. .take-photo {
  1487. /deep/ .el-dialog__header {
  1488. display: none;
  1489. }
  1490. /deep/ .el-dialog__body {
  1491. padding: 0;
  1492. overflow: unset;
  1493. }
  1494. &__close {
  1495. cursor: pointer;
  1496. position: absolute;
  1497. right: 0;
  1498. top: -28px;
  1499. width: 24px;
  1500. height: 24px;
  1501. line-height: 24px;
  1502. text-align: center;
  1503. color: #eee;
  1504. border: 1px solid #eee;
  1505. border-radius: 50%;
  1506. }
  1507. &__header {
  1508. height: 40px;
  1509. border-bottom: 1px solid #eee;
  1510. line-height: 40px;
  1511. font-size: 16px;
  1512. font-family: Microsoft YaHei;
  1513. font-weight: bold;
  1514. color: #333333;
  1515. padding-left: 24px;
  1516. }
  1517. &__body {
  1518. height: 400px;
  1519. padding: 40px 24px;
  1520. .left-box {
  1521. width: 336px;
  1522. float: left;
  1523. .title {
  1524. font-size: 16px;
  1525. font-family: Microsoft YaHei;
  1526. font-weight: bold;
  1527. color: #ff3b30;
  1528. line-height: 24px;
  1529. }
  1530. .content {
  1531. font-size: 14px;
  1532. font-family: Microsoft YaHei;
  1533. font-weight: 400;
  1534. color: #333333;
  1535. line-height: 28px;
  1536. margin-top: 32px;
  1537. }
  1538. }
  1539. .right-box {
  1540. float: right;
  1541. width: 400px;
  1542. height: 300px;
  1543. video {
  1544. width: 100%;
  1545. height: 100%;
  1546. }
  1547. }
  1548. }
  1549. &__footer {
  1550. height: 90px;
  1551. border-top: 1px solid #eee;
  1552. text-align: center;
  1553. .take {
  1554. display: inline-block;
  1555. width: 200px;
  1556. height: 40px;
  1557. padding: 0;
  1558. border-radius: 20px;
  1559. text-align: center;
  1560. line-height: 40px;
  1561. margin: 24px auto;
  1562. }
  1563. }
  1564. }
  1565. }
  1566. </style>