index.vue 97 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806
  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. export default {
  1067. name: "BankExplain",
  1068. components: {
  1069. Footer,
  1070. Header,
  1071. ToolBar,
  1072. HeaderTabBox
  1073. },
  1074. computed: {
  1075. ...mapGetters(["sysTime"])
  1076. },
  1077. data() {
  1078. return {
  1079. recordId: 0,
  1080. tabIndex: "1",
  1081. textarea: "",
  1082. questionIndex: 0,
  1083. checked: false,
  1084. activeName: "1",
  1085. questionList: [],
  1086. goodsExamConfig: [],
  1087. goodsDetail: {},
  1088. bankList: [],
  1089. judge: ["正确", "错误"],
  1090. ast: [
  1091. "A",
  1092. "B",
  1093. "C",
  1094. "D",
  1095. "E",
  1096. "F",
  1097. "G",
  1098. "H",
  1099. "I",
  1100. "J",
  1101. "K",
  1102. "L",
  1103. "M",
  1104. "N",
  1105. "O",
  1106. "P",
  1107. "Q",
  1108. "R",
  1109. "S",
  1110. "T",
  1111. "U",
  1112. "V",
  1113. "W",
  1114. "X",
  1115. "Y",
  1116. "Z"
  1117. ],
  1118. loading: false,
  1119. needPhoto: false,
  1120. lastTime: 0, //剩余考试时长
  1121. allTimes: 0, //总考试时长
  1122. goodsId: "",
  1123. orderGoodsId: "",
  1124. lastCount: 0,
  1125. examId: 0,
  1126. current: 0,
  1127. eachExamId: 0,
  1128. bankType: 0,
  1129. timer: null,
  1130. examData: {},
  1131. collectList: [],
  1132. isSubmit: false,
  1133. postTimer: null,
  1134. subscribeId: 0,
  1135. isAutoSubmit: false,
  1136. examEndTime: 0,
  1137. examStartTime: 0,
  1138. doMode: 1, //3模考组卷1普通考卷
  1139. simulateExamId: ""
  1140. };
  1141. },
  1142. async mounted() {
  1143. this.examStartTime = this.$route.query.examStartTime;
  1144. this.examEndTime = this.$route.query.examEndTime;
  1145. this.examId = this.$route.query.examId;
  1146. this.eachExamId = this.$route.query.eachExamId;
  1147. this.subscribeId = this.$route.query.subscribeId || "";
  1148. this.allTimes = this.examEndTime - this.examStartTime || "";
  1149. this.goodsId = this.$route.query.goodsId;
  1150. this.orderGoodsId = this.$route.query.orderGoodsId;
  1151. await this.setSystemTime();
  1152. await this.bankExam();
  1153. this.goodsQuestionList();
  1154. },
  1155. beforeDestroy() {
  1156. clearInterval(this.postTimer);
  1157. clearInterval(this.timer);
  1158. try {
  1159. this.$msgbox.close();
  1160. } catch (err) {}
  1161. },
  1162. beforeRouteLeave(to, from, next) {
  1163. if (this.isSubmit) {
  1164. //交卷
  1165. next();
  1166. } else {
  1167. //离开
  1168. if (this.bankType == 1) {
  1169. console.log(1);
  1170. let ansCount = this.questionOverNum(true); //已答题数
  1171. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1172. //所有题目答完
  1173. if (this.lastCount == 0) {
  1174. // this.testOver = true;
  1175. this.$nextTick(() => {
  1176. this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
  1177. confirmButtonText: "结束做题",
  1178. cancelButtonText: "下次继续",
  1179. type: "warning"
  1180. })
  1181. .then(() => {
  1182. this.examSubmit();
  1183. })
  1184. .catch(() => {
  1185. this.mockRecordEdit();
  1186. next();
  1187. });
  1188. });
  1189. //未答完
  1190. } else {
  1191. this.$nextTick(() => {
  1192. this.$confirm(
  1193. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1194. "温馨提示",
  1195. {
  1196. confirmButtonText: "继续作答",
  1197. cancelButtonText: "下次继续",
  1198. type: "warning"
  1199. }
  1200. )
  1201. .then(() => {
  1202. // confirmButton回调
  1203. })
  1204. .catch(() => {
  1205. this.mockRecordEdit();
  1206. next();
  1207. });
  1208. });
  1209. // this.isLastCount = true;
  1210. }
  1211. } else if (this.bankType == 2) {
  1212. console.log(2);
  1213. let ansCount = this.questionOverNum(true); //已答题数
  1214. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1215. //所有题目答完
  1216. if (this.lastCount == 0) {
  1217. this.$nextTick(() => {
  1218. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1219. confirmButtonText: "立即交卷",
  1220. cancelButtonText: "暂不交卷",
  1221. type: "warning"
  1222. })
  1223. .then(() => {
  1224. // confirmButton回调
  1225. this.examSubmit();
  1226. next();
  1227. })
  1228. .catch(() => {});
  1229. });
  1230. //未答完
  1231. } else {
  1232. this.$nextTick(() => {
  1233. this.$confirm(
  1234. `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
  1235. "温馨提示",
  1236. {
  1237. confirmButtonText: "继续离开",
  1238. cancelButtonText: "暂不离开",
  1239. type: "warning"
  1240. }
  1241. )
  1242. .then(() => {
  1243. this.examSubmit();
  1244. })
  1245. .catch(() => {});
  1246. });
  1247. }
  1248. }
  1249. }
  1250. },
  1251. methods: {
  1252. ...mapMutations(["setExamResult"]),
  1253. ...mapActions(["setSystemTime"]),
  1254. mockSubscribeEdit() {
  1255. this.$request
  1256. .mockSubscribeEdit({
  1257. subscribeId: this.subscribeId,
  1258. handStatus: this.isAutoSubmit ? 2 : 1
  1259. })
  1260. .then(res => {});
  1261. },
  1262. toFixed(num) {
  1263. if (num) {
  1264. let str = String(num).indexOf(".");
  1265. if (str != -1) {
  1266. return +num.toFixed(2);
  1267. } else {
  1268. return num;
  1269. }
  1270. } else {
  1271. return 0;
  1272. }
  1273. },
  1274. /**
  1275. * @param {Object} current
  1276. * 获取收藏信息
  1277. */
  1278. getCollectInfo(current) {
  1279. this.$request
  1280. .getCollectInfo({
  1281. examId: this.examId,
  1282. questionId: this.questionList[current].questionId,
  1283. goodsId: this.goodsId,
  1284. orderGoodsId: this.orderGoodsId,
  1285. doMode: this.doMode
  1286. })
  1287. .then(res => {
  1288. this.$set(this.collectList, current, res.data);
  1289. })
  1290. .catch(err => {
  1291. this.$set(this.collectList, current, false);
  1292. });
  1293. },
  1294. /**
  1295. * 是否做完所有题目
  1296. */
  1297. isDoOver() {
  1298. let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
  1299. if (this.questionList.length == questionOverNum) {
  1300. //全部做完弹窗
  1301. this.$nextTick(() => {
  1302. this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
  1303. confirmButtonText: "立即交卷",
  1304. cancelButtonText: "暂不交卷",
  1305. type: "warning"
  1306. })
  1307. .then(() => {
  1308. // confirmButton回调
  1309. this.examSubmit();
  1310. })
  1311. .catch(() => {});
  1312. });
  1313. }
  1314. },
  1315. /**
  1316. * 请求题目列表
  1317. */
  1318. goodsQuestionList() {
  1319. console.log(this.doMode, this.examId, this.goodsId);
  1320. this.$request[
  1321. this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
  1322. ]({
  1323. examId: this.examId,
  1324. goodsId: this.goodsId,
  1325. orderGoodsId: this.orderGoodsId,
  1326. from: this.doMode == 3 ? 3 : ""
  1327. }).then(async items => {
  1328. var data = []
  1329. if (this.doMode == 3) {
  1330. this.simulateExamId = items.data.simulateExamId;
  1331. data = items.data.questionList;
  1332. }else{
  1333. data = items.data
  1334. }
  1335. if (!data.length) {
  1336. this.$message({
  1337. type: "warning",
  1338. message: "该试卷暂无题目"
  1339. });
  1340. return;
  1341. }
  1342. if (this.subscribeId) {
  1343. this.lastTime = this.examEndTime - this.sysTime;
  1344. //考试时间到了自动交卷
  1345. if (this.lastTime) {
  1346. this.timer = setInterval(() => {
  1347. if (this.lastTime <= 0) {
  1348. clearInterval(this.timer);
  1349. this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
  1350. confirmButtonText: "立即交卷",
  1351. closeOnClickModal: false,
  1352. showCancelButton: false,
  1353. closeOnPressEscape: false,
  1354. distinguishCancelAndClose: false,
  1355. showClose: false
  1356. });
  1357. this.isAutoSubmit = true;
  1358. setTimeout(() => {
  1359. try {
  1360. this.$msgbox.close();
  1361. } catch (err) {}
  1362. this.examSubmit();
  1363. }, 3000);
  1364. return;
  1365. }
  1366. this.lastTime--;
  1367. }, 1000);
  1368. } else {
  1369. }
  1370. }
  1371. data.forEach((item, index) => {
  1372. item.jsonStr = JSON.parse(item.jsonStr);
  1373. if (item.type == 2) {
  1374. //多选
  1375. item.jsonStr.forEach(str => {
  1376. str.optionsId = "" + str.optionsId;
  1377. });
  1378. let arr = item.answerQuestion.split(",");
  1379. arr.forEach((a, i) => {
  1380. arr[i] = "" + a;
  1381. });
  1382. item.ans = arr;
  1383. item.quesSelect = [];
  1384. item.analysisContent &&
  1385. (item.analysisContent = item.analysisContent.replace(
  1386. /<img/gi,
  1387. '<img style="max-width:100%;"'
  1388. ));
  1389. item.content &&
  1390. (item.content = item.content.replace(
  1391. /<img/gi,
  1392. '<img style="max-width:100%;"'
  1393. ));
  1394. return;
  1395. } else if (item.type == 5) {
  1396. //简答题
  1397. item.ansText = {
  1398. text: "",
  1399. imageList: []
  1400. };
  1401. item.ques = {
  1402. text: "",
  1403. imageList: []
  1404. };
  1405. item.analysisContent &&
  1406. (item.analysisContent = item.analysisContent.replace(
  1407. /<img/gi,
  1408. '<img style="max-width:100%;"'
  1409. ));
  1410. item.content &&
  1411. (item.content = item.content.replace(
  1412. /<img/gi,
  1413. '<img style="max-width:100%;"'
  1414. ));
  1415. return;
  1416. } else if (item.type == 4) {
  1417. //案例题
  1418. console.log(item.jsonStr);
  1419. item.ques = [];
  1420. item.tabIndex = "0";
  1421. let ansArr = [];
  1422. item.jsonStr.forEach((json, index) => {
  1423. if (json.type == 1) {
  1424. ansArr[index] = json.answerQuestion;
  1425. json.content &&
  1426. (json.content = json.content.replace(
  1427. /<img/gi,
  1428. '<img style="max-width:100%;"'
  1429. ));
  1430. } else if (json.type == 2) {
  1431. json.optionsList.forEach(str => {
  1432. str.optionsId = "" + str.optionsId;
  1433. });
  1434. let arr = json.answerQuestion.split(",");
  1435. arr.forEach((a, i) => {
  1436. arr[i] = "" + a;
  1437. });
  1438. ansArr[index] = arr;
  1439. json.content &&
  1440. (json.content = json.content.replace(
  1441. /<img/gi,
  1442. '<img style="max-width:100%;"'
  1443. ));
  1444. } else if (json.type == 3) {
  1445. ansArr[index] = json.answerQuestion;
  1446. json.content &&
  1447. (json.content = json.content.replace(
  1448. /<img/gi,
  1449. '<img style="max-width:100%;"'
  1450. ));
  1451. } else if (json.type == 5) {
  1452. ansArr[index] = {
  1453. text: "",
  1454. imageList: []
  1455. };
  1456. json.ansText = {
  1457. text: "",
  1458. imageList: []
  1459. };
  1460. json.ques = {
  1461. text: "",
  1462. imageList: []
  1463. };
  1464. json.content &&
  1465. (json.content = json.content.replace(
  1466. /<img/gi,
  1467. '<img style="max-width:100%;"'
  1468. ));
  1469. }
  1470. });
  1471. item.ans = ansArr;
  1472. return;
  1473. }
  1474. item.analysisContent &&
  1475. (item.analysisContent = item.analysisContent.replace(
  1476. /<img/gi,
  1477. '<img style="max-width:100%;"'
  1478. ));
  1479. item.content &&
  1480. (item.content = item.content.replace(
  1481. /<img/gi,
  1482. '<img style="max-width:100%;"'
  1483. ));
  1484. item.ques = "";
  1485. item.ans = item.answerQuestion;
  1486. });
  1487. this.questionList = data;
  1488. this.lastCount = this.questionList.length;
  1489. this.getCollectInfo(this.current);
  1490. await this.mockRecord();
  1491. });
  1492. },
  1493. /**
  1494. * 记录总题数,获取recordId
  1495. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  1496. */
  1497. mockRecord(hasSpecial) {
  1498. return new Promise(resolve => {
  1499. let self = this;
  1500. let questionList = 0;
  1501. // if(!hasSpecial) {
  1502. this.questionList.forEach((item, index) => {
  1503. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1504. questionList++;
  1505. }
  1506. });
  1507. // } else {
  1508. // questionList = this.questionList.length;
  1509. // }
  1510. this.$request
  1511. .mockRecord({
  1512. eachExamId: this.eachExamId,
  1513. examId: this.examId,
  1514. totalQuestionNum: questionList,
  1515. allQuestionNum: this.questionList.length,
  1516. doMode: this.doMode,
  1517. simulateExamId: this.simulateExamId
  1518. })
  1519. .then(res => {
  1520. this.recordId = res.data;
  1521. });
  1522. });
  1523. },
  1524. /**
  1525. * 离开页面统计回答正确题数
  1526. */
  1527. mockRecordEdit() {
  1528. clearInterval(this.postTimer);
  1529. clearInterval(this.timer);
  1530. let form = this.calculateScore(this.questionList)
  1531. if (this.subscribeId) {
  1532. this.mockSubscribeEdit();
  1533. }
  1534. this.$request
  1535. .mockRecordEdit({
  1536. eachExamId: this.eachExamId,
  1537. examId: this.examId,
  1538. recordId: this.recordId,
  1539. status: 1,
  1540. ...form
  1541. })
  1542. .then(res => {});
  1543. },
  1544. /**
  1545. * 获取试卷类型2考试,1练习
  1546. */
  1547. bankExam() {
  1548. return new Promise(resolve => {
  1549. this.$request.bankExam(this.examId).then(res => {
  1550. this.bankType = res.data.doType;
  1551. this.examData = res.data;
  1552. this.doMode = res.data.simulateStatus ? 3 : 1;
  1553. if (this.bankType == 2) {
  1554. this.needBack = true;
  1555. }
  1556. resolve();
  1557. });
  1558. });
  1559. },
  1560. /**
  1561. * @param {Object}
  1562. * 单选点击确认
  1563. */
  1564. radioSelect(question, questionIndex, optionsId) {
  1565. // if (this.questionList[questionIndex].ques) return;
  1566. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1567. return;
  1568. }
  1569. this.$set(this.questionList[questionIndex], "ques", optionsId);
  1570. this.isDoOver();
  1571. },
  1572. /**
  1573. * @param {Object}
  1574. * 案例单选点击
  1575. */
  1576. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  1577. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1578. if (
  1579. this.questionList[questionIndex].ques[jsonIndex] &&
  1580. this.bankType == 1
  1581. ) {
  1582. return;
  1583. }
  1584. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  1585. this.isDoOver();
  1586. },
  1587. /**
  1588. * 多选点击确认
  1589. */
  1590. checkboxSubmit(question, questionIndex) {
  1591. // if (this.questionList[questionIndex].ques) return;
  1592. if (this.questionList[questionIndex].ques && this.bankType == 1) {
  1593. return;
  1594. }
  1595. let arr = [];
  1596. this.questionList[questionIndex].jsonStr.forEach(item => {
  1597. if (item.checked) {
  1598. arr.push(item.optionsId);
  1599. }
  1600. });
  1601. if (!arr.length) {
  1602. delete this.questionList[questionIndex].ques;
  1603. this.$message({
  1604. type: "warning",
  1605. message: "请选择答案"
  1606. });
  1607. return;
  1608. }
  1609. this.$set(this.questionList[questionIndex], "ques", arr);
  1610. this.isDoOver();
  1611. },
  1612. /**
  1613. * @param {Object}
  1614. * 案例多选确认
  1615. */
  1616. checkboxSubmitChild(questionIndex, ansIndex) {
  1617. // if (this.questionList[questionIndex].ques[ansIndex]) return;
  1618. if (
  1619. this.questionList[questionIndex].ques[ansIndex] &&
  1620. this.bankType == 1
  1621. ) {
  1622. return;
  1623. }
  1624. let arr = [];
  1625. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  1626. item => {
  1627. if (item.checked) {
  1628. arr.push(item.optionsId);
  1629. }
  1630. }
  1631. );
  1632. if (!arr.length) {
  1633. delete this.questionList[questionIndex].ques[ansIndex];
  1634. this.$message({
  1635. type: "warning",
  1636. message: "请选择答案"
  1637. });
  1638. return;
  1639. }
  1640. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  1641. this.isDoOver();
  1642. },
  1643. /**
  1644. * 判断点击确认
  1645. */
  1646. judgeSelect(question, questionIndex, index) {
  1647. // if (question.ques) return;
  1648. if (question.ques && this.bankType == 1) {
  1649. return;
  1650. }
  1651. this.$set(
  1652. this.questionList[questionIndex],
  1653. "ques",
  1654. index == 0 ? "1" : "0"
  1655. );
  1656. this.isDoOver();
  1657. },
  1658. judgeSelectChild(questionIndex, jsonIndex, index) {
  1659. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  1660. // if (this.questionList[questionIndex].ques[jsonIndex]) return;
  1661. if (
  1662. this.questionList[questionIndex].ques[jsonIndex] &&
  1663. this.bankType == 1
  1664. ) {
  1665. return;
  1666. }
  1667. this.$set(
  1668. this.questionList[questionIndex].ques,
  1669. jsonIndex,
  1670. index == 0 ? "1" : "0"
  1671. );
  1672. this.isDoOver();
  1673. },
  1674. /**
  1675. * 上传图片
  1676. */
  1677. uploadImg(e, question, questionIndex) {
  1678. var file = e.target.files[0];
  1679. if (file.size > 2 * 1024 * 1024) {
  1680. this.$message.warn("图片不得大于2000kb");
  1681. return;
  1682. }
  1683. var type = e.target.value
  1684. .toLowerCase()
  1685. .split(".")
  1686. .splice(-1);
  1687. if (
  1688. type[0] != "jpg" &&
  1689. type[0] != "png" &&
  1690. type[0] != "jpeg" &&
  1691. type[0] != "gif"
  1692. ) {
  1693. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1694. e.target.value = "";
  1695. return;
  1696. }
  1697. this.$upload.upload(file, 0).then(res => {
  1698. question.ansText.imageList.push(res);
  1699. });
  1700. },
  1701. /**
  1702. * 案例上传图片
  1703. */
  1704. uploadImgChild(e, questionIndex, jsonIndex) {
  1705. var file = e.target.files[0];
  1706. if (file.size > 2 * 1024 * 1024) {
  1707. this.$message.warn("图片不得大于2000kb");
  1708. return;
  1709. }
  1710. var type = e.target.value
  1711. .toLowerCase()
  1712. .split(".")
  1713. .splice(-1);
  1714. if (
  1715. type[0] != "jpg" &&
  1716. type[0] != "png" &&
  1717. type[0] != "jpeg" &&
  1718. type[0] != "gif"
  1719. ) {
  1720. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1721. e.target.value = "";
  1722. return;
  1723. }
  1724. this.$upload.upload(file, 0).then(res => {
  1725. this.questionList[questionIndex].jsonStr[
  1726. jsonIndex
  1727. ].ansText.imageList.push(res);
  1728. });
  1729. },
  1730. isOver(item, index) {
  1731. if (this.questionList[index].ques) {
  1732. if (item.type == 4) {
  1733. //案例题
  1734. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1735. if (
  1736. jsonItem.type == 1 ||
  1737. jsonItem.type == 2 ||
  1738. jsonItem.type == 3
  1739. ) {
  1740. if (item.ques[indexs]) {
  1741. return true;
  1742. } else {
  1743. return false;
  1744. }
  1745. } else if (jsonItem.type == 5) {
  1746. if (
  1747. item.ques[indexs] &&
  1748. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1749. ) {
  1750. console.log("chil");
  1751. return true;
  1752. } else {
  1753. return false;
  1754. }
  1755. }
  1756. });
  1757. if (isOver) {
  1758. return true;
  1759. } else {
  1760. return false;
  1761. }
  1762. } else if (item.type == 5) {
  1763. //简答题
  1764. //每一项都相等
  1765. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1766. return true;
  1767. }
  1768. //判断
  1769. } else {
  1770. return false;
  1771. }
  1772. } else {
  1773. return false;
  1774. }
  1775. },
  1776. ansSubmit(question, questionIndex) {
  1777. if (!question.ansText.text && !question.ansText.imageList.length) {
  1778. this.$message({
  1779. type: "warning",
  1780. message: "请输入内容或上传图片"
  1781. });
  1782. return;
  1783. }
  1784. question.ques.imageList = question.ansText.imageList;
  1785. question.ques.text = question.ansText.text;
  1786. this.isDoOver();
  1787. console.log(question.ques);
  1788. },
  1789. ansSubmitChild(question, questionIndex, jsonIndex) {
  1790. if (
  1791. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1792. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1793. .length
  1794. ) {
  1795. this.$message({
  1796. type: "warning",
  1797. message: "请输入内容或上传图片"
  1798. });
  1799. return;
  1800. }
  1801. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1802. imageList:
  1803. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1804. .imageList || [],
  1805. text:
  1806. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text || ""
  1807. });
  1808. this.isDoOver();
  1809. },
  1810. changeIndex(index) {
  1811. this.current = index;
  1812. this.getCollectInfo(this.current);
  1813. },
  1814. nextQuestion() {
  1815. if (this.current >= this.questionList.length - 1) {
  1816. this.$message({
  1817. type: "warning",
  1818. message: "已经是最后一题了!"
  1819. });
  1820. return;
  1821. }
  1822. this.current++;
  1823. this.getCollectInfo(this.current);
  1824. },
  1825. prevQuestion() {
  1826. if (this.current == 0) {
  1827. this.$message({
  1828. type: "warning",
  1829. message: "已经是第一题了!"
  1830. });
  1831. return;
  1832. } else {
  1833. this.current--;
  1834. this.getCollectInfo(this.current);
  1835. }
  1836. },
  1837. isCheck(item, index) {
  1838. if (this.questionList[index].ques) {
  1839. return true;
  1840. }
  1841. },
  1842. isRight(item, index) {
  1843. //单选
  1844. if (this.questionList[index].ques) {
  1845. if (item.type == 1) {
  1846. console.log(
  1847. this.questionList[index].ques == this.questionList[index].ans
  1848. );
  1849. return this.questionList[index].ques == this.questionList[index].ans;
  1850. //多选
  1851. } else if (item.type == 2) {
  1852. //每一项都相等
  1853. return this.questionList[index].ans.every((item, i) => {
  1854. return item == this.questionList[index].ques[i];
  1855. });
  1856. //判断
  1857. } else if (item.type == 3) {
  1858. return this.questionList[index].ques == this.questionList[index].ans;
  1859. } else {
  1860. return false;
  1861. }
  1862. } else {
  1863. return false;
  1864. }
  1865. },
  1866. isWrong(item, index) {
  1867. if (this.questionList[index].ques) {
  1868. //单选
  1869. if (item.type == 1) {
  1870. return this.questionList[index].ques != this.questionList[index].ans;
  1871. //多选
  1872. } else if (item.type == 2) {
  1873. //每一项都相等
  1874. return this.questionList[index].ques.some((item, i) => {
  1875. return this.questionList[index].ans.indexOf(item) == -1;
  1876. });
  1877. //判断
  1878. } else if (item.type == 3) {
  1879. return this.questionList[index].ques != this.questionList[index].ans;
  1880. } else {
  1881. return false;
  1882. }
  1883. } else {
  1884. return false;
  1885. }
  1886. },
  1887. isPart(item, index) {
  1888. if (this.questionList[index].ques) {
  1889. if (item.type == 2) {
  1890. let isWrong = this.questionList[index].ques.some((item, i) => {
  1891. return this.questionList[index].ans.indexOf(item) == -1;
  1892. });
  1893. let isRight = this.questionList[index].ans.every((item, i) => {
  1894. return item == this.questionList[index].ques[i];
  1895. });
  1896. if (!isRight && !isWrong) {
  1897. return true;
  1898. }
  1899. }
  1900. } else {
  1901. return false;
  1902. }
  1903. },
  1904. right(bankIndex, ansIndex, option) {
  1905. if (
  1906. this.questionList[bankIndex].ques[ansIndex] &&
  1907. this.questionList[bankIndex].ans[ansIndex]
  1908. ) {
  1909. if (
  1910. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1911. option.optionsId
  1912. ) != -1 ||
  1913. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1914. option.optionsId
  1915. ) != -1
  1916. ) {
  1917. return true;
  1918. } else {
  1919. return false;
  1920. }
  1921. } else {
  1922. return false;
  1923. }
  1924. },
  1925. wrong(bankIndex, ansIndex, option) {
  1926. if (
  1927. this.questionList[bankIndex].ques[ansIndex] &&
  1928. this.questionList[bankIndex].ans[ansIndex]
  1929. ) {
  1930. if (
  1931. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1932. option.optionsId
  1933. ) != -1 &&
  1934. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1935. option.optionsId
  1936. ) == -1
  1937. ) {
  1938. return true;
  1939. } else {
  1940. return false;
  1941. }
  1942. } else {
  1943. return false;
  1944. }
  1945. },
  1946. /**
  1947. * 获取已经回答的题目数
  1948. * hasSpecail (是否包含简答和案例)
  1949. */
  1950. questionOverNum(hasSpecail) {
  1951. let count = 0;
  1952. this.questionList.forEach(item => {
  1953. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1954. if (item.ques) {
  1955. count++;
  1956. }
  1957. } else if (item.type == 4) {
  1958. //案例题
  1959. if (hasSpecail) {
  1960. let isOver = item.jsonStr.every((jsonItem, index) => {
  1961. if (
  1962. jsonItem.type == 1 ||
  1963. jsonItem.type == 2 ||
  1964. jsonItem.type == 3
  1965. ) {
  1966. if (item.ques[index]) {
  1967. return true;
  1968. } else {
  1969. return false;
  1970. }
  1971. } else if (jsonItem.type == 5) {
  1972. if (
  1973. item.ques[index] &&
  1974. (item.ques[index].text || item.ques[index].imageList.length)
  1975. ) {
  1976. return true;
  1977. } else {
  1978. return false;
  1979. }
  1980. }
  1981. });
  1982. if (isOver) {
  1983. count++;
  1984. console.log(item, 444);
  1985. }
  1986. }
  1987. } else if (item.type == 5) {
  1988. //简答题
  1989. if (hasSpecail) {
  1990. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1991. console.log(5, item);
  1992. count++;
  1993. }
  1994. }
  1995. }
  1996. });
  1997. return count;
  1998. },
  1999. collect(state, index) {
  2000. if (!state) {
  2001. this.$request
  2002. .collectQuestion({
  2003. examId: this.examId,
  2004. questionId: this.questionList[index].questionId,
  2005. goodsId: this.goodsId || "",
  2006. orderGoodsId: this.orderGoodsId,
  2007. doMode: this.doMode
  2008. })
  2009. .then(res => {
  2010. this.$set(this.collectList, index, true);
  2011. this.$message.success("收藏成功");
  2012. this.getCollectInfo(index);
  2013. });
  2014. } else {
  2015. this.$request
  2016. .deleteCollectQuestion(this.collectList[index].collectQuestionId)
  2017. .then(res => {
  2018. this.$set(this.collectList, index, false);
  2019. this.$message.success("取消收藏成功");
  2020. });
  2021. }
  2022. return;
  2023. },
  2024. submit() {
  2025. let ansCount = this.questionOverNum(true); //已答题数
  2026. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  2027. //没有答完
  2028. if (this.lastCount > 0) {
  2029. this.$confirm(
  2030. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  2031. "提示",
  2032. {
  2033. confirmButtonText: "立即交卷",
  2034. cancelButtonText: "继续做题",
  2035. closeOnClickModal: false,
  2036. closeOnPressEscape: false,
  2037. distinguishCancelAndClose: false,
  2038. showClose: false
  2039. }
  2040. )
  2041. .then(_ => {
  2042. this.examSubmit();
  2043. })
  2044. .catch(_ => {});
  2045. return;
  2046. }
  2047. if (this.bankType == 2) {
  2048. if (this.lastTime > 0) {
  2049. let lastTime = this.countdown(this.lastTime);
  2050. this.$confirm(`时间还剩余${lastTime},确定交卷吗?`, "提示", {
  2051. confirmButtonText: "交卷",
  2052. cancelButtonText: "继续答题",
  2053. closeOnClickModal: false,
  2054. closeOnPressEscape: false,
  2055. distinguishCancelAndClose: false,
  2056. showClose: false
  2057. })
  2058. .then(_ => {
  2059. this.examSubmit();
  2060. })
  2061. .catch(_ => {});
  2062. return;
  2063. }
  2064. }
  2065. this.examSubmit();
  2066. },
  2067. /**
  2068. * @param {Object} second倒计时过滤器
  2069. */
  2070. countdown(second) {
  2071. if (second) {
  2072. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  2073. let m = parseInt((second / 60) % 60); // 计算分数
  2074. let s = parseInt(second % 60); // 计算当前秒数
  2075. if (h < 10) h = "0" + h;
  2076. if (m < 10) m = "0" + m;
  2077. if (s < 10) s = "0" + s;
  2078. return h + ":" + m + ":" + s;
  2079. } else {
  2080. return "";
  2081. }
  2082. },
  2083. /**
  2084. * 交卷,跳转报告页
  2085. */
  2086. examSubmit() {
  2087. this.loading = true;
  2088. clearInterval(this.timer);
  2089. clearInterval(this.postTimer);
  2090. let form = this.calculateScore(this.questionList)
  2091. if (this.subscribeId) {
  2092. this.mockSubscribeEdit();
  2093. }
  2094. //交卷
  2095. this.$request
  2096. .mockRecordEdit({
  2097. eachExamId: this.eachExamId,
  2098. examId: this.examId,
  2099. recordId: this.recordId,
  2100. orderGoodsId:this.orderGoodsId,
  2101. goodsId:this.goodsId,
  2102. status: 1,
  2103. examTime: parseInt(this.allTimes),
  2104. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2105. ...form
  2106. })
  2107. .then(res => {
  2108. this.isSubmit = true;
  2109. this.loading = false;
  2110. this.$message({
  2111. type: "success",
  2112. message: "交卷成功"
  2113. });
  2114. setTimeout(() => {
  2115. this.$router.replace({
  2116. path: "/mock-report",
  2117. query: {
  2118. subscribeId: this.subscribeId,
  2119. eachExamId: this.eachExamId,
  2120. examId: this.examId,
  2121. recordId: this.recordId
  2122. }
  2123. });
  2124. }, 1000);
  2125. })
  2126. .catch(err => {
  2127. this.loading = false;
  2128. });
  2129. //错题集id提交(客观题)
  2130. this.$request
  2131. .mockWrongRecord({
  2132. eachExamId: this.eachExamId,
  2133. examId: this.examId,
  2134. questionIds: form.questionIds,
  2135. recordId: this.recordId
  2136. })
  2137. .then(res => {})
  2138. .catch(err => {});
  2139. },
  2140. /**
  2141. * 交卷,不用跳转
  2142. */
  2143. leaveNow() {
  2144. clearInterval(this.timer);
  2145. clearInterval(this.postTimer);
  2146. let form = this.calculateScore(this.questionList)
  2147. if (this.subscribeId) {
  2148. this.mockSubscribeEdit();
  2149. }
  2150. //交卷
  2151. this.$request
  2152. .mockRecordEdit({
  2153. eachExamId: this.eachExamId,
  2154. examId: this.examId,
  2155. recordId: this.recordId,
  2156. status: 1,
  2157. examTime: parseInt(this.allTimes),
  2158. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  2159. ...form
  2160. })
  2161. .then(res => {});
  2162. //错题集id提交(客观题)
  2163. this.$request
  2164. .examWrongRecord({
  2165. eachExamId: this.eachExamId,
  2166. examId: this.examId,
  2167. questionIds: form.questionIds,
  2168. recordId: this.recordId,
  2169. doMode: this.doMode
  2170. })
  2171. .then(res => {
  2172. this.loading = false;
  2173. })
  2174. .catch(err => {
  2175. this.loading = false;
  2176. });
  2177. }
  2178. }
  2179. };
  2180. </script>
  2181. <!-- Add "scoped" attribute to limit CSS to this component only -->
  2182. <style scoped lang="scss">
  2183. .course-exam {
  2184. .section {
  2185. overflow: hidden;
  2186. &__header {
  2187. height: 20px;
  2188. margin-top: 20px;
  2189. }
  2190. &__body {
  2191. .explain-record {
  2192. &__header {
  2193. }
  2194. &__body {
  2195. margin-bottom: 20px;
  2196. border: 1px solid #eee;
  2197. .left-box {
  2198. float: left;
  2199. width: 970px;
  2200. min-height: 630px;
  2201. border: 1px solid #eee;
  2202. &__body {
  2203. .question {
  2204. padding: 12px 0 0 12px;
  2205. display: flex;
  2206. flex-direction: column;
  2207. height: 100%;
  2208. &__title {
  2209. padding-left: 12px;
  2210. font-size: 16px;
  2211. font-family: Microsoft YaHei;
  2212. font-weight: bold;
  2213. color: #333333;
  2214. line-height: 24px;
  2215. }
  2216. &__desc {
  2217. padding-left: 12px;
  2218. margin-top: 20px;
  2219. font-size: 16px;
  2220. font-family: Microsoft YaHei;
  2221. font-weight: 400;
  2222. color: #666666;
  2223. line-height: 24px;
  2224. /deep/ img {
  2225. max-width: 100% !important;
  2226. }
  2227. }
  2228. &__content {
  2229. /deep/ .el-tabs__item {
  2230. height: 40px;
  2231. line-height: 40px;
  2232. }
  2233. .question__content {
  2234. height: auto;
  2235. overflow: auto;
  2236. }
  2237. .question-list {
  2238. padding: 24px 0 0 24px;
  2239. .checkbox,
  2240. .radio {
  2241. cursor: pointer;
  2242. margin-right: 24px;
  2243. padding: 0 24px;
  2244. display: flex;
  2245. align-items: center;
  2246. margin-top: 2px;
  2247. min-height: 40px;
  2248. padding-top: 10px;
  2249. padding-bottom: 10px;
  2250. background: #f5f9ff;
  2251. border-radius: 8px;
  2252. box-sizing: border-box;
  2253. &.right {
  2254. background: #37c65b;
  2255. }
  2256. &.wrong {
  2257. background: #ff3a30;
  2258. }
  2259. &.user_choose {
  2260. background: #007aff;
  2261. }
  2262. }
  2263. &.textarea {
  2264. margin-right: 12px;
  2265. .upload {
  2266. margin-top: 10px;
  2267. &__imgs {
  2268. margin-right: 10px;
  2269. width: 80px;
  2270. height: 80px;
  2271. background: #ffffff;
  2272. border: 1px solid #eeeeee;
  2273. border-radius: 4px;
  2274. position: relative;
  2275. display: flex;
  2276. float: left;
  2277. align-items: center;
  2278. justify-content: center;
  2279. img {
  2280. max-width: 100%;
  2281. max-height: 100%;
  2282. }
  2283. }
  2284. &__btn {
  2285. margin-right: 10px;
  2286. width: 80px;
  2287. height: 80px;
  2288. background: #ffffff;
  2289. border: 1px solid #eeeeee;
  2290. border-radius: 4px;
  2291. position: relative;
  2292. display: flex;
  2293. float: left;
  2294. align-items: center;
  2295. justify-content: center;
  2296. flex-direction: column;
  2297. .icon {
  2298. font-size: 20px;
  2299. color: #3f8dfd;
  2300. }
  2301. p {
  2302. font-size: 12px;
  2303. font-family: Microsoft YaHei;
  2304. font-weight: 400;
  2305. color: #999999;
  2306. line-height: 24px;
  2307. }
  2308. input {
  2309. position: absolute;
  2310. left: 0;
  2311. top: 0;
  2312. display: block;
  2313. width: 100%;
  2314. height: 100%;
  2315. opacity: 0;
  2316. }
  2317. }
  2318. }
  2319. }
  2320. /deep/
  2321. .el-checkbox__input.is-checked
  2322. + .el-checkbox__label {
  2323. color: #000 !important;
  2324. }
  2325. /deep/
  2326. .el-checkbox__input.is-disabled
  2327. + span.el-checkbox__label {
  2328. color: #000;
  2329. }
  2330. /deep/ .el-checkbox {
  2331. white-space: normal;
  2332. }
  2333. }
  2334. .answer-list {
  2335. height: 40px;
  2336. border-top: 1px solid #eee;
  2337. border-bottom: 1px solid #eee;
  2338. margin-top: 24px;
  2339. display: flex;
  2340. align-items: center;
  2341. justify-content: space-between;
  2342. padding: 0 24px;
  2343. &__left {
  2344. font-size: 16px;
  2345. font-family: Microsoft YaHei;
  2346. font-weight: 400;
  2347. color: #333333;
  2348. line-height: 24px;
  2349. }
  2350. &__right {
  2351. font-size: 16px;
  2352. font-family: Microsoft YaHei;
  2353. font-weight: 400;
  2354. color: #333333;
  2355. line-height: 24px;
  2356. }
  2357. }
  2358. .explain-list {
  2359. padding: 12px 24px;
  2360. &__header {
  2361. font-size: 16px;
  2362. font-family: Microsoft YaHei;
  2363. font-weight: bold;
  2364. color: #666666;
  2365. line-height: 24px;
  2366. }
  2367. &__body {
  2368. margin-top: 12px;
  2369. font-size: 16px;
  2370. font-family: Microsoft YaHei;
  2371. font-weight: 400;
  2372. color: #666666;
  2373. line-height: 24px;
  2374. }
  2375. .upload {
  2376. margin-top: 10px;
  2377. &__imgs {
  2378. margin-right: 10px;
  2379. width: 80px;
  2380. height: 80px;
  2381. background: #ffffff;
  2382. border: 1px solid #eeeeee;
  2383. border-radius: 4px;
  2384. position: relative;
  2385. display: flex;
  2386. float: left;
  2387. align-items: center;
  2388. justify-content: center;
  2389. img {
  2390. max-width: 100%;
  2391. max-height: 100%;
  2392. }
  2393. }
  2394. }
  2395. }
  2396. }
  2397. &__btns {
  2398. position: relative;
  2399. height: 32px;
  2400. .submit {
  2401. cursor: pointer;
  2402. margin: 0 auto;
  2403. width: 140px;
  2404. height: 32px;
  2405. padding: 0;
  2406. color: #fff;
  2407. background: #3f8dfd;
  2408. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2409. border-radius: 16px;
  2410. text-align: center;
  2411. line-height: 32px;
  2412. font-size: 16px;
  2413. }
  2414. .collect {
  2415. width: 100px;
  2416. cursor: pointer;
  2417. position: absolute;
  2418. right: 0;
  2419. top: 5px;
  2420. font-size: 12px;
  2421. font-family: Microsoft YaHei;
  2422. font-weight: 400;
  2423. color: #3f8dfd;
  2424. line-height: 24px;
  2425. i {
  2426. font-size: 20px;
  2427. }
  2428. }
  2429. }
  2430. }
  2431. }
  2432. &__footer {
  2433. height: 40px;
  2434. display: flex;
  2435. justify-content: space-around;
  2436. align-items: center;
  2437. .btn {
  2438. cursor: pointer;
  2439. width: 140px;
  2440. height: 32px;
  2441. background: #ffffff;
  2442. border: 1px solid #3f8dfd;
  2443. border-radius: 16px;
  2444. line-height: 32px;
  2445. text-align: center;
  2446. color: #3f8dfd;
  2447. }
  2448. }
  2449. }
  2450. .right-box {
  2451. float: right;
  2452. width: 299px;
  2453. border-right: 1px solid #eee;
  2454. &__header {
  2455. height: 40px;
  2456. line-height: 40px;
  2457. border-bottom: 1px solid #eeeeee;
  2458. .back-btn {
  2459. display: block;
  2460. margin: 0 auto;
  2461. width: 160px;
  2462. }
  2463. .title {
  2464. float: left;
  2465. font-size: 16px;
  2466. font-family: Microsoft YaHei;
  2467. font-weight: bold;
  2468. color: #333333;
  2469. }
  2470. .time {
  2471. font-size: 16px;
  2472. font-family: Microsoft YaHei;
  2473. font-weight: 400;
  2474. color: #666666;
  2475. float: right;
  2476. }
  2477. }
  2478. &__body {
  2479. height: 510px;
  2480. border-bottom: 1px solid #eee;
  2481. .card {
  2482. &__note {
  2483. display: flex;
  2484. height: 64px;
  2485. align-items: center;
  2486. border-bottom: 1px solid #eee;
  2487. flex-wrap: wrap;
  2488. .item {
  2489. display: flex;
  2490. align-items: center;
  2491. margin-left: 10px;
  2492. width: 84px;
  2493. font-size: 12px;
  2494. .box {
  2495. margin-right: 5px;
  2496. width: 16px;
  2497. height: 16px;
  2498. border-radius: 4px;
  2499. &.white {
  2500. background: #ffffff;
  2501. border: 1px solid #eeeeee;
  2502. }
  2503. &.green {
  2504. background: #37c65b;
  2505. }
  2506. &.red {
  2507. background: #ff3a30;
  2508. }
  2509. &.yellow {
  2510. background: #ffc53d;
  2511. }
  2512. &.blue,
  2513. &.check_ans {
  2514. background: #3f8dfd;
  2515. }
  2516. }
  2517. }
  2518. }
  2519. &__content {
  2520. height: 440px;
  2521. overflow-y: scroll;
  2522. &::-webkit-scrollbar {
  2523. width: 6px;
  2524. }
  2525. &::-webkit-scrollbar-track {
  2526. background-color: #fff;
  2527. -webkit-border-radius: 2em;
  2528. -moz-border-radius: 2em;
  2529. border-radius: 2em;
  2530. }
  2531. &::-webkit-scrollbar-thumb {
  2532. background-color: #eeeeee;
  2533. -webkit-border-radius: 2em;
  2534. -moz-border-radius: 2em;
  2535. border-radius: 2em;
  2536. }
  2537. .list {
  2538. display: flex;
  2539. flex-wrap: wrap;
  2540. .item {
  2541. width: 40px;
  2542. height: 40px;
  2543. border-radius: 10px;
  2544. text-align: center;
  2545. line-height: 40px;
  2546. margin-left: 16px;
  2547. margin-top: 16px;
  2548. cursor: pointer;
  2549. &.white {
  2550. line-height: 38px;
  2551. color: #333333;
  2552. background: #ffffff;
  2553. border: 1px solid #eeeeee;
  2554. }
  2555. &.green {
  2556. color: #fff;
  2557. background: #37c65b;
  2558. }
  2559. &.red {
  2560. color: #fff;
  2561. background: #ff3a30;
  2562. }
  2563. &.blue,
  2564. &.check_ans {
  2565. color: #fff;
  2566. background: #3f8dfd;
  2567. }
  2568. &.yellow {
  2569. background: #ffc53d;
  2570. }
  2571. &.disabled {
  2572. cursor: not-allowed;
  2573. line-height: 38px;
  2574. color: #eeeeee;
  2575. background: #ffffff;
  2576. border: 1px solid #eeeeee;
  2577. }
  2578. }
  2579. }
  2580. }
  2581. }
  2582. }
  2583. &__footer {
  2584. border-bottom: 1px solid #eee;
  2585. height: 40px;
  2586. display: flex;
  2587. align-items: center;
  2588. justify-content: center;
  2589. .submit {
  2590. cursor: pointer;
  2591. width: 140px;
  2592. height: 32px;
  2593. padding: 0;
  2594. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  2595. border-radius: 16px;
  2596. line-height: 32px;
  2597. text-align: center;
  2598. font-size: 16px;
  2599. }
  2600. }
  2601. }
  2602. }
  2603. }
  2604. }
  2605. }
  2606. .take-photo {
  2607. /deep/ .el-dialog__header {
  2608. display: none;
  2609. }
  2610. /deep/ .el-dialog__body {
  2611. padding: 0;
  2612. overflow: unset;
  2613. }
  2614. &__close {
  2615. cursor: pointer;
  2616. position: absolute;
  2617. right: 0;
  2618. top: -28px;
  2619. width: 24px;
  2620. height: 24px;
  2621. line-height: 24px;
  2622. text-align: center;
  2623. color: #eee;
  2624. border: 1px solid #eee;
  2625. border-radius: 50%;
  2626. }
  2627. &__header {
  2628. height: 40px;
  2629. border-bottom: 1px solid #eee;
  2630. line-height: 40px;
  2631. font-size: 16px;
  2632. font-family: Microsoft YaHei;
  2633. font-weight: bold;
  2634. color: #333333;
  2635. padding-left: 24px;
  2636. }
  2637. &__body {
  2638. height: 400px;
  2639. padding: 40px 24px;
  2640. .left-box {
  2641. width: 336px;
  2642. float: left;
  2643. .title {
  2644. font-size: 16px;
  2645. font-family: Microsoft YaHei;
  2646. font-weight: bold;
  2647. color: #ff3b30;
  2648. line-height: 24px;
  2649. }
  2650. .content {
  2651. font-size: 14px;
  2652. font-family: Microsoft YaHei;
  2653. font-weight: 400;
  2654. color: #333333;
  2655. line-height: 28px;
  2656. margin-top: 32px;
  2657. }
  2658. }
  2659. .right-box {
  2660. float: right;
  2661. width: 400px;
  2662. height: 300px;
  2663. video {
  2664. width: 100%;
  2665. height: 100%;
  2666. }
  2667. }
  2668. }
  2669. &__footer {
  2670. height: 90px;
  2671. border-top: 1px solid #eee;
  2672. text-align: center;
  2673. .take {
  2674. display: inline-block;
  2675. width: 200px;
  2676. height: 40px;
  2677. padding: 0;
  2678. border-radius: 20px;
  2679. text-align: center;
  2680. line-height: 40px;
  2681. margin: 24px auto;
  2682. }
  2683. }
  2684. }
  2685. }
  2686. </style>