index.vue 106 KB

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