wrong-bank.vue 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125
  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">
  19. <div class="left-box">
  20. <div class="left-box__header">
  21. <el-progress
  22. class="progress"
  23. :text-inside="true"
  24. :stroke-width="26"
  25. :percentage="
  26. toFixed(
  27. (questionOverNum(true) / questionList.length) * 100
  28. ) || 0
  29. "
  30. ></el-progress>
  31. <div class="text">
  32. 已完成<span>{{ questionOverNum(true) }}</span
  33. >/{{ questionList.length }}道题
  34. </div>
  35. </div>
  36. <div class="left-box__body">
  37. <template v-for="(question, questionIndex) in questionList">
  38. <div
  39. class="question"
  40. v-if="question.type == 1 && current == questionIndex"
  41. :key="questionIndex"
  42. >
  43. <div class="question__title">
  44. {{ questionIndex + 1 }}、单选题
  45. </div>
  46. <div
  47. class="question__desc"
  48. v-html="question.content"
  49. ></div>
  50. <div class="question__content">
  51. <div class="question-list" v-if="!question.ques">
  52. <div
  53. class="radio"
  54. v-for="(item, index) in question.jsonStr"
  55. :key="index"
  56. @click="
  57. radioSelect(
  58. question,
  59. questionIndex,
  60. item.optionsId
  61. )
  62. "
  63. >
  64. <div>{{ ast[index] }}. {{ item.content }}</div>
  65. </div>
  66. </div>
  67. <div class="question-list" v-if="question.ques">
  68. <div
  69. class="radio"
  70. :class="{
  71. right:
  72. item.optionsId == question.ques ||
  73. item.optionsId == question.ans,
  74. wrong:
  75. item.optionsId == question.ques &&
  76. question.ques != question.ans,
  77. }"
  78. v-for="(item, index) in question.jsonStr"
  79. :key="index"
  80. >
  81. <div>{{ ast[index] }}. {{ item.content }}</div>
  82. </div>
  83. </div>
  84. <div class="answer-list" v-if="question.ques">
  85. <div class="answer-list__left">
  86. 正确答案:{{ ast[question.ans - 1] }}
  87. </div>
  88. <div class="answer-list__left" v-if="!explain">
  89. 我的答案:{{ ast[question.ques - 1] }}
  90. </div>
  91. </div>
  92. <div class="explain-list" v-if="question.ques">
  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. class="checkbox"
  120. v-for="(item, index) in question.jsonStr"
  121. :key="index"
  122. :label="item.optionsId"
  123. v-model="item.checked"
  124. >
  125. <div>{{ ast[index] }}. {{ item.content }}</div>
  126. </el-checkbox>
  127. </div>
  128. <div class="question-list" v-if="question.ques">
  129. <el-checkbox
  130. disabled
  131. class="checkbox"
  132. :class="{
  133. right:
  134. question.ques.indexOf(item.optionsId) != -1 ||
  135. question.ans.indexOf(item.optionsId) != -1,
  136. wrong:
  137. question.ques.indexOf(item.optionsId) != -1 &&
  138. question.ans.indexOf(item.optionsId) == -1,
  139. }"
  140. v-for="(item, index) in question.jsonStr"
  141. :key="index"
  142. :label="item.optionsId"
  143. v-model="item.checked"
  144. >
  145. <div>{{ ast[index] }}. {{ item.content }}</div>
  146. </el-checkbox>
  147. </div>
  148. <div class="answer-list" v-if="question.ques">
  149. <div class="answer-list__left">
  150. 正确答案:
  151. <template v-for="ansItem in question.ans">{{
  152. ast[ansItem - 1]
  153. }}</template>
  154. </div>
  155. <div class="answer-list__left" v-if="!explain">
  156. 我的答案:
  157. <template v-for="quesItem in question.ques">{{
  158. ast[quesItem - 1]
  159. }}</template>
  160. </div>
  161. </div>
  162. <div class="explain-list" v-if="question.ques">
  163. <div class="explain-list__header">答案解析:</div>
  164. <div
  165. class="explain-list__body"
  166. v-if="question.analysisContent"
  167. ></div>
  168. </div>
  169. </div>
  170. <div class="question__btns">
  171. <div
  172. v-if="!question.ques"
  173. class="submit"
  174. @click="checkboxSubmit(question, questionIndex)"
  175. >
  176. 确认答案
  177. </div>
  178. <!-- <div class="collect" @click="collect">收藏本题</div> -->
  179. </div>
  180. </div>
  181. <div
  182. class="question"
  183. v-if="question.type == 3 && current == questionIndex"
  184. :key="questionIndex"
  185. >
  186. <div class="question__title">
  187. {{ questionIndex + 1 }}、判断题
  188. </div>
  189. <div
  190. class="question__desc"
  191. v-html="question.content"
  192. ></div>
  193. <div class="question__content">
  194. <div class="question-list" v-if="!question.ques">
  195. <div
  196. class="radio"
  197. v-for="(item, index) in judge"
  198. :key="index"
  199. @click="judgeSelect(question, questionIndex, index)"
  200. >
  201. <div>{{ ast[index] }}. {{ item }}</div>
  202. </div>
  203. </div>
  204. <div class="question-list" v-if="question.ques">
  205. <div
  206. class="radio"
  207. :class="{
  208. right:
  209. index == question.ques || index == question.ans,
  210. wrong:
  211. index == question.ques &&
  212. question.ques != question.ans,
  213. }"
  214. v-for="(item, index) in judge"
  215. :key="index"
  216. >
  217. <div>{{ ast[index] }}. {{ item }}</div>
  218. </div>
  219. </div>
  220. <div class="answer-list" v-if="question.ques">
  221. <div class="answer-list__left">
  222. 正确答案:{{ ast[question.ans] }}
  223. </div>
  224. <div class="answer-list__left" v-if="!explain">
  225. 我的答案:{{ ast[question.ques] }}
  226. </div>
  227. </div>
  228. <div class="explain-list" v-if="question.ques">
  229. <div class="explain-list__header">答案解析:</div>
  230. <div
  231. class="explain-list__body"
  232. v-html="question.analysisContent"
  233. ></div>
  234. </div>
  235. </div>
  236. <div class="question__btns">
  237. <!-- <div class="collect" @click="collect">收藏本题</div> -->
  238. </div>
  239. </div>
  240. <div
  241. class="question"
  242. v-if="question.type == 4 && current == questionIndex"
  243. :key="questionIndex"
  244. >
  245. <div class="question__title">
  246. {{ questionIndex + 1 }}、案例题
  247. </div>
  248. <div class="question__content">
  249. <el-tabs v-model="question.tabIndex">
  250. <el-tab-pane
  251. v-for="(json, jsonIndex) in question.jsonStr"
  252. :label="'问题' + (jsonIndex + 1)"
  253. :name="jsonIndex + ''"
  254. :key="jsonIndex"
  255. >
  256. <div
  257. class="question"
  258. v-if="json.type == 1"
  259. :key="questionIndex"
  260. >
  261. <div class="question__title">
  262. {{ jsonIndex + 1 }}、单选题
  263. </div>
  264. <div
  265. class="question__desc"
  266. v-html="json.content"
  267. ></div>
  268. <div class="question__content">
  269. <div
  270. class="question-list"
  271. v-if="!question.ques[jsonIndex]"
  272. >
  273. <div
  274. class="radio"
  275. v-for="(item, index) in json.optionsList"
  276. :key="index"
  277. @click="
  278. radioSelectChild(
  279. questionIndex,
  280. jsonIndex,
  281. item.optionsId
  282. )
  283. "
  284. >
  285. <div>
  286. {{ ast[index] }}. {{ item.content }}
  287. </div>
  288. </div>
  289. </div>
  290. <div
  291. class="question-list"
  292. v-if="question.ques[jsonIndex]"
  293. >
  294. <div
  295. class="radio"
  296. :class="{
  297. right:
  298. item.optionsId ==
  299. question.ques[jsonIndex] ||
  300. item.optionsId ==
  301. question.ans[jsonIndex],
  302. wrong:
  303. item.optionsId ==
  304. question.ques[jsonIndex] &&
  305. question.ques[jsonIndex] !=
  306. question.ans[jsonIndex],
  307. }"
  308. v-for="(item, index) in json.optionsList"
  309. :key="index"
  310. >
  311. <div>
  312. {{ ast[index] }}. {{ item.content }}
  313. </div>
  314. </div>
  315. </div>
  316. <div
  317. class="answer-list"
  318. v-if="question.ques[jsonIndex]"
  319. >
  320. <div class="answer-list__left">
  321. 正确答案:{{
  322. ast[question.ans[jsonIndex] - 1]
  323. }}
  324. </div>
  325. <div
  326. class="answer-list__left"
  327. v-if="!explain"
  328. >
  329. 我的答案:{{
  330. ast[question.ques[jsonIndex] - 1]
  331. }}
  332. </div>
  333. </div>
  334. <div
  335. class="explain-list"
  336. v-if="question.ques[jsonIndex]"
  337. >
  338. <div class="explain-list__header">
  339. 答案解析:
  340. </div>
  341. <div
  342. class="explain-list__body"
  343. v-html="json.analysisContent"
  344. ></div>
  345. </div>
  346. </div>
  347. <div class="question__btns"></div>
  348. </div>
  349. <div
  350. class="question"
  351. v-if="json.type == 2"
  352. :key="jsonIndex"
  353. >
  354. <div class="question__title">
  355. {{ jsonIndex + 1 }}、多选题
  356. </div>
  357. <div
  358. class="question__desc"
  359. v-html="json.content"
  360. ></div>
  361. <div class="question__content">
  362. <div
  363. class="question-list"
  364. v-if="!question.ques[jsonIndex]"
  365. >
  366. <el-checkbox
  367. class="checkbox"
  368. v-for="(item, index) in json.optionsList"
  369. :key="index"
  370. :label="item.optionsId"
  371. v-model="item.checked"
  372. >
  373. <div>
  374. {{ ast[index] }}. {{ item.content }}
  375. </div>
  376. </el-checkbox>
  377. </div>
  378. <div
  379. class="question-list"
  380. v-if="question.ques[jsonIndex]"
  381. >
  382. <el-checkbox
  383. disabled
  384. class="checkbox"
  385. :class="{
  386. right:
  387. question.ques[jsonIndex].indexOf(
  388. item.optionsId
  389. ) != -1 ||
  390. question.ans[jsonIndex].indexOf(
  391. item.optionsId
  392. ) != -1,
  393. wrong:
  394. question.ques[jsonIndex].indexOf(
  395. item.optionsId
  396. ) != -1 &&
  397. question.ans[jsonIndex].indexOf(
  398. item.optionsId
  399. ) == -1,
  400. }"
  401. v-for="(item, index) in json.optionsList"
  402. :key="index"
  403. :label="item.optionsId"
  404. v-model="item.checked"
  405. >
  406. <div>
  407. {{ ast[index] }}. {{ item.content }}
  408. </div>
  409. </el-checkbox>
  410. </div>
  411. <div
  412. class="answer-list"
  413. v-if="question.ques[jsonIndex]"
  414. >
  415. <div class="answer-list__left">
  416. 正确答案:
  417. <template
  418. v-for="ansItem in question.ans[jsonIndex]"
  419. >{{ ast[ansItem - 1] }}</template
  420. >
  421. </div>
  422. <div
  423. class="answer-list__left"
  424. v-if="!explain"
  425. >
  426. 我的答案:
  427. <template
  428. v-for="quesItem in question.ques[
  429. jsonIndex
  430. ]"
  431. >{{ ast[quesItem - 1] }}</template
  432. >
  433. </div>
  434. </div>
  435. <div
  436. class="explain-list"
  437. v-if="question.ques[jsonIndex]"
  438. >
  439. <div class="explain-list__header">
  440. 答案解析:
  441. </div>
  442. <div
  443. class="explain-list__body"
  444. v-html="json.analysisContent"
  445. ></div>
  446. </div>
  447. </div>
  448. <div class="question__btns">
  449. <div
  450. v-if="!question.ques[jsonIndex]"
  451. class="submit"
  452. @click="
  453. checkboxSubmitChild(
  454. questionIndex,
  455. jsonIndex
  456. )
  457. "
  458. >
  459. 确认答案
  460. </div>
  461. </div>
  462. </div>
  463. <div
  464. class="question"
  465. v-if="json.type == 3"
  466. :key="jsonIndex"
  467. >
  468. <div class="question__title">
  469. {{ jsonIndex + 1 }}、判断题
  470. </div>
  471. <div
  472. class="question__desc"
  473. v-html="json.content"
  474. ></div>
  475. <div class="question__content">
  476. <div
  477. class="question-list"
  478. v-if="!question.ques[jsonIndex]"
  479. >
  480. <div
  481. class="radio"
  482. v-for="(item, index) in judge"
  483. :key="index"
  484. @click="
  485. judgeSelectChild(
  486. questionIndex,
  487. jsonIndex,
  488. index
  489. )
  490. "
  491. >
  492. <div>{{ ast[index] }}. {{ item }}</div>
  493. </div>
  494. </div>
  495. <div
  496. class="question-list"
  497. v-if="question.ques[jsonIndex]"
  498. >
  499. <div
  500. class="radio"
  501. :class="{
  502. right:
  503. index == question.ques[jsonIndex] ||
  504. index == question.ans[jsonIndex],
  505. wrong:
  506. index == question.ques[jsonIndex] &&
  507. question.ques[jsonIndex] !=
  508. question.ans[jsonIndex],
  509. }"
  510. v-for="(item, index) in judge"
  511. :key="index"
  512. >
  513. <div>{{ ast[index] }}. {{ item }}</div>
  514. </div>
  515. </div>
  516. <div
  517. class="answer-list"
  518. v-if="question.ques[jsonIndex]"
  519. >
  520. <div class="answer-list__left">
  521. 正确答案:{{ ast[question.ans[jsonIndex]] }}
  522. </div>
  523. <div
  524. class="answer-list__left"
  525. v-if="!explain"
  526. >
  527. 我的答案:{{
  528. ast[question.ques[jsonIndex]]
  529. }}
  530. </div>
  531. </div>
  532. <div
  533. class="explain-list"
  534. v-if="question.ques[jsonIndex]"
  535. >
  536. <div class="explain-list__header">
  537. 答案解析:
  538. </div>
  539. <div
  540. class="explain-list__body"
  541. v-html="json.analysisContent"
  542. ></div>
  543. </div>
  544. </div>
  545. <div class="question__btns"></div>
  546. </div>
  547. <div
  548. class="question"
  549. v-if="json.type == 5"
  550. :key="jsonIndex"
  551. >
  552. <div class="question__title">
  553. {{ jsonIndex }}、简答题
  554. </div>
  555. <div
  556. class="question__desc"
  557. v-html="json.content"
  558. ></div>
  559. <div class="question__content">
  560. <div
  561. class="question-list textarea"
  562. v-if="
  563. !(
  564. question.ques[jsonIndex] &&
  565. (question.ques[jsonIndex].imageList
  566. .length ||
  567. question.ques[jsonIndex].text)
  568. )
  569. "
  570. >
  571. <el-input
  572. type="textarea"
  573. rows="5"
  574. v-model="json.ansText.text"
  575. resize="none"
  576. ></el-input>
  577. <div class="upload clearfix">
  578. <div
  579. class="upload__imgs"
  580. v-for="(img, imgIndex) in json.ansText
  581. .imageList"
  582. :key="imgIndex"
  583. >
  584. <img
  585. :src="$tools.splitImgHost(img, true)"
  586. alt=""
  587. />
  588. </div>
  589. <div class="upload__btn">
  590. <i class="el-icon-plus icon"></i>
  591. <p>上传图片</p>
  592. <input
  593. @change="
  594. uploadImgChild(
  595. $event,
  596. questionIndex,
  597. jsonIndex
  598. )
  599. "
  600. type="file"
  601. />
  602. </div>
  603. </div>
  604. </div>
  605. <div
  606. class="explain-list"
  607. v-if="
  608. question.ques[jsonIndex] &&
  609. (question.ques[jsonIndex].imageList
  610. .length ||
  611. question.ques[jsonIndex].text) &&
  612. !explain
  613. "
  614. >
  615. <div class="explain-list__header">
  616. 我的答案:
  617. </div>
  618. <div class="explain-list__body">
  619. <div>
  620. {{ question.ques[jsonIndex].text }}
  621. </div>
  622. <div class="upload clearfix">
  623. <div
  624. class="upload__imgs"
  625. v-for="(img, imgIndex) in question.ques[
  626. jsonIndex
  627. ].imageList"
  628. :key="imgIndex"
  629. >
  630. <img
  631. :src="$tools.splitImgHost(img, true)"
  632. alt=""
  633. />
  634. </div>
  635. </div>
  636. </div>
  637. <div class="explain-list__header">
  638. 答案解析:
  639. </div>
  640. <div
  641. class="explain-list__body"
  642. v-html="question.analysisContent"
  643. ></div>
  644. </div>
  645. </div>
  646. <div class="question__btns">
  647. <div
  648. v-if="
  649. !(
  650. question.ques[jsonIndex] &&
  651. (question.ques[jsonIndex].imageList
  652. .length ||
  653. question.ques[jsonIndex].text)
  654. )
  655. "
  656. class="submit"
  657. @click="
  658. ansSubmitChild(
  659. question,
  660. questionIndex,
  661. jsonIndex
  662. )
  663. "
  664. >
  665. 确认答案
  666. </div>
  667. </div>
  668. </div>
  669. </el-tab-pane>
  670. </el-tabs>
  671. </div>
  672. <div class="question__btns">
  673. <!-- <div class="collect" @click="collect">收藏本题</div> -->
  674. </div>
  675. </div>
  676. <div
  677. class="question"
  678. v-if="question.type == 5 && current == questionIndex"
  679. :key="questionIndex"
  680. >
  681. <div class="question__title">
  682. {{ questionIndex }}、简答题
  683. </div>
  684. <div
  685. class="question__desc"
  686. v-html="question.content"
  687. ></div>
  688. <div class="question__content">
  689. <div
  690. class="question-list textarea"
  691. v-if="
  692. !question.ques.imageList.length &&
  693. !question.ques.text
  694. "
  695. >
  696. <el-input
  697. type="textarea"
  698. rows="5"
  699. v-model="question.ansText.text"
  700. resize="none"
  701. ></el-input>
  702. <div class="upload clearfix">
  703. <div
  704. class="upload__imgs"
  705. v-for="(img, imgIndex) in question.ansText
  706. .imageList"
  707. :key="imgIndex"
  708. >
  709. <img
  710. :src="$tools.splitImgHost(img, true)"
  711. alt=""
  712. />
  713. </div>
  714. <div class="upload__btn">
  715. <i class="el-icon-plus icon"></i>
  716. <p>上传图片</p>
  717. <input
  718. @change="
  719. uploadImg($event, question, questionIndex)
  720. "
  721. type="file"
  722. />
  723. </div>
  724. </div>
  725. </div>
  726. <div
  727. class="explain-list"
  728. v-if="
  729. (question.ques.imageList.length ||
  730. question.ques.text) &&
  731. !explain
  732. "
  733. >
  734. <div class="explain-list__header">我的答案:</div>
  735. <div class="explain-list__body">
  736. <div>{{ question.ques.text }}</div>
  737. <div class="upload clearfix">
  738. <div
  739. class="upload__imgs"
  740. v-for="(img, imgIndex) in question.ques
  741. .imageList"
  742. :key="imgIndex"
  743. >
  744. <img
  745. :src="$tools.splitImgHost(img, true)"
  746. alt=""
  747. />
  748. </div>
  749. </div>
  750. </div>
  751. <div class="explain-list__header">答案解析:</div>
  752. <div
  753. class="explain-list__body"
  754. v-html="question.analysisContent"
  755. ></div>
  756. </div>
  757. </div>
  758. <div class="question__btns">
  759. <div
  760. v-if="
  761. !question.ques.imageList.length &&
  762. !question.ques.text
  763. "
  764. class="submit"
  765. @click="ansSubmit(question, questionIndex)"
  766. >
  767. 确认答案
  768. </div>
  769. <!-- <div class="collect" @click="collect">收藏本题</div> -->
  770. </div>
  771. </div>
  772. </template>
  773. </div>
  774. <div class="left-box__footer">
  775. <div class="btn" @click="prevQuestion">上一题</div>
  776. <div class="btn" @click="nextQuestion">下一题</div>
  777. </div>
  778. </div>
  779. <div class="right-box">
  780. <div class="right-box__header">
  781. <el-button
  782. type="primary"
  783. round
  784. plain
  785. size="small"
  786. class="back-btn"
  787. @click="$router.back(-1)"
  788. >返回</el-button
  789. >
  790. </div>
  791. <div class="right-box__header">答题卡</div>
  792. <div class="right-box__body">
  793. <div class="card">
  794. <div class="card__note">
  795. <div class="item">
  796. <div class="box green"></div>
  797. 正确
  798. </div>
  799. <div class="item">
  800. <div class="box red"></div>
  801. 错误
  802. </div>
  803. <div class="item">
  804. <div class="box blue"></div>
  805. 已做未评改
  806. </div>
  807. <div class="item">
  808. <div class="box white"></div>
  809. 未做
  810. </div>
  811. </div>
  812. <div class="card__content">
  813. <ul class="list">
  814. <li
  815. class="item white"
  816. v-for="(item, index) in questionList"
  817. :key="index"
  818. :class="{
  819. green: isRight(item, index),
  820. red: isWrong(item, index),
  821. blue: isOver(item, index),
  822. }"
  823. @click="changeIndex(index)"
  824. >
  825. {{ index + 1 }}
  826. </li>
  827. </ul>
  828. </div>
  829. </div>
  830. </div>
  831. <div class="right-box__footer">
  832. <div class="submit" v-if="!explain" @click="submit">交卷</div>
  833. </div>
  834. </div>
  835. </div>
  836. </div>
  837. </div>
  838. </div>
  839. </section>
  840. <ToolBar></ToolBar>
  841. <Footer></Footer>
  842. </div>
  843. </template>
  844. <script>
  845. import Footer from "@/components/footer/index";
  846. import Header from "@/components/header/index";
  847. import ToolBar from "@/components/toolbar/index";
  848. import { mapMutations } from "vuex";
  849. export default {
  850. name: "BankExplain",
  851. components: {
  852. Footer,
  853. Header,
  854. ToolBar,
  855. },
  856. data() {
  857. return {
  858. questionIndex: 0,
  859. questionList: [],
  860. orderGoodsId: "",
  861. bankList: [],
  862. judge: ["错误", "正确"],
  863. ast: [
  864. "A",
  865. "B",
  866. "C",
  867. "D",
  868. "E",
  869. "F",
  870. "G",
  871. "H",
  872. "I",
  873. "J",
  874. "K",
  875. "L",
  876. "M",
  877. "N",
  878. "O",
  879. "P",
  880. "Q",
  881. "R",
  882. "S",
  883. "T",
  884. "U",
  885. "V",
  886. "W",
  887. "X",
  888. "Y",
  889. "Z",
  890. ],
  891. current: 0,
  892. examId: "",
  893. explain: "",
  894. };
  895. },
  896. async mounted() {
  897. this.examId = this.$route.params.examId;
  898. this.explain = this.$route.query.explain || "";
  899. this.orderGoodsId = this.$route.query.orderGoodsId || "";
  900. this.wrongRecordExamQuestionList();
  901. },
  902. methods: {
  903. toFixed(num) {
  904. if (num) {
  905. let str = String(num).indexOf(".");
  906. if (str != -1) {
  907. return +num.toFixed(2);
  908. } else {
  909. return num;
  910. }
  911. } else {
  912. return 0;
  913. }
  914. },
  915. /**
  916. * 请求题目列表
  917. */
  918. wrongRecordExamQuestionList() {
  919. this.$request
  920. .wrongRecordExamQuestionList({
  921. examId: this.examId,
  922. })
  923. .then(async (res) => {
  924. res.rows.forEach((item, index) => {
  925. if (typeof item.jsonStr == "string") {
  926. item.jsonStr = JSON.parse(item.jsonStr);
  927. if (item.type == 2) {
  928. //多选
  929. item.jsonStr.forEach((str) => {
  930. str.optionsId = "" + str.optionsId;
  931. });
  932. let arr = item.answerQuestion.split(",");
  933. arr.forEach((a, i) => {
  934. arr[i] = "" + a;
  935. });
  936. item.ans = arr;
  937. if (this.explain) {
  938. item.ques = item.ans;
  939. }
  940. item.quesSelect = [];
  941. item.analysisContent &&
  942. (item.analysisContent = item.analysisContent.replace(
  943. /<img/gi,
  944. '<img style="max-width:100%;"'
  945. ));
  946. item.content &&
  947. (item.content = item.content.replace(
  948. /<img/gi,
  949. '<img style="max-width:100%;"'
  950. ));
  951. return;
  952. } else if (item.type == 5) {
  953. //简答题
  954. item.ansText = {
  955. text: "",
  956. imageList: [],
  957. };
  958. item.ques = {
  959. text: "",
  960. imageList: [],
  961. };
  962. item.analysisContent &&
  963. (item.analysisContent = item.analysisContent.replace(
  964. /<img/gi,
  965. '<img style="max-width:100%;"'
  966. ));
  967. item.content &&
  968. (item.content = item.content.replace(
  969. /<img/gi,
  970. '<img style="max-width:100%;"'
  971. ));
  972. if (this.explain) {
  973. item.ques = {
  974. text: item.analysisContent,
  975. imageList: [],
  976. };
  977. return;
  978. }
  979. } else if (item.type == 4) {
  980. //案例题
  981. console.log(item.jsonStr);
  982. item.ques = [];
  983. item.tabIndex = "0";
  984. let ansArr = [];
  985. item.jsonStr.forEach((json, index) => {
  986. if (json.type == 1) {
  987. ansArr[index] = json.answerQuestion;
  988. json.content &&
  989. (json.content = json.content.replace(
  990. /<img/gi,
  991. '<img style="max-width:100%;"'
  992. ));
  993. } else if (json.type == 2) {
  994. json.optionsList.forEach((str) => {
  995. str.optionsId = "" + str.optionsId;
  996. });
  997. let arr = json.answerQuestion.split(",");
  998. arr.forEach((a, i) => {
  999. arr[i] = "" + a;
  1000. });
  1001. ansArr[index] = arr;
  1002. json.content &&
  1003. (json.content = json.content.replace(
  1004. /<img/gi,
  1005. '<img style="max-width:100%;"'
  1006. ));
  1007. } else if (json.type == 3) {
  1008. ansArr[index] = json.answerQuestion;
  1009. json.content &&
  1010. (json.content = json.content.replace(
  1011. /<img/gi,
  1012. '<img style="max-width:100%;"'
  1013. ));
  1014. } else if (json.type == 5) {
  1015. ansArr[index] = {
  1016. text: "",
  1017. imageList: [],
  1018. };
  1019. json.ansText = {
  1020. text: "",
  1021. imageList: [],
  1022. };
  1023. json.ques = {
  1024. text: "",
  1025. imageList: [],
  1026. };
  1027. json.content &&
  1028. (json.content = json.content.replace(
  1029. /<img/gi,
  1030. '<img style="max-width:100%;"'
  1031. ));
  1032. }
  1033. });
  1034. item.analysisContent &&
  1035. (item.analysisContent = item.analysisContent.replace(
  1036. /<img/gi,
  1037. '<img style="max-width:100%;"'
  1038. ));
  1039. item.content &&
  1040. (item.content = item.content.replace(
  1041. /<img/gi,
  1042. '<img style="max-width:100%;"'
  1043. ));
  1044. item.ans = ansArr;
  1045. if (this.explain) {
  1046. item.ques = item.ans;
  1047. }
  1048. return;
  1049. }
  1050. item.analysisContent &&
  1051. (item.analysisContent = item.analysisContent.replace(
  1052. /<img/gi,
  1053. '<img style="max-width:100%;"'
  1054. ));
  1055. item.content &&
  1056. (item.content = item.content.replace(
  1057. /<img/gi,
  1058. '<img style="max-width:100%;"'
  1059. ));
  1060. item.ques = "";
  1061. item.ans = item.answerQuestion;
  1062. if (this.explain) {
  1063. item.ques = item.ans;
  1064. }
  1065. } else {
  1066. if (this.explain) {
  1067. item.ques = item.ans;
  1068. }
  1069. }
  1070. });
  1071. this.questionList = res.rows;
  1072. });
  1073. },
  1074. /**
  1075. * @param {Object}
  1076. * 单选点击确认
  1077. */
  1078. radioSelect(question, questionIndex, optionsId) {
  1079. if (this.questionList[questionIndex].ques) return;
  1080. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1081. // 回答错误
  1082. if (
  1083. this.questionList[questionIndex].ques !=
  1084. this.questionList[questionIndex].ans
  1085. ) {
  1086. } else {
  1087. console.log(this.questionList[questionIndex]);
  1088. this.$request
  1089. .wrongRecordDelete({
  1090. examId: this.questionList[questionIndex].examId,
  1091. orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
  1092. questionId: this.questionList[questionIndex].questionId,
  1093. goodsId: this.questionList[questionIndex].orderGoodsId
  1094. ? ""
  1095. : this.questionList[questionIndex].goodsId,
  1096. })
  1097. .then((res) => {});
  1098. }
  1099. },
  1100. /**
  1101. * @param {Object}
  1102. * 案例单选点击
  1103. */
  1104. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1105. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1106. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1107. },
  1108. /**
  1109. * 多选点击确认
  1110. */
  1111. checkboxSubmit(question, questionIndex) {
  1112. if (this.questionList[questionIndex].ques) return;
  1113. let arr = [];
  1114. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1115. if (item.checked) {
  1116. arr.push(item.optionsId);
  1117. }
  1118. });
  1119. if (!arr.length) {
  1120. this.$message({
  1121. type: "warning",
  1122. message: "请选择答案",
  1123. });
  1124. return;
  1125. }
  1126. this.$set(this.questionList[questionIndex], "ques", arr);
  1127. let isWrong = this.questionList[questionIndex].ques.some(
  1128. (quesItem, quesIndex) => {
  1129. return (
  1130. this.questionList[questionIndex].ques[quesIndex] !=
  1131. this.questionList[questionIndex].ans[quesIndex]
  1132. );
  1133. }
  1134. );
  1135. // 回答错误
  1136. if (isWrong) {
  1137. } else {
  1138. let question = this.questionList.find(
  1139. (item) =>
  1140. item.questionId == this.questionList[questionIndex].questionId
  1141. );
  1142. if (question) {
  1143. this.$request
  1144. .wrongRecordDelete({
  1145. examId: question.examId,
  1146. orderGoodsId: question.orderGoodsId,
  1147. goodsId: this.questionList[questionIndex].orderGoodsId
  1148. ? ""
  1149. : this.questionList[questionIndex].goodsId,
  1150. questionId: question.questionId,
  1151. })
  1152. .then((res) => {});
  1153. }
  1154. }
  1155. },
  1156. /**
  1157. * @param {Object}
  1158. * 案例多选确认
  1159. */
  1160. checkboxSubmitChild(questionIndex, ansIndex) {
  1161. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1162. let arr = [];
  1163. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1164. (item) => {
  1165. if (item.checked) {
  1166. arr.push(item.optionsId);
  1167. }
  1168. }
  1169. );
  1170. if (!arr.length) {
  1171. this.$message({
  1172. type: "warning",
  1173. message: "请选择答案",
  1174. });
  1175. return;
  1176. }
  1177. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1178. },
  1179. /**
  1180. * 判断点击确认
  1181. */
  1182. judgeSelect(question, questionIndex, index) {
  1183. if (question.ques) return;
  1184. this.$set(this.questionList[questionIndex], "ques", index + "");
  1185. // 回答错误
  1186. if (
  1187. this.questionList[questionIndex].ques !=
  1188. this.questionList[questionIndex].ans
  1189. ) {
  1190. } else {
  1191. this.$request
  1192. .wrongRecordDelete({
  1193. examId: this.questionList[questionIndex].examId,
  1194. orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
  1195. goodsId: this.questionList[questionIndex].orderGoodsId
  1196. ? ""
  1197. : this.questionList[questionIndex].goodsId,
  1198. questionId: this.questionList[questionIndex].questionId,
  1199. })
  1200. .then((res) => {});
  1201. }
  1202. },
  1203. judgeSelectChild(questionIndex, jsonIndex, index) {
  1204. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1205. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1206. this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
  1207. },
  1208. /**
  1209. * 上传图片
  1210. */
  1211. uploadImg(e, question, questionIndex) {
  1212. var file = e.target.files[0];
  1213. if (file.size > 2 * 1024 * 1024) {
  1214. this.$message.warn("图片不得大于2000kb");
  1215. return;
  1216. }
  1217. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1218. if (
  1219. type[0] != "jpg" &&
  1220. type[0] != "png" &&
  1221. type[0] != "jpeg" &&
  1222. type[0] != "gif"
  1223. ) {
  1224. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1225. e.target.value = "";
  1226. return;
  1227. }
  1228. this.$upload.upload(file, 0).then((res) => {
  1229. question.ansText.imageList.push(res);
  1230. });
  1231. },
  1232. /**
  1233. * 案例上传图片
  1234. */
  1235. uploadImgChild(e, questionIndex, jsonIndex) {
  1236. var file = e.target.files[0];
  1237. if (file.size > 2 * 1024 * 1024) {
  1238. this.$message.warn("图片不得大于2000kb");
  1239. return;
  1240. }
  1241. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1242. if (
  1243. type[0] != "jpg" &&
  1244. type[0] != "png" &&
  1245. type[0] != "jpeg" &&
  1246. type[0] != "gif"
  1247. ) {
  1248. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1249. e.target.value = "";
  1250. return;
  1251. }
  1252. this.$upload.upload(file, 0).then((res) => {
  1253. this.questionList[questionIndex].jsonStr[
  1254. jsonIndex
  1255. ].ansText.imageList.push(res);
  1256. });
  1257. },
  1258. isOver(item, index) {
  1259. if (this.questionList[index].ques) {
  1260. if (item.type == 4) {
  1261. //案例题
  1262. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1263. if (
  1264. jsonItem.type == 1 ||
  1265. jsonItem.type == 2 ||
  1266. jsonItem.type == 3
  1267. ) {
  1268. if (item.ques[indexs]) {
  1269. return true;
  1270. } else {
  1271. return false;
  1272. }
  1273. } else if (jsonItem.type == 5) {
  1274. if (
  1275. item.ques[indexs] &&
  1276. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1277. ) {
  1278. console.log("chil");
  1279. return true;
  1280. } else {
  1281. return false;
  1282. }
  1283. }
  1284. });
  1285. if (isOver) {
  1286. return true;
  1287. } else {
  1288. return false;
  1289. }
  1290. } else if (item.type == 5) {
  1291. //简答题
  1292. //每一项都相等
  1293. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1294. return true;
  1295. }
  1296. //判断
  1297. } else {
  1298. return false;
  1299. }
  1300. } else {
  1301. return false;
  1302. }
  1303. },
  1304. ansSubmit(question, questionIndex) {
  1305. if (!question.ansText.text && !question.ansText.imageList.length) {
  1306. this.$message({
  1307. type: "warning",
  1308. message: "请输入内容或上传图片",
  1309. });
  1310. return;
  1311. }
  1312. question.ques.imageList = question.ansText.imageList;
  1313. question.ques.text = question.ansText.text;
  1314. console.log(question.ques);
  1315. },
  1316. ansSubmitChild(question, questionIndex, jsonIndex) {
  1317. if (
  1318. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1319. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1320. .length
  1321. ) {
  1322. this.$message({
  1323. type: "warning",
  1324. message: "请输入内容或上传图片",
  1325. });
  1326. return;
  1327. }
  1328. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1329. imageList:
  1330. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1331. .imageList || [],
  1332. text:
  1333. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1334. "",
  1335. });
  1336. },
  1337. changeIndex(index) {
  1338. this.current = index;
  1339. },
  1340. nextQuestion() {
  1341. if (this.current >= this.questionList.length - 1) {
  1342. this.$message({
  1343. type: "warning",
  1344. message: "已经是最后一题了!",
  1345. });
  1346. return;
  1347. }
  1348. this.current++;
  1349. },
  1350. prevQuestion() {
  1351. if (this.current == 0) {
  1352. this.$message({
  1353. type: "warning",
  1354. message: "已经是第一题了!",
  1355. });
  1356. return;
  1357. } else {
  1358. this.current--;
  1359. }
  1360. },
  1361. isRight(item, index) {
  1362. console.log(item);
  1363. //单选
  1364. if (this.questionList[index].ques) {
  1365. if (item.type == 1) {
  1366. console.log(
  1367. this.questionList[index].ques == this.questionList[index].ans
  1368. );
  1369. return this.questionList[index].ques == this.questionList[index].ans;
  1370. //多选
  1371. } else if (item.type == 2) {
  1372. //每一项都相等
  1373. return this.questionList[index].ans.every((item, i) => {
  1374. return item == this.questionList[index].ques[i];
  1375. });
  1376. //判断
  1377. } else if (item.type == 3) {
  1378. return this.questionList[index].ques == this.questionList[index].ans;
  1379. } else {
  1380. return false;
  1381. }
  1382. } else {
  1383. return false;
  1384. }
  1385. },
  1386. isWrong(item, index) {
  1387. if (this.questionList[index].ques) {
  1388. //单选
  1389. if (item.type == 1) {
  1390. return this.questionList[index].ques != this.questionList[index].ans;
  1391. //多选
  1392. } else if (item.type == 2) {
  1393. //每一项都相等
  1394. return this.questionList[index].ans.some((item, i) => {
  1395. return item != this.questionList[index].ques[i];
  1396. });
  1397. //判断
  1398. } else if (item.type == 3) {
  1399. return this.questionList[index].ques != this.questionList[index].ans;
  1400. } else {
  1401. return false;
  1402. }
  1403. } else {
  1404. return false;
  1405. }
  1406. },
  1407. right(bankIndex, ansIndex, option) {
  1408. if (
  1409. this.questionList[bankIndex].ques[ansIndex] &&
  1410. this.questionList[bankIndex].ans[ansIndex]
  1411. ) {
  1412. if (
  1413. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1414. option.optionsId
  1415. ) != -1 ||
  1416. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1417. option.optionsId
  1418. ) != -1
  1419. ) {
  1420. return true;
  1421. } else {
  1422. return false;
  1423. }
  1424. } else {
  1425. return false;
  1426. }
  1427. },
  1428. wrong(bankIndex, ansIndex, option) {
  1429. if (
  1430. this.questionList[bankIndex].ques[ansIndex] &&
  1431. this.questionList[bankIndex].ans[ansIndex]
  1432. ) {
  1433. if (
  1434. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1435. option.optionsId
  1436. ) != -1 &&
  1437. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1438. option.optionsId
  1439. ) == -1
  1440. ) {
  1441. return true;
  1442. } else {
  1443. return false;
  1444. }
  1445. } else {
  1446. return false;
  1447. }
  1448. },
  1449. /**
  1450. * 获取已经回答的题目数
  1451. * hasSpecail (是否包含简答和案例)
  1452. */
  1453. questionOverNum(hasSpecail) {
  1454. let count = 0;
  1455. this.questionList.forEach((item) => {
  1456. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1457. if (item.ques) {
  1458. count++;
  1459. }
  1460. } else if (item.type == 4) {
  1461. //案例题
  1462. if (hasSpecail) {
  1463. let isOver = item.jsonStr.every((jsonItem, index) => {
  1464. if (
  1465. jsonItem.type == 1 ||
  1466. jsonItem.type == 2 ||
  1467. jsonItem.type == 3
  1468. ) {
  1469. if (item.ques[index]) {
  1470. return true;
  1471. } else {
  1472. return false;
  1473. }
  1474. } else if (jsonItem.type == 5) {
  1475. if (
  1476. item.ques[index] &&
  1477. (item.ques[index].text || item.ques[index].imageList.length)
  1478. ) {
  1479. return true;
  1480. } else {
  1481. return false;
  1482. }
  1483. }
  1484. });
  1485. if (isOver) {
  1486. count++;
  1487. }
  1488. }
  1489. } else if (item.type == 5) {
  1490. //简答题
  1491. if (hasSpecail) {
  1492. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1493. console.log(5, item);
  1494. count++;
  1495. }
  1496. }
  1497. }
  1498. });
  1499. return count;
  1500. },
  1501. collect() {
  1502. this.$message({
  1503. message: "试做题目,不支持收藏~",
  1504. type: "warning",
  1505. });
  1506. return;
  1507. },
  1508. submit() {
  1509. this.$message({
  1510. type: "success",
  1511. message: "交卷成功",
  1512. });
  1513. setTimeout(() => {
  1514. this.$router.back(-1);
  1515. }, 2000);
  1516. },
  1517. },
  1518. };
  1519. </script>
  1520. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1521. <style scoped lang="scss">
  1522. .course-exam {
  1523. .section {
  1524. overflow: hidden;
  1525. &__header {
  1526. height: 20px;
  1527. margin-top: 20px;
  1528. }
  1529. &__body {
  1530. .explain-record {
  1531. &__header {
  1532. }
  1533. &__body {
  1534. height: 800px;
  1535. border: 1px solid #eee;
  1536. .left-box {
  1537. float: left;
  1538. width: 970px;
  1539. border-right: 1px solid #eee;
  1540. &__header {
  1541. height: 40px;
  1542. padding-left: 12px;
  1543. border-bottom: 1px solid #eeeeee;
  1544. display: flex;
  1545. align-items: center;
  1546. .progress {
  1547. width: 636px;
  1548. }
  1549. .text {
  1550. margin-left: 15px;
  1551. font-size: 16px;
  1552. span {
  1553. font-family: Microsoft YaHei;
  1554. font-weight: bold;
  1555. color: #3f8dfd;
  1556. line-height: 24px;
  1557. }
  1558. }
  1559. }
  1560. &__body {
  1561. height: 720px;
  1562. border-bottom: 1px solid #eee;
  1563. .question {
  1564. padding: 12px 0 0 12px;
  1565. display: flex;
  1566. flex-direction: column;
  1567. height: 100%;
  1568. &__title {
  1569. padding-left: 12px;
  1570. font-size: 16px;
  1571. font-family: Microsoft YaHei;
  1572. font-weight: bold;
  1573. color: #333333;
  1574. line-height: 24px;
  1575. }
  1576. &__desc {
  1577. padding-left: 12px;
  1578. margin-top: 20px;
  1579. font-size: 16px;
  1580. font-family: Microsoft YaHei;
  1581. font-weight: 400;
  1582. color: #666666;
  1583. line-height: 24px;
  1584. /deep/ img {
  1585. max-width: 100% !important;
  1586. max-height: 400px !important;
  1587. }
  1588. }
  1589. &__content {
  1590. flex: 1;
  1591. overflow-y: scroll;
  1592. &::-webkit-scrollbar {
  1593. width: 6px;
  1594. }
  1595. &::-webkit-scrollbar-track {
  1596. background-color: #fff;
  1597. -webkit-border-radius: 2em;
  1598. -moz-border-radius: 2em;
  1599. border-radius: 2em;
  1600. }
  1601. &::-webkit-scrollbar-thumb {
  1602. background-color: #eeeeee;
  1603. -webkit-border-radius: 2em;
  1604. -moz-border-radius: 2em;
  1605. border-radius: 2em;
  1606. }
  1607. /deep/ .el-tabs__item {
  1608. padding: 0 20px !important;
  1609. height: 40px;
  1610. line-height: 40px;
  1611. }
  1612. .question__content {
  1613. height: auto;
  1614. overflow: auto;
  1615. }
  1616. .question-list {
  1617. padding: 24px 0 0 24px;
  1618. .checkbox,
  1619. .radio {
  1620. cursor: pointer;
  1621. margin-right: 24px;
  1622. padding: 0 24px;
  1623. display: flex;
  1624. align-items: center;
  1625. margin-top: 2px;
  1626. min-height: 40px;
  1627. padding-top: 10px;
  1628. padding-bottom: 10px;
  1629. background: #f5f9ff;
  1630. border-radius: 8px;
  1631. box-sizing: border-box;
  1632. &.right {
  1633. background: #37c65b;
  1634. }
  1635. &.wrong {
  1636. background: #ff3a30;
  1637. }
  1638. }
  1639. &.textarea {
  1640. margin-right: 12px;
  1641. .upload {
  1642. margin-top: 10px;
  1643. &__imgs {
  1644. margin-right: 10px;
  1645. width: 80px;
  1646. height: 80px;
  1647. background: #ffffff;
  1648. border: 1px solid #eeeeee;
  1649. border-radius: 4px;
  1650. position: relative;
  1651. display: flex;
  1652. float: left;
  1653. align-items: center;
  1654. justify-content: center;
  1655. img {
  1656. max-width: 100%;
  1657. max-height: 100%;
  1658. }
  1659. }
  1660. &__btn {
  1661. margin-right: 10px;
  1662. width: 80px;
  1663. height: 80px;
  1664. background: #ffffff;
  1665. border: 1px solid #eeeeee;
  1666. border-radius: 4px;
  1667. position: relative;
  1668. display: flex;
  1669. float: left;
  1670. align-items: center;
  1671. justify-content: center;
  1672. flex-direction: column;
  1673. .icon {
  1674. font-size: 20px;
  1675. color: #3f8dfd;
  1676. }
  1677. p {
  1678. font-size: 12px;
  1679. font-family: Microsoft YaHei;
  1680. font-weight: 400;
  1681. color: #999999;
  1682. line-height: 24px;
  1683. }
  1684. input {
  1685. position: absolute;
  1686. left: 0;
  1687. top: 0;
  1688. display: block;
  1689. width: 100%;
  1690. height: 100%;
  1691. opacity: 0;
  1692. }
  1693. }
  1694. }
  1695. }
  1696. /deep/ .el-checkbox {
  1697. white-space: pre-wrap;
  1698. }
  1699. }
  1700. .answer-list {
  1701. height: 40px;
  1702. border-top: 1px solid #eee;
  1703. border-bottom: 1px solid #eee;
  1704. margin-top: 24px;
  1705. display: flex;
  1706. align-items: center;
  1707. justify-content: space-between;
  1708. padding: 0 24px;
  1709. &__left {
  1710. font-size: 16px;
  1711. font-family: Microsoft YaHei;
  1712. font-weight: 400;
  1713. color: #333333;
  1714. line-height: 24px;
  1715. }
  1716. &__right {
  1717. font-size: 16px;
  1718. font-family: Microsoft YaHei;
  1719. font-weight: 400;
  1720. color: #333333;
  1721. line-height: 24px;
  1722. }
  1723. }
  1724. .explain-list {
  1725. padding: 12px 24px;
  1726. &__header {
  1727. font-size: 16px;
  1728. font-family: Microsoft YaHei;
  1729. font-weight: bold;
  1730. color: #666666;
  1731. line-height: 24px;
  1732. }
  1733. &__body {
  1734. margin-top: 12px;
  1735. font-size: 16px;
  1736. font-family: Microsoft YaHei;
  1737. font-weight: 400;
  1738. color: #666666;
  1739. line-height: 24px;
  1740. }
  1741. .upload {
  1742. margin-top: 10px;
  1743. &__imgs {
  1744. margin-right: 10px;
  1745. width: 80px;
  1746. height: 80px;
  1747. background: #ffffff;
  1748. border: 1px solid #eeeeee;
  1749. border-radius: 4px;
  1750. position: relative;
  1751. display: flex;
  1752. float: left;
  1753. align-items: center;
  1754. justify-content: center;
  1755. img {
  1756. max-width: 100%;
  1757. max-height: 100%;
  1758. }
  1759. }
  1760. }
  1761. }
  1762. }
  1763. &__btns {
  1764. position: relative;
  1765. height: 32px;
  1766. .submit {
  1767. cursor: pointer;
  1768. margin: 0 auto;
  1769. width: 140px;
  1770. height: 32px;
  1771. background: #3f8dfd;
  1772. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1773. border-radius: 16px;
  1774. text-align: center;
  1775. line-height: 32px;
  1776. color: #fff;
  1777. font-size: 16px;
  1778. }
  1779. .collect {
  1780. cursor: pointer;
  1781. position: absolute;
  1782. right: 0;
  1783. top: 5px;
  1784. font-size: 12px;
  1785. font-family: Microsoft YaHei;
  1786. font-weight: 400;
  1787. color: #3f8dfd;
  1788. line-height: 24px;
  1789. }
  1790. }
  1791. }
  1792. }
  1793. &__footer {
  1794. height: 40px;
  1795. display: flex;
  1796. justify-content: space-around;
  1797. align-items: center;
  1798. .btn {
  1799. cursor: pointer;
  1800. width: 140px;
  1801. height: 32px;
  1802. background: #ffffff;
  1803. border: 1px solid #3f8dfd;
  1804. border-radius: 16px;
  1805. line-height: 32px;
  1806. text-align: center;
  1807. color: #3f8dfd;
  1808. }
  1809. }
  1810. }
  1811. .right-box {
  1812. float: right;
  1813. width: 300px;
  1814. &__header {
  1815. height: 40px;
  1816. line-height: 40px;
  1817. font-size: 16px;
  1818. font-family: Microsoft YaHei;
  1819. font-weight: bold;
  1820. color: #333333;
  1821. text-align: center;
  1822. border-bottom: 1px solid #eeeeee;
  1823. .back-btn {
  1824. display: block;
  1825. margin: 0 auto;
  1826. width: 160px;
  1827. }
  1828. }
  1829. &__body {
  1830. height: 720px;
  1831. border-bottom: 1px solid #eee;
  1832. .card {
  1833. &__note {
  1834. display: flex;
  1835. height: 40px;
  1836. align-items: center;
  1837. border-bottom: 1px solid #eee;
  1838. .item {
  1839. display: flex;
  1840. align-items: center;
  1841. margin-left: 10px;
  1842. .box {
  1843. margin-right: 5px;
  1844. width: 16px;
  1845. height: 16px;
  1846. border-radius: 4px;
  1847. &.white {
  1848. background: #ffffff;
  1849. border: 1px solid #eeeeee;
  1850. }
  1851. &.green {
  1852. background: #37c65b;
  1853. }
  1854. &.red {
  1855. background: #ff3a30;
  1856. }
  1857. &.blue {
  1858. background: #3f8dfd;
  1859. }
  1860. }
  1861. }
  1862. }
  1863. &__content {
  1864. height: 630px;
  1865. overflow-y: scroll;
  1866. &::-webkit-scrollbar {
  1867. width: 6px;
  1868. }
  1869. &::-webkit-scrollbar-track {
  1870. background-color: #fff;
  1871. -webkit-border-radius: 2em;
  1872. -moz-border-radius: 2em;
  1873. border-radius: 2em;
  1874. }
  1875. &::-webkit-scrollbar-thumb {
  1876. background-color: #eeeeee;
  1877. -webkit-border-radius: 2em;
  1878. -moz-border-radius: 2em;
  1879. border-radius: 2em;
  1880. }
  1881. .list {
  1882. display: flex;
  1883. flex-wrap: wrap;
  1884. .item {
  1885. width: 40px;
  1886. height: 40px;
  1887. border-radius: 10px;
  1888. text-align: center;
  1889. line-height: 40px;
  1890. margin-left: 16px;
  1891. margin-top: 16px;
  1892. cursor: pointer;
  1893. &.white {
  1894. line-height: 38px;
  1895. color: #333333;
  1896. background: #ffffff;
  1897. border: 1px solid #eeeeee;
  1898. }
  1899. &.green {
  1900. color: #fff;
  1901. background: #37c65b;
  1902. }
  1903. &.red {
  1904. color: #fff;
  1905. background: #ff3a30;
  1906. }
  1907. &.blue {
  1908. border: 1rpx solid #eeeeee;
  1909. color: #fff;
  1910. background: #3f8dfd;
  1911. }
  1912. &.disabled {
  1913. cursor: not-allowed;
  1914. line-height: 38px;
  1915. color: #eeeeee;
  1916. background: #ffffff;
  1917. border: 1px solid #eeeeee;
  1918. }
  1919. }
  1920. }
  1921. }
  1922. }
  1923. }
  1924. &__footer {
  1925. height: 40px;
  1926. display: flex;
  1927. align-items: center;
  1928. justify-content: center;
  1929. .submit {
  1930. cursor: pointer;
  1931. width: 140px;
  1932. height: 32px;
  1933. background: #3f8dfd;
  1934. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1935. border-radius: 16px;
  1936. line-height: 32px;
  1937. text-align: center;
  1938. color: #fff;
  1939. font-size: 16px;
  1940. }
  1941. }
  1942. }
  1943. }
  1944. }
  1945. }
  1946. }
  1947. .take-photo {
  1948. /deep/ .el-dialog__header {
  1949. display: none;
  1950. }
  1951. /deep/ .el-dialog__body {
  1952. padding: 0;
  1953. overflow: unset;
  1954. }
  1955. &__close {
  1956. cursor: pointer;
  1957. position: absolute;
  1958. right: 0;
  1959. top: -28px;
  1960. width: 24px;
  1961. height: 24px;
  1962. line-height: 24px;
  1963. text-align: center;
  1964. color: #eee;
  1965. border: 1px solid #eee;
  1966. border-radius: 50%;
  1967. }
  1968. &__header {
  1969. height: 40px;
  1970. border-bottom: 1px solid #eee;
  1971. line-height: 40px;
  1972. font-size: 16px;
  1973. font-family: Microsoft YaHei;
  1974. font-weight: bold;
  1975. color: #333333;
  1976. padding-left: 24px;
  1977. }
  1978. &__body {
  1979. height: 400px;
  1980. padding: 40px 24px;
  1981. .left-box {
  1982. width: 336px;
  1983. float: left;
  1984. .title {
  1985. font-size: 16px;
  1986. font-family: Microsoft YaHei;
  1987. font-weight: bold;
  1988. color: #ff3b30;
  1989. line-height: 24px;
  1990. }
  1991. .content {
  1992. font-size: 14px;
  1993. font-family: Microsoft YaHei;
  1994. font-weight: 400;
  1995. color: #333333;
  1996. line-height: 28px;
  1997. margin-top: 32px;
  1998. }
  1999. }
  2000. .right-box {
  2001. float: right;
  2002. width: 400px;
  2003. height: 300px;
  2004. video {
  2005. width: 100%;
  2006. height: 100%;
  2007. }
  2008. }
  2009. }
  2010. &__footer {
  2011. height: 90px;
  2012. border-top: 1px solid #eee;
  2013. text-align: center;
  2014. .take {
  2015. display: inline-block;
  2016. width: 200px;
  2017. height: 40px;
  2018. padding: 0;
  2019. border-radius: 20px;
  2020. text-align: center;
  2021. line-height: 40px;
  2022. margin: 24px auto;
  2023. }
  2024. }
  2025. }
  2026. }
  2027. </style>