index.vue 91 KB

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