questionBank.vue 92 KB

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