index.vue 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809
  1. <template>
  2. <div class="course-exam">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <!-- <el-breadcrumb separator="/">
  8. <el-breadcrumb-item
  9. v-for="(item, index) in $route.matched"
  10. :key="index"
  11. :to="{ path: item.path }"
  12. >{{ item.name }}</el-breadcrumb-item
  13. >
  14. </el-breadcrumb> -->
  15. </div>
  16. <div class="section__body">
  17. <div class="explain-record">
  18. <div class="explain-record__body clearfix">
  19. <div class="left-box">
  20. <Header-tab-box
  21. :num="questionOverNum(true)"
  22. :allNum="questionList.length"
  23. @prevQuestion="prevQuestion"
  24. @nextQuestion="nextQuestion"
  25. ></Header-tab-box>
  26. <div class="left-box__body">
  27. <template v-for="(question, questionIndex) in questionList">
  28. <div
  29. class="question"
  30. v-if="question.type == 1 && current == questionIndex"
  31. :key="questionIndex"
  32. >
  33. <div class="question__title">
  34. {{ questionIndex + 1 }}、单选题
  35. </div>
  36. <div
  37. class="question__desc"
  38. v-html="question.content"
  39. ></div>
  40. <div class="question__content">
  41. <div class="question-list" v-if="!question.ques">
  42. <div
  43. class="radio"
  44. v-for="(item, index) in question.jsonStr"
  45. :key="index"
  46. @click="
  47. radioSelect(
  48. question,
  49. questionIndex,
  50. item.optionsId
  51. )
  52. "
  53. >
  54. <div>
  55. {{ ast[index] }}. {{ item.content }}
  56. <div v-if="item.imgUrl">
  57. <img
  58. style="max-width: 100%"
  59. :src="$tools.splitImgHost(item.imgUrl)"
  60. alt=""
  61. />
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="question-list" v-if="question.ques">
  67. <div
  68. class="radio"
  69. :class="{
  70. right:
  71. bankType == 1 &&
  72. (item.optionsId == question.ques ||
  73. item.optionsId == question.ans),
  74. wrong:
  75. bankType == 1 &&
  76. item.optionsId == question.ques &&
  77. question.ques != question.ans,
  78. user_choose:
  79. bankType == 2 && item.optionsId == question.ques
  80. }"
  81. v-for="(item, index) in question.jsonStr"
  82. :key="index"
  83. @click="
  84. radioSelect(
  85. question,
  86. questionIndex,
  87. item.optionsId
  88. )
  89. "
  90. >
  91. <div>
  92. {{ ast[index] }}. {{ item.content }}
  93. <div v-if="item.imgUrl">
  94. <img
  95. style="max-width: 100%"
  96. :src="$tools.splitImgHost(item.imgUrl)"
  97. alt=""
  98. />
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div
  104. class="answer-list"
  105. v-if="bankType == 1 && question.ques"
  106. >
  107. <div class="answer-list__left">
  108. 题目答案:{{ ast[question.ans - 1] }}
  109. </div>
  110. <div class="answer-list__left">
  111. 我的答案:{{ ast[question.ques - 1] }}
  112. </div>
  113. </div>
  114. <div
  115. class="explain-list"
  116. v-if="bankType == 1 && question.ques"
  117. >
  118. <div class="explain-list__header">答案解析:</div>
  119. <div
  120. class="explain-list__body"
  121. v-html="question.analysisContent"
  122. ></div>
  123. </div>
  124. </div>
  125. <div class="question__btns"></div>
  126. </div>
  127. <div
  128. class="question"
  129. v-if="question.type == 2 && current == questionIndex"
  130. :key="questionIndex"
  131. >
  132. <div class="question__title">
  133. {{ questionIndex + 1 }}、多选题
  134. </div>
  135. <div
  136. class="question__desc"
  137. v-html="question.content"
  138. ></div>
  139. <div class="question__content">
  140. <div class="question-list" v-if="!question.ques">
  141. <el-checkbox
  142. class="checkbox"
  143. v-for="(item, index) in question.jsonStr"
  144. :key="index"
  145. :label="item.optionsId"
  146. v-model="item.checked"
  147. >
  148. <div>
  149. {{ ast[index] }}. {{ item.content }}
  150. <div v-if="item.imgUrl">
  151. <img
  152. style="max-width: 100%"
  153. :src="$tools.splitImgHost(item.imgUrl)"
  154. alt=""
  155. />
  156. </div>
  157. </div>
  158. </el-checkbox>
  159. </div>
  160. <div class="question-list" v-if="question.ques">
  161. <el-checkbox
  162. :disabled="bankType == 2 ? false : true"
  163. class="checkbox"
  164. :class="{
  165. right:
  166. bankType == 1 &&
  167. (question.ques.indexOf(item.optionsId) != -1 ||
  168. question.ans.indexOf(item.optionsId) != -1),
  169. wrong:
  170. bankType == 1 &&
  171. question.ques.indexOf(item.optionsId) != -1 &&
  172. question.ans.indexOf(item.optionsId) == -1,
  173. user_choose:
  174. bankType == 2 &&
  175. question.ques.indexOf(item.optionsId) != -1
  176. }"
  177. v-for="(item, index) in question.jsonStr"
  178. :key="index"
  179. :label="item.optionsId"
  180. v-model="item.checked"
  181. >
  182. <div>
  183. {{ ast[index] }}. {{ item.content }}
  184. <div v-if="item.imgUrl">
  185. <img
  186. style="max-width: 100%"
  187. :src="$tools.splitImgHost(item.imgUrl)"
  188. alt=""
  189. />
  190. </div>
  191. </div>
  192. </el-checkbox>
  193. </div>
  194. <div
  195. class="answer-list"
  196. v-if="bankType == 1 && question.ques"
  197. >
  198. <div class="answer-list__left">
  199. 题目答案:
  200. <template v-for="ansItem in question.ans">{{
  201. ast[ansItem - 1]
  202. }}</template>
  203. </div>
  204. <div class="answer-list__left">
  205. 我的答案:
  206. <template v-for="quesItem in question.ques">{{
  207. ast[quesItem - 1]
  208. }}</template>
  209. </div>
  210. </div>
  211. <div
  212. class="explain-list"
  213. v-if="bankType == 1 && question.ques"
  214. >
  215. <div class="explain-list__header">答案解析:</div>
  216. <div
  217. class="explain-list__body"
  218. v-html="question.analysisContent"
  219. ></div>
  220. </div>
  221. </div>
  222. <div class="question__btns">
  223. <div
  224. v-if="
  225. bankType == 2 || (bankType == 1 && !question.ques)
  226. "
  227. class="submit"
  228. @click="checkboxSubmit(question, questionIndex)"
  229. >
  230. 确认答案
  231. </div>
  232. </div>
  233. </div>
  234. <div
  235. class="question"
  236. v-if="question.type == 3 && current == questionIndex"
  237. :key="questionIndex"
  238. >
  239. <div class="question__title">
  240. {{ questionIndex + 1 }}、判断题
  241. </div>
  242. <div
  243. class="question__desc"
  244. v-html="question.content"
  245. ></div>
  246. <div class="question__content">
  247. <div class="question-list" v-if="!question.ques">
  248. <div
  249. class="radio"
  250. v-for="(item, index) in judge"
  251. :key="index"
  252. @click="judgeSelect(question, questionIndex, index)"
  253. >
  254. <div>
  255. {{ ast[index] }}. {{ item }}
  256. <div v-if="item.imgUrl">
  257. <img
  258. style="max-width: 100%"
  259. :src="$tools.splitImgHost(item.imgUrl)"
  260. alt=""
  261. />
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <div class="question-list" v-if="question.ques">
  267. <div
  268. class="radio"
  269. :class="{
  270. right:
  271. bankType == 1 &&
  272. (index == (question.ques == 1 ? 0 : 1) ||
  273. index != question.ans),
  274. wrong:
  275. bankType == 1 &&
  276. index == (question.ques == 1 ? 0 : 1) &&
  277. question.ques != question.ans,
  278. user_choose:
  279. bankType == 2 &&
  280. index == (question.ques == 1 ? 0 : 1)
  281. }"
  282. v-for="(item, index) in judge"
  283. :key="index"
  284. @click="judgeSelect(question, questionIndex, index)"
  285. >
  286. <div>
  287. {{ ast[index] }}. {{ item }}
  288. <div v-if="item.imgUrl">
  289. <img
  290. style="max-width: 100%"
  291. :src="$tools.splitImgHost(item.imgUrl)"
  292. alt=""
  293. />
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <div
  299. class="answer-list"
  300. v-if="bankType == 1 && question.ques"
  301. >
  302. <div class="answer-list__left">
  303. 题目答案:{{ ast[question.ans == 1 ? 0 : 1] }}
  304. </div>
  305. <div class="answer-list__left">
  306. 我的答案:{{ ast[question.ques == 1 ? 0 : 1] }}
  307. </div>
  308. </div>
  309. <div
  310. class="explain-list"
  311. v-if="bankType == 1 && question.ques"
  312. >
  313. <div class="explain-list__header">答案解析:</div>
  314. <div
  315. class="explain-list__body"
  316. v-html="question.analysisContent"
  317. ></div>
  318. </div>
  319. </div>
  320. <div class="question__btns"></div>
  321. </div>
  322. <div
  323. class="question"
  324. v-if="question.type == 4 && current == questionIndex"
  325. :key="questionIndex"
  326. >
  327. <div class="question__title">
  328. {{ questionIndex + 1 }}、案例题
  329. </div>
  330. <div
  331. class="question__desc"
  332. v-html="question.content"
  333. ></div>
  334. <div class="question__content">
  335. <el-tabs v-model="question.tabIndex">
  336. <el-tab-pane
  337. v-for="(json, jsonIndex) in question.jsonStr"
  338. :label="'问题' + (jsonIndex + 1)"
  339. :name="jsonIndex + ''"
  340. :key="jsonIndex"
  341. >
  342. <div
  343. class="question"
  344. v-if="json.type == 1"
  345. :key="questionIndex"
  346. >
  347. <div class="question__title">
  348. {{ jsonIndex + 1 }}、单选题
  349. </div>
  350. <div
  351. class="question__desc"
  352. v-html="json.content"
  353. ></div>
  354. <div class="question__content">
  355. <div
  356. class="question-list"
  357. v-if="!question.ques[jsonIndex]"
  358. >
  359. <div
  360. class="radio"
  361. v-for="(item, index) in json.optionsList"
  362. :key="index"
  363. @click="
  364. radioSelectChild(
  365. questionIndex,
  366. jsonIndex,
  367. item.optionsId
  368. )
  369. "
  370. >
  371. <div>
  372. {{ ast[index] }}. {{ item.content }}
  373. <div v-if="item.imgUrl">
  374. <img
  375. style="max-width: 100%"
  376. :src="
  377. $tools.splitImgHost(item.imgUrl)
  378. "
  379. alt=""
  380. />
  381. </div>
  382. </div>
  383. </div>
  384. </div>
  385. <div
  386. class="question-list"
  387. v-if="question.ques[jsonIndex]"
  388. >
  389. <div
  390. class="radio"
  391. :class="{
  392. right:
  393. bankType == 1 &&
  394. (item.optionsId ==
  395. question.ques[jsonIndex] ||
  396. item.optionsId ==
  397. question.ans[jsonIndex]),
  398. wrong:
  399. bankType == 1 &&
  400. item.optionsId ==
  401. question.ques[jsonIndex] &&
  402. question.ques[jsonIndex] !=
  403. question.ans[jsonIndex],
  404. user_choose:
  405. bankType == 2 &&
  406. item.optionsId ==
  407. question.ques[jsonIndex]
  408. }"
  409. v-for="(item, index) in json.optionsList"
  410. :key="index"
  411. @click="
  412. radioSelectChild(
  413. questionIndex,
  414. jsonIndex,
  415. item.optionsId
  416. )
  417. "
  418. >
  419. <div>
  420. {{ ast[index] }}. {{ item.content }}
  421. <div v-if="item.imgUrl">
  422. <img
  423. style="max-width: 100%"
  424. :src="
  425. $tools.splitImgHost(item.imgUrl)
  426. "
  427. alt=""
  428. />
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. <div
  434. class="answer-list"
  435. v-if="
  436. bankType == 1 && question.ques[jsonIndex]
  437. "
  438. >
  439. <div class="answer-list__left">
  440. 题目答案:{{
  441. ast[question.ans[jsonIndex] - 1]
  442. }}
  443. </div>
  444. <div class="answer-list__left">
  445. 我的答案:{{
  446. ast[question.ques[jsonIndex] - 1]
  447. }}
  448. </div>
  449. </div>
  450. <div
  451. class="explain-list"
  452. v-if="
  453. bankType == 1 && question.ques[jsonIndex]
  454. "
  455. >
  456. <div class="explain-list__header">
  457. 答案解析:
  458. </div>
  459. <div
  460. class="explain-list__body"
  461. v-html="json.analysisContent"
  462. ></div>
  463. </div>
  464. </div>
  465. <div class="question__btns"></div>
  466. </div>
  467. <div
  468. class="question"
  469. v-if="json.type == 2"
  470. :key="jsonIndex"
  471. >
  472. <div class="question__title">
  473. {{ jsonIndex + 1 }}、多选题
  474. </div>
  475. <div
  476. class="question__desc"
  477. v-html="json.content"
  478. ></div>
  479. <div class="question__content">
  480. <div
  481. class="question-list"
  482. v-if="!question.ques[jsonIndex]"
  483. >
  484. <el-checkbox
  485. class="checkbox"
  486. v-for="(item, index) in json.optionsList"
  487. :key="index"
  488. :label="item.optionsId"
  489. v-model="item.checked"
  490. >
  491. <div>
  492. {{ ast[index] }}. {{ item.content }}
  493. <div v-if="item.imgUrl">
  494. <img
  495. style="max-width: 100%"
  496. :src="
  497. $tools.splitImgHost(item.imgUrl)
  498. "
  499. alt=""
  500. />
  501. </div>
  502. </div>
  503. </el-checkbox>
  504. </div>
  505. <div
  506. class="question-list"
  507. v-if="question.ques[jsonIndex]"
  508. >
  509. <el-checkbox
  510. :disabled="bankType == 2 ? false : true"
  511. class="checkbox"
  512. :class="{
  513. right:
  514. bankType == 1 &&
  515. (question.ques[jsonIndex].indexOf(
  516. item.optionsId
  517. ) != -1 ||
  518. question.ans[jsonIndex].indexOf(
  519. item.optionsId
  520. ) != -1),
  521. wrong:
  522. bankType == 1 &&
  523. question.ques[jsonIndex].indexOf(
  524. item.optionsId
  525. ) != -1 &&
  526. question.ans[jsonIndex].indexOf(
  527. item.optionsId
  528. ) == -1,
  529. user_choose:
  530. bankType == 2 &&
  531. question.ques[jsonIndex].indexOf(
  532. item.optionsId
  533. ) != -1
  534. }"
  535. v-for="(item, index) in json.optionsList"
  536. :key="index"
  537. :label="item.optionsId"
  538. v-model="item.checked"
  539. >
  540. <div>
  541. {{ ast[index] }}. {{ item.content }}
  542. <div v-if="item.imgUrl">
  543. <img
  544. style="max-width: 100%"
  545. :src="
  546. $tools.splitImgHost(item.imgUrl)
  547. "
  548. alt=""
  549. />
  550. </div>
  551. </div>
  552. </el-checkbox>
  553. </div>
  554. <div
  555. class="answer-list"
  556. v-if="
  557. bankType == 1 && question.ques[jsonIndex]
  558. "
  559. >
  560. <div class="answer-list__left">
  561. 题目答案:
  562. <template
  563. v-for="ansItem in question.ans[jsonIndex]"
  564. >{{ ast[ansItem - 1] }}</template
  565. >
  566. </div>
  567. <div class="answer-list__left">
  568. 我的答案:
  569. <template
  570. v-for="quesItem in question.ques[
  571. jsonIndex
  572. ]"
  573. >{{ ast[quesItem - 1] }}</template
  574. >
  575. </div>
  576. </div>
  577. <div
  578. class="explain-list"
  579. v-if="
  580. bankType == 1 && question.ques[jsonIndex]
  581. "
  582. >
  583. <div class="explain-list__header">
  584. 答案解析:
  585. </div>
  586. <div
  587. class="explain-list__body"
  588. v-html="json.analysisContent"
  589. ></div>
  590. </div>
  591. </div>
  592. <div class="question__btns">
  593. <div
  594. v-if="
  595. bankType == 2 ||
  596. (bankType == 1 &&
  597. !question.ques[jsonIndex])
  598. "
  599. class="submit"
  600. @click="
  601. checkboxSubmitChild(
  602. questionIndex,
  603. jsonIndex
  604. )
  605. "
  606. >
  607. 确认答案
  608. </div>
  609. </div>
  610. </div>
  611. <div
  612. class="question"
  613. v-if="json.type == 3"
  614. :key="jsonIndex"
  615. >
  616. <div class="question__title">
  617. {{ jsonIndex + 1 }}、判断题
  618. </div>
  619. <div
  620. class="question__desc"
  621. v-html="json.content"
  622. ></div>
  623. <div class="question__content">
  624. <div
  625. class="question-list"
  626. v-if="!question.ques[jsonIndex]"
  627. >
  628. <div
  629. class="radio"
  630. v-for="(item, index) in judge"
  631. :key="index"
  632. @click="
  633. judgeSelectChild(
  634. questionIndex,
  635. jsonIndex,
  636. index
  637. )
  638. "
  639. >
  640. <div>
  641. {{ ast[index] }}. {{ item }}
  642. <div v-if="item.imgUrl">
  643. <img
  644. style="max-width: 100%"
  645. :src="
  646. $tools.splitImgHost(item.imgUrl)
  647. "
  648. alt=""
  649. />
  650. </div>
  651. </div>
  652. </div>
  653. </div>
  654. <div
  655. class="question-list"
  656. v-if="question.ques[jsonIndex]"
  657. >
  658. <div
  659. class="radio"
  660. :class="{
  661. right:
  662. bankType == 1 &&
  663. (index ==
  664. (question.ques[jsonIndex] == 1
  665. ? 0
  666. : 1) ||
  667. index != question.ans[jsonIndex]),
  668. wrong:
  669. bankType == 1 &&
  670. index ==
  671. (question.ques[jsonIndex] == 1
  672. ? 0
  673. : 1) &&
  674. question.ques[jsonIndex] !=
  675. question.ans[jsonIndex],
  676. user_choose:
  677. bankType == 2 &&
  678. index ==
  679. (question.ques[jsonIndex] == 1
  680. ? 0
  681. : 1)
  682. }"
  683. v-for="(item, index) in judge"
  684. :key="index"
  685. @click="
  686. judgeSelectChild(
  687. questionIndex,
  688. jsonIndex,
  689. index
  690. )
  691. "
  692. >
  693. <div>
  694. {{ ast[index] }}. {{ item }}
  695. <div v-if="item.imgUrl">
  696. <img
  697. style="max-width: 100%"
  698. :src="
  699. $tools.splitImgHost(item.imgUrl)
  700. "
  701. alt=""
  702. />
  703. </div>
  704. </div>
  705. </div>
  706. </div>
  707. <div
  708. class="answer-list"
  709. v-if="
  710. bankType == 1 && question.ques[jsonIndex]
  711. "
  712. >
  713. <div class="answer-list__left">
  714. 题目答案:{{
  715. ast[question.ans[jsonIndex] == 1 ? 0 : 1]
  716. }}
  717. </div>
  718. <div class="answer-list__left">
  719. 我的答案:{{
  720. ast[question.ques[jsonIndex] == 1 ? 0 : 1]
  721. }}
  722. </div>
  723. </div>
  724. <div
  725. class="explain-list"
  726. v-if="
  727. bankType == 1 && question.ques[jsonIndex]
  728. "
  729. >
  730. <div class="explain-list__header">
  731. 答案解析:
  732. </div>
  733. <div
  734. class="explain-list__body"
  735. v-html="json.analysisContent"
  736. ></div>
  737. </div>
  738. </div>
  739. <div class="question__btns"></div>
  740. </div>
  741. <div
  742. class="question"
  743. v-if="json.type == 5"
  744. :key="jsonIndex"
  745. >
  746. <div class="question__title">
  747. {{ jsonIndex + 1 }}、简答题
  748. </div>
  749. <div
  750. class="question__desc"
  751. v-html="json.content"
  752. ></div>
  753. <div class="question__content">
  754. <div
  755. class="question-list textarea"
  756. v-if="
  757. bankType == 2 ||
  758. (bankType == 1 &&
  759. !(
  760. question.ques[jsonIndex] &&
  761. (question.ques[jsonIndex].imageList
  762. .length ||
  763. question.ques[jsonIndex].text)
  764. ))
  765. "
  766. >
  767. <el-input
  768. type="textarea"
  769. rows="5"
  770. v-model="json.ansText.text"
  771. resize="none"
  772. ></el-input>
  773. <div class="upload clearfix">
  774. <div
  775. class="upload__imgs"
  776. v-for="(img, imgIndex) in json.ansText
  777. .imageList"
  778. :key="imgIndex"
  779. >
  780. <img
  781. style="max-width: 100%"
  782. :src="$tools.splitImgHost(img, true)"
  783. alt=""
  784. />
  785. </div>
  786. <div class="upload__btn">
  787. <i class="el-icon-plus icon"></i>
  788. <p>上传图片</p>
  789. <input
  790. @change="
  791. uploadImgChild(
  792. $event,
  793. questionIndex,
  794. jsonIndex
  795. )
  796. "
  797. type="file"
  798. />
  799. </div>
  800. </div>
  801. </div>
  802. <div
  803. class="explain-list"
  804. v-if="
  805. bankType == 1 &&
  806. question.ques[jsonIndex] &&
  807. (question.ques[jsonIndex].imageList
  808. .length ||
  809. question.ques[jsonIndex].text)
  810. "
  811. >
  812. <div class="explain-list__header">
  813. 我的答案:
  814. </div>
  815. <div class="explain-list__body">
  816. <div>
  817. {{ question.ques[jsonIndex].text }}
  818. </div>
  819. <div class="upload clearfix">
  820. <div
  821. class="upload__imgs"
  822. v-for="(img, imgIndex) in question.ques[
  823. jsonIndex
  824. ].imageList"
  825. :key="imgIndex"
  826. >
  827. <img
  828. style="max-width: 100%"
  829. :src="$tools.splitImgHost(img, true)"
  830. alt=""
  831. />
  832. </div>
  833. </div>
  834. </div>
  835. <div class="explain-list__header">
  836. 答案解析:
  837. </div>
  838. <div
  839. class="explain-list__body"
  840. v-html="question.analysisContent"
  841. ></div>
  842. </div>
  843. </div>
  844. <div class="question__btns">
  845. <div
  846. v-if="
  847. bankType == 2 ||
  848. (bankType == 1 &&
  849. !(
  850. question.ques[jsonIndex] &&
  851. (question.ques[jsonIndex].imageList
  852. .length ||
  853. question.ques[jsonIndex].text)
  854. ))
  855. "
  856. class="submit"
  857. @click="
  858. ansSubmitChild(
  859. question,
  860. questionIndex,
  861. jsonIndex
  862. )
  863. "
  864. >
  865. 确认答案
  866. </div>
  867. </div>
  868. </div>
  869. </el-tab-pane>
  870. </el-tabs>
  871. </div>
  872. <div class="question__btns"></div>
  873. </div>
  874. <div
  875. class="question"
  876. v-if="question.type == 5 && current == questionIndex"
  877. :key="questionIndex"
  878. >
  879. <div class="question__title">
  880. {{ questionIndex + 1 }}、简答题
  881. </div>
  882. <div
  883. class="question__desc"
  884. v-html="question.content"
  885. ></div>
  886. <div class="question__content">
  887. <div
  888. class="question-list textarea"
  889. v-if="
  890. bankType == 2 ||
  891. (bankType == 1 &&
  892. !question.ques.imageList.length &&
  893. !question.ques.text)
  894. "
  895. >
  896. <el-input
  897. type="textarea"
  898. rows="5"
  899. v-model="question.ansText.text"
  900. resize="none"
  901. ></el-input>
  902. <div class="upload clearfix">
  903. <div
  904. class="upload__imgs"
  905. v-for="(img, imgIndex) in question.ansText
  906. .imageList"
  907. :key="imgIndex"
  908. >
  909. <img
  910. style="max-width: 100%"
  911. :src="$tools.splitImgHost(img, true)"
  912. alt=""
  913. />
  914. </div>
  915. <div class="upload__btn">
  916. <i class="el-icon-plus icon"></i>
  917. <p>上传图片</p>
  918. <input
  919. @change="
  920. uploadImg($event, question, questionIndex)
  921. "
  922. type="file"
  923. />
  924. </div>
  925. </div>
  926. </div>
  927. <div
  928. class="explain-list"
  929. v-if="
  930. bankType == 1 &&
  931. (question.ques.imageList.length ||
  932. question.ques.text)
  933. "
  934. >
  935. <div class="explain-list__header">我的答案:</div>
  936. <div class="explain-list__body">
  937. <div>{{ question.ques.text }}</div>
  938. <div class="upload clearfix">
  939. <div
  940. class="upload__imgs"
  941. v-for="(img, imgIndex) in question.ques
  942. .imageList"
  943. :key="imgIndex"
  944. >
  945. <img
  946. style="max-width: 100%"
  947. :src="$tools.splitImgHost(img, true)"
  948. alt=""
  949. />
  950. </div>
  951. </div>
  952. </div>
  953. <div class="explain-list__header">答案解析:</div>
  954. <div
  955. class="explain-list__body"
  956. v-html="question.analysisContent"
  957. ></div>
  958. </div>
  959. </div>
  960. <div class="question__btns">
  961. <div
  962. v-if="
  963. bankType == 2 ||
  964. (bankType == 1 &&
  965. !question.ques.imageList.length &&
  966. !question.ques.text)
  967. "
  968. class="submit"
  969. @click="ansSubmit(question, questionIndex)"
  970. >
  971. 确认答案
  972. </div>
  973. </div>
  974. </div>
  975. </template>
  976. </div>
  977. </div>
  978. <div class="right-box">
  979. <div class="right-box__header">
  980. <el-button
  981. type="primary"
  982. round
  983. plain
  984. size="small"
  985. class="back-btn"
  986. @click="$router.back(-1)"
  987. >返回</el-button
  988. >
  989. </div>
  990. <div class="right-box__footer">
  991. <el-button
  992. type="primary"
  993. :loading="loading"
  994. class="submit"
  995. @click="submit"
  996. >交卷</el-button
  997. >
  998. </div>
  999. <div class="right-box__header">
  1000. <div class="title">答题卡</div>
  1001. <div class="time" v-if="allTimes">
  1002. {{ countdown(lastTime) }}
  1003. </div>
  1004. </div>
  1005. <div class="right-box__body">
  1006. <div class="card">
  1007. <div class="card__note">
  1008. <div class="item">
  1009. <div class="box green"></div>
  1010. 正确
  1011. </div>
  1012. <div class="item">
  1013. <div class="box red"></div>
  1014. 错误
  1015. </div>
  1016. <div class="item">
  1017. <div class="box blue"></div>
  1018. 已做未评改
  1019. </div>
  1020. <div class="item">
  1021. <div class="box yellow"></div>
  1022. 少选
  1023. </div>
  1024. <div class="item">
  1025. <div class="box white"></div>
  1026. 未做
  1027. </div>
  1028. </div>
  1029. <div class="card__content">
  1030. <ul class="list">
  1031. <li
  1032. class="item white"
  1033. v-for="(item, index) in questionList"
  1034. :key="index"
  1035. :class="{
  1036. green: bankType == 1 && isRight(item, index),
  1037. red: bankType == 1 && isWrong(item, index),
  1038. yellow: bankType == 1 && isPart(item, index),
  1039. blue: bankType == 1 && isOver(item, index),
  1040. check_ans: bankType == 2 && isCheck(item, index)
  1041. }"
  1042. @click="changeIndex(index)"
  1043. >
  1044. {{ index + 1 }}
  1045. </li>
  1046. </ul>
  1047. </div>
  1048. </div>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. </div>
  1053. </div>
  1054. </div>
  1055. </section>
  1056. <ToolBar></ToolBar>
  1057. <Footer></Footer>
  1058. </div>
  1059. </template>
  1060. <script>
  1061. import Footer from "@/components/footer/index";
  1062. import Header from "@/components/header/index";
  1063. import ToolBar from "@/components/toolbar/index";
  1064. import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
  1065. import { mapMutations, mapGetters, mapActions } from "vuex";
  1066. import myMixins from "@/mixin";
  1067. export default {
  1068. name: "BankExplain",
  1069. components: {
  1070. Footer,
  1071. Header,
  1072. ToolBar,
  1073. HeaderTabBox
  1074. },
  1075. computed: {
  1076. ...mapGetters(["sysTime"])
  1077. },
  1078. mixins: [myMixins],
  1079. data() {
  1080. return {
  1081. recordId: 0,
  1082. tabIndex: "1",
  1083. textarea: "",
  1084. questionIndex: 0,
  1085. checked: false,
  1086. activeName: "1",
  1087. questionList: [],
  1088. goodsExamConfig: [],
  1089. goodsDetail: {},
  1090. bankList: [],
  1091. judge: ["正确", "错误"],
  1092. ast: [
  1093. "A",
  1094. "B",
  1095. "C",
  1096. "D",
  1097. "E",
  1098. "F",
  1099. "G",
  1100. "H",
  1101. "I",
  1102. "J",
  1103. "K",
  1104. "L",
  1105. "M",
  1106. "N",
  1107. "O",
  1108. "P",
  1109. "Q",
  1110. "R",
  1111. "S",
  1112. "T",
  1113. "U",
  1114. "V",
  1115. "W",
  1116. "X",
  1117. "Y",
  1118. "Z"
  1119. ],
  1120. loading: false,
  1121. needPhoto: false,
  1122. lastTime: 0, //剩余考试时长
  1123. allTimes: 0, //总考试时长
  1124. goodsId: "",
  1125. orderGoodsId: "",
  1126. lastCount: 0,
  1127. examId: 0,
  1128. current: 0,
  1129. eachExamId: 0,
  1130. bankType: 0,
  1131. timer: null,
  1132. examData: {},
  1133. collectList: [],
  1134. isSubmit: false,
  1135. postTimer: null,
  1136. subscribeId: 0,
  1137. isAutoSubmit: false,
  1138. examEndTime: 0,
  1139. examStartTime: 0,
  1140. doMode: 1, //3模考组卷1普通考卷
  1141. simulateExamId: ""
  1142. };
  1143. },
  1144. async mounted() {
  1145. this.examStartTime = this.$route.query.examStartTime;
  1146. this.examEndTime = this.$route.query.examEndTime;
  1147. this.examId = this.$route.query.examId;
  1148. this.eachExamId = this.$route.query.eachExamId;
  1149. this.subscribeId = this.$route.query.subscribeId || "";
  1150. this.allTimes = this.examEndTime - this.examStartTime || "";
  1151. this.goodsId = this.$route.query.goodsId;
  1152. this.orderGoodsId = this.$route.query.orderGoodsId;
  1153. await this.setSystemTime();
  1154. await this.bankExam();
  1155. this.goodsQuestionList();
  1156. },
  1157. beforeDestroy() {
  1158. clearInterval(this.postTimer);
  1159. clearInterval(this.timer);
  1160. try {
  1161. this.$msgbox.close();
  1162. } catch (err) {}
  1163. },
  1164. beforeRouteLeave(to, from, next) {
  1165. if (this.isSubmit ||
  1166. (to.path == "/home" && !this.$store.state.userInfo)) {
  1167. //交卷
  1168. next();
  1169. } else {
  1170. next(false)
  1171. //离开
  1172. if (this.bankType == 1) {
  1173. let ansCount = this.questionOverNum(true); //已答题数
  1174. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1175. //所有题目答完
  1176. if (this.lastCount == 0) {
  1177. // this.testOver = true;
  1178. this.$nextTick(() => {
  1179. this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
  1180. confirmButtonText: "结束做题",
  1181. cancelButtonText: "下次继续",
  1182. type: "warning"
  1183. })
  1184. .then(() => {
  1185. this.examSubmit();
  1186. })
  1187. .catch(() => {
  1188. this.mockRecordEdit();
  1189. next();
  1190. });
  1191. });
  1192. //未答完
  1193. } else {
  1194. this.$nextTick(() => {
  1195. this.$confirm(
  1196. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1197. "温馨提示",
  1198. {
  1199. confirmButtonText: "继续作答",
  1200. cancelButtonText: "下次继续",
  1201. type: "warning"
  1202. }
  1203. )
  1204. .then(() => {
  1205. // confirmButton回调
  1206. })
  1207. .catch(() => {
  1208. this.mockRecordEdit();
  1209. next();
  1210. });
  1211. });
  1212. // this.isLastCount = true;
  1213. }
  1214. } else if (this.bankType == 2) {
  1215. console.log(2);
  1216. let ansCount = this.questionOverNum(true); //已答题数
  1217. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1218. //所有题目答完
  1219. if (this.lastCount == 0) {
  1220. this.$nextTick(() => {
  1221. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1222. confirmButtonText: "立即交卷",
  1223. cancelButtonText: "暂不交卷",
  1224. type: "warning"
  1225. })
  1226. .then(() => {
  1227. // confirmButton回调
  1228. this.examSubmit();
  1229. next();
  1230. })
  1231. .catch(() => {});
  1232. });
  1233. //未答完
  1234. } else {
  1235. this.$nextTick(() => {
  1236. this.$confirm(
  1237. `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
  1238. "温馨提示",
  1239. {
  1240. confirmButtonText: "继续离开",
  1241. cancelButtonText: "暂不离开",
  1242. type: "warning"
  1243. }
  1244. )
  1245. .then(() => {
  1246. this.examSubmit();
  1247. })
  1248. .catch(() => {});
  1249. });
  1250. }
  1251. }
  1252. }
  1253. },
  1254. methods: {
  1255. ...mapMutations(["setExamResult"]),
  1256. ...mapActions(["setSystemTime"]),
  1257. mockSubscribeEdit() {
  1258. this.$request
  1259. .mockSubscribeEdit({
  1260. subscribeId: this.subscribeId,
  1261. handStatus: this.isAutoSubmit ? 2 : 1
  1262. })
  1263. .then(res => {});
  1264. },
  1265. toFixed(num) {
  1266. if (num) {
  1267. let str = String(num).indexOf(".");
  1268. if (str != -1) {
  1269. return +num.toFixed(2);
  1270. } else {
  1271. return num;
  1272. }
  1273. } else {
  1274. return 0;
  1275. }
  1276. },
  1277. /**
  1278. * @param {Object} current
  1279. * 获取收藏信息
  1280. */
  1281. getCollectInfo(current) {
  1282. this.$request
  1283. .getCollectInfo({
  1284. examId: this.examId,
  1285. questionId: this.questionList[current].questionId,
  1286. goodsId: this.goodsId,
  1287. orderGoodsId: this.orderGoodsId,
  1288. doMode: this.doMode
  1289. })
  1290. .then(res => {
  1291. this.$set(this.collectList, current, res.data);
  1292. })
  1293. .catch(err => {
  1294. this.$set(this.collectList, current, false);
  1295. });
  1296. },
  1297. /**
  1298. * 是否做完所有题目
  1299. */
  1300. isDoOver() {
  1301. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1302. if (this.questionList.length == questionOverNum) {
  1303. //全部做完弹窗
  1304. this.$nextTick(() => {
  1305. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1306. confirmButtonText: "立即交卷",
  1307. cancelButtonText: "暂不交卷",
  1308. type: "warning"
  1309. })
  1310. .then(() => {
  1311. // confirmButton回调
  1312. this.examSubmit();
  1313. })
  1314. .catch(() => {});
  1315. });
  1316. }
  1317. },
  1318. /**
  1319. * 请求题目列表
  1320. */
  1321. goodsQuestionList() {
  1322. console.log(this.doMode, this.examId, this.goodsId);
  1323. this.$request[
  1324. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1325. ]({
  1326. examId: this.examId,
  1327. goodsId: this.goodsId,
  1328. orderGoodsId: this.orderGoodsId,
  1329. from: this.doMode == 3 ? 3 : ""
  1330. }).then(async items => {
  1331. var data = [];
  1332. if (this.doMode == 3) {
  1333. this.simulateExamId = items.data.simulateExamId;
  1334. data = items.data.questionList;
  1335. } else {
  1336. data = items.data;
  1337. }
  1338. if (!data.length) {
  1339. this.$message({
  1340. type: "warning",
  1341. message: "该试卷暂无题目"
  1342. });
  1343. return;
  1344. }
  1345. if (this.subscribeId) {
  1346. this.lastTime = this.examEndTime - this.sysTime;
  1347. //考试时间到了自动交卷
  1348. if (this.lastTime) {
  1349. this.timer = setInterval(() => {
  1350. if (this.lastTime <= 0) {
  1351. clearInterval(this.timer);
  1352. this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
  1353. confirmButtonText: "立即交卷",
  1354. closeOnClickModal: false,
  1355. showCancelButton: false,
  1356. closeOnPressEscape: false,
  1357. distinguishCancelAndClose: false,
  1358. showClose: false
  1359. });
  1360. this.isAutoSubmit = true;
  1361. setTimeout(() => {
  1362. try {
  1363. this.$msgbox.close();
  1364. } catch (err) {}
  1365. this.examSubmit();
  1366. }, 3000);
  1367. return;
  1368. }
  1369. this.lastTime--;
  1370. }, 1000);
  1371. } else {
  1372. }
  1373. }
  1374. data.forEach((item, index) => {
  1375. item.jsonStr = JSON.parse(item.jsonStr);
  1376. if (item.type == 2) {
  1377. //多选
  1378. item.jsonStr.forEach(str => {
  1379. str.optionsId = "" + str.optionsId;
  1380. });
  1381. let arr = item.answerQuestion.split(",");
  1382. arr.forEach((a, i) => {
  1383. arr[i] = "" + a;
  1384. });
  1385. item.ans = arr;
  1386. item.quesSelect = [];
  1387. item.analysisContent &&
  1388. (item.analysisContent = item.analysisContent.replace(
  1389. /<img/gi,
  1390. '<img style="max-width:100%;"'
  1391. ));
  1392. item.content &&
  1393. (item.content = item.content.replace(
  1394. /<img/gi,
  1395. '<img style="max-width:100%;"'
  1396. ));
  1397. return;
  1398. } else if (item.type == 5) {
  1399. //简答题
  1400. item.ansText = {
  1401. text: "",
  1402. imageList: []
  1403. };
  1404. item.ques = {
  1405. text: "",
  1406. imageList: []
  1407. };
  1408. item.analysisContent &&
  1409. (item.analysisContent = item.analysisContent.replace(
  1410. /<img/gi,
  1411. '<img style="max-width:100%;"'
  1412. ));
  1413. item.content &&
  1414. (item.content = item.content.replace(
  1415. /<img/gi,
  1416. '<img style="max-width:100%;"'
  1417. ));
  1418. return;
  1419. } else if (item.type == 4) {
  1420. //案例题
  1421. console.log(item.jsonStr);
  1422. item.ques = [];
  1423. item.tabIndex = "0";
  1424. let ansArr = [];
  1425. item.jsonStr.forEach((json, index) => {
  1426. if (json.type == 1) {
  1427. ansArr[index] = json.answerQuestion;
  1428. json.content &&
  1429. (json.content = json.content.replace(
  1430. /<img/gi,
  1431. '<img style="max-width:100%;"'
  1432. ));
  1433. } else if (json.type == 2) {
  1434. json.optionsList.forEach(str => {
  1435. str.optionsId = "" + str.optionsId;
  1436. });
  1437. let arr = json.answerQuestion.split(",");
  1438. arr.forEach((a, i) => {
  1439. arr[i] = "" + a;
  1440. });
  1441. ansArr[index] = arr;
  1442. json.content &&
  1443. (json.content = json.content.replace(
  1444. /<img/gi,
  1445. '<img style="max-width:100%;"'
  1446. ));
  1447. } else if (json.type == 3) {
  1448. ansArr[index] = json.answerQuestion;
  1449. json.content &&
  1450. (json.content = json.content.replace(
  1451. /<img/gi,
  1452. '<img style="max-width:100%;"'
  1453. ));
  1454. } else if (json.type == 5) {
  1455. ansArr[index] = {
  1456. text: "",
  1457. imageList: []
  1458. };
  1459. json.ansText = {
  1460. text: "",
  1461. imageList: []
  1462. };
  1463. json.ques = {
  1464. text: "",
  1465. imageList: []
  1466. };
  1467. json.content &&
  1468. (json.content = json.content.replace(
  1469. /<img/gi,
  1470. '<img style="max-width:100%;"'
  1471. ));
  1472. }
  1473. });
  1474. item.ans = ansArr;
  1475. return;
  1476. }
  1477. item.analysisContent &&
  1478. (item.analysisContent = item.analysisContent.replace(
  1479. /<img/gi,
  1480. '<img style="max-width:100%;"'
  1481. ));
  1482. item.content &&
  1483. (item.content = item.content.replace(
  1484. /<img/gi,
  1485. '<img style="max-width:100%;"'
  1486. ));
  1487. item.ques = "";
  1488. item.ans = item.answerQuestion;
  1489. });
  1490. this.questionList = data;
  1491. this.lastCount = this.questionList.length;
  1492. this.getCollectInfo(this.current);
  1493. await this.mockRecord();
  1494. });
  1495. },
  1496. /**
  1497. * 记录总题数,获取recordId
  1498. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1499. */
  1500. mockRecord(hasSpecial) {
  1501. return new Promise(resolve => {
  1502. let self = this;
  1503. let questionList = 0;
  1504. // if(!hasSpecial) {
  1505. this.questionList.forEach((item, index) => {
  1506. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1507. questionList++;
  1508. }
  1509. });
  1510. // } else {
  1511. // questionList = this.questionList.length;
  1512. // }
  1513. this.$request
  1514. .mockRecord({
  1515. eachExamId: this.eachExamId,
  1516. examId: this.examId,
  1517. totalQuestionNum: questionList,
  1518. allQuestionNum: this.questionList.length,
  1519. doMode: this.doMode,
  1520. simulateExamId: this.simulateExamId
  1521. })
  1522. .then(res => {
  1523. this.recordId = res.data;
  1524. });
  1525. });
  1526. },
  1527. /**
  1528. * 离开页面统计回答正确题数
  1529. */
  1530. mockRecordEdit() {
  1531. clearInterval(this.postTimer);
  1532. clearInterval(this.timer);
  1533. let form = this.calculateScore(this.questionList);
  1534. if (this.subscribeId) {
  1535. this.mockSubscribeEdit();
  1536. }
  1537. this.$request
  1538. .mockRecordEdit({
  1539. eachExamId: this.eachExamId,
  1540. examId: this.examId,
  1541. recordId: this.recordId,
  1542. status: 1,
  1543. ...form
  1544. })
  1545. .then(res => {});
  1546. },
  1547. /**
  1548. * 获取试卷类型2考试,1练习
  1549. */
  1550. bankExam() {
  1551. return new Promise(resolve => {
  1552. this.$request.bankExam(this.examId).then(res => {
  1553. this.bankType = res.data.doType;
  1554. this.examData = res.data;
  1555. this.doMode = res.data.simulateStatus ? 3 : 1;
  1556. if (this.bankType == 2) {
  1557. this.needBack = true;
  1558. }
  1559. resolve();
  1560. });
  1561. });
  1562. },
  1563. /**
  1564. * @param {Object}
  1565. * 单选点击确认
  1566. */
  1567. radioSelect(question, questionIndex, optionsId) {
  1568. // if (this.questionList[questionIndex].ques) return;
  1569. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1570. return;
  1571. }
  1572. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1573. this.isDoOver();
  1574. },
  1575. /**
  1576. * @param {Object}
  1577. * 案例单选点击
  1578. */
  1579. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1580. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1581. if (
  1582. this.questionList[questionIndex].ques[jsonIndex] &&
  1583. this.bankType == 1
  1584. ) {
  1585. return;
  1586. }
  1587. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1588. this.isDoOver();
  1589. },
  1590. /**
  1591. * 多选点击确认
  1592. */
  1593. checkboxSubmit(question, questionIndex) {
  1594. // if (this.questionList[questionIndex].ques) return;
  1595. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1596. return;
  1597. }
  1598. let arr = [];
  1599. this.questionList[questionIndex].jsonStr.forEach(item => {
  1600. if (item.checked) {
  1601. arr.push(item.optionsId);
  1602. }
  1603. });
  1604. if (!arr.length) {
  1605. delete this.questionList[questionIndex].ques;
  1606. this.$message({
  1607. type: "warning",
  1608. message: "请选择答案"
  1609. });
  1610. return;
  1611. }
  1612. this.$set(this.questionList[questionIndex], "ques", arr);
  1613. this.isDoOver();
  1614. },
  1615. /**
  1616. * @param {Object}
  1617. * 案例多选确认
  1618. */
  1619. checkboxSubmitChild(questionIndex, ansIndex) {
  1620. // if (this.questionList[questionIndex].ques[ansIndex]) return;
  1621. if (
  1622. this.questionList[questionIndex].ques[ansIndex] &&
  1623. this.bankType == 1
  1624. ) {
  1625. return;
  1626. }
  1627. let arr = [];
  1628. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1629. item => {
  1630. if (item.checked) {
  1631. arr.push(item.optionsId);
  1632. }
  1633. }
  1634. );
  1635. if (!arr.length) {
  1636. delete this.questionList[questionIndex].ques[ansIndex];
  1637. this.$message({
  1638. type: "warning",
  1639. message: "请选择答案"
  1640. });
  1641. return;
  1642. }
  1643. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1644. this.isDoOver();
  1645. },
  1646. /**
  1647. * 判断点击确认
  1648. */
  1649. judgeSelect(question, questionIndex, index) {
  1650. // if (question.ques) return;
  1651. if (question.ques && this.bankType == 1) {
  1652. return;
  1653. }
  1654. this.$set(
  1655. this.questionList[questionIndex],
  1656. "ques",
  1657. index == 0 ? "1" : "0"
  1658. );
  1659. this.isDoOver();
  1660. },
  1661. judgeSelectChild(questionIndex, jsonIndex, index) {
  1662. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1663. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1664. if (
  1665. this.questionList[questionIndex].ques[jsonIndex] &&
  1666. this.bankType == 1
  1667. ) {
  1668. return;
  1669. }
  1670. this.$set(
  1671. this.questionList[questionIndex].ques,
  1672. jsonIndex,
  1673. index == 0 ? "1" : "0"
  1674. );
  1675. this.isDoOver();
  1676. },
  1677. /**
  1678. * 上传图片
  1679. */
  1680. uploadImg(e, question, questionIndex) {
  1681. var file = e.target.files[0];
  1682. if (file.size > 2 * 1024 * 1024) {
  1683. this.$message.warn("图片不得大于2000kb");
  1684. return;
  1685. }
  1686. var type = e.target.value
  1687. .toLowerCase()
  1688. .split(".")
  1689. .splice(-1);
  1690. if (
  1691. type[0] != "jpg" &&
  1692. type[0] != "png" &&
  1693. type[0] != "jpeg" &&
  1694. type[0] != "gif"
  1695. ) {
  1696. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1697. e.target.value = "";
  1698. return;
  1699. }
  1700. this.$upload.upload(file, 0).then(res => {
  1701. question.ansText.imageList.push(res);
  1702. });
  1703. },
  1704. /**
  1705. * 案例上传图片
  1706. */
  1707. uploadImgChild(e, questionIndex, jsonIndex) {
  1708. var file = e.target.files[0];
  1709. if (file.size > 2 * 1024 * 1024) {
  1710. this.$message.warn("图片不得大于2000kb");
  1711. return;
  1712. }
  1713. var type = e.target.value
  1714. .toLowerCase()
  1715. .split(".")
  1716. .splice(-1);
  1717. if (
  1718. type[0] != "jpg" &&
  1719. type[0] != "png" &&
  1720. type[0] != "jpeg" &&
  1721. type[0] != "gif"
  1722. ) {
  1723. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1724. e.target.value = "";
  1725. return;
  1726. }
  1727. this.$upload.upload(file, 0).then(res => {
  1728. this.questionList[questionIndex].jsonStr[
  1729. jsonIndex
  1730. ].ansText.imageList.push(res);
  1731. });
  1732. },
  1733. isOver(item, index) {
  1734. if (this.questionList[index].ques) {
  1735. if (item.type == 4) {
  1736. //案例题
  1737. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1738. if (
  1739. jsonItem.type == 1 ||
  1740. jsonItem.type == 2 ||
  1741. jsonItem.type == 3
  1742. ) {
  1743. if (item.ques[indexs]) {
  1744. return true;
  1745. } else {
  1746. return false;
  1747. }
  1748. } else if (jsonItem.type == 5) {
  1749. if (
  1750. item.ques[indexs] &&
  1751. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1752. ) {
  1753. console.log("chil");
  1754. return true;
  1755. } else {
  1756. return false;
  1757. }
  1758. }
  1759. });
  1760. if (isOver) {
  1761. return true;
  1762. } else {
  1763. return false;
  1764. }
  1765. } else if (item.type == 5) {
  1766. //简答题
  1767. //每一项都相等
  1768. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1769. return true;
  1770. }
  1771. //判断
  1772. } else {
  1773. return false;
  1774. }
  1775. } else {
  1776. return false;
  1777. }
  1778. },
  1779. ansSubmit(question, questionIndex) {
  1780. if (!question.ansText.text && !question.ansText.imageList.length) {
  1781. this.$message({
  1782. type: "warning",
  1783. message: "请输入内容或上传图片"
  1784. });
  1785. return;
  1786. }
  1787. question.ques.imageList = question.ansText.imageList;
  1788. question.ques.text = question.ansText.text;
  1789. this.isDoOver();
  1790. console.log(question.ques);
  1791. },
  1792. ansSubmitChild(question, questionIndex, jsonIndex) {
  1793. if (
  1794. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1795. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1796. .length
  1797. ) {
  1798. this.$message({
  1799. type: "warning",
  1800. message: "请输入内容或上传图片"
  1801. });
  1802. return;
  1803. }
  1804. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1805. imageList:
  1806. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1807. .imageList || [],
  1808. text:
  1809. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text || ""
  1810. });
  1811. this.isDoOver();
  1812. },
  1813. changeIndex(index) {
  1814. this.current = index;
  1815. this.getCollectInfo(this.current);
  1816. },
  1817. nextQuestion() {
  1818. if (this.current >= this.questionList.length - 1) {
  1819. this.$message({
  1820. type: "warning",
  1821. message: "已经是最后一题了!"
  1822. });
  1823. return;
  1824. }
  1825. this.current++;
  1826. this.getCollectInfo(this.current);
  1827. },
  1828. prevQuestion() {
  1829. if (this.current == 0) {
  1830. this.$message({
  1831. type: "warning",
  1832. message: "已经是第一题了!"
  1833. });
  1834. return;
  1835. } else {
  1836. this.current--;
  1837. this.getCollectInfo(this.current);
  1838. }
  1839. },
  1840. isCheck(item, index) {
  1841. if (this.questionList[index].ques) {
  1842. return true;
  1843. }
  1844. },
  1845. isRight(item, index) {
  1846. //单选
  1847. if (this.questionList[index].ques) {
  1848. if (item.type == 1) {
  1849. console.log(
  1850. this.questionList[index].ques == this.questionList[index].ans
  1851. );
  1852. return this.questionList[index].ques == this.questionList[index].ans;
  1853. //多选
  1854. } else if (item.type == 2) {
  1855. //每一项都相等
  1856. return this.questionList[index].ans.every((item, i) => {
  1857. return item == this.questionList[index].ques[i];
  1858. });
  1859. //判断
  1860. } else if (item.type == 3) {
  1861. return this.questionList[index].ques == this.questionList[index].ans;
  1862. } else {
  1863. return false;
  1864. }
  1865. } else {
  1866. return false;
  1867. }
  1868. },
  1869. isWrong(item, index) {
  1870. if (this.questionList[index].ques) {
  1871. //单选
  1872. if (item.type == 1) {
  1873. return this.questionList[index].ques != this.questionList[index].ans;
  1874. //多选
  1875. } else if (item.type == 2) {
  1876. //每一项都相等
  1877. return this.questionList[index].ques.some((item, i) => {
  1878. return this.questionList[index].ans.indexOf(item) == -1;
  1879. });
  1880. //判断
  1881. } else if (item.type == 3) {
  1882. return this.questionList[index].ques != this.questionList[index].ans;
  1883. } else {
  1884. return false;
  1885. }
  1886. } else {
  1887. return false;
  1888. }
  1889. },
  1890. isPart(item, index) {
  1891. if (this.questionList[index].ques) {
  1892. if (item.type == 2) {
  1893. let isWrong = this.questionList[index].ques.some((item, i) => {
  1894. return this.questionList[index].ans.indexOf(item) == -1;
  1895. });
  1896. let isRight = this.questionList[index].ans.every((item, i) => {
  1897. return item == this.questionList[index].ques[i];
  1898. });
  1899. if (!isRight && !isWrong) {
  1900. return true;
  1901. }
  1902. }
  1903. } else {
  1904. return false;
  1905. }
  1906. },
  1907. right(bankIndex, ansIndex, option) {
  1908. if (
  1909. this.questionList[bankIndex].ques[ansIndex] &&
  1910. this.questionList[bankIndex].ans[ansIndex]
  1911. ) {
  1912. if (
  1913. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1914. option.optionsId
  1915. ) != -1 ||
  1916. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1917. option.optionsId
  1918. ) != -1
  1919. ) {
  1920. return true;
  1921. } else {
  1922. return false;
  1923. }
  1924. } else {
  1925. return false;
  1926. }
  1927. },
  1928. wrong(bankIndex, ansIndex, option) {
  1929. if (
  1930. this.questionList[bankIndex].ques[ansIndex] &&
  1931. this.questionList[bankIndex].ans[ansIndex]
  1932. ) {
  1933. if (
  1934. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1935. option.optionsId
  1936. ) != -1 &&
  1937. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1938. option.optionsId
  1939. ) == -1
  1940. ) {
  1941. return true;
  1942. } else {
  1943. return false;
  1944. }
  1945. } else {
  1946. return false;
  1947. }
  1948. },
  1949. /**
  1950. * 获取已经回答的题目数
  1951. * hasSpecail (是否包含简答和案例)
  1952. */
  1953. questionOverNum(hasSpecail) {
  1954. let count = 0;
  1955. this.questionList.forEach(item => {
  1956. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1957. if (item.ques) {
  1958. count++;
  1959. }
  1960. } else if (item.type == 4) {
  1961. //案例题
  1962. if (hasSpecail) {
  1963. let isOver = item.jsonStr.every((jsonItem, index) => {
  1964. if (
  1965. jsonItem.type == 1 ||
  1966. jsonItem.type == 2 ||
  1967. jsonItem.type == 3
  1968. ) {
  1969. if (item.ques[index]) {
  1970. return true;
  1971. } else {
  1972. return false;
  1973. }
  1974. } else if (jsonItem.type == 5) {
  1975. if (
  1976. item.ques[index] &&
  1977. (item.ques[index].text || item.ques[index].imageList.length)
  1978. ) {
  1979. return true;
  1980. } else {
  1981. return false;
  1982. }
  1983. }
  1984. });
  1985. if (isOver) {
  1986. count++;
  1987. console.log(item, 444);
  1988. }
  1989. }
  1990. } else if (item.type == 5) {
  1991. //简答题
  1992. if (hasSpecail) {
  1993. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1994. console.log(5, item);
  1995. count++;
  1996. }
  1997. }
  1998. }
  1999. });
  2000. return count;
  2001. },
  2002. collect(state, index) {
  2003. if (!state) {
  2004. this.$request
  2005. .collectQuestion({
  2006. examId: this.examId,
  2007. questionId: this.questionList[index].questionId,
  2008. goodsId: this.goodsId || "",
  2009. orderGoodsId: this.orderGoodsId,
  2010. doMode: this.doMode
  2011. })
  2012. .then(res => {
  2013. this.$set(this.collectList, index, true);
  2014. this.$message.success("收藏成功");
  2015. this.getCollectInfo(index);
  2016. });
  2017. } else {
  2018. this.$request
  2019. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  2020. .then(res => {
  2021. this.$set(this.collectList, index, false);
  2022. this.$message.success("取消收藏成功");
  2023. });
  2024. }
  2025. return;
  2026. },
  2027. submit() {
  2028. let ansCount = this.questionOverNum(true); //已答题数
  2029. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  2030. //没有答完
  2031. if (this.lastCount > 0) {
  2032. this.$confirm(
  2033. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  2034. "提示",
  2035. {
  2036. confirmButtonText: "立即交卷",
  2037. cancelButtonText: "继续做题",
  2038. closeOnClickModal: false,
  2039. closeOnPressEscape: false,
  2040. distinguishCancelAndClose: false,
  2041. showClose: false
  2042. }
  2043. )
  2044. .then(_ => {
  2045. this.examSubmit();
  2046. })
  2047. .catch(_ => {});
  2048. return;
  2049. }
  2050. if (this.bankType == 2) {
  2051. if (this.lastTime > 0) {
  2052. let lastTime = this.countdown(this.lastTime);
  2053. this.$confirm(`时间还剩余${lastTime},确定交卷吗?`, "提示", {
  2054. confirmButtonText: "交卷",
  2055. cancelButtonText: "继续答题",
  2056. closeOnClickModal: false,
  2057. closeOnPressEscape: false,
  2058. distinguishCancelAndClose: false,
  2059. showClose: false
  2060. })
  2061. .then(_ => {
  2062. this.examSubmit();
  2063. })
  2064. .catch(_ => {});
  2065. return;
  2066. }
  2067. }
  2068. this.examSubmit();
  2069. },
  2070. /**
  2071. * @param {Object} second倒计时过滤器
  2072. */
  2073. countdown(second) {
  2074. if (second) {
  2075. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  2076. let m = parseInt((second / 60) % 60); // 计算分数
  2077. let s = parseInt(second % 60); // 计算当前秒数
  2078. if (h < 10) h = "0" + h;
  2079. if (m < 10) m = "0" + m;
  2080. if (s < 10) s = "0" + s;
  2081. return h + ":" + m + ":" + s;
  2082. } else {
  2083. return "";
  2084. }
  2085. },
  2086. /**
  2087. * 交卷,跳转报告页
  2088. */
  2089. examSubmit() {
  2090. this.loading = true;
  2091. clearInterval(this.timer);
  2092. clearInterval(this.postTimer);
  2093. let form = this.calculateScore(this.questionList);
  2094. if (this.subscribeId) {
  2095. this.mockSubscribeEdit();
  2096. }
  2097. //交卷
  2098. this.$request
  2099. .mockRecordEdit({
  2100. eachExamId: this.eachExamId,
  2101. examId: this.examId,
  2102. recordId: this.recordId,
  2103. orderGoodsId: this.orderGoodsId,
  2104. goodsId: this.goodsId,
  2105. status: 1,
  2106. examTime: parseInt(this.allTimes),
  2107. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2108. ...form
  2109. })
  2110. .then(res => {
  2111. this.isSubmit = true;
  2112. this.loading = false;
  2113. this.$message({
  2114. type: "success",
  2115. message: "交卷成功"
  2116. });
  2117. setTimeout(() => {
  2118. this.$router.replace({
  2119. path: "/mock-report",
  2120. query: {
  2121. subscribeId: this.subscribeId,
  2122. eachExamId: this.eachExamId,
  2123. examId: this.examId,
  2124. recordId: this.recordId
  2125. }
  2126. });
  2127. }, 1000);
  2128. })
  2129. .catch(err => {
  2130. this.loading = false;
  2131. });
  2132. //错题集id提交(客观题)
  2133. this.$request
  2134. .mockWrongRecord({
  2135. eachExamId: this.eachExamId,
  2136. examId: this.examId,
  2137. questionIds: form.questionIds,
  2138. recordId: this.recordId
  2139. })
  2140. .then(res => {})
  2141. .catch(err => {});
  2142. },
  2143. /**
  2144. * 交卷,不用跳转
  2145. */
  2146. leaveNow() {
  2147. clearInterval(this.timer);
  2148. clearInterval(this.postTimer);
  2149. let form = this.calculateScore(this.questionList);
  2150. if (this.subscribeId) {
  2151. this.mockSubscribeEdit();
  2152. }
  2153. //交卷
  2154. this.$request
  2155. .mockRecordEdit({
  2156. eachExamId: this.eachExamId,
  2157. examId: this.examId,
  2158. recordId: this.recordId,
  2159. status: 1,
  2160. examTime: parseInt(this.allTimes),
  2161. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2162. ...form
  2163. })
  2164. .then(res => {});
  2165. //错题集id提交(客观题)
  2166. this.$request
  2167. .examWrongRecord({
  2168. eachExamId: this.eachExamId,
  2169. examId: this.examId,
  2170. questionIds: form.questionIds,
  2171. recordId: this.recordId,
  2172. doMode: this.doMode
  2173. })
  2174. .then(res => {
  2175. this.loading = false;
  2176. })
  2177. .catch(err => {
  2178. this.loading = false;
  2179. });
  2180. }
  2181. }
  2182. };
  2183. </script>
  2184. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2185. <style scoped lang="scss">
  2186. .course-exam {
  2187. .section {
  2188. overflow: hidden;
  2189. &__header {
  2190. height: 20px;
  2191. margin-top: 20px;
  2192. }
  2193. &__body {
  2194. .explain-record {
  2195. &__header {
  2196. }
  2197. &__body {
  2198. margin-bottom: 20px;
  2199. border: 1px solid #eee;
  2200. .left-box {
  2201. float: left;
  2202. width: 970px;
  2203. min-height: 630px;
  2204. border: 1px solid #eee;
  2205. &__body {
  2206. .question {
  2207. padding: 12px 0 0 12px;
  2208. display: flex;
  2209. flex-direction: column;
  2210. height: 100%;
  2211. &__title {
  2212. padding-left: 12px;
  2213. font-size: 16px;
  2214. font-family: Microsoft YaHei;
  2215. font-weight: bold;
  2216. color: #333333;
  2217. line-height: 24px;
  2218. }
  2219. &__desc {
  2220. padding-left: 12px;
  2221. margin-top: 20px;
  2222. font-size: 16px;
  2223. font-family: Microsoft YaHei;
  2224. font-weight: 400;
  2225. color: #666666;
  2226. line-height: 24px;
  2227. /deep/ img {
  2228. max-width: 100% !important;
  2229. }
  2230. }
  2231. &__content {
  2232. /deep/ .el-tabs__item {
  2233. height: 40px;
  2234. line-height: 40px;
  2235. }
  2236. .question__content {
  2237. height: auto;
  2238. overflow: auto;
  2239. }
  2240. .question-list {
  2241. padding: 24px 0 0 24px;
  2242. .checkbox,
  2243. .radio {
  2244. cursor: pointer;
  2245. margin-right: 24px;
  2246. padding: 0 24px;
  2247. display: flex;
  2248. align-items: center;
  2249. margin-top: 2px;
  2250. min-height: 40px;
  2251. padding-top: 10px;
  2252. padding-bottom: 10px;
  2253. background: #f5f9ff;
  2254. border-radius: 8px;
  2255. box-sizing: border-box;
  2256. &.right {
  2257. background: #37c65b;
  2258. }
  2259. &.wrong {
  2260. background: #ff3a30;
  2261. }
  2262. &.user_choose {
  2263. background: #007aff;
  2264. }
  2265. }
  2266. &.textarea {
  2267. margin-right: 12px;
  2268. .upload {
  2269. margin-top: 10px;
  2270. &__imgs {
  2271. margin-right: 10px;
  2272. width: 80px;
  2273. height: 80px;
  2274. background: #ffffff;
  2275. border: 1px solid #eeeeee;
  2276. border-radius: 4px;
  2277. position: relative;
  2278. display: flex;
  2279. float: left;
  2280. align-items: center;
  2281. justify-content: center;
  2282. img {
  2283. max-width: 100%;
  2284. max-height: 100%;
  2285. }
  2286. }
  2287. &__btn {
  2288. margin-right: 10px;
  2289. width: 80px;
  2290. height: 80px;
  2291. background: #ffffff;
  2292. border: 1px solid #eeeeee;
  2293. border-radius: 4px;
  2294. position: relative;
  2295. display: flex;
  2296. float: left;
  2297. align-items: center;
  2298. justify-content: center;
  2299. flex-direction: column;
  2300. .icon {
  2301. font-size: 20px;
  2302. color: #3f8dfd;
  2303. }
  2304. p {
  2305. font-size: 12px;
  2306. font-family: Microsoft YaHei;
  2307. font-weight: 400;
  2308. color: #999999;
  2309. line-height: 24px;
  2310. }
  2311. input {
  2312. position: absolute;
  2313. left: 0;
  2314. top: 0;
  2315. display: block;
  2316. width: 100%;
  2317. height: 100%;
  2318. opacity: 0;
  2319. }
  2320. }
  2321. }
  2322. }
  2323. /deep/
  2324. .el-checkbox__input.is-checked
  2325. + .el-checkbox__label {
  2326. color: #000 !important;
  2327. }
  2328. /deep/
  2329. .el-checkbox__input.is-disabled
  2330. + span.el-checkbox__label {
  2331. color: #000;
  2332. }
  2333. /deep/ .el-checkbox {
  2334. white-space: normal;
  2335. }
  2336. }
  2337. .answer-list {
  2338. height: 40px;
  2339. border-top: 1px solid #eee;
  2340. border-bottom: 1px solid #eee;
  2341. margin-top: 24px;
  2342. display: flex;
  2343. align-items: center;
  2344. justify-content: space-between;
  2345. padding: 0 24px;
  2346. &__left {
  2347. font-size: 16px;
  2348. font-family: Microsoft YaHei;
  2349. font-weight: 400;
  2350. color: #333333;
  2351. line-height: 24px;
  2352. }
  2353. &__right {
  2354. font-size: 16px;
  2355. font-family: Microsoft YaHei;
  2356. font-weight: 400;
  2357. color: #333333;
  2358. line-height: 24px;
  2359. }
  2360. }
  2361. .explain-list {
  2362. padding: 12px 24px;
  2363. &__header {
  2364. font-size: 16px;
  2365. font-family: Microsoft YaHei;
  2366. font-weight: bold;
  2367. color: #666666;
  2368. line-height: 24px;
  2369. }
  2370. &__body {
  2371. margin-top: 12px;
  2372. font-size: 16px;
  2373. font-family: Microsoft YaHei;
  2374. font-weight: 400;
  2375. color: #666666;
  2376. line-height: 24px;
  2377. }
  2378. .upload {
  2379. margin-top: 10px;
  2380. &__imgs {
  2381. margin-right: 10px;
  2382. width: 80px;
  2383. height: 80px;
  2384. background: #ffffff;
  2385. border: 1px solid #eeeeee;
  2386. border-radius: 4px;
  2387. position: relative;
  2388. display: flex;
  2389. float: left;
  2390. align-items: center;
  2391. justify-content: center;
  2392. img {
  2393. max-width: 100%;
  2394. max-height: 100%;
  2395. }
  2396. }
  2397. }
  2398. }
  2399. }
  2400. &__btns {
  2401. position: relative;
  2402. height: 32px;
  2403. .submit {
  2404. cursor: pointer;
  2405. margin: 0 auto;
  2406. width: 140px;
  2407. height: 32px;
  2408. padding: 0;
  2409. color: #fff;
  2410. background: #3f8dfd;
  2411. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2412. border-radius: 16px;
  2413. text-align: center;
  2414. line-height: 32px;
  2415. font-size: 16px;
  2416. }
  2417. .collect {
  2418. width: 100px;
  2419. cursor: pointer;
  2420. position: absolute;
  2421. right: 0;
  2422. top: 5px;
  2423. font-size: 12px;
  2424. font-family: Microsoft YaHei;
  2425. font-weight: 400;
  2426. color: #3f8dfd;
  2427. line-height: 24px;
  2428. i {
  2429. font-size: 20px;
  2430. }
  2431. }
  2432. }
  2433. }
  2434. }
  2435. &__footer {
  2436. height: 40px;
  2437. display: flex;
  2438. justify-content: space-around;
  2439. align-items: center;
  2440. .btn {
  2441. cursor: pointer;
  2442. width: 140px;
  2443. height: 32px;
  2444. background: #ffffff;
  2445. border: 1px solid #3f8dfd;
  2446. border-radius: 16px;
  2447. line-height: 32px;
  2448. text-align: center;
  2449. color: #3f8dfd;
  2450. }
  2451. }
  2452. }
  2453. .right-box {
  2454. float: right;
  2455. width: 299px;
  2456. border-right: 1px solid #eee;
  2457. &__header {
  2458. height: 40px;
  2459. line-height: 40px;
  2460. border-bottom: 1px solid #eeeeee;
  2461. .back-btn {
  2462. display: block;
  2463. margin: 0 auto;
  2464. width: 160px;
  2465. }
  2466. .title {
  2467. float: left;
  2468. font-size: 16px;
  2469. font-family: Microsoft YaHei;
  2470. font-weight: bold;
  2471. color: #333333;
  2472. }
  2473. .time {
  2474. font-size: 16px;
  2475. font-family: Microsoft YaHei;
  2476. font-weight: 400;
  2477. color: #666666;
  2478. float: right;
  2479. }
  2480. }
  2481. &__body {
  2482. height: 510px;
  2483. border-bottom: 1px solid #eee;
  2484. .card {
  2485. &__note {
  2486. display: flex;
  2487. height: 64px;
  2488. align-items: center;
  2489. border-bottom: 1px solid #eee;
  2490. flex-wrap: wrap;
  2491. .item {
  2492. display: flex;
  2493. align-items: center;
  2494. margin-left: 10px;
  2495. width: 84px;
  2496. font-size: 12px;
  2497. .box {
  2498. margin-right: 5px;
  2499. width: 16px;
  2500. height: 16px;
  2501. border-radius: 4px;
  2502. &.white {
  2503. background: #ffffff;
  2504. border: 1px solid #eeeeee;
  2505. }
  2506. &.green {
  2507. background: #37c65b;
  2508. }
  2509. &.red {
  2510. background: #ff3a30;
  2511. }
  2512. &.yellow {
  2513. background: #ffc53d;
  2514. }
  2515. &.blue,
  2516. &.check_ans {
  2517. background: #3f8dfd;
  2518. }
  2519. }
  2520. }
  2521. }
  2522. &__content {
  2523. height: 440px;
  2524. overflow-y: scroll;
  2525. &::-webkit-scrollbar {
  2526. width: 6px;
  2527. }
  2528. &::-webkit-scrollbar-track {
  2529. background-color: #fff;
  2530. -webkit-border-radius: 2em;
  2531. -moz-border-radius: 2em;
  2532. border-radius: 2em;
  2533. }
  2534. &::-webkit-scrollbar-thumb {
  2535. background-color: #eeeeee;
  2536. -webkit-border-radius: 2em;
  2537. -moz-border-radius: 2em;
  2538. border-radius: 2em;
  2539. }
  2540. .list {
  2541. display: flex;
  2542. flex-wrap: wrap;
  2543. .item {
  2544. width: 40px;
  2545. height: 40px;
  2546. border-radius: 10px;
  2547. text-align: center;
  2548. line-height: 40px;
  2549. margin-left: 16px;
  2550. margin-top: 16px;
  2551. cursor: pointer;
  2552. &.white {
  2553. line-height: 38px;
  2554. color: #333333;
  2555. background: #ffffff;
  2556. border: 1px solid #eeeeee;
  2557. }
  2558. &.green {
  2559. color: #fff;
  2560. background: #37c65b;
  2561. }
  2562. &.red {
  2563. color: #fff;
  2564. background: #ff3a30;
  2565. }
  2566. &.blue,
  2567. &.check_ans {
  2568. color: #fff;
  2569. background: #3f8dfd;
  2570. }
  2571. &.yellow {
  2572. background: #ffc53d;
  2573. }
  2574. &.disabled {
  2575. cursor: not-allowed;
  2576. line-height: 38px;
  2577. color: #eeeeee;
  2578. background: #ffffff;
  2579. border: 1px solid #eeeeee;
  2580. }
  2581. }
  2582. }
  2583. }
  2584. }
  2585. }
  2586. &__footer {
  2587. border-bottom: 1px solid #eee;
  2588. height: 40px;
  2589. display: flex;
  2590. align-items: center;
  2591. justify-content: center;
  2592. .submit {
  2593. cursor: pointer;
  2594. width: 140px;
  2595. height: 32px;
  2596. padding: 0;
  2597. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2598. border-radius: 16px;
  2599. line-height: 32px;
  2600. text-align: center;
  2601. font-size: 16px;
  2602. }
  2603. }
  2604. }
  2605. }
  2606. }
  2607. }
  2608. }
  2609. .take-photo {
  2610. /deep/ .el-dialog__header {
  2611. display: none;
  2612. }
  2613. /deep/ .el-dialog__body {
  2614. padding: 0;
  2615. overflow: unset;
  2616. }
  2617. &__close {
  2618. cursor: pointer;
  2619. position: absolute;
  2620. right: 0;
  2621. top: -28px;
  2622. width: 24px;
  2623. height: 24px;
  2624. line-height: 24px;
  2625. text-align: center;
  2626. color: #eee;
  2627. border: 1px solid #eee;
  2628. border-radius: 50%;
  2629. }
  2630. &__header {
  2631. height: 40px;
  2632. border-bottom: 1px solid #eee;
  2633. line-height: 40px;
  2634. font-size: 16px;
  2635. font-family: Microsoft YaHei;
  2636. font-weight: bold;
  2637. color: #333333;
  2638. padding-left: 24px;
  2639. }
  2640. &__body {
  2641. height: 400px;
  2642. padding: 40px 24px;
  2643. .left-box {
  2644. width: 336px;
  2645. float: left;
  2646. .title {
  2647. font-size: 16px;
  2648. font-family: Microsoft YaHei;
  2649. font-weight: bold;
  2650. color: #ff3b30;
  2651. line-height: 24px;
  2652. }
  2653. .content {
  2654. font-size: 14px;
  2655. font-family: Microsoft YaHei;
  2656. font-weight: 400;
  2657. color: #333333;
  2658. line-height: 28px;
  2659. margin-top: 32px;
  2660. }
  2661. }
  2662. .right-box {
  2663. float: right;
  2664. width: 400px;
  2665. height: 300px;
  2666. video {
  2667. width: 100%;
  2668. height: 100%;
  2669. }
  2670. }
  2671. }
  2672. &__footer {
  2673. height: 90px;
  2674. border-top: 1px solid #eee;
  2675. text-align: center;
  2676. .take {
  2677. display: inline-block;
  2678. width: 200px;
  2679. height: 40px;
  2680. padding: 0;
  2681. border-radius: 20px;
  2682. text-align: center;
  2683. line-height: 40px;
  2684. margin: 24px auto;
  2685. }
  2686. }
  2687. }
  2688. }
  2689. </style>