index.vue 109 KB

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