index.vue 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063
  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">
  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__body">
  37. <template v-for="(question, questionIndex) in questionList">
  38. <div
  39. class="question"
  40. v-if="question.type == 1 && current == questionIndex"
  41. :key="questionIndex"
  42. >
  43. <div class="question__title">
  44. {{ questionIndex + 1 }}、单选题
  45. </div>
  46. <div
  47. class="question__desc"
  48. v-html="question.content"
  49. ></div>
  50. <div class="question__content">
  51. <div class="question-list" v-if="!question.ques">
  52. <div
  53. class="radio"
  54. v-for="(item, index) in question.jsonStr"
  55. :key="index"
  56. @click="
  57. radioSelect(
  58. question,
  59. questionIndex,
  60. item.optionsId
  61. )
  62. "
  63. >
  64. <div>{{ ast[index] }}. {{ item.content }}</div>
  65. </div>
  66. </div>
  67. <div class="question-list" v-if="question.ques">
  68. <div
  69. class="radio"
  70. :class="{
  71. right:
  72. item.optionsId == question.ques ||
  73. item.optionsId == question.ans,
  74. wrong:
  75. item.optionsId == question.ques &&
  76. question.ques != question.ans,
  77. }"
  78. v-for="(item, index) in question.jsonStr"
  79. :key="index"
  80. >
  81. <div>{{ ast[index] }}. {{ item.content }}</div>
  82. </div>
  83. </div>
  84. <div class="answer-list" v-if="question.ques">
  85. <div class="answer-list__left">
  86. 正确答案:{{ ast[question.ans - 1] }}
  87. </div>
  88. <div class="answer-list__left">
  89. 我的答案:{{ ast[question.ques - 1] }}
  90. </div>
  91. </div>
  92. <div class="explain-list" v-if="question.ques">
  93. <div class="explain-list__header">答案解析:</div>
  94. <div
  95. class="explain-list__body"
  96. v-html="question.analysisContent"
  97. ></div>
  98. </div>
  99. </div>
  100. <div class="question__btns">
  101. <div class="collect" @click="collect">收藏本题</div>
  102. </div>
  103. </div>
  104. <div
  105. class="question"
  106. v-if="question.type == 2 && current == questionIndex"
  107. :key="questionIndex"
  108. >
  109. <div class="question__title">
  110. {{ questionIndex + 1 }}、多选题
  111. </div>
  112. <div
  113. class="question__desc"
  114. v-html="question.content"
  115. ></div>
  116. <div class="question__content">
  117. <div class="question-list" v-if="!question.ques">
  118. <el-checkbox
  119. class="checkbox"
  120. v-for="(item, index) in question.jsonStr"
  121. :key="index"
  122. :label="item.optionsId"
  123. v-model="item.checked"
  124. >
  125. <div>{{ ast[index] }}. {{ item.content }}</div>
  126. </el-checkbox>
  127. </div>
  128. <div class="question-list" v-if="question.ques">
  129. <el-checkbox
  130. disabled
  131. class="checkbox"
  132. :class="{
  133. right:
  134. question.ques.indexOf(item.optionsId) != -1 ||
  135. question.ans.indexOf(item.optionsId) != -1,
  136. wrong:
  137. question.ques.indexOf(item.optionsId) != -1 &&
  138. question.ans.indexOf(item.optionsId) == -1,
  139. }"
  140. v-for="(item, index) in question.jsonStr"
  141. :key="index"
  142. :label="item.optionsId"
  143. v-model="item.checked"
  144. >
  145. <div>{{ ast[index] }}. {{ item.content }}</div>
  146. </el-checkbox>
  147. </div>
  148. <div class="answer-list" v-if="question.ques">
  149. <div class="answer-list__left">
  150. 正确答案:
  151. <template v-for="ansItem in question.ans">{{
  152. ast[ansItem - 1]
  153. }}</template>
  154. </div>
  155. <div class="answer-list__left">
  156. 我的答案:
  157. <template v-for="quesItem in question.ques">{{
  158. ast[quesItem - 1]
  159. }}</template>
  160. </div>
  161. </div>
  162. <div class="explain-list" v-if="question.ques">
  163. <div class="explain-list__header">答案解析:</div>
  164. <div
  165. class="explain-list__body"
  166. v-if="question.analysisContent"
  167. ></div>
  168. </div>
  169. </div>
  170. <div class="question__btns">
  171. <div
  172. v-if="!question.ques"
  173. class="submit"
  174. @click="checkboxSubmit(question, questionIndex)"
  175. >
  176. 确认答案
  177. </div>
  178. <div class="collect" @click="collect">收藏本题</div>
  179. </div>
  180. </div>
  181. <div
  182. class="question"
  183. v-if="question.type == 3 && current == questionIndex"
  184. :key="questionIndex"
  185. >
  186. <div class="question__title">
  187. {{ questionIndex + 1 }}、判断题
  188. </div>
  189. <div
  190. class="question__desc"
  191. v-html="question.content"
  192. ></div>
  193. <div class="question__content">
  194. <div class="question-list" v-if="!question.ques">
  195. <div
  196. class="radio"
  197. v-for="(item, index) in judge"
  198. :key="index"
  199. @click="judgeSelect(question, questionIndex, index)"
  200. >
  201. <div>{{ ast[index] }}. {{ item }}</div>
  202. </div>
  203. </div>
  204. <div class="question-list" v-if="question.ques">
  205. <div
  206. class="radio"
  207. :class="{
  208. right:
  209. index == question.ques || index == question.ans,
  210. wrong:
  211. index == question.ques &&
  212. question.ques != question.ans,
  213. }"
  214. v-for="(item, index) in judge"
  215. :key="index"
  216. >
  217. <div>{{ ast[index] }}. {{ item }}</div>
  218. </div>
  219. </div>
  220. <div class="answer-list" v-if="question.ques">
  221. <div class="answer-list__left">
  222. 正确答案:{{ ast[question.ans] }}
  223. </div>
  224. <div class="answer-list__left">
  225. 我的答案:{{ ast[question.ques] }}
  226. </div>
  227. </div>
  228. <div class="explain-list" v-if="question.ques">
  229. <div class="explain-list__header">答案解析:</div>
  230. <div
  231. class="explain-list__body"
  232. v-html="question.analysisContent"
  233. ></div>
  234. </div>
  235. </div>
  236. <div class="question__btns">
  237. <div class="collect" @click="collect">收藏本题</div>
  238. </div>
  239. </div>
  240. <div
  241. class="question"
  242. v-if="question.type == 4 && current == questionIndex"
  243. :key="questionIndex"
  244. >
  245. <div class="question__title">
  246. {{ questionIndex + 1 }}、案例题
  247. </div>
  248. <div class="question__content">
  249. <el-tabs v-model="question.tabIndex">
  250. <el-tab-pane
  251. v-for="(json, jsonIndex) in question.jsonStr"
  252. :label="'问题' + (jsonIndex + 1)"
  253. :name="jsonIndex + ''"
  254. :key="jsonIndex"
  255. >
  256. <div
  257. class="question"
  258. v-if="json.type == 1"
  259. :key="questionIndex"
  260. >
  261. <div class="question__title">
  262. {{ jsonIndex + 1 }}、单选题
  263. </div>
  264. <div
  265. class="question__desc"
  266. v-html="json.content"
  267. ></div>
  268. <div class="question__content">
  269. <div
  270. class="question-list"
  271. v-if="!question.ques[jsonIndex]"
  272. >
  273. <div
  274. class="radio"
  275. v-for="(item, index) in json.optionsList"
  276. :key="index"
  277. @click="
  278. radioSelectChild(
  279. questionIndex,
  280. jsonIndex,
  281. item.optionsId
  282. )
  283. "
  284. >
  285. <div>
  286. {{ ast[index] }}. {{ item.content }}
  287. </div>
  288. </div>
  289. </div>
  290. <div
  291. class="question-list"
  292. v-if="question.ques[jsonIndex]"
  293. >
  294. <div
  295. class="radio"
  296. :class="{
  297. right:
  298. item.optionsId ==
  299. question.ques[jsonIndex] ||
  300. item.optionsId ==
  301. question.ans[jsonIndex],
  302. wrong:
  303. item.optionsId ==
  304. question.ques[jsonIndex] &&
  305. question.ques[jsonIndex] !=
  306. question.ans[jsonIndex],
  307. }"
  308. v-for="(item, index) in json.optionsList"
  309. :key="index"
  310. >
  311. <div>
  312. {{ ast[index] }}. {{ item.content }}
  313. </div>
  314. </div>
  315. </div>
  316. <div
  317. class="answer-list"
  318. v-if="question.ques[jsonIndex]"
  319. >
  320. <div class="answer-list__left">
  321. 正确答案:{{
  322. ast[question.ans[jsonIndex] - 1]
  323. }}
  324. </div>
  325. <div class="answer-list__left">
  326. 我的答案:{{
  327. ast[question.ques[jsonIndex] - 1]
  328. }}
  329. </div>
  330. </div>
  331. <div
  332. class="explain-list"
  333. v-if="question.ques[jsonIndex]"
  334. >
  335. <div class="explain-list__header">
  336. 答案解析:
  337. </div>
  338. <div
  339. class="explain-list__body"
  340. v-html="json.analysisContent"
  341. ></div>
  342. </div>
  343. </div>
  344. <div class="question__btns"></div>
  345. </div>
  346. <div
  347. class="question"
  348. v-if="json.type == 2"
  349. :key="jsonIndex"
  350. >
  351. <div class="question__title">
  352. {{ jsonIndex + 1 }}、多选题
  353. </div>
  354. <div
  355. class="question__desc"
  356. v-html="json.content"
  357. ></div>
  358. <div class="question__content">
  359. <div
  360. class="question-list"
  361. v-if="!question.ques[jsonIndex]"
  362. >
  363. <el-checkbox
  364. class="checkbox"
  365. v-for="(item, index) in json.optionsList"
  366. :key="index"
  367. :label="item.optionsId"
  368. v-model="item.checked"
  369. >
  370. <div>
  371. {{ ast[index] }}. {{ item.content }}
  372. </div>
  373. </el-checkbox>
  374. </div>
  375. <div
  376. class="question-list"
  377. v-if="question.ques[jsonIndex]"
  378. >
  379. <el-checkbox
  380. disabled
  381. class="checkbox"
  382. :class="{
  383. right:
  384. question.ques[jsonIndex].indexOf(
  385. item.optionsId
  386. ) != -1 ||
  387. question.ans[jsonIndex].indexOf(
  388. item.optionsId
  389. ) != -1,
  390. wrong:
  391. question.ques[jsonIndex].indexOf(
  392. item.optionsId
  393. ) != -1 &&
  394. question.ans[jsonIndex].indexOf(
  395. item.optionsId
  396. ) == -1,
  397. }"
  398. v-for="(item, index) in json.optionsList"
  399. :key="index"
  400. :label="item.optionsId"
  401. v-model="item.checked"
  402. >
  403. <div>
  404. {{ ast[index] }}. {{ item.content }}
  405. </div>
  406. </el-checkbox>
  407. </div>
  408. <div
  409. class="answer-list"
  410. v-if="question.ques[jsonIndex]"
  411. >
  412. <div class="answer-list__left">
  413. 正确答案:
  414. <template
  415. v-for="ansItem in question.ans[jsonIndex]"
  416. >{{ ast[ansItem - 1] }}</template
  417. >
  418. </div>
  419. <div class="answer-list__left">
  420. 我的答案:
  421. <template
  422. v-for="quesItem in question.ques[
  423. jsonIndex
  424. ]"
  425. >{{ ast[quesItem - 1] }}</template
  426. >
  427. </div>
  428. </div>
  429. <div
  430. class="explain-list"
  431. v-if="question.ques[jsonIndex]"
  432. >
  433. <div class="explain-list__header">
  434. 答案解析:
  435. </div>
  436. <div
  437. class="explain-list__body"
  438. v-html="json.analysisContent"
  439. ></div>
  440. </div>
  441. </div>
  442. <div class="question__btns">
  443. <div
  444. v-if="!question.ques[jsonIndex]"
  445. class="submit"
  446. @click="
  447. checkboxSubmitChild(
  448. questionIndex,
  449. jsonIndex
  450. )
  451. "
  452. >
  453. 确认答案
  454. </div>
  455. </div>
  456. </div>
  457. <div
  458. class="question"
  459. v-if="json.type == 3"
  460. :key="jsonIndex"
  461. >
  462. <div class="question__title">
  463. {{ jsonIndex + 1 }}、判断题
  464. </div>
  465. <div
  466. class="question__desc"
  467. v-html="json.content"
  468. ></div>
  469. <div class="question__content">
  470. <div
  471. class="question-list"
  472. v-if="!question.ques[jsonIndex]"
  473. >
  474. <div
  475. class="radio"
  476. v-for="(item, index) in judge"
  477. :key="index"
  478. @click="
  479. judgeSelectChild(
  480. questionIndex,
  481. jsonIndex,
  482. index
  483. )
  484. "
  485. >
  486. <div>{{ ast[index] }}. {{ item }}</div>
  487. </div>
  488. </div>
  489. <div
  490. class="question-list"
  491. v-if="question.ques[jsonIndex]"
  492. >
  493. <div
  494. class="radio"
  495. :class="{
  496. right:
  497. index == question.ques[jsonIndex] ||
  498. index == question.ans[jsonIndex],
  499. wrong:
  500. index == question.ques[jsonIndex] &&
  501. question.ques[jsonIndex] !=
  502. question.ans[jsonIndex],
  503. }"
  504. v-for="(item, index) in judge"
  505. :key="index"
  506. >
  507. <div>{{ ast[index] }}. {{ item }}</div>
  508. </div>
  509. </div>
  510. <div
  511. class="answer-list"
  512. v-if="question.ques[jsonIndex]"
  513. >
  514. <div class="answer-list__left">
  515. 正确答案:{{ ast[question.ans[jsonIndex]] }}
  516. </div>
  517. <div class="answer-list__left">
  518. 我的答案:{{
  519. ast[question.ques[jsonIndex]]
  520. }}
  521. </div>
  522. </div>
  523. <div
  524. class="explain-list"
  525. v-if="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"></div>
  537. </div>
  538. <div
  539. class="question"
  540. v-if="json.type == 5"
  541. :key="jsonIndex"
  542. >
  543. <div class="question__title">
  544. {{ jsonIndex }}、简答题
  545. </div>
  546. <div
  547. class="question__desc"
  548. v-html="json.content"
  549. ></div>
  550. <div class="question__content">
  551. <div
  552. class="question-list textarea"
  553. v-if="
  554. !(
  555. question.ques[jsonIndex] &&
  556. (question.ques[jsonIndex].imageList
  557. .length ||
  558. question.ques[jsonIndex].text)
  559. )
  560. "
  561. >
  562. <el-input
  563. type="textarea"
  564. rows="5"
  565. v-model="json.ansText.text"
  566. resize="none"
  567. ></el-input>
  568. <div class="upload clearfix">
  569. <div
  570. class="upload__imgs"
  571. v-for="(img, imgIndex) in json.ansText
  572. .imageList"
  573. :key="imgIndex"
  574. >
  575. <img
  576. :src="$tools.splitImgHost(img, true)"
  577. alt=""
  578. />
  579. </div>
  580. <div class="upload__btn">
  581. <i class="el-icon-plus icon"></i>
  582. <p>上传图片</p>
  583. <input
  584. @change="
  585. uploadImgChild(
  586. $event,
  587. questionIndex,
  588. jsonIndex
  589. )
  590. "
  591. type="file"
  592. />
  593. </div>
  594. </div>
  595. </div>
  596. <div
  597. class="explain-list"
  598. v-if="
  599. question.ques[jsonIndex] &&
  600. (question.ques[jsonIndex].imageList
  601. .length ||
  602. question.ques[jsonIndex].text)
  603. "
  604. >
  605. <div class="explain-list__header">
  606. 我的答案:
  607. </div>
  608. <div class="explain-list__body">
  609. <div>
  610. {{ question.ques[jsonIndex].text }}
  611. </div>
  612. <div class="upload clearfix">
  613. <div
  614. class="upload__imgs"
  615. v-for="(img, imgIndex) in question.ques[
  616. jsonIndex
  617. ].imageList"
  618. :key="imgIndex"
  619. >
  620. <img
  621. :src="$tools.splitImgHost(img, true)"
  622. alt=""
  623. />
  624. </div>
  625. </div>
  626. </div>
  627. <div class="explain-list__header">
  628. 答案解析:
  629. </div>
  630. <div
  631. class="explain-list__body"
  632. v-html="question.analysisContent"
  633. ></div>
  634. </div>
  635. </div>
  636. <div class="question__btns">
  637. <div
  638. v-if="
  639. !(
  640. question.ques[jsonIndex] &&
  641. (question.ques[jsonIndex].imageList
  642. .length ||
  643. question.ques[jsonIndex].text)
  644. )
  645. "
  646. class="submit"
  647. @click="
  648. ansSubmitChild(
  649. question,
  650. questionIndex,
  651. jsonIndex
  652. )
  653. "
  654. >
  655. 确认答案
  656. </div>
  657. </div>
  658. </div>
  659. </el-tab-pane>
  660. </el-tabs>
  661. </div>
  662. <div class="question__btns">
  663. <div class="collect" @click="collect">收藏本题</div>
  664. </div>
  665. </div>
  666. <div
  667. class="question"
  668. v-if="question.type == 5 && current == questionIndex"
  669. :key="questionIndex"
  670. >
  671. <div class="question__title">
  672. {{ questionIndex }}、简答题
  673. </div>
  674. <div
  675. class="question__desc"
  676. v-html="question.content"
  677. ></div>
  678. <div class="question__content">
  679. <div
  680. class="question-list textarea"
  681. v-if="
  682. !question.ques.imageList.length &&
  683. !question.ques.text
  684. "
  685. >
  686. <el-input
  687. type="textarea"
  688. rows="5"
  689. v-model="question.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 question.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. uploadImg($event, question, questionIndex)
  710. "
  711. type="file"
  712. />
  713. </div>
  714. </div>
  715. </div>
  716. <div
  717. class="explain-list"
  718. v-if="
  719. question.ques.imageList.length || question.ques.text
  720. "
  721. >
  722. <div class="explain-list__header">我的答案:</div>
  723. <div class="explain-list__body">
  724. <div>{{ question.ques.text }}</div>
  725. <div class="upload clearfix">
  726. <div
  727. class="upload__imgs"
  728. v-for="(img, imgIndex) in question.ques
  729. .imageList"
  730. :key="imgIndex"
  731. >
  732. <img
  733. :src="$tools.splitImgHost(img, true)"
  734. alt=""
  735. />
  736. </div>
  737. </div>
  738. </div>
  739. <div class="explain-list__header">答案解析:</div>
  740. <div
  741. class="explain-list__body"
  742. v-html="question.analysisContent"
  743. ></div>
  744. </div>
  745. </div>
  746. <div class="question__btns">
  747. <div
  748. v-if="
  749. !question.ques.imageList.length &&
  750. !question.ques.text
  751. "
  752. class="submit"
  753. @click="ansSubmit(question, questionIndex)"
  754. >
  755. 确认答案
  756. </div>
  757. <div class="collect" @click="collect">收藏本题</div>
  758. </div>
  759. </div>
  760. </template>
  761. </div>
  762. <div class="left-box__footer">
  763. <div class="btn" @click="prevQuestion">上一题</div>
  764. <div class="btn" @click="nextQuestion">下一题</div>
  765. </div>
  766. </div>
  767. <div class="right-box">
  768. <div class="right-box__header">答题卡</div>
  769. <div class="right-box__body">
  770. <div class="card">
  771. <div class="card__note">
  772. <div class="item">
  773. <div class="box green"></div>
  774. 正确
  775. </div>
  776. <div class="item">
  777. <div class="box red"></div>
  778. 错误
  779. </div>
  780. <div class="item">
  781. <div class="box blue"></div>
  782. 已做未评改
  783. </div>
  784. <div class="item">
  785. <div class="box white"></div>
  786. 未做
  787. </div>
  788. </div>
  789. <div class="card__content">
  790. <ul class="list">
  791. <li
  792. class="item white"
  793. v-for="(item, index) in questionList"
  794. :key="index"
  795. :class="{
  796. green: isRight(item, index),
  797. red: isWrong(item, index),
  798. blue: isOver(item, index),
  799. }"
  800. @click="changeIndex(index)"
  801. >
  802. {{ index + 1 }}
  803. </li>
  804. </ul>
  805. </div>
  806. </div>
  807. </div>
  808. <div class="right-box__footer">
  809. <div class="submit" @click="submit">交卷</div>
  810. </div>
  811. </div>
  812. </div>
  813. </div>
  814. </div>
  815. </div>
  816. </section>
  817. <ToolBar></ToolBar>
  818. <Footer></Footer>
  819. </div>
  820. </template>
  821. <script>
  822. import Footer from "@/components/footer/index";
  823. import Header from "@/components/header/index";
  824. import ToolBar from "@/components/toolbar/index";
  825. import { mapMutations } from "vuex";
  826. export default {
  827. name: "BankExplain",
  828. components: {
  829. Footer,
  830. Header,
  831. ToolBar,
  832. },
  833. data() {
  834. return {
  835. recordId: 0,
  836. questionIndex: 0,
  837. checked: false,
  838. activeName: "1",
  839. questionList: [],
  840. bankList: [],
  841. judge: ["错误", "正确"],
  842. ast: ["A", "B", "C", "D", "E", "F", "G"],
  843. lastTime: 0, //剩余考试时长
  844. allTimes: 0, //总考试时长
  845. lastCount: 0,
  846. examId: 0,
  847. goodsId: 0,
  848. moduleId: 0,
  849. chapterId: 0,
  850. current: 0,
  851. examData: {},
  852. orderGoodsId: "",
  853. };
  854. },
  855. async mounted() {
  856. this.goodsId = this.$route.params.goodsId;
  857. this.examId = this.$route.query.examId;
  858. this.moduleId = this.$route.query.moduleId;
  859. this.chapterId = this.$route.query.chapterId;
  860. this.recordId = this.$route.query.recordId;
  861. this.orderGoodsId = this.$route.query.orderGoodsId || "";
  862. this.goodsQuestionList();
  863. },
  864. methods: {
  865. ...mapMutations(["setExamResult"]),
  866. toFixed(num) {
  867. if (num) {
  868. let str = String(num).indexOf(".");
  869. if (str != -1) {
  870. return +num.toFixed(2);
  871. } else {
  872. return num;
  873. }
  874. } else {
  875. return 0;
  876. }
  877. },
  878. /**
  879. * 请求题目列表
  880. */
  881. goodsQuestionList() {
  882. console.log("继续做题");
  883. this.$request.examReport(this.recordId).then((res) => {
  884. let json = JSON.parse(res.data.historyExamJson);
  885. this.examData = res.data;
  886. this.questionList = json;
  887. });
  888. },
  889. /**
  890. * @param {Object}
  891. * 单选点击确认
  892. */
  893. radioSelect(question, questionIndex, optionsId) {
  894. if (this.questionList[questionIndex].ques) return;
  895. this.$set(this.questionList[questionIndex], "ques", optionsId);
  896. },
  897. /**
  898. * @param {Object}
  899. * 案例单选点击
  900. */
  901. radioSelectChild(questionIndex, jsonIndex, optionsId) {
  902. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  903. this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
  904. },
  905. /**
  906. * 多选点击确认
  907. */
  908. checkboxSubmit(question, questionIndex) {
  909. if (this.questionList[questionIndex].ques) return;
  910. let arr = [];
  911. this.questionList[questionIndex].jsonStr.forEach((item) => {
  912. if (item.checked) {
  913. arr.push(item.optionsId);
  914. }
  915. });
  916. if (!arr.length) {
  917. this.$message({
  918. type: "warning",
  919. message: "请选择答案",
  920. });
  921. return;
  922. }
  923. this.$set(this.questionList[questionIndex], "ques", arr);
  924. },
  925. /**
  926. * @param {Object}
  927. * 案例多选确认
  928. */
  929. checkboxSubmitChild(questionIndex, ansIndex) {
  930. if (this.questionList[questionIndex].ques[ansIndex]) return;
  931. let arr = [];
  932. this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
  933. (item) => {
  934. if (item.checked) {
  935. arr.push(item.optionsId);
  936. }
  937. }
  938. );
  939. if (!arr.length) {
  940. this.$message({
  941. type: "warning",
  942. message: "请选择答案",
  943. });
  944. return;
  945. }
  946. this.$set(this.questionList[questionIndex].ques, ansIndex, arr);
  947. },
  948. /**
  949. * 判断点击确认
  950. */
  951. judgeSelect(question, questionIndex, index) {
  952. if (question.ques) return;
  953. this.$set(this.questionList[questionIndex], "ques", index + "");
  954. },
  955. judgeSelectChild(questionIndex, jsonIndex, index) {
  956. console.log(this.questionList[questionIndex].ques[jsonIndex]);
  957. if (this.questionList[questionIndex].ques[jsonIndex]) return;
  958. this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
  959. },
  960. /**
  961. * 上传图片
  962. */
  963. uploadImg(e, question, questionIndex) {
  964. var file = e.target.files[0];
  965. if (file.size > 2 * 1024 * 1024) {
  966. this.$message.warn("图片不得大于2000kb");
  967. return;
  968. }
  969. var type = e.target.value.toLowerCase().split(".").splice(-1);
  970. if (
  971. type[0] != "jpg" &&
  972. type[0] != "png" &&
  973. type[0] != "jpeg" &&
  974. type[0] != "gif"
  975. ) {
  976. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  977. e.target.value = "";
  978. return;
  979. }
  980. this.$upload.upload(file, 0).then((res) => {
  981. question.ansText.imageList.push(res);
  982. });
  983. },
  984. /**
  985. * 案例上传图片
  986. */
  987. uploadImgChild(e, questionIndex, jsonIndex) {
  988. var file = e.target.files[0];
  989. if (file.size > 2 * 1024 * 1024) {
  990. this.$message.warn("图片不得大于2000kb");
  991. return;
  992. }
  993. var type = e.target.value.toLowerCase().split(".").splice(-1);
  994. if (
  995. type[0] != "jpg" &&
  996. type[0] != "png" &&
  997. type[0] != "jpeg" &&
  998. type[0] != "gif"
  999. ) {
  1000. this.$message.error("上传格式需为:.jpg/.png/.jpeg/gif");
  1001. e.target.value = "";
  1002. return;
  1003. }
  1004. this.$upload.upload(file, 0).then((res) => {
  1005. this.questionList[questionIndex].jsonStr[
  1006. jsonIndex
  1007. ].ansText.imageList.push(res);
  1008. });
  1009. },
  1010. isOver(item, index) {
  1011. if (this.questionList[index].ques) {
  1012. if (item.type == 4) {
  1013. //案例题
  1014. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  1015. if (
  1016. jsonItem.type == 1 ||
  1017. jsonItem.type == 2 ||
  1018. jsonItem.type == 3
  1019. ) {
  1020. if (item.ques[indexs]) {
  1021. return true;
  1022. } else {
  1023. return false;
  1024. }
  1025. } else if (jsonItem.type == 5) {
  1026. if (
  1027. item.ques[indexs] &&
  1028. (item.ques[indexs].text || item.ques[indexs].imageList.length)
  1029. ) {
  1030. console.log("chil");
  1031. return true;
  1032. } else {
  1033. return false;
  1034. }
  1035. }
  1036. });
  1037. if (isOver) {
  1038. return true;
  1039. } else {
  1040. return false;
  1041. }
  1042. } else if (item.type == 5) {
  1043. //简答题
  1044. //每一项都相等
  1045. if (item.ques && (item.ques.imageList.length || item.ques.text)) {
  1046. return true;
  1047. }
  1048. //判断
  1049. } else {
  1050. return false;
  1051. }
  1052. } else {
  1053. return false;
  1054. }
  1055. },
  1056. ansSubmit(question, questionIndex) {
  1057. if (!question.ansText.text && !question.ansText.imageList.length) {
  1058. this.$message({
  1059. type: "warning",
  1060. message: "请输入内容或上传图片",
  1061. });
  1062. return;
  1063. }
  1064. question.ques.imageList = question.ansText.imageList;
  1065. question.ques.text = question.ansText.text;
  1066. console.log(question.ques);
  1067. },
  1068. ansSubmitChild(question, questionIndex, jsonIndex) {
  1069. if (
  1070. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text &&
  1071. !this.questionList[questionIndex].jsonStr[jsonIndex].ansText.imageList
  1072. .length
  1073. ) {
  1074. this.$message({
  1075. type: "warning",
  1076. message: "请输入内容或上传图片",
  1077. });
  1078. return;
  1079. }
  1080. this.$set(this.questionList[questionIndex].ques, jsonIndex, {
  1081. imageList:
  1082. this.questionList[questionIndex].jsonStr[jsonIndex].ansText
  1083. .imageList || [],
  1084. text:
  1085. this.questionList[questionIndex].jsonStr[jsonIndex].ansText.text ||
  1086. "",
  1087. });
  1088. },
  1089. changeIndex(index) {
  1090. this.current = index;
  1091. },
  1092. nextQuestion() {
  1093. if (this.current >= this.questionList.length - 1) {
  1094. this.$message({
  1095. type: "warning",
  1096. message: "已经是最后一题了!",
  1097. });
  1098. return;
  1099. }
  1100. this.current++;
  1101. },
  1102. prevQuestion() {
  1103. if (this.current == 0) {
  1104. this.$message({
  1105. type: "warning",
  1106. message: "已经是第一题了!",
  1107. });
  1108. return;
  1109. } else {
  1110. this.current--;
  1111. }
  1112. },
  1113. isRight(item, index) {
  1114. //单选
  1115. if (this.questionList[index].ques) {
  1116. if (item.type == 1) {
  1117. console.log(
  1118. this.questionList[index].ques == this.questionList[index].ans
  1119. );
  1120. return this.questionList[index].ques == this.questionList[index].ans;
  1121. //多选
  1122. } else if (item.type == 2) {
  1123. //每一项都相等
  1124. return this.questionList[index].ans.every((item, i) => {
  1125. return item == this.questionList[index].ques[i];
  1126. });
  1127. //判断
  1128. } else if (item.type == 3) {
  1129. return this.questionList[index].ques == this.questionList[index].ans;
  1130. } else {
  1131. return false;
  1132. }
  1133. } else {
  1134. return false;
  1135. }
  1136. },
  1137. isWrong(item, index) {
  1138. if (this.questionList[index].ques) {
  1139. //单选
  1140. if (item.type == 1) {
  1141. return this.questionList[index].ques != this.questionList[index].ans;
  1142. //多选
  1143. } else if (item.type == 2) {
  1144. //每一项都相等
  1145. return this.questionList[index].ans.some((item, i) => {
  1146. return item != this.questionList[index].ques[i];
  1147. });
  1148. //判断
  1149. } else if (item.type == 3) {
  1150. return this.questionList[index].ques != this.questionList[index].ans;
  1151. } else {
  1152. return false;
  1153. }
  1154. } else {
  1155. return false;
  1156. }
  1157. },
  1158. right(bankIndex, ansIndex, option) {
  1159. if (
  1160. this.questionList[bankIndex].ques[ansIndex] &&
  1161. this.questionList[bankIndex].ans[ansIndex]
  1162. ) {
  1163. if (
  1164. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1165. option.optionsId
  1166. ) != -1 ||
  1167. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1168. option.optionsId
  1169. ) != -1
  1170. ) {
  1171. return true;
  1172. } else {
  1173. return false;
  1174. }
  1175. } else {
  1176. return false;
  1177. }
  1178. },
  1179. wrong(bankIndex, ansIndex, option) {
  1180. if (
  1181. this.questionList[bankIndex].ques[ansIndex] &&
  1182. this.questionList[bankIndex].ans[ansIndex]
  1183. ) {
  1184. if (
  1185. this.questionList[bankIndex].ques[ansIndex].indexOf(
  1186. option.optionsId
  1187. ) != -1 &&
  1188. this.questionList[bankIndex].ans[ansIndex].indexOf(
  1189. option.optionsId
  1190. ) == -1
  1191. ) {
  1192. return true;
  1193. } else {
  1194. return false;
  1195. }
  1196. } else {
  1197. return false;
  1198. }
  1199. },
  1200. /**
  1201. * 获取已经回答的题目数
  1202. * hasSpecail (是否包含简答和案例)
  1203. */
  1204. questionOverNum(hasSpecail) {
  1205. let count = 0;
  1206. this.questionList.forEach((item) => {
  1207. if (item.type == 1 || item.type == 2 || item.type == 3) {
  1208. if (item.ques) {
  1209. count++;
  1210. }
  1211. } else if (item.type == 4) {
  1212. //案例题
  1213. if (hasSpecail) {
  1214. let isOver = item.jsonStr.every((jsonItem, index) => {
  1215. if (
  1216. jsonItem.type == 1 ||
  1217. jsonItem.type == 2 ||
  1218. jsonItem.type == 3
  1219. ) {
  1220. if (item.ques[index]) {
  1221. return true;
  1222. } else {
  1223. return false;
  1224. }
  1225. } else if (jsonItem.type == 5) {
  1226. if (
  1227. item.ques[index] &&
  1228. (item.ques[index].text || item.ques[index].imageList.length)
  1229. ) {
  1230. return true;
  1231. } else {
  1232. return false;
  1233. }
  1234. }
  1235. });
  1236. if (isOver) {
  1237. count++;
  1238. console.log(item, 444);
  1239. }
  1240. }
  1241. } else if (item.type == 5) {
  1242. //简答题
  1243. if (hasSpecail) {
  1244. if (item.ques && (item.ques.text || item.ques.imageList.length)) {
  1245. console.log(5, item);
  1246. count++;
  1247. }
  1248. }
  1249. }
  1250. });
  1251. return count;
  1252. },
  1253. collect() {
  1254. this.$message({
  1255. message: "试做题目,不支持收藏~",
  1256. type: "warning",
  1257. });
  1258. return;
  1259. },
  1260. submit() {
  1261. let ansCount = this.questionOverNum(true); //已答题数
  1262. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1263. //没有答完
  1264. if (this.lastCount !== 0) {
  1265. this.$confirm(
  1266. `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
  1267. "提示",
  1268. {
  1269. confirmButtonText: "立即交卷",
  1270. cancelButtonText: "继续做题",
  1271. closeOnClickModal: false,
  1272. closeOnPressEscape: false,
  1273. distinguishCancelAndClose: false,
  1274. showClose: false,
  1275. }
  1276. )
  1277. .then((_) => {
  1278. this.examSubmit();
  1279. })
  1280. .catch((_) => {});
  1281. return;
  1282. }
  1283. this.examSubmit();
  1284. },
  1285. examSubmit() {
  1286. let score = 0; //计算总分
  1287. let reportStatus = 0;
  1288. let number = 0; //做对的题目数量
  1289. let doQuestionNum = 0; //做过的题目数量
  1290. let allScore = 0; //总分
  1291. let passScore = 0;
  1292. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1293. let doQuestionIds = []; //做过的题目id
  1294. let rightQuestionIds = []; //做对的题目id
  1295. this.questionList.forEach((item, index) => {
  1296. passScore = item.passScore;
  1297. if (item.type == 1) {
  1298. //正确
  1299. if (item.ques == item.ans) {
  1300. item.scoreResult = item.score;
  1301. score += item.score;
  1302. number++;
  1303. rightQuestionIds.push(item.questionId);
  1304. } else {
  1305. //错误
  1306. item.scoreResult = 0;
  1307. doWrongQuestionIds.push(item.questionId);
  1308. }
  1309. allScore += item.score;
  1310. if (item.ques) {
  1311. doQuestionNum++;
  1312. doQuestionIds.push(item.questionId);
  1313. }
  1314. } else if (item.type == 2) {
  1315. let isRight =
  1316. item.ans &&
  1317. item.ans.every((quesItem, quesIndex) => {
  1318. if (item.ques) {
  1319. return item.ques[quesIndex] == item.ans[quesIndex];
  1320. } else {
  1321. return false;
  1322. }
  1323. });
  1324. if (isRight) {
  1325. score += item.score;
  1326. number++;
  1327. item.scoreResult = item.score;
  1328. rightQuestionIds.push(item.questionId);
  1329. } else {
  1330. let checkboxScore = item.score; //获取单题总分数
  1331. item.ques &&
  1332. item.ques.forEach((ques, quesIndex) => {
  1333. //选错一个全扣
  1334. if (item.ques) {
  1335. if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1336. checkboxScore = 0;
  1337. }
  1338. } else {
  1339. checkboxScore = 0;
  1340. }
  1341. });
  1342. console.log(checkboxScore);
  1343. //没选错
  1344. if (checkboxScore) {
  1345. item.ans.forEach((ans, quesIndex) => {
  1346. //漏选扣一部分
  1347. if (item.ques) {
  1348. if (item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1349. checkboxScore = item.partScore;
  1350. }
  1351. } else {
  1352. checkboxScore = 0;
  1353. }
  1354. });
  1355. }
  1356. if (checkboxScore <= 0) {
  1357. //0分
  1358. item.scoreResult = 0;
  1359. doWrongQuestionIds.push(item.questionId);
  1360. } else {
  1361. //部分分
  1362. // number++;
  1363. doWrongQuestionIds.push(item.questionId);
  1364. item.scoreResult = checkboxScore;
  1365. score += checkboxScore;
  1366. // rightQuestionIds.push(item.questionId)
  1367. }
  1368. }
  1369. allScore += item.score;
  1370. if (item.ques && item.ques.length) {
  1371. doQuestionNum++;
  1372. doQuestionIds.push(item.questionId);
  1373. }
  1374. } else if (item.type == 3) {
  1375. if (item.ques == item.ans) {
  1376. item.scoreResult = item.score;
  1377. score += item.score;
  1378. number++;
  1379. rightQuestionIds.push(item.questionId);
  1380. } else {
  1381. item.scoreResult = 0;
  1382. doWrongQuestionIds.push(item.questionId);
  1383. }
  1384. allScore += item.score;
  1385. if (item.ques) {
  1386. doQuestionNum++;
  1387. doQuestionIds.push(item.questionId);
  1388. }
  1389. } else if (item.type == 4) {
  1390. allScore += item.score;
  1391. if (item.ques && item.ques.length) {
  1392. doQuestionNum++;
  1393. doQuestionIds.push(item.questionId);
  1394. }
  1395. } else if (item.type == 5) {
  1396. allScore += item.score;
  1397. if (item.ques && (item.ques.imageList || item.ques.text)) {
  1398. doQuestionNum++;
  1399. doQuestionIds.push(item.questionId);
  1400. }
  1401. }
  1402. });
  1403. //大于分及格
  1404. if (score >= passScore) {
  1405. reportStatus = 1;
  1406. } else {
  1407. reportStatus = 0;
  1408. }
  1409. //交卷
  1410. this.$request
  1411. .examRecordEdit({
  1412. orderGoodsId: this.orderGoodsId,
  1413. examId: this.examId,
  1414. goodsId: this.goodsId,
  1415. reportStatus: reportStatus,
  1416. totalScore: allScore,
  1417. recordId: this.recordId,
  1418. rightQuestionNum: number,
  1419. status: 1,
  1420. moduleExamId: this.moduleId || 0,
  1421. chapterExamId: this.chapterId || 0,
  1422. doQuestionIds: doQuestionIds.join(","),
  1423. rightQuestionIds: rightQuestionIds.join(","),
  1424. doQuestionNum: doQuestionNum,
  1425. performance: score,
  1426. historyExamJson: JSON.stringify(this.questionList),
  1427. })
  1428. .then((res) => {
  1429. this.isSubmit = true;
  1430. this.$message({
  1431. type: "success",
  1432. message: "交卷成功",
  1433. });
  1434. setTimeout(() => {
  1435. let result = {
  1436. orderGoodsId: this.orderGoodsId,
  1437. chapterId: this.chapterId,
  1438. moduleId: this.moduleId,
  1439. examId: this.examId,
  1440. recordId: this.recordId,
  1441. };
  1442. console.log(result);
  1443. this.setExamResult(result);
  1444. this.$router.replace({
  1445. path: "/bank-report/" + this.goodsId,
  1446. query: {
  1447. orderGoodsId: this.orderGoodsId,
  1448. chapterId: this.chapterId,
  1449. moduleId: this.moduleId,
  1450. examId: this.examId,
  1451. recordId: this.recordId,
  1452. },
  1453. });
  1454. }, 1000);
  1455. })
  1456. .catch((err) => {
  1457. console.log(err, "err");
  1458. });
  1459. },
  1460. },
  1461. };
  1462. </script>
  1463. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1464. <style scoped lang="scss">
  1465. .course-exam {
  1466. .section {
  1467. overflow: hidden;
  1468. &__header {
  1469. height: 20px;
  1470. margin-top: 20px;
  1471. }
  1472. &__body {
  1473. .explain-record {
  1474. &__header {
  1475. }
  1476. &__body {
  1477. height: 800px;
  1478. border: 1px solid #eee;
  1479. .left-box {
  1480. float: left;
  1481. width: 970px;
  1482. border-right: 1px solid #eee;
  1483. &__header {
  1484. height: 40px;
  1485. padding-left: 12px;
  1486. border-bottom: 1px solid #eeeeee;
  1487. display: flex;
  1488. align-items: center;
  1489. .progress {
  1490. width: 636px;
  1491. }
  1492. .text {
  1493. margin-left: 15px;
  1494. font-size: 16px;
  1495. span {
  1496. font-family: Microsoft YaHei;
  1497. font-weight: bold;
  1498. color: #3f8dfd;
  1499. line-height: 24px;
  1500. }
  1501. }
  1502. }
  1503. &__body {
  1504. height: 720px;
  1505. border-bottom: 1px solid #eee;
  1506. .question {
  1507. padding: 12px 0 0 12px;
  1508. display: flex;
  1509. flex-direction: column;
  1510. height: 100%;
  1511. &__title {
  1512. padding-left: 12px;
  1513. font-size: 16px;
  1514. font-family: Microsoft YaHei;
  1515. font-weight: bold;
  1516. color: #333333;
  1517. line-height: 24px;
  1518. }
  1519. &__desc {
  1520. padding-left: 12px;
  1521. margin-top: 20px;
  1522. font-size: 16px;
  1523. font-family: Microsoft YaHei;
  1524. font-weight: 400;
  1525. color: #666666;
  1526. line-height: 24px;
  1527. /deep/ img {
  1528. max-width: 100% !important;
  1529. max-height: 400px !important;
  1530. }
  1531. }
  1532. &__content {
  1533. flex: 1;
  1534. overflow-y: scroll;
  1535. &::-webkit-scrollbar {
  1536. width: 6px;
  1537. }
  1538. &::-webkit-scrollbar-track {
  1539. background-color: #fff;
  1540. -webkit-border-radius: 2em;
  1541. -moz-border-radius: 2em;
  1542. border-radius: 2em;
  1543. }
  1544. &::-webkit-scrollbar-thumb {
  1545. background-color: #eeeeee;
  1546. -webkit-border-radius: 2em;
  1547. -moz-border-radius: 2em;
  1548. border-radius: 2em;
  1549. }
  1550. /deep/ .el-tabs__item {
  1551. padding: 0 20px !important;
  1552. height: 40px;
  1553. line-height: 40px;
  1554. }
  1555. .question__content {
  1556. height: auto;
  1557. overflow: auto;
  1558. }
  1559. .question-list {
  1560. padding: 24px 0 0 24px;
  1561. .checkbox,
  1562. .radio {
  1563. cursor: pointer;
  1564. margin-right: 24px;
  1565. padding: 0 24px;
  1566. display: flex;
  1567. align-items: center;
  1568. margin-top: 2px;
  1569. min-height: 40px;
  1570. padding-top: 10px;
  1571. padding-bottom: 10px;
  1572. background: #f5f9ff;
  1573. border-radius: 8px;
  1574. box-sizing: border-box;
  1575. &.right {
  1576. background: #37c65b;
  1577. }
  1578. &.wrong {
  1579. background: #ff3a30;
  1580. }
  1581. }
  1582. &.textarea {
  1583. margin-right: 12px;
  1584. .upload {
  1585. margin-top: 10px;
  1586. &__imgs {
  1587. margin-right: 10px;
  1588. width: 80px;
  1589. height: 80px;
  1590. background: #ffffff;
  1591. border: 1px solid #eeeeee;
  1592. border-radius: 4px;
  1593. position: relative;
  1594. display: flex;
  1595. float: left;
  1596. align-items: center;
  1597. justify-content: center;
  1598. img {
  1599. max-width: 100%;
  1600. max-height: 100%;
  1601. }
  1602. }
  1603. &__btn {
  1604. margin-right: 10px;
  1605. width: 80px;
  1606. height: 80px;
  1607. background: #ffffff;
  1608. border: 1px solid #eeeeee;
  1609. border-radius: 4px;
  1610. position: relative;
  1611. display: flex;
  1612. float: left;
  1613. align-items: center;
  1614. justify-content: center;
  1615. flex-direction: column;
  1616. .icon {
  1617. font-size: 20px;
  1618. color: #3f8dfd;
  1619. }
  1620. p {
  1621. font-size: 12px;
  1622. font-family: Microsoft YaHei;
  1623. font-weight: 400;
  1624. color: #999999;
  1625. line-height: 24px;
  1626. }
  1627. input {
  1628. position: absolute;
  1629. left: 0;
  1630. top: 0;
  1631. display: block;
  1632. width: 100%;
  1633. height: 100%;
  1634. opacity: 0;
  1635. }
  1636. }
  1637. }
  1638. }
  1639. /deep/ .el-checkbox {
  1640. white-space: pre-wrap;
  1641. }
  1642. }
  1643. .answer-list {
  1644. height: 40px;
  1645. border-top: 1px solid #eee;
  1646. border-bottom: 1px solid #eee;
  1647. margin-top: 24px;
  1648. display: flex;
  1649. align-items: center;
  1650. justify-content: space-between;
  1651. padding: 0 24px;
  1652. &__left {
  1653. font-size: 16px;
  1654. font-family: Microsoft YaHei;
  1655. font-weight: 400;
  1656. color: #333333;
  1657. line-height: 24px;
  1658. }
  1659. &__right {
  1660. font-size: 16px;
  1661. font-family: Microsoft YaHei;
  1662. font-weight: 400;
  1663. color: #333333;
  1664. line-height: 24px;
  1665. }
  1666. }
  1667. .explain-list {
  1668. padding: 12px 24px;
  1669. &__header {
  1670. font-size: 16px;
  1671. font-family: Microsoft YaHei;
  1672. font-weight: bold;
  1673. color: #666666;
  1674. line-height: 24px;
  1675. }
  1676. &__body {
  1677. margin-top: 12px;
  1678. font-size: 16px;
  1679. font-family: Microsoft YaHei;
  1680. font-weight: 400;
  1681. color: #666666;
  1682. line-height: 24px;
  1683. }
  1684. .upload {
  1685. margin-top: 10px;
  1686. &__imgs {
  1687. margin-right: 10px;
  1688. width: 80px;
  1689. height: 80px;
  1690. background: #ffffff;
  1691. border: 1px solid #eeeeee;
  1692. border-radius: 4px;
  1693. position: relative;
  1694. display: flex;
  1695. float: left;
  1696. align-items: center;
  1697. justify-content: center;
  1698. img {
  1699. max-width: 100%;
  1700. max-height: 100%;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. }
  1706. &__btns {
  1707. position: relative;
  1708. height: 32px;
  1709. .submit {
  1710. cursor: pointer;
  1711. margin: 0 auto;
  1712. width: 140px;
  1713. height: 32px;
  1714. background: #3f8dfd;
  1715. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1716. border-radius: 16px;
  1717. text-align: center;
  1718. line-height: 32px;
  1719. color: #fff;
  1720. font-size: 16px;
  1721. }
  1722. .collect {
  1723. cursor: pointer;
  1724. position: absolute;
  1725. right: 0;
  1726. top: 5px;
  1727. font-size: 12px;
  1728. font-family: Microsoft YaHei;
  1729. font-weight: 400;
  1730. color: #3f8dfd;
  1731. line-height: 24px;
  1732. }
  1733. }
  1734. }
  1735. }
  1736. &__footer {
  1737. height: 40px;
  1738. display: flex;
  1739. justify-content: space-around;
  1740. align-items: center;
  1741. .btn {
  1742. cursor: pointer;
  1743. width: 140px;
  1744. height: 32px;
  1745. background: #ffffff;
  1746. border: 1px solid #3f8dfd;
  1747. border-radius: 16px;
  1748. line-height: 32px;
  1749. text-align: center;
  1750. color: #3f8dfd;
  1751. }
  1752. }
  1753. }
  1754. .right-box {
  1755. float: right;
  1756. width: 300px;
  1757. &__header {
  1758. height: 40px;
  1759. line-height: 40px;
  1760. font-size: 16px;
  1761. font-family: Microsoft YaHei;
  1762. font-weight: bold;
  1763. color: #333333;
  1764. text-align: center;
  1765. border-bottom: 1px solid #eeeeee;
  1766. }
  1767. &__body {
  1768. height: 720px;
  1769. border-bottom: 1px solid #eee;
  1770. .card {
  1771. &__note {
  1772. display: flex;
  1773. height: 40px;
  1774. align-items: center;
  1775. border-bottom: 1px solid #eee;
  1776. .item {
  1777. display: flex;
  1778. align-items: center;
  1779. margin-left: 10px;
  1780. .box {
  1781. margin-right: 5px;
  1782. width: 16px;
  1783. height: 16px;
  1784. border-radius: 4px;
  1785. &.white {
  1786. background: #ffffff;
  1787. border: 1px solid #eeeeee;
  1788. }
  1789. &.green {
  1790. background: #37c65b;
  1791. }
  1792. &.red {
  1793. background: #ff3a30;
  1794. }
  1795. &.blue {
  1796. background: #3f8dfd;
  1797. }
  1798. }
  1799. }
  1800. }
  1801. &__content {
  1802. height: 410px;
  1803. overflow-y: scroll;
  1804. &::-webkit-scrollbar {
  1805. width: 6px;
  1806. }
  1807. &::-webkit-scrollbar-track {
  1808. background-color: #fff;
  1809. -webkit-border-radius: 2em;
  1810. -moz-border-radius: 2em;
  1811. border-radius: 2em;
  1812. }
  1813. &::-webkit-scrollbar-thumb {
  1814. background-color: #eeeeee;
  1815. -webkit-border-radius: 2em;
  1816. -moz-border-radius: 2em;
  1817. border-radius: 2em;
  1818. }
  1819. .list {
  1820. display: flex;
  1821. flex-wrap: wrap;
  1822. .item {
  1823. width: 40px;
  1824. height: 40px;
  1825. border-radius: 10px;
  1826. text-align: center;
  1827. line-height: 40px;
  1828. margin-left: 16px;
  1829. margin-top: 16px;
  1830. cursor: pointer;
  1831. &.white {
  1832. line-height: 38px;
  1833. color: #333333;
  1834. background: #ffffff;
  1835. border: 1px solid #eeeeee;
  1836. }
  1837. &.green {
  1838. color: #fff;
  1839. background: #37c65b;
  1840. }
  1841. &.red {
  1842. color: #fff;
  1843. background: #ff3a30;
  1844. }
  1845. &.blue {
  1846. border: 1rpx solid #eeeeee;
  1847. color: #fff;
  1848. background: #3f8dfd;
  1849. }
  1850. &.disabled {
  1851. cursor: not-allowed;
  1852. line-height: 38px;
  1853. color: #eeeeee;
  1854. background: #ffffff;
  1855. border: 1px solid #eeeeee;
  1856. }
  1857. }
  1858. }
  1859. }
  1860. }
  1861. }
  1862. &__footer {
  1863. height: 40px;
  1864. display: flex;
  1865. align-items: center;
  1866. justify-content: center;
  1867. .submit {
  1868. cursor: pointer;
  1869. width: 140px;
  1870. height: 32px;
  1871. background: #3f8dfd;
  1872. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2);
  1873. border-radius: 16px;
  1874. line-height: 32px;
  1875. text-align: center;
  1876. color: #fff;
  1877. font-size: 16px;
  1878. }
  1879. }
  1880. }
  1881. }
  1882. }
  1883. }
  1884. }
  1885. .take-photo {
  1886. /deep/ .el-dialog__header {
  1887. display: none;
  1888. }
  1889. /deep/ .el-dialog__body {
  1890. padding: 0;
  1891. overflow: unset;
  1892. }
  1893. &__close {
  1894. cursor: pointer;
  1895. position: absolute;
  1896. right: 0;
  1897. top: -28px;
  1898. width: 24px;
  1899. height: 24px;
  1900. line-height: 24px;
  1901. text-align: center;
  1902. color: #eee;
  1903. border: 1px solid #eee;
  1904. border-radius: 50%;
  1905. }
  1906. &__header {
  1907. height: 40px;
  1908. border-bottom: 1px solid #eee;
  1909. line-height: 40px;
  1910. font-size: 16px;
  1911. font-family: Microsoft YaHei;
  1912. font-weight: bold;
  1913. color: #333333;
  1914. padding-left: 24px;
  1915. }
  1916. &__body {
  1917. height: 400px;
  1918. padding: 40px 24px;
  1919. .left-box {
  1920. width: 336px;
  1921. float: left;
  1922. .title {
  1923. font-size: 16px;
  1924. font-family: Microsoft YaHei;
  1925. font-weight: bold;
  1926. color: #ff3b30;
  1927. line-height: 24px;
  1928. }
  1929. .content {
  1930. font-size: 14px;
  1931. font-family: Microsoft YaHei;
  1932. font-weight: 400;
  1933. color: #333333;
  1934. line-height: 28px;
  1935. margin-top: 32px;
  1936. }
  1937. }
  1938. .right-box {
  1939. float: right;
  1940. width: 400px;
  1941. height: 300px;
  1942. video {
  1943. width: 100%;
  1944. height: 100%;
  1945. }
  1946. }
  1947. }
  1948. &__footer {
  1949. height: 90px;
  1950. border-top: 1px solid #eee;
  1951. text-align: center;
  1952. .take {
  1953. display: inline-block;
  1954. width: 200px;
  1955. height: 40px;
  1956. padding: 0;
  1957. border-radius: 20px;
  1958. text-align: center;
  1959. line-height: 40px;
  1960. margin: 24px auto;
  1961. }
  1962. }
  1963. }
  1964. }
  1965. </style>