index.vue 113 KB

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