wrong-bank.vue 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098
  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: ["A", "B", "C", "D", "E", "F", "G"],
  864. current: 0,
  865. examId: "",
  866. explain: "",
  867. };
  868. },
  869. async mounted() {
  870. this.examId = this.$route.params.examId;
  871. this.explain = this.$route.query.explain || "";
  872. this.orderGoodsId = this.$route.query.orderGoodsId || "";
  873. this.wrongRecordExamQuestionList();
  874. },
  875. methods: {
  876. toFixed(num) {
  877. if (num) {
  878. let str = String(num).indexOf(".");
  879. if (str != -1) {
  880. return +num.toFixed(2);
  881. } else {
  882. return num;
  883. }
  884. } else {
  885. return 0;
  886. }
  887. },
  888. /**
  889. * 请求题目列表
  890. */
  891. wrongRecordExamQuestionList() {
  892. this.$request
  893. .wrongRecordExamQuestionList({
  894. examId: this.examId,
  895. })
  896. .then(async (res) => {
  897. res.rows.forEach((item, index) => {
  898. if (typeof item.jsonStr == "string") {
  899. item.jsonStr = JSON.parse(item.jsonStr);
  900. if (item.type == 2) {
  901. //多选
  902. item.jsonStr.forEach((str) => {
  903. str.optionsId = "" + str.optionsId;
  904. });
  905. let arr = item.answerQuestion.split(",");
  906. arr.forEach((a, i) => {
  907. arr[i] = "" + a;
  908. });
  909. item.ans = arr;
  910. if (this.explain) {
  911. item.ques = item.ans;
  912. }
  913. item.quesSelect = [];
  914. item.analysisContent &&
  915. (item.analysisContent = item.analysisContent.replace(
  916. /<img/gi,
  917. '<img style="max-width:100%;"'
  918. ));
  919. item.content &&
  920. (item.content = item.content.replace(
  921. /<img/gi,
  922. '<img style="max-width:100%;"'
  923. ));
  924. return;
  925. } else if (item.type == 5) {
  926. //简答题
  927. item.ansText = {
  928. text: "",
  929. imageList: [],
  930. };
  931. item.ques = {
  932. text: "",
  933. imageList: [],
  934. };
  935. item.analysisContent &&
  936. (item.analysisContent = item.analysisContent.replace(
  937. /<img/gi,
  938. '<img style="max-width:100%;"'
  939. ));
  940. item.content &&
  941. (item.content = item.content.replace(
  942. /<img/gi,
  943. '<img style="max-width:100%;"'
  944. ));
  945. if (this.explain) {
  946. item.ques = {
  947. text: item.analysisContent,
  948. imageList: [],
  949. };
  950. return;
  951. }
  952. } else if (item.type == 4) {
  953. //案例题
  954. console.log(item.jsonStr);
  955. item.ques = [];
  956. item.tabIndex = "0";
  957. let ansArr = [];
  958. item.jsonStr.forEach((json, index) => {
  959. if (json.type == 1) {
  960. ansArr[index] = json.answerQuestion;
  961. json.content &&
  962. (json.content = json.content.replace(
  963. /<img/gi,
  964. '<img style="max-width:100%;"'
  965. ));
  966. } else if (json.type == 2) {
  967. json.optionsList.forEach((str) => {
  968. str.optionsId = "" + str.optionsId;
  969. });
  970. let arr = json.answerQuestion.split(",");
  971. arr.forEach((a, i) => {
  972. arr[i] = "" + a;
  973. });
  974. ansArr[index] = arr;
  975. json.content &&
  976. (json.content = json.content.replace(
  977. /<img/gi,
  978. '<img style="max-width:100%;"'
  979. ));
  980. } else if (json.type == 3) {
  981. ansArr[index] = json.answerQuestion;
  982. json.content &&
  983. (json.content = json.content.replace(
  984. /<img/gi,
  985. '<img style="max-width:100%;"'
  986. ));
  987. } else if (json.type == 5) {
  988. ansArr[index] = {
  989. text: "",
  990. imageList: [],
  991. };
  992. json.ansText = {
  993. text: "",
  994. imageList: [],
  995. };
  996. json.ques = {
  997. text: "",
  998. imageList: [],
  999. };
  1000. json.content &&
  1001. (json.content = json.content.replace(
  1002. /<img/gi,
  1003. '<img style="max-width:100%;"'
  1004. ));
  1005. }
  1006. });
  1007. item.analysisContent &&
  1008. (item.analysisContent = item.analysisContent.replace(
  1009. /<img/gi,
  1010. '<img style="max-width:100%;"'
  1011. ));
  1012. item.content &&
  1013. (item.content = item.content.replace(
  1014. /<img/gi,
  1015. '<img style="max-width:100%;"'
  1016. ));
  1017. item.ans = ansArr;
  1018. if (this.explain) {
  1019. item.ques = item.ans;
  1020. }
  1021. return;
  1022. }
  1023. item.analysisContent &&
  1024. (item.analysisContent = item.analysisContent.replace(
  1025. /<img/gi,
  1026. '<img style="max-width:100%;"'
  1027. ));
  1028. item.content &&
  1029. (item.content = item.content.replace(
  1030. /<img/gi,
  1031. '<img style="max-width:100%;"'
  1032. ));
  1033. item.ques = "";
  1034. item.ans = item.answerQuestion;
  1035. if (this.explain) {
  1036. item.ques = item.ans;
  1037. }
  1038. } else {
  1039. if (this.explain) {
  1040. item.ques = item.ans;
  1041. }
  1042. }
  1043. });
  1044. this.questionList = res.rows;
  1045. });
  1046. },
  1047. /**
  1048. * @param {Object}
  1049. * 单选点击确认
  1050. */
  1051. radioSelect(question, questionIndex, optionsId) {
  1052. if (this.questionList[questionIndex].ques) return;
  1053. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1054. // 回答错误
  1055. if (
  1056. this.questionList[questionIndex].ques !=
  1057. this.questionList[questionIndex].ans
  1058. ) {
  1059. } else {
  1060. console.log(this.questionList[questionIndex]);
  1061. this.$request
  1062. .wrongRecordDelete({
  1063. examId: this.questionList[questionIndex].examId,
  1064. orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
  1065. questionId: this.questionList[questionIndex].questionId,
  1066. goodsId: this.questionList[questionIndex].orderGoodsId
  1067. ? ""
  1068. : this.questionList[questionIndex].goodsId,
  1069. })
  1070. .then((res) => {});
  1071. }
  1072. },
  1073. /**
  1074. * @param {Object}
  1075. * 案例单选点击
  1076. */
  1077. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1078. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1079. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1080. },
  1081. /**
  1082. * 多选点击确认
  1083. */
  1084. checkboxSubmit(question, questionIndex) {
  1085. if (this.questionList[questionIndex].ques) return;
  1086. let arr = [];
  1087. this.questionList[questionIndex].jsonStr.forEach((item) => {
  1088. if (item.checked) {
  1089. arr.push(item.optionsId);
  1090. }
  1091. });
  1092. if (!arr.length) {
  1093. this.$message({
  1094. type: "warning",
  1095. message: "请选择答案",
  1096. });
  1097. return;
  1098. }
  1099. this.$set(this.questionList[questionIndex], "ques", arr);
  1100. let isWrong = this.questionList[questionIndex].ques.some(
  1101. (quesItem, quesIndex) => {
  1102. return (
  1103. this.questionList[questionIndex].ques[quesIndex] !=
  1104. this.questionList[questionIndex].ans[quesIndex]
  1105. );
  1106. }
  1107. );
  1108. // 回答错误
  1109. if (isWrong) {
  1110. } else {
  1111. let question = this.questionList.find(
  1112. (item) =>
  1113. item.questionId == this.questionList[questionIndex].questionId
  1114. );
  1115. if (question) {
  1116. this.$request
  1117. .wrongRecordDelete({
  1118. examId: question.examId,
  1119. orderGoodsId: question.orderGoodsId,
  1120. goodsId: this.questionList[questionIndex].orderGoodsId
  1121. ? ""
  1122. : this.questionList[questionIndex].goodsId,
  1123. questionId: question.questionId,
  1124. })
  1125. .then((res) => {});
  1126. }
  1127. }
  1128. },
  1129. /**
  1130. * @param {Object}
  1131. * 案例多选确认
  1132. */
  1133. checkboxSubmitChild(questionIndex, ansIndex) {
  1134. if (this.questionList[questionIndex].ques[ansIndex]) return;
  1135. let arr = [];
  1136. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1137. (item) => {
  1138. if (item.checked) {
  1139. arr.push(item.optionsId);
  1140. }
  1141. }
  1142. );
  1143. if (!arr.length) {
  1144. this.$message({
  1145. type: "warning",
  1146. message: "请选择答案",
  1147. });
  1148. return;
  1149. }
  1150. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1151. },
  1152. /**
  1153. * 判断点击确认
  1154. */
  1155. judgeSelect(question, questionIndex, index) {
  1156. if (question.ques) return;
  1157. this.$set(this.questionList[questionIndex], "ques", index + "");
  1158. // 回答错误
  1159. if (
  1160. this.questionList[questionIndex].ques !=
  1161. this.questionList[questionIndex].ans
  1162. ) {
  1163. } else {
  1164. this.$request
  1165. .wrongRecordDelete({
  1166. examId: this.questionList[questionIndex].examId,
  1167. orderGoodsId: this.questionList[questionIndex].orderGoodsId || "",
  1168. goodsId: this.questionList[questionIndex].orderGoodsId
  1169. ? ""
  1170. : this.questionList[questionIndex].goodsId,
  1171. questionId: this.questionList[questionIndex].questionId,
  1172. })
  1173. .then((res) => {});
  1174. }
  1175. },
  1176. judgeSelectChild(questionIndex, jsonIndex, index) {
  1177. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1178. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1179. this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
  1180. },
  1181. /**
  1182. * 上传图片
  1183. */
  1184. uploadImg(e, question, questionIndex) {
  1185. var file = e.target.files[0];
  1186. if (file.size > 2 * 1024 * 1024) {
  1187. this.$message.warn("图片不得大于2000kb");
  1188. return;
  1189. }
  1190. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1191. if (
  1192. type[0] != "jpg" &&
  1193. type[0] != "png" &&
  1194. type[0] != "jpeg" &&
  1195. type[0] != "gif"
  1196. ) {
  1197. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1198. e.target.value = "";
  1199. return;
  1200. }
  1201. this.$upload.upload(file, 0).then((res) => {
  1202. question.ansText.imageList.push(res);
  1203. });
  1204. },
  1205. /**
  1206. * 案例上传图片
  1207. */
  1208. uploadImgChild(e, questionIndex, jsonIndex) {
  1209. var file = e.target.files[0];
  1210. if (file.size > 2 * 1024 * 1024) {
  1211. this.$message.warn("图片不得大于2000kb");
  1212. return;
  1213. }
  1214. var type = e.target.value.toLowerCase().split(".").splice(-1);
  1215. if (
  1216. type[0] != "jpg" &&
  1217. type[0] != "png" &&
  1218. type[0] != "jpeg" &&
  1219. type[0] != "gif"
  1220. ) {
  1221. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1222. e.target.value = "";
  1223. return;
  1224. }
  1225. this.$upload.upload(file, 0).then((res) => {
  1226. this.questionList[questionIndex].jsonStr[
  1227. jsonIndex
  1228. ].ansText.imageList.push(res);
  1229. });
  1230. },
  1231. isOver(item, index) {
  1232. if (this.questionList[index].ques) {
  1233. if (item.type == 4) {
  1234. //案例题
  1235. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1236. if (
  1237. jsonItem.type == 1 ||
  1238. jsonItem.type == 2 ||
  1239. jsonItem.type == 3
  1240. ) {
  1241. if (item.ques[indexs]) {
  1242. return true;
  1243. } else {
  1244. return false;
  1245. }
  1246. } else if (jsonItem.type == 5) {
  1247. if (
  1248. item.ques[indexs] &&
  1249. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1250. ) {
  1251. console.log("chil");
  1252. return true;
  1253. } else {
  1254. return false;
  1255. }
  1256. }
  1257. });
  1258. if (isOver) {
  1259. return true;
  1260. } else {
  1261. return false;
  1262. }
  1263. } else if (item.type == 5) {
  1264. //简答题
  1265. //每一项都相等
  1266. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1267. return true;
  1268. }
  1269. //判断
  1270. } else {
  1271. return false;
  1272. }
  1273. } else {
  1274. return false;
  1275. }
  1276. },
  1277. ansSubmit(question, questionIndex) {
  1278. if (!question.ansText.text && !question.ansText.imageList.length) {
  1279. this.$message({
  1280. type: "warning",
  1281. message: "请输入内容或上传图片",
  1282. });
  1283. return;
  1284. }
  1285. question.ques.imageList = question.ansText.imageList;
  1286. question.ques.text = question.ansText.text;
  1287. console.log(question.ques);
  1288. },
  1289. ansSubmitChild(question, questionIndex, jsonIndex) {
  1290. if (
  1291. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1292. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1293. .length
  1294. ) {
  1295. this.$message({
  1296. type: "warning",
  1297. message: "请输入内容或上传图片",
  1298. });
  1299. return;
  1300. }
  1301. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1302. imageList:
  1303. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1304. .imageList || [],
  1305. text:
  1306. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1307. "",
  1308. });
  1309. },
  1310. changeIndex(index) {
  1311. this.current = index;
  1312. },
  1313. nextQuestion() {
  1314. if (this.current >= this.questionList.length - 1) {
  1315. this.$message({
  1316. type: "warning",
  1317. message: "已经是最后一题了!",
  1318. });
  1319. return;
  1320. }
  1321. this.current++;
  1322. },
  1323. prevQuestion() {
  1324. if (this.current == 0) {
  1325. this.$message({
  1326. type: "warning",
  1327. message: "已经是第一题了!",
  1328. });
  1329. return;
  1330. } else {
  1331. this.current--;
  1332. }
  1333. },
  1334. isRight(item, index) {
  1335. console.log(item);
  1336. //单选
  1337. if (this.questionList[index].ques) {
  1338. if (item.type == 1) {
  1339. console.log(
  1340. this.questionList[index].ques == this.questionList[index].ans
  1341. );
  1342. return this.questionList[index].ques == this.questionList[index].ans;
  1343. //多选
  1344. } else if (item.type == 2) {
  1345. //每一项都相等
  1346. return this.questionList[index].ans.every((item, i) => {
  1347. return item == this.questionList[index].ques[i];
  1348. });
  1349. //判断
  1350. } else if (item.type == 3) {
  1351. return this.questionList[index].ques == this.questionList[index].ans;
  1352. } else {
  1353. return false;
  1354. }
  1355. } else {
  1356. return false;
  1357. }
  1358. },
  1359. isWrong(item, index) {
  1360. if (this.questionList[index].ques) {
  1361. //单选
  1362. if (item.type == 1) {
  1363. return this.questionList[index].ques != this.questionList[index].ans;
  1364. //多选
  1365. } else if (item.type == 2) {
  1366. //每一项都相等
  1367. return this.questionList[index].ans.some((item, i) => {
  1368. return item != this.questionList[index].ques[i];
  1369. });
  1370. //判断
  1371. } else if (item.type == 3) {
  1372. return this.questionList[index].ques != this.questionList[index].ans;
  1373. } else {
  1374. return false;
  1375. }
  1376. } else {
  1377. return false;
  1378. }
  1379. },
  1380. right(bankIndex, ansIndex, option) {
  1381. if (
  1382. this.questionList[bankIndex].ques[ansIndex] &&
  1383. this.questionList[bankIndex].ans[ansIndex]
  1384. ) {
  1385. if (
  1386. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1387. option.optionsId
  1388. ) != -1 ||
  1389. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1390. option.optionsId
  1391. ) != -1
  1392. ) {
  1393. return true;
  1394. } else {
  1395. return false;
  1396. }
  1397. } else {
  1398. return false;
  1399. }
  1400. },
  1401. wrong(bankIndex, ansIndex, option) {
  1402. if (
  1403. this.questionList[bankIndex].ques[ansIndex] &&
  1404. this.questionList[bankIndex].ans[ansIndex]
  1405. ) {
  1406. if (
  1407. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1408. option.optionsId
  1409. ) != -1 &&
  1410. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1411. option.optionsId
  1412. ) == -1
  1413. ) {
  1414. return true;
  1415. } else {
  1416. return false;
  1417. }
  1418. } else {
  1419. return false;
  1420. }
  1421. },
  1422. /**
  1423. * 获取已经回答的题目数
  1424. * hasSpecail (是否包含简答和案例)
  1425. */
  1426. questionOverNum(hasSpecail) {
  1427. let count = 0;
  1428. this.questionList.forEach((item) => {
  1429. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1430. if (item.ques) {
  1431. count++;
  1432. }
  1433. } else if (item.type == 4) {
  1434. //案例题
  1435. if (hasSpecail) {
  1436. let isOver = item.jsonStr.every((jsonItem, index) => {
  1437. if (
  1438. jsonItem.type == 1 ||
  1439. jsonItem.type == 2 ||
  1440. jsonItem.type == 3
  1441. ) {
  1442. if (item.ques[index]) {
  1443. return true;
  1444. } else {
  1445. return false;
  1446. }
  1447. } else if (jsonItem.type == 5) {
  1448. if (
  1449. item.ques[index] &&
  1450. (item.ques[index].text || item.ques[index].imageList.length)
  1451. ) {
  1452. return true;
  1453. } else {
  1454. return false;
  1455. }
  1456. }
  1457. });
  1458. if (isOver) {
  1459. count++;
  1460. }
  1461. }
  1462. } else if (item.type == 5) {
  1463. //简答题
  1464. if (hasSpecail) {
  1465. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1466. console.log(5, item);
  1467. count++;
  1468. }
  1469. }
  1470. }
  1471. });
  1472. return count;
  1473. },
  1474. collect() {
  1475. this.$message({
  1476. message: "试做题目,不支持收藏~",
  1477. type: "warning",
  1478. });
  1479. return;
  1480. },
  1481. submit() {
  1482. this.$message({
  1483. type: "success",
  1484. message: "交卷成功",
  1485. });
  1486. setTimeout(() => {
  1487. this.$router.back(-1);
  1488. }, 2000);
  1489. },
  1490. },
  1491. };
  1492. </script>
  1493. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1494. <style scoped lang="scss">
  1495. .course-exam {
  1496. .section {
  1497. overflow: hidden;
  1498. &__header {
  1499. height: 20px;
  1500. margin-top: 20px;
  1501. }
  1502. &__body {
  1503. .explain-record {
  1504. &__header {
  1505. }
  1506. &__body {
  1507. height: 800px;
  1508. border: 1px solid #eee;
  1509. .left-box {
  1510. float: left;
  1511. width: 970px;
  1512. border-right: 1px solid #eee;
  1513. &__header {
  1514. height: 40px;
  1515. padding-left: 12px;
  1516. border-bottom: 1px solid #eeeeee;
  1517. display: flex;
  1518. align-items: center;
  1519. .progress {
  1520. width: 636px;
  1521. }
  1522. .text {
  1523. margin-left: 15px;
  1524. font-size: 16px;
  1525. span {
  1526. font-family: Microsoft YaHei;
  1527. font-weight: bold;
  1528. color: #3f8dfd;
  1529. line-height: 24px;
  1530. }
  1531. }
  1532. }
  1533. &__body {
  1534. height: 720px;
  1535. border-bottom: 1px solid #eee;
  1536. .question {
  1537. padding: 12px 0 0 12px;
  1538. display: flex;
  1539. flex-direction: column;
  1540. height: 100%;
  1541. &__title {
  1542. padding-left: 12px;
  1543. font-size: 16px;
  1544. font-family: Microsoft YaHei;
  1545. font-weight: bold;
  1546. color: #333333;
  1547. line-height: 24px;
  1548. }
  1549. &__desc {
  1550. padding-left: 12px;
  1551. margin-top: 20px;
  1552. font-size: 16px;
  1553. font-family: Microsoft YaHei;
  1554. font-weight: 400;
  1555. color: #666666;
  1556. line-height: 24px;
  1557. /deep/ img {
  1558. max-width: 100% !important;
  1559. max-height: 400px !important;
  1560. }
  1561. }
  1562. &__content {
  1563. flex: 1;
  1564. overflow-y: scroll;
  1565. &::-webkit-scrollbar {
  1566. width: 6px;
  1567. }
  1568. &::-webkit-scrollbar-track {
  1569. background-color: #fff;
  1570. -webkit-border-radius: 2em;
  1571. -moz-border-radius: 2em;
  1572. border-radius: 2em;
  1573. }
  1574. &::-webkit-scrollbar-thumb {
  1575. background-color: #eeeeee;
  1576. -webkit-border-radius: 2em;
  1577. -moz-border-radius: 2em;
  1578. border-radius: 2em;
  1579. }
  1580. /deep/ .el-tabs__item {
  1581. padding: 0 20px !important;
  1582. height: 40px;
  1583. line-height: 40px;
  1584. }
  1585. .question__content {
  1586. height: auto;
  1587. overflow: auto;
  1588. }
  1589. .question-list {
  1590. padding: 24px 0 0 24px;
  1591. .checkbox,
  1592. .radio {
  1593. cursor: pointer;
  1594. margin-right: 24px;
  1595. padding: 0 24px;
  1596. display: flex;
  1597. align-items: center;
  1598. margin-top: 2px;
  1599. min-height: 40px;
  1600. padding-top: 10px;
  1601. padding-bottom: 10px;
  1602. background: #f5f9ff;
  1603. border-radius: 8px;
  1604. box-sizing: border-box;
  1605. &.right {
  1606. background: #37c65b;
  1607. }
  1608. &.wrong {
  1609. background: #ff3a30;
  1610. }
  1611. }
  1612. &.textarea {
  1613. margin-right: 12px;
  1614. .upload {
  1615. margin-top: 10px;
  1616. &__imgs {
  1617. margin-right: 10px;
  1618. width: 80px;
  1619. height: 80px;
  1620. background: #ffffff;
  1621. border: 1px solid #eeeeee;
  1622. border-radius: 4px;
  1623. position: relative;
  1624. display: flex;
  1625. float: left;
  1626. align-items: center;
  1627. justify-content: center;
  1628. img {
  1629. max-width: 100%;
  1630. max-height: 100%;
  1631. }
  1632. }
  1633. &__btn {
  1634. margin-right: 10px;
  1635. width: 80px;
  1636. height: 80px;
  1637. background: #ffffff;
  1638. border: 1px solid #eeeeee;
  1639. border-radius: 4px;
  1640. position: relative;
  1641. display: flex;
  1642. float: left;
  1643. align-items: center;
  1644. justify-content: center;
  1645. flex-direction: column;
  1646. .icon {
  1647. font-size: 20px;
  1648. color: #3f8dfd;
  1649. }
  1650. p {
  1651. font-size: 12px;
  1652. font-family: Microsoft YaHei;
  1653. font-weight: 400;
  1654. color: #999999;
  1655. line-height: 24px;
  1656. }
  1657. input {
  1658. position: absolute;
  1659. left: 0;
  1660. top: 0;
  1661. display: block;
  1662. width: 100%;
  1663. height: 100%;
  1664. opacity: 0;
  1665. }
  1666. }
  1667. }
  1668. }
  1669. /deep/ .el-checkbox {
  1670. white-space: pre-wrap;
  1671. }
  1672. }
  1673. .answer-list {
  1674. height: 40px;
  1675. border-top: 1px solid #eee;
  1676. border-bottom: 1px solid #eee;
  1677. margin-top: 24px;
  1678. display: flex;
  1679. align-items: center;
  1680. justify-content: space-between;
  1681. padding: 0 24px;
  1682. &__left {
  1683. font-size: 16px;
  1684. font-family: Microsoft YaHei;
  1685. font-weight: 400;
  1686. color: #333333;
  1687. line-height: 24px;
  1688. }
  1689. &__right {
  1690. font-size: 16px;
  1691. font-family: Microsoft YaHei;
  1692. font-weight: 400;
  1693. color: #333333;
  1694. line-height: 24px;
  1695. }
  1696. }
  1697. .explain-list {
  1698. padding: 12px 24px;
  1699. &__header {
  1700. font-size: 16px;
  1701. font-family: Microsoft YaHei;
  1702. font-weight: bold;
  1703. color: #666666;
  1704. line-height: 24px;
  1705. }
  1706. &__body {
  1707. margin-top: 12px;
  1708. font-size: 16px;
  1709. font-family: Microsoft YaHei;
  1710. font-weight: 400;
  1711. color: #666666;
  1712. line-height: 24px;
  1713. }
  1714. .upload {
  1715. margin-top: 10px;
  1716. &__imgs {
  1717. margin-right: 10px;
  1718. width: 80px;
  1719. height: 80px;
  1720. background: #ffffff;
  1721. border: 1px solid #eeeeee;
  1722. border-radius: 4px;
  1723. position: relative;
  1724. display: flex;
  1725. float: left;
  1726. align-items: center;
  1727. justify-content: center;
  1728. img {
  1729. max-width: 100%;
  1730. max-height: 100%;
  1731. }
  1732. }
  1733. }
  1734. }
  1735. }
  1736. &__btns {
  1737. position: relative;
  1738. height: 32px;
  1739. .submit {
  1740. cursor: pointer;
  1741. margin: 0 auto;
  1742. width: 140px;
  1743. height: 32px;
  1744. background: #3f8dfd;
  1745. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1746. border-radius: 16px;
  1747. text-align: center;
  1748. line-height: 32px;
  1749. color: #fff;
  1750. font-size: 16px;
  1751. }
  1752. .collect {
  1753. cursor: pointer;
  1754. position: absolute;
  1755. right: 0;
  1756. top: 5px;
  1757. font-size: 12px;
  1758. font-family: Microsoft YaHei;
  1759. font-weight: 400;
  1760. color: #3f8dfd;
  1761. line-height: 24px;
  1762. }
  1763. }
  1764. }
  1765. }
  1766. &__footer {
  1767. height: 40px;
  1768. display: flex;
  1769. justify-content: space-around;
  1770. align-items: center;
  1771. .btn {
  1772. cursor: pointer;
  1773. width: 140px;
  1774. height: 32px;
  1775. background: #ffffff;
  1776. border: 1px solid #3f8dfd;
  1777. border-radius: 16px;
  1778. line-height: 32px;
  1779. text-align: center;
  1780. color: #3f8dfd;
  1781. }
  1782. }
  1783. }
  1784. .right-box {
  1785. float: right;
  1786. width: 300px;
  1787. &__header {
  1788. height: 40px;
  1789. line-height: 40px;
  1790. font-size: 16px;
  1791. font-family: Microsoft YaHei;
  1792. font-weight: bold;
  1793. color: #333333;
  1794. text-align: center;
  1795. border-bottom: 1px solid #eeeeee;
  1796. .back-btn {
  1797. display: block;
  1798. margin: 0 auto;
  1799. width: 160px;
  1800. }
  1801. }
  1802. &__body {
  1803. height: 720px;
  1804. border-bottom: 1px solid #eee;
  1805. .card {
  1806. &__note {
  1807. display: flex;
  1808. height: 40px;
  1809. align-items: center;
  1810. border-bottom: 1px solid #eee;
  1811. .item {
  1812. display: flex;
  1813. align-items: center;
  1814. margin-left: 10px;
  1815. .box {
  1816. margin-right: 5px;
  1817. width: 16px;
  1818. height: 16px;
  1819. border-radius: 4px;
  1820. &.white {
  1821. background: #ffffff;
  1822. border: 1px solid #eeeeee;
  1823. }
  1824. &.green {
  1825. background: #37c65b;
  1826. }
  1827. &.red {
  1828. background: #ff3a30;
  1829. }
  1830. &.blue {
  1831. background: #3f8dfd;
  1832. }
  1833. }
  1834. }
  1835. }
  1836. &__content {
  1837. height: 630px;
  1838. overflow-y: scroll;
  1839. &::-webkit-scrollbar {
  1840. width: 6px;
  1841. }
  1842. &::-webkit-scrollbar-track {
  1843. background-color: #fff;
  1844. -webkit-border-radius: 2em;
  1845. -moz-border-radius: 2em;
  1846. border-radius: 2em;
  1847. }
  1848. &::-webkit-scrollbar-thumb {
  1849. background-color: #eeeeee;
  1850. -webkit-border-radius: 2em;
  1851. -moz-border-radius: 2em;
  1852. border-radius: 2em;
  1853. }
  1854. .list {
  1855. display: flex;
  1856. flex-wrap: wrap;
  1857. .item {
  1858. width: 40px;
  1859. height: 40px;
  1860. border-radius: 10px;
  1861. text-align: center;
  1862. line-height: 40px;
  1863. margin-left: 16px;
  1864. margin-top: 16px;
  1865. cursor: pointer;
  1866. &.white {
  1867. line-height: 38px;
  1868. color: #333333;
  1869. background: #ffffff;
  1870. border: 1px solid #eeeeee;
  1871. }
  1872. &.green {
  1873. color: #fff;
  1874. background: #37c65b;
  1875. }
  1876. &.red {
  1877. color: #fff;
  1878. background: #ff3a30;
  1879. }
  1880. &.blue {
  1881. border: 1rpx solid #eeeeee;
  1882. color: #fff;
  1883. background: #3f8dfd;
  1884. }
  1885. &.disabled {
  1886. cursor: not-allowed;
  1887. line-height: 38px;
  1888. color: #eeeeee;
  1889. background: #ffffff;
  1890. border: 1px solid #eeeeee;
  1891. }
  1892. }
  1893. }
  1894. }
  1895. }
  1896. }
  1897. &__footer {
  1898. height: 40px;
  1899. display: flex;
  1900. align-items: center;
  1901. justify-content: center;
  1902. .submit {
  1903. cursor: pointer;
  1904. width: 140px;
  1905. height: 32px;
  1906. background: #3f8dfd;
  1907. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1908. border-radius: 16px;
  1909. line-height: 32px;
  1910. text-align: center;
  1911. color: #fff;
  1912. font-size: 16px;
  1913. }
  1914. }
  1915. }
  1916. }
  1917. }
  1918. }
  1919. }
  1920. .take-photo {
  1921. /deep/ .el-dialog__header {
  1922. display: none;
  1923. }
  1924. /deep/ .el-dialog__body {
  1925. padding: 0;
  1926. overflow: unset;
  1927. }
  1928. &__close {
  1929. cursor: pointer;
  1930. position: absolute;
  1931. right: 0;
  1932. top: -28px;
  1933. width: 24px;
  1934. height: 24px;
  1935. line-height: 24px;
  1936. text-align: center;
  1937. color: #eee;
  1938. border: 1px solid #eee;
  1939. border-radius: 50%;
  1940. }
  1941. &__header {
  1942. height: 40px;
  1943. border-bottom: 1px solid #eee;
  1944. line-height: 40px;
  1945. font-size: 16px;
  1946. font-family: Microsoft YaHei;
  1947. font-weight: bold;
  1948. color: #333333;
  1949. padding-left: 24px;
  1950. }
  1951. &__body {
  1952. height: 400px;
  1953. padding: 40px 24px;
  1954. .left-box {
  1955. width: 336px;
  1956. float: left;
  1957. .title {
  1958. font-size: 16px;
  1959. font-family: Microsoft YaHei;
  1960. font-weight: bold;
  1961. color: #ff3b30;
  1962. line-height: 24px;
  1963. }
  1964. .content {
  1965. font-size: 14px;
  1966. font-family: Microsoft YaHei;
  1967. font-weight: 400;
  1968. color: #333333;
  1969. line-height: 28px;
  1970. margin-top: 32px;
  1971. }
  1972. }
  1973. .right-box {
  1974. float: right;
  1975. width: 400px;
  1976. height: 300px;
  1977. video {
  1978. width: 100%;
  1979. height: 100%;
  1980. }
  1981. }
  1982. }
  1983. &__footer {
  1984. height: 90px;
  1985. border-top: 1px solid #eee;
  1986. text-align: center;
  1987. .take {
  1988. display: inline-block;
  1989. width: 200px;
  1990. height: 40px;
  1991. padding: 0;
  1992. border-radius: 20px;
  1993. text-align: center;
  1994. line-height: 40px;
  1995. margin: 24px auto;
  1996. }
  1997. }
  1998. }
  1999. }
  2000. </style>