questionBank.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393
  1. <template>
  2. <view class="questionBank">
  3. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" ref="navbar" :statusBar="true" title="试卷"></uni-nav-bar>
  4. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  5. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  6. <view class="pageContent">
  7. <view class="pad_8 titBox">
  8. <view class="firstLetter">
  9. <view class="leftLetters">
  10. <view class="btnType">
  11. <text v-if="bank.type == 1">单选</text>
  12. <text v-if="bank.type == 2">多选</text>
  13. <text v-if="bank.type == 3">判断</text>
  14. <text v-if="bank.type == 4">案例</text>
  15. <text v-if="bank.type == 5">简答</text>
  16. </view>
  17. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  18. </view>
  19. <view style="color: #666;font-size: 28rpx;">{{ countdown(lastTime) }}</view>
  20. <view class="leftLetters"></view>
  21. </view>
  22. <view class="titles"><rich-text :nodes="bank.content"></rich-text></view>
  23. </view>
  24. <template v-if="bank.type == 1">
  25. <view class="pad_8 titBox no-margin">
  26. <view v-if="!bank.ques">
  27. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId, bankIndex)">
  28. <view class="activeTI">{{ ast[index] }}</view>
  29. <view class="flex_auto">{{ item.content }}</view>
  30. </view>
  31. </view>
  32. <view v-if="bank.ques">
  33. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  34. <text
  35. :class="{ right: item.optionsId == bank.ques || item.optionsId == bank.ans, wrong: item.optionsId == bank.ques && bank.ques != bank.ans }"
  36. class="activeTI"
  37. >
  38. {{ ast[index] }}
  39. </text>
  40. <view class="flex_auto">{{ item.content }}</view>
  41. </view>
  42. </view>
  43. <view v-if="bank.ques">
  44. <view class="pad_8 answer">
  45. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  46. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  47. </view>
  48. <view class="pad_8 answerInfos">
  49. <view class="answerTitle">答案解析</view>
  50. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <template v-if="bank.type == 2">
  56. <view class="pad_8 titBox no-margin">
  57. <view v-if="!bank.ques">
  58. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId, bankIndex, index)">
  59. <view :class="{ checked: item.checked }" class="activeTI">{{ ast[index] }}</view>
  60. <view class="flex_auto">{{ item.content }}</view>
  61. </view>
  62. </view>
  63. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">确认答案</view>
  64. <view v-if="bank.ques">
  65. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  66. <text
  67. :class="{
  68. right: bank.ques.indexOf(item.optionsId) != -1 || bank.ans.indexOf(item.optionsId) != -1,
  69. wrong: bank.ques.indexOf(item.optionsId) != -1 && bank.ans.indexOf(item.optionsId) == -1
  70. }"
  71. class="activeTI"
  72. >
  73. {{ ast[index] }}
  74. </text>
  75. <view class="flex_auto">{{ item.content }}</view>
  76. </view>
  77. </view>
  78. <view v-if="bank.ques">
  79. <view class="pad_8 answer">
  80. <view>
  81. 正确答案:
  82. <text v-for="(ansItem,ansIndex) in bank.ans" :key="ansIndex">{{ ast[ansItem - 1] }}</text>
  83. </view>
  84. <view>
  85. 我的答案:
  86. <text v-for="(quesItem,quesIndex) in bank.ques" :key="quesIndex">{{ ast[quesItem - 1] }}</text>
  87. </view>
  88. </view>
  89. <view class="pad_8 answerInfos">
  90. <view class="answerTitle">答案解析</view>
  91. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-if="bank.type == 3">
  97. <view class="pad_8 titBox no-margin">
  98. <view v-if="!bank.ques">
  99. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
  100. <view class="activeTI">{{ ast[index] }}</view>
  101. {{ item }}
  102. </view>
  103. </view>
  104. <view v-if="bank.ques">
  105. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  106. <text :class="{ right: index == bank.ques || index == bank.ans, wrong: index == bank.ques && bank.ques != bank.ans }" class="activeTI">
  107. {{ ast[index] }}
  108. </text>
  109. {{ item }}
  110. </view>
  111. </view>
  112. <view v-if="bank.ques">
  113. <view class="pad_8 answer">
  114. <view>正确答案:{{ ast[bank.ans] }}</view>
  115. <view>我的答案:{{ ast[bank.ques] }}</view>
  116. </view>
  117. <view class="pad_8 answerInfos">
  118. <view class="answerTitle">答案解析</view>
  119. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <!-- 简答题 -->
  125. <template v-if="bank.type == 5">
  126. <view class="pad_8 titBox">
  127. <view class="ans">
  128. <view class="ans_input" v-if="!bank.ques">
  129. <view class="top flex">
  130. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
  131. <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
  132. <view class="submit" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @click="submitAns(bankIndex)">确认答案</view>
  133. </view>
  134. <view class="textarea"><textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea></view>
  135. <view class="imgs">
  136. <view class="img" v-for="(img, imgIndex) in bank.ansText.imageList" :key="imgIndex">
  137. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  138. <image :src="$method.splitImgHost(img, true)"></image>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="ans_submit answerInfos" v-if="bank.ques">
  143. <view class="answerTitle">我的答案:</view>
  144. {{ bank.ques.text }}
  145. <view class="imgs"><image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques, true)"></image></view>
  146. </view>
  147. </view>
  148. <view v-if="bank.ques">
  149. <view class="pad_8 answerInfos">
  150. <view class="answerTitle">答案解析:</view>
  151. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  152. </view>
  153. </view>
  154. </view>
  155. </template>
  156. <!-- 案例题 -->
  157. <template v-if="bank.type == 4">
  158. <view class="pad_8 titBox">
  159. <view class="tabs">
  160. <view
  161. class="tab"
  162. :class="{ current: tabIndex == bank.current }"
  163. :key="tabIndex"
  164. v-for="(tab, tabIndex) in bank.jsonStr"
  165. @click="tabSelect(tabIndex, bankIndex)"
  166. >
  167. 问题{{ tabIndex }}
  168. </view>
  169. </view>
  170. <view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  171. <view class="titles"><rich-text :nodes="ansItem.content"></rich-text></view>
  172. <template v-if="ansItem.type == 1">
  173. <view v-if="!bank.ques[ansIndex]">
  174. <view
  175. v-for="(option, childIndex) in ansItem.optionsList"
  176. :key="childIndex"
  177. class="lisSty"
  178. @click="radioSelectChild(option.optionsId, ansIndex, bankIndex)"
  179. >
  180. <view class="activeTI">{{ ast[childIndex] }}</view>
  181. <rich-text class="textChild" :nodes="option.content"></rich-text>
  182. </view>
  183. </view>
  184. <view v-if="bank.ques[ansIndex]">
  185. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty">
  186. <text
  187. :class="{
  188. right: option.optionsId == bank.ques[ansIndex] || option.optionsId == bank.ans[ansIndex],
  189. wrong: option.optionsId == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  190. }"
  191. class="activeTI"
  192. >
  193. {{ ast[childIndex] }}
  194. </text>
  195. <rich-text :nodes="option.content"></rich-text>
  196. </view>
  197. </view>
  198. <view v-if="bank.ques[ansIndex]">
  199. <view class="pad_8 answer">
  200. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  201. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  202. </view>
  203. <view class="pad_8 answerInfos">
  204. <view class="answerTitle">答案解析</view>
  205. <view class="answerContent"><rich-text :nodes="option.analysisContent"></rich-text></view>
  206. </view>
  207. </view>
  208. </template>
  209. <template v-if="ansItem.type == 2">
  210. <view v-if="!bank.ques[ansIndex]">
  211. <view
  212. v-for="(option, childindex) in ansItem.optionsList"
  213. :key="childindex"
  214. class="lisSty"
  215. @click="checkboxSelectChild(bankIndex, ansIndex, childindex)"
  216. >
  217. <view :class="{ checked: option.checked }" class="activeTI">{{ ast[childindex] }}</view>
  218. <rich-text :nodes="option.content"></rich-text>
  219. </view>
  220. </view>
  221. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
  222. <view v-if="bank.ques && bank.ques[ansIndex]">
  223. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  224. <text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
  225. {{ ast[childindex] }}
  226. </text>
  227. <rich-text :nodes="option.content"></rich-text>
  228. </view>
  229. </view>
  230. <view v-if="bank.ques[ansIndex]">
  231. <view class="pad_8 answer">
  232. <view>
  233. 正确答案:
  234. <text :key="ansItemIndex1" v-for="(ansItem1,ansItemIndex1) in bank.ans[ansIndex]">{{ ast[ansItem1 - 1] }}</text>
  235. </view>
  236. <view>
  237. 我的答案:
  238. <text :key="quesItemIndex" v-for="(quesItem,quesItemIndex) in bank.ques[ansIndex]">{{ ast[quesItem - 1] }}</text>
  239. </view>
  240. </view>
  241. <view class="pad_8 answerInfos">
  242. <view class="answerTitle">答案解析</view>
  243. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  244. </view>
  245. </view>
  246. </template>
  247. <template v-if="ansItem.type == 3">
  248. <view v-if="!bank.ques[ansIndex]">
  249. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex, childindex, bankIndex)">
  250. <view class="activeTI">{{ ast[childindex] }}</view>
  251. {{ option }}
  252. </view>
  253. </view>
  254. <view v-if="bank.ques[ansIndex]">
  255. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  256. <text
  257. :class="{
  258. right: childindex == bank.ques[ansIndex] || childindex == bank.ans[ansIndex],
  259. wrong: childindex == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  260. }"
  261. class="activeTI"
  262. >
  263. {{ ast[childindex] }}
  264. </text>
  265. {{ option }}
  266. </view>
  267. </view>
  268. <view v-if="bank.ques[ansIndex]">
  269. <view class="pad_8 answer">
  270. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  271. <view>我的答案:{{ ast[bank.ques[ansIndex]] }}</view>
  272. </view>
  273. <view class="pad_8 answerInfos">
  274. <view class="answerTitle">答案解析</view>
  275. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  276. </view>
  277. </view>
  278. </template>
  279. <!-- 简答题 -->
  280. <template v-if="ansItem.type == 5">
  281. <view class="ans">
  282. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  283. <view class="top flex">
  284. <image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/camera.png" mode=""></image>
  285. <view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
  286. <view class="submit" :class="{disabled:!ansItem.ansText.text && hasImgs(ansItem)}" @click="submitAnsChild(bankIndex, ansIndex)">确认答案</view>
  287. </view>
  288. <view class="textarea"><textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea></view>
  289. <view class="imgs">
  290. <view class="img" v-for="(img, imgIndex) in ansItem.ansText.imageList" :key="imgIndex">
  291. <text @click="deleteImgChild(imgIndex, bankIndex, ansIndex)">x</text>
  292. <image :src="$method.splitImgHost(img, true)"></image>
  293. </view>
  294. </view>
  295. </view>
  296. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex]">
  297. <view class="answerTitle">答案我的</view>
  298. {{ bank.ques[ansIndex].text }}
  299. <view class="imgs">
  300. <image class="img" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image>
  301. </view>
  302. </view>
  303. </view>
  304. <view v-if="bank.ques[ansIndex]">
  305. <view class="pad_8 answerInfos">
  306. <view class="answerTitle">答案解析</view>
  307. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  308. </view>
  309. </view>
  310. </template>
  311. </view>
  312. </view>
  313. </template>
  314. <view class="footer_btn">
  315. <view class="collect" :class="{ show: goodsId && !isFromVideo ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
  316. <view v-if="collectList[bankIndex]">
  317. <image src="/static/icon/collected.png" mode=""></image>
  318. <view>取消收藏</view>
  319. </view>
  320. <view v-if="!collectList[bankIndex]">
  321. <image src="/static/icon/collect.png" mode=""></image>
  322. <view>收藏</view>
  323. </view>
  324. </view>
  325. <view class="flex_center" @click="openFooterTab">
  326. <view class="up-icon">
  327. <image src="/static/up.png"></image>
  328. </view>
  329. 答题卡
  330. </view>
  331. <view class="collect show" @click="pdsubmit">
  332. <view>
  333. <image src="/static/jj.png" mode=""></image>
  334. <view>交卷</view>
  335. </view>
  336. </view>
  337. </view>
  338. </view>
  339. </swiper-item>
  340. </swiper>
  341. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  342. <view class="popupView">
  343. <view class="popupTops">
  344. <view class="topIcon"></view>
  345. 点击编号即可跳转至对应题目
  346. </view>
  347. <view class="popupContent">
  348. <scroll-view scroll-y="true" style="height: 506rpx;">
  349. <view class="boxSty">
  350. <view
  351. v-for="(item, index) in questionList"
  352. :key="index"
  353. @click="changeIndex(index)"
  354. :class="{ isRight: isRight(item, index), isWrong: isWrong(item, index) }"
  355. class="liListSty"
  356. >
  357. {{ index + 1 }}
  358. </view>
  359. </view>
  360. </scroll-view>
  361. </view>
  362. </view>
  363. </u-popup>
  364. <view class="dialog" v-if="showDialog">
  365. <image class="pointer" src="/static/pointer.png" mode=""></image>
  366. <view class="text">左右滑动切换上下题</view>
  367. <view class="btn" @click="showDialog = false">我知道了</view>
  368. </view>
  369. <view class="dialog-arrow" v-if="showArrow">
  370. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  371. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  372. <view class="btn" @click="showArrow = false">我知道了</view>
  373. </view>
  374. <view class="dialog_wrap" v-if="testOver">
  375. <view class="bg"></view>
  376. <view class="dialog">
  377. <view class="title">温馨提示</view>
  378. <view class="content">
  379. <view>您已完成所有题目,</view>
  380. <view>快去交卷吧!</view>
  381. </view>
  382. <view class="btns">
  383. <view class="btn" @click="noSubmit()">暂不交卷</view>
  384. <view class="btn active" @click="submitNow()">立即交卷</view>
  385. </view>
  386. </view>
  387. </view>
  388. <view class="dialog_wrap" v-if="isLastCount">
  389. <view class="bg"></view>
  390. <view class="dialog">
  391. <view class="title">温馨提示</view>
  392. <view class="content">
  393. <view>您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view>
  394. </view>
  395. <view class="btns">
  396. <view class="btn" @click="noLeave()">暂不离开</view>
  397. <view class="btn active" @click="leaveNow()">继续离开</view>
  398. </view>
  399. </view>
  400. </view>
  401. <u-popup v-model="showpopups" mode="center" border-radius="24" height="439rpx" width="640rpx" :mask-close-able="false">
  402. <view class="popboxs">
  403. <view class="classTops">温馨提示</view>
  404. <view class="textStys">
  405. {{
  406. cgType === 7
  407. ? '您还未交卷,确定结束做题吗?'
  408. : cgType === 8
  409. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  410. : cgType === 6
  411. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  412. : ''
  413. }}
  414. </view>
  415. <view class="classFootsty" v-if="cgType === 6">
  416. <view class="btnsty btns1" @click="submit">立即交卷</view>
  417. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  418. </view>
  419. <view class="classFootsty" v-if="cgType === 7">
  420. <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
  421. <view class="btnsty btns2" @click="backPages">结束做题</view>
  422. </view>
  423. <view class="classFootsty" v-if="cgType === 8">
  424. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  425. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  426. </view>
  427. </view>
  428. </u-popup>
  429. </view>
  430. </template>
  431. <script>
  432. export default {
  433. data() {
  434. return {
  435. showpopups: false,
  436. id: '',
  437. current: 0,
  438. questionList: [],
  439. ast: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
  440. judge: ['错误', '正确'],
  441. ans: [],
  442. ques: [],
  443. show: false,
  444. showDialog: false,
  445. bankList: [],
  446. collectList: [],
  447. goodsId: '',
  448. recordId: '',
  449. isSubmit: false,
  450. lastTime: 0, //剩余考试时长
  451. allTimes: 0, //总考试时长
  452. timer: null,
  453. wrongList: [],
  454. bankType: 0, //试卷类型
  455. needBack: false, //是否是考试
  456. testOver: false,
  457. isLastCount: false, //是否有未答题目
  458. lastCount: 0, //剩余没有回答的题目数
  459. chapterId: 0,
  460. moduleId: 0,
  461. showArrow:false, //退出提示
  462. isFromVideo:'',
  463. gradeId:'',
  464. cgType: 0 //对应设计稿弹窗编码
  465. };
  466. },
  467. onLoad(option) {
  468. this.current = +option.current || 0
  469. this.id = option.id;
  470. this.goodsId = option.goodsid;
  471. this.chapterId = option.chapterId;
  472. this.moduleId = option.moduleId;
  473. this.isFromVideo = option.isFromVideo||'';
  474. this.gradeId = option.gradeId || '';
  475. let isBack = option.isback;
  476. let showDialog = uni.getStorageSync('showDialog');
  477. if(showDialog) {
  478. this.showDialog = false;
  479. } else {
  480. this.showDialog = true;
  481. uni.setStorageSync('showDialog','1');
  482. }
  483. if (isBack) {
  484. let app = getApp();
  485. let globalData = app.globalData;
  486. for (var k in globalData.bankData) {
  487. this[k] = globalData.bankData[k];
  488. }
  489. this.showArrow = true;
  490. this.timer = setInterval(() => {
  491. if (this.lastTime <= 0) {
  492. clearInterval(this.timer);
  493. uni.showToast({
  494. icon:'none',
  495. mask:true,
  496. title:'考试时间到,自动交卷',
  497. duration:10000
  498. })
  499. this.submit();
  500. return;
  501. }
  502. this.lastTime--;
  503. }, 1000);
  504. } else {
  505. this.goodsQuestionList();
  506. this.bankExam();
  507. }
  508. },
  509. onUnload() {
  510. if (this.isSubmit) {
  511. clearInterval(this.timer)
  512. return;
  513. }
  514. //考试试卷 阻止ios手势返回,自动跳回答题页
  515. if (this.needBack) {
  516. let app = getApp();
  517. app.globalData.bankData = this.$data;
  518. clearInterval(this.timer);
  519. uni.navigateTo({
  520. url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
  521. });
  522. } else {
  523. //点击返回按钮确认允许退出,记录答题记录
  524. clearInterval(this.timer)
  525. this.examRecordEdit();
  526. }
  527. },
  528. methods: {
  529. /**
  530. * 是否有上传图片
  531. */
  532. hasImgs(bank) {
  533. return bank.ansText.imageList.length == 0;
  534. },
  535. /**
  536. * 获取试卷类型2考试,1练习
  537. */
  538. bankExam() {
  539. this.$api.bankExam(this.id).then(res => {
  540. this.bankType = res.data.data.doType;
  541. if (this.bankType == 2) {
  542. this.needBack = true;
  543. }
  544. });
  545. },
  546. /**
  547. * 点击后退按钮
  548. */
  549. clickLeft() {
  550. if (this.bankType == 1) {
  551. let ansCount = this.questionOverNum(true); //已答题数
  552. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  553. //所有题目答完
  554. if (this.lastCount == 0) {
  555. // this.testOver = true;
  556. this.cgType = 7;
  557. //未答完
  558. } else {
  559. this.cgType = 8;
  560. // this.isLastCount = true;
  561. }
  562. this.showpopups = true;
  563. } else if (this.bankType == 2) {
  564. let ansCount = this.questionOverNum(true); //已答题数
  565. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  566. //所有题目答完
  567. if (this.lastCount == 0) {
  568. this.testOver = true;
  569. //未答完
  570. } else {
  571. this.isLastCount = true;
  572. }
  573. }
  574. },
  575. /**
  576. * 返回上一页
  577. */
  578. backPages() {
  579. this.needBack = false;
  580. uni.navigateBack({
  581. delta: 1
  582. });
  583. },
  584. /**
  585. * 获取已经回答的题目数
  586. * hasSpecail (是否包含简答和案例)
  587. */
  588. questionOverNum(hasSpecail) {
  589. let count = 0;
  590. this.questionList.forEach(item => {
  591. if (item.type == 1 || item.type == 2 || item.type == 3) {
  592. if (item.ques) {
  593. count++;
  594. }
  595. } else if (item.type == 4) {
  596. //案例题
  597. if(hasSpecail) {
  598. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  599. if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
  600. if (item.ques[indexs]) {
  601. return true;
  602. } else {
  603. return false;
  604. }
  605. } else if (jsonItem.type == 5) {
  606. if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
  607. return true;
  608. } else {
  609. return false;
  610. }
  611. }
  612. });
  613. if (isOver) {
  614. count++;
  615. console.log(item, 444);
  616. }
  617. }
  618. } else if (item.type == 5) {
  619. //简答题
  620. if(hasSpecail) {
  621. if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
  622. count++;
  623. }
  624. }
  625. }
  626. });
  627. return count;
  628. },
  629. /**
  630. * 暂不交卷
  631. */
  632. noSubmit() {
  633. //设为允许退出页面
  634. this.needBack = false;
  635. uni.navigateBack({
  636. delta: 1
  637. });
  638. },
  639. /**
  640. * 不离开
  641. */
  642. noLeave() {
  643. this.isLastCount = false;
  644. },
  645. /**
  646. * 立即离开并交卷
  647. */
  648. leaveNow() {
  649. this.needBack = false;
  650. this.isSubmit = true;
  651. uni.navigateBack({
  652. delta: 1
  653. });
  654. let score = 0; //计算总分
  655. let reportStatus = 0;
  656. let number = 0; //做对的题目数量
  657. let doQuestionNum = 0; //做过的题目数量
  658. let allScore = 0; //总分
  659. let passScore = 0;
  660. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  661. let doQuestionIds = []; //做过的题目id
  662. let rightQuestionIds = []; //做对的题目id
  663. this.questionList.forEach((item, index) => {
  664. // passScore = item.passScore
  665. if (item.type == 1) {
  666. //正确
  667. if (item.ques == item.ans) {
  668. item.scoreResult = item.score;
  669. score += item.score;
  670. number++;
  671. rightQuestionIds.push(item.questionId)
  672. } else { //错误
  673. item.scoreResult = 0;
  674. doWrongQuestionIds.push(item.questionId)
  675. }
  676. allScore += item.score;
  677. if (item.ques) {
  678. doQuestionNum++;
  679. doQuestionIds.push(item.questionId)
  680. }
  681. } else if (item.type == 2) {
  682. let isRight =
  683. item.ans &&
  684. item.ans.every((quesItem, quesIndex) => {
  685. if(item.ques) {
  686. return item.ques[quesIndex] == item.ans[quesIndex];
  687. } else {
  688. return false;
  689. }
  690. });
  691. if (isRight) {
  692. score += item.score;
  693. number++;
  694. item.scoreResult = item.score;
  695. rightQuestionIds.push(item.questionId)
  696. } else {
  697. let checkboxScore = item.score; //获取单题总分数
  698. item.ques && item.ques.forEach((ques,quesIndex) => {
  699. //选错一个全扣
  700. if(item.ques) {
  701. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  702. checkboxScore = 0;
  703. }
  704. } else {
  705. checkboxScore = 0;
  706. }
  707. })
  708. console.log(checkboxScore)
  709. //没选错
  710. if(checkboxScore) {
  711. item.ans.forEach((ans,quesIndex) => {
  712. //漏选扣一部分
  713. if(item.ques) {
  714. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  715. checkboxScore -= item.partScore;
  716. }
  717. } else {
  718. checkboxScore = 0;
  719. }
  720. })
  721. }
  722. if(checkboxScore <= 0) { //0分
  723. item.scoreResult = 0;
  724. doWrongQuestionIds.push(item.questionId)
  725. } else { //部分分
  726. number++;
  727. item.scoreResult = checkboxScore;
  728. score += checkboxScore;
  729. rightQuestionIds.push(item.questionId)
  730. }
  731. }
  732. allScore += item.score;
  733. if (item.ques && item.ques.length) {
  734. doQuestionNum++;
  735. doQuestionIds.push(item.questionId)
  736. }
  737. } else if (item.type == 3) {
  738. if (item.ques == item.ans) {
  739. item.scoreResult = item.score;
  740. score += item.score;
  741. number++;
  742. rightQuestionIds.push(item.questionId)
  743. } else {
  744. item.scoreResult = 0;
  745. doWrongQuestionIds.push(item.questionId)
  746. }
  747. allScore += item.score;
  748. if (item.ques) {
  749. doQuestionNum++;
  750. doQuestionIds.push(item.questionId)
  751. }
  752. } else if (item.type == 4) {
  753. if (item.ques && item.ques.length) {
  754. doQuestionNum++;
  755. }
  756. } else if (item.type == 5) {
  757. if (item.ques) {
  758. doQuestionNum++;
  759. }
  760. }
  761. });
  762. //大于60分及格
  763. if(score >= 60) {
  764. reportStatus = 1
  765. } else {
  766. reportStatus = 0
  767. }
  768. //交卷
  769. this.$api
  770. .examRecordEdit({
  771. examId: this.id,
  772. goodsId: this.goodsId,
  773. reportStatus:reportStatus,
  774. recordId: this.recordId,
  775. rightQuestionNum: number,
  776. status: 1,
  777. moduleExamId:this.moduleId || 0,
  778. chapterExamId:this.chapterId || 0,
  779. doQuestionIds:doQuestionIds.join(','),
  780. rightQuestionIds:rightQuestionIds.join(','),
  781. doQuestionNum: doQuestionNum,
  782. performance: score,
  783. totalScore: allScore,
  784. examTime: parseInt(this.allTimes),
  785. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  786. historyExamJson: JSON.stringify(this.questionList)
  787. })
  788. .then(res => {
  789. this.isSubmit = true;
  790. if (res.data.code == 200) {
  791. }
  792. });
  793. //错题集id提交(客观题)
  794. this.$api.examWrongRecord({
  795. moduleExamId:this.moduleId || 0,
  796. chapterExamId:this.chapterId || 0,
  797. examId: this.id,
  798. goodsId: this.goodsId,
  799. questionIds: doWrongQuestionIds,
  800. recordId: this.recordId
  801. }).then(res => {
  802. });
  803. },
  804. /**
  805. * 立即交卷
  806. */
  807. submitNow() {
  808. this.showpopups = false;
  809. this.needBack = false;
  810. this.submit();
  811. },
  812. /**
  813. * 离开页面统计回答正确题数
  814. */
  815. examRecordEdit() {
  816. if (!this.isSubmit) {
  817. let number = 0;
  818. let score = 0;
  819. let doQuestionNum = 0;
  820. this.questionList.forEach((item, index) => {
  821. if (item.type == 1) {
  822. if (item.ques == item.ans) {
  823. score += item.score;
  824. number++;
  825. }
  826. if (item.ques) {
  827. doQuestionNum++;
  828. }
  829. } else if (item.type == 2) {
  830. let isRight =
  831. item.ans &&
  832. item.ans.every((quesItem, quesIndex) => {
  833. if(item.ques) {
  834. return item.ques[quesIndex] == item.ans[quesIndex];
  835. } else {
  836. return false;
  837. }
  838. });
  839. if (isRight) {
  840. score += item.score;
  841. number++;
  842. } else {
  843. let checkboxScore = item.score; //获取单题总分数
  844. item.ques && item.ques.forEach((ques,quesIndex) => {
  845. //选错一个全扣
  846. if(item.ques) {
  847. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  848. checkboxScore = 0;
  849. }
  850. } else {
  851. checkboxScore = 0;
  852. }
  853. })
  854. console.log(checkboxScore)
  855. //没选错
  856. if(checkboxScore) {
  857. item.ans.forEach((ans,quesIndex) => {
  858. //漏选扣一部分
  859. if(item.ques) {
  860. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  861. checkboxScore -= item.partScore;
  862. }
  863. } else {
  864. checkboxScore = 0;
  865. }
  866. })
  867. }
  868. if(checkboxScore <= 0) { //0分
  869. } else { //部分分
  870. number++;
  871. score += checkboxScore;
  872. }
  873. }
  874. if (item.ques && item.ques.length) {
  875. doQuestionNum++;
  876. }
  877. } else if (item.type == 3) {
  878. if (item.ques == item.ans) {
  879. score += item.score;
  880. number++;
  881. }
  882. if (item.ques) {
  883. doQuestionNum++;
  884. }
  885. } else if (item == 4) {
  886. if (item.ques.length) {
  887. doQuestionNum++;
  888. }
  889. } else if (item.type == 5) {
  890. if (item.ques) {
  891. doQuestionNum++;
  892. }
  893. }
  894. });
  895. this.$api
  896. .examRecordEdit({
  897. examId: this.id,
  898. goodsId: this.goodsId,
  899. recordId: this.recordId,
  900. rightQuestionNum: number,
  901. moduleExamId:this.moduleId || 0,
  902. chapterExamId:this.chapterId || 0,
  903. status: 0,
  904. doQuestionNum: doQuestionNum,
  905. historyExamJson: JSON.stringify(this.questionList)
  906. })
  907. .then(res => {});
  908. }
  909. },
  910. /**
  911. * 记录总题数
  912. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  913. */
  914. examRecord(hasSpecial) {
  915. let questionList = 0;
  916. if(!hasSpecial) {
  917. this.questionList.forEach((item, index) => {
  918. if(item.type == 1 || item.type == 2 || item.type == 3) {
  919. questionList++;
  920. }
  921. })
  922. } else {
  923. questionList = this.questionList.length;
  924. }
  925. if(this.isFromVideo) { //视频课程
  926. this.$api
  927. .bankRecord({
  928. chapterExamId: this.chapterId || 0,
  929. moduleExamId: this.moduleId || 0,
  930. examId: this.id,
  931. goodsId: this.goodsId,
  932. gradeId:this.gradeId,
  933. totalQuestionNum: questionList
  934. })
  935. .then(res => {
  936. this.recordId = res.data.data;
  937. });
  938. } else { //题库
  939. this.$api
  940. .examRecord({
  941. chapterExamId: this.chapterId || 0,
  942. moduleExamId: this.moduleId || 0,
  943. examId: this.id,
  944. goodsId: this.goodsId,
  945. totalQuestionNum: questionList
  946. })
  947. .then(res => {
  948. this.recordId = res.data.data;
  949. });
  950. }
  951. },
  952. /**
  953. * @param {Object} second倒计时过滤器
  954. */
  955. countdown(second) {
  956. if (second) {
  957. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  958. let m = parseInt((second / 60) % 60); // 计算分数
  959. let s = parseInt(second % 60); // 计算当前秒数
  960. if (h < 10) h = '0' + h;
  961. if (m < 10) m = '0' + m;
  962. if (s < 10) s = '0' + s;
  963. return h + ':' + m + ':' + s;
  964. } else {
  965. return '';
  966. }
  967. },
  968. /**
  969. * 请求题目列表
  970. */
  971. goodsQuestionList() {
  972. this.$api
  973. .goodsQuestionList({
  974. examId: this.id
  975. })
  976. .then(res => {
  977. if (!res.data.data.length) {
  978. this.hideDialog();
  979. uni.showModal({
  980. showCancel: false,
  981. content: '该试卷暂无题目',
  982. success: function(k) {
  983. if (k.confirm) {
  984. uni.navigateBack();
  985. }
  986. }
  987. });
  988. return;
  989. }
  990. this.allTimes = res.data.data[0].answerTime * 60;
  991. this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  992. //考试时间到了自动交卷
  993. if (this.lastTime) {
  994. this.timer = setInterval(() => {
  995. if (this.lastTime <= 0) {
  996. clearInterval(this.timer);
  997. uni.showToast({
  998. icon:'none',
  999. mask:true,
  1000. title:'考试时间到,自动交卷',
  1001. duration:10000
  1002. })
  1003. this.submit();
  1004. return;
  1005. }
  1006. this.lastTime--;
  1007. }, 1000);
  1008. } else {
  1009. }
  1010. res.data.data.forEach((item, index) => {
  1011. if (typeof item.jsonStr == 'string') {
  1012. item.jsonStr = JSON.parse(item.jsonStr);
  1013. if (item.type == 2) {
  1014. //多选
  1015. item.jsonStr.forEach(str => {
  1016. str.optionsId = '' + str.optionsId;
  1017. });
  1018. let arr = item.answerQuestion.split(',');
  1019. arr.forEach((a, i) => {
  1020. arr[i] = '' + a;
  1021. });
  1022. item.ans = arr;
  1023. return;
  1024. } else if (item.type == 5) {
  1025. //简答题
  1026. item.ansText = {
  1027. text: '',
  1028. imageList: []
  1029. };
  1030. } else if (item.type == 4) {
  1031. //案例题
  1032. console.log(item.jsonStr);
  1033. item.ques = [];
  1034. item.current = 0;
  1035. let ansArr = [];
  1036. item.jsonStr.forEach((json, index) => {
  1037. if (json.type == 1) {
  1038. ansArr[index] = json.answerQuestion;
  1039. } else if (json.type == 2) {
  1040. json.optionsList.forEach(str => {
  1041. str.optionsId = '' + str.optionsId;
  1042. });
  1043. let arr = json.answerQuestion.split(',');
  1044. arr.forEach((a, i) => {
  1045. arr[i] = '' + a;
  1046. });
  1047. ansArr[index] = arr;
  1048. } else if (json.type == 3) {
  1049. ansArr[index] = json.answerQuestion;
  1050. } else if (json.type == 5) {
  1051. ansArr[index] = {
  1052. text: '',
  1053. imageList: []
  1054. };
  1055. json.ansText = {
  1056. text: '',
  1057. imageList: []
  1058. };
  1059. }
  1060. });
  1061. item.ans = ansArr;
  1062. return;
  1063. }
  1064. item.ans = item.answerQuestion;
  1065. }
  1066. });
  1067. this.questionList = res.data.data;
  1068. this.lastCount = this.questionList.length;
  1069. this.examRecord();
  1070. this.getCollectInfo(this.current);
  1071. });
  1072. },
  1073. /**
  1074. * @param {Object} e单选点击
  1075. */
  1076. radioSelect(optionsId, bindex) {
  1077. if (this.questionList[bindex].ques) return;
  1078. this.$set(this.questionList[bindex], 'ques', optionsId);
  1079. // 回答错误
  1080. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1081. this.$api
  1082. .examWrongRecord({
  1083. examId: this.id,
  1084. goodsId: this.goodsId,
  1085. moduleExamId:this.moduleId || 0,
  1086. chapterExamId:this.chapterId || 0,
  1087. questionIds: [this.questionList[bindex].questionId],
  1088. recordId: this.recordId
  1089. })
  1090. .then(res => {});
  1091. } else {
  1092. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1093. // if(question) {
  1094. // this.$api.wrongRecordDelete({
  1095. // "examId": +this.id,
  1096. // "goodsId": +this.goodsId,
  1097. // "questionId": this.questionList[bindex].questionId,
  1098. // }).then(res => {
  1099. // })
  1100. // }
  1101. }
  1102. },
  1103. /**
  1104. * @param {Object} e案例单选点击
  1105. */
  1106. radioSelectChild(optionsId, ansIndex, bindex) {
  1107. if (this.questionList[bindex].ques[ansIndex]) return;
  1108. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1109. },
  1110. /**
  1111. * @param {Object} 多选点击
  1112. */
  1113. checkboxSelect(optionsId, bindex, index) {
  1114. this.$set(this.questionList[bindex].jsonStr[index], 'checked', !this.questionList[bindex].jsonStr[index].checked);
  1115. },
  1116. /**
  1117. * @param {Object} 案例多选点击
  1118. */
  1119. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1120. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
  1121. },
  1122. /**
  1123. * @param {Object} 多选确认
  1124. */
  1125. checkboxSubmit(bindex) {
  1126. if (this.questionList[bindex].ques) return;
  1127. let arr = [];
  1128. this.questionList[bindex].jsonStr.forEach(item => {
  1129. if (item.checked) {
  1130. arr.push(item.optionsId);
  1131. }
  1132. });
  1133. this.$set(this.questionList[bindex], 'ques', arr);
  1134. let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
  1135. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
  1136. });
  1137. // 回答错误
  1138. if (isWrong) {
  1139. this.$api
  1140. .examWrongRecord({
  1141. examId: this.id,
  1142. goodsId: this.goodsId,
  1143. moduleExamId:this.moduleId || 0,
  1144. chapterExamId:this.chapterId || 0,
  1145. questionIds: [this.questionList[bindex].questionId],
  1146. recordId: this.recordId
  1147. })
  1148. .then(res => {});
  1149. } else {
  1150. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1151. // if(question) {
  1152. // this.$api.wrongRecordDelete({
  1153. // "examId": +this.id,
  1154. // "goodsId": +this.goodsId,
  1155. // "questionId": this.questionList[bindex].questionId,
  1156. // }).then(res => {
  1157. // })
  1158. // }
  1159. }
  1160. },
  1161. /**
  1162. * @param {Object} 案例多选确认
  1163. */
  1164. checkboxSubmitChild(bindex, ansIndex) {
  1165. if (this.questionList[bindex].ques[ansIndex]) return;
  1166. let arr = [];
  1167. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  1168. if (item.checked) {
  1169. arr.push(item.optionsId);
  1170. }
  1171. });
  1172. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1173. },
  1174. /**
  1175. * @param {Object} index
  1176. * @param {Object} bindex
  1177. * 判断题
  1178. */
  1179. judgeSelect(index, bindex) {
  1180. if (this.questionList[bindex].ques) return;
  1181. this.$set(this.questionList[bindex], 'ques', index + '');
  1182. // 回答错误
  1183. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1184. this.$api
  1185. .examWrongRecord({
  1186. examId: this.id,
  1187. goodsId: this.goodsId,
  1188. moduleExamId:this.moduleId || 0,
  1189. chapterExamId:this.chapterId || 0,
  1190. questionIds:[this.questionList[bindex].questionId],
  1191. recordId: this.recordId
  1192. })
  1193. .then(res => {});
  1194. } else {
  1195. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1196. // if(question) {
  1197. // this.$api.wrongRecordDelete({
  1198. // "examId": +this.id,
  1199. // "goodsId": +this.goodsId,
  1200. // "questionId": this.questionList[bindex].questionId,
  1201. // }).then(res => {
  1202. // })
  1203. // }
  1204. }
  1205. },
  1206. /**
  1207. * @param {Object} ansindex
  1208. * @param {Object} childindex
  1209. * @param {Object} bindex
  1210. * 案例判断题
  1211. */
  1212. judgeSelectChild(ansindex, childindex, bindex) {
  1213. if (this.questionList[bindex].ques[ansindex]) return;
  1214. this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
  1215. },
  1216. openFooterTab() {
  1217. this.show = true;
  1218. },
  1219. changeIndex(index) {
  1220. this.current = index;
  1221. },
  1222. swiperChange(e) {
  1223. this.current = e.detail.current;
  1224. this.getCollectInfo(this.current);
  1225. },
  1226. /**
  1227. * @param {Object} current
  1228. * 获取收藏信息
  1229. */
  1230. getCollectInfo(current) {
  1231. this.$api
  1232. .getCollectInfo({
  1233. examId: this.id,
  1234. questionId: this.questionList[current].questionId,
  1235. goodsId: this.goodsId
  1236. })
  1237. .then(res => {
  1238. if (res.data.code == 500) {
  1239. this.$set(this.collectList, current, false);
  1240. } else if (res.data.code == 200) {
  1241. this.$set(this.collectList, current, res.data.data);
  1242. }
  1243. });
  1244. },
  1245. pdsubmit() {
  1246. // if (this.bankType == 1) {
  1247. let ansCount = this.questionOverNum(true); //已答题数
  1248. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1249. //没有答完
  1250. if (this.lastCount !== 0) {
  1251. this.cgType = 6;
  1252. this.showpopups = true;
  1253. return;
  1254. }
  1255. // }
  1256. this.submit();
  1257. },
  1258. /**
  1259. * 交卷
  1260. */
  1261. submit() {
  1262. let score = 0; //计算总分
  1263. let reportStatus = 0;
  1264. let number = 0; //做对的题目数量
  1265. let doQuestionNum = 0; //做过的题目数量
  1266. let allScore = 0; //总分
  1267. let passScore = 0;
  1268. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1269. let doQuestionIds = []; //做过的题目id
  1270. let rightQuestionIds = []; //做对的题目id
  1271. this.questionList.forEach((item, index) => {
  1272. passScore = item.passScore
  1273. if (item.type == 1) {
  1274. //正确
  1275. if (item.ques == item.ans) {
  1276. item.scoreResult = item.score;
  1277. score += item.score;
  1278. number++;
  1279. rightQuestionIds.push(item.questionId)
  1280. } else { //错误
  1281. item.scoreResult = 0;
  1282. doWrongQuestionIds.push(item.questionId)
  1283. }
  1284. allScore += item.score;
  1285. if (item.ques) {
  1286. doQuestionNum++;
  1287. doQuestionIds.push(item.questionId)
  1288. }
  1289. } else if (item.type == 2) {
  1290. let isRight =
  1291. item.ans &&
  1292. item.ans.every((quesItem, quesIndex) => {
  1293. if(item.ques) {
  1294. return item.ques[quesIndex] == item.ans[quesIndex];
  1295. } else {
  1296. return false;
  1297. }
  1298. });
  1299. if (isRight) {
  1300. score += item.score;
  1301. number++;
  1302. item.scoreResult = item.score;
  1303. rightQuestionIds.push(item.questionId)
  1304. } else {
  1305. let checkboxScore = item.score; //获取单题总分数
  1306. item.ques && item.ques.forEach((ques,quesIndex) => {
  1307. //选错一个全扣
  1308. if(item.ques) {
  1309. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1310. checkboxScore = 0;
  1311. }
  1312. } else {
  1313. checkboxScore = 0;
  1314. }
  1315. })
  1316. console.log(checkboxScore)
  1317. //没选错
  1318. if(checkboxScore) {
  1319. item.ans.forEach((ans,quesIndex) => {
  1320. //漏选扣一部分
  1321. if(item.ques) {
  1322. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1323. checkboxScore -= item.partScore;
  1324. }
  1325. } else {
  1326. checkboxScore = 0;
  1327. }
  1328. })
  1329. }
  1330. if(checkboxScore <= 0) { //0分
  1331. item.scoreResult = 0;
  1332. doWrongQuestionIds.push(item.questionId)
  1333. } else { //部分分
  1334. number++;
  1335. item.scoreResult = checkboxScore;
  1336. score += checkboxScore;
  1337. rightQuestionIds.push(item.questionId)
  1338. }
  1339. }
  1340. allScore += item.score;
  1341. if (item.ques && item.ques.length) {
  1342. doQuestionNum++;
  1343. doQuestionIds.push(item.questionId)
  1344. }
  1345. } else if (item.type == 3) {
  1346. if (item.ques == item.ans) {
  1347. item.scoreResult = item.score;
  1348. score += item.score;
  1349. number++;
  1350. rightQuestionIds.push(item.questionId)
  1351. } else {
  1352. item.scoreResult = 0;
  1353. doWrongQuestionIds.push(item.questionId)
  1354. }
  1355. allScore += item.score;
  1356. if (item.ques) {
  1357. doQuestionNum++;
  1358. doQuestionIds.push(item.questionId)
  1359. }
  1360. } else if (item.type == 4) {
  1361. if (item.ques && item.ques.length) {
  1362. doQuestionNum++;
  1363. }
  1364. } else if (item.type == 5) {
  1365. if (item.ques) {
  1366. doQuestionNum++;
  1367. }
  1368. }
  1369. });
  1370. //大于及格
  1371. if(score >= passScore) {
  1372. reportStatus = 1
  1373. } else {
  1374. reportStatus = 0
  1375. }
  1376. //交卷
  1377. this.$api
  1378. .examRecordEdit({
  1379. examId: this.id,
  1380. goodsId: this.goodsId,
  1381. reportStatus:reportStatus,
  1382. recordId: this.recordId,
  1383. rightQuestionNum: number,
  1384. status: 1,
  1385. moduleExamId:this.moduleId || 0,
  1386. chapterExamId:this.chapterId || 0,
  1387. doQuestionIds:doQuestionIds.join(','),
  1388. rightQuestionIds:rightQuestionIds.join(','),
  1389. doQuestionNum: doQuestionNum,
  1390. performance: score,
  1391. totalScore: allScore,
  1392. examTime: parseInt(this.allTimes),
  1393. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1394. historyExamJson: JSON.stringify(this.questionList)
  1395. })
  1396. .then(res => {
  1397. this.isSubmit = true;
  1398. if (res.data.code == 200) {
  1399. uni.showToast({
  1400. title: '交卷成功',
  1401. duration: 1000,
  1402. icon: 'none'
  1403. });
  1404. setTimeout(() => {
  1405. uni.redirectTo({
  1406. url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
  1407. });
  1408. }, 1000);
  1409. }
  1410. });
  1411. //错题集id提交(客观题)
  1412. this.$api.examWrongRecord({
  1413. examId: this.id,
  1414. goodsId: this.goodsId,
  1415. questionIds: doWrongQuestionIds,
  1416. recordId: this.recordId
  1417. }).then(res => {
  1418. });
  1419. },
  1420. /**
  1421. * @param {Object} state
  1422. * @param {Object} index
  1423. * 收藏
  1424. */
  1425. collect(state, index) {
  1426. if (!state) {
  1427. this.$api
  1428. .collectQuestion({
  1429. examId: this.id,
  1430. questionId: this.questionList[index].questionId,
  1431. goodsId: this.goodsId || ''
  1432. })
  1433. .then(res => {
  1434. if (res.data.code == 200) {
  1435. this.$set(this.collectList, index, true);
  1436. uni.showToast({
  1437. title: '收藏成功',
  1438. duration: 2000,
  1439. icon: 'none'
  1440. });
  1441. this.getCollectInfo(index)
  1442. }
  1443. });
  1444. } else {
  1445. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  1446. if (res.data.code == 200) {
  1447. this.$set(this.collectList, index, false);
  1448. uni.showToast({
  1449. title: '取消收藏成功',
  1450. duration: 2000,
  1451. icon: 'none'
  1452. });
  1453. }
  1454. });
  1455. }
  1456. return;
  1457. },
  1458. /**
  1459. * @param {Object} imgIndex
  1460. * @param {Object} bankIndex
  1461. * 删除简答图片
  1462. */
  1463. deleteImg(imgIndex, bankIndex) {
  1464. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1465. },
  1466. /**
  1467. * @param {Object} imgIndex
  1468. * @param {Object} bankIndex
  1469. * @param {Object} ansIndex
  1470. * 删除案例题简答图片
  1471. */
  1472. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1473. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex, 1);
  1474. },
  1475. /**
  1476. * @param {Object} bankindex
  1477. * 选择上传图片
  1478. */
  1479. chooseImg(bankindex) {
  1480. if(this.questionList[bankindex] && this.questionList[bankindex].ansText && this.questionList[bankindex].ansText.imageList.length >= 4) {
  1481. uni.showToast({
  1482. icon:'none',
  1483. title:'最多选择4张'
  1484. })
  1485. return;
  1486. }
  1487. uni.chooseImage({
  1488. count: 1, //默认9
  1489. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1490. sourceType: ['album', 'camera'], //从相册选择
  1491. success: res => {
  1492. let self = this;
  1493. // console.log(JSON.stringify(res.tempFilePaths));
  1494. let img = res.tempFilePaths[0];
  1495. uni.getImageInfo({
  1496. src: img,
  1497. success: async res => {
  1498. let canvasWidth = res.width; //图片原始长宽
  1499. let canvasHeight = res.height;
  1500. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1501. uni.compressImage({
  1502. src: img,
  1503. quality: 75,
  1504. width: '50%',
  1505. height: '50%',
  1506. success: async rest => {
  1507. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1508. this.questionList[bankindex].ansText.imageList.push(dir);
  1509. }
  1510. });
  1511. } else {
  1512. const dir = await self.uploadFile(img, 0);
  1513. this.questionList[bankindex].ansText.imageList.push(dir);
  1514. }
  1515. }
  1516. });
  1517. }
  1518. });
  1519. },
  1520. /**
  1521. * @param {Object} bankindex
  1522. * @param {Object} ansindex
  1523. * 案例题选择上传图片
  1524. */
  1525. chooseImgChild(bankindex, ansindex) {
  1526. if(this.questionList[bankindex].jsonStr[ansindex] && this.questionList[bankindex].jsonStr[ansindex].ansText && this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length >= 4) {
  1527. uni.showToast({
  1528. icon:'none',
  1529. title:'最多选择4张'
  1530. })
  1531. return;
  1532. }
  1533. uni.chooseImage({
  1534. count: 1, //默认9
  1535. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1536. sourceType: ['album', 'camera'], //从相册选择
  1537. success: res => {
  1538. let self = this;
  1539. // console.log(JSON.stringify(res.tempFilePaths));
  1540. let img = res.tempFilePaths[0];
  1541. uni.getImageInfo({
  1542. src: img,
  1543. success: async res => {
  1544. let canvasWidth = res.width; //图片原始长宽
  1545. let canvasHeight = res.height;
  1546. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1547. uni.compressImage({
  1548. src: img,
  1549. quality: 75,
  1550. width: '50%',
  1551. height: '50%',
  1552. success: async rest => {
  1553. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1554. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1555. }
  1556. });
  1557. } else {
  1558. const dir = await self.uploadFile(img, 0);
  1559. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1560. }
  1561. }
  1562. });
  1563. }
  1564. });
  1565. },
  1566. uploadFile(options, int) {
  1567. var self = this;
  1568. return new Promise((resolve, reject) => {
  1569. var data = {
  1570. imageStatus: int
  1571. };
  1572. self.$api.aliyunpolicy(data).then(res => {
  1573. console.log(res.data, 6);
  1574. if (res.data.code != 200) {
  1575. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  1576. return;
  1577. }
  1578. var ossToken = res.data.data.resultContent;
  1579. if (ossToken.host == null || ossToken.host == undefined) {
  1580. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  1581. return;
  1582. }
  1583. uni.uploadFile({
  1584. url: ossToken.host,
  1585. name: 'file',
  1586. filePath: options,
  1587. fileType: 'image',
  1588. header: {
  1589. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1590. },
  1591. formData: {
  1592. key: ossToken.dir,
  1593. OSSAccessKeyId: ossToken.accessid,
  1594. policy: ossToken.policy,
  1595. Signature: ossToken.signature,
  1596. callback: ossToken.callback,
  1597. success_action_status: 200
  1598. },
  1599. success: result => {
  1600. if (result.statusCode === 200) {
  1601. resolve(ossToken.dir);
  1602. } else {
  1603. uni.showToast({
  1604. title: '上传失败',
  1605. icon: 'none'
  1606. });
  1607. return;
  1608. }
  1609. },
  1610. fail: error => {
  1611. uni.showToast({
  1612. title: '上传接口报错' + error,
  1613. icon: 'none'
  1614. });
  1615. return;
  1616. }
  1617. });
  1618. });
  1619. });
  1620. },
  1621. /**
  1622. * @param {Object} type
  1623. * @param {Object} bankindex
  1624. * 简答题答案确认
  1625. */
  1626. submitAns(bankindex) {
  1627. console.log(this.questionList[bankindex]);
  1628. if (!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1629. uni.showToast({
  1630. title: '请输入内容或上传图片',
  1631. duration: 2000,
  1632. icon: 'none'
  1633. });
  1634. return;
  1635. }
  1636. this.$set(this.questionList[bankindex], 'ques', {
  1637. imageList: this.questionList[bankindex].ansText.imageList,
  1638. text: this.questionList[bankindex].ansText.text
  1639. });
  1640. },
  1641. /**
  1642. * @param {Object} bankindex
  1643. * @param {Object} ansindex
  1644. * 案例题简答答案确认
  1645. */
  1646. submitAnsChild(bankindex, ansindex) {
  1647. if (!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1648. uni.showToast({
  1649. title: '请输入内容或上传图片',
  1650. duration: 2000,
  1651. icon: 'none'
  1652. });
  1653. return;
  1654. }
  1655. this.$set(this.questionList[bankindex].ques, ansindex, {
  1656. imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1657. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
  1658. });
  1659. },
  1660. isRight(item, index) {
  1661. //单选
  1662. if (this.questionList[index].ques) {
  1663. if (item.type == 1) {
  1664. return this.questionList[index].ques == this.questionList[index].ans;
  1665. //多选
  1666. } else if (item.type == 2) {
  1667. //每一项都相等
  1668. return this.questionList[index].ques.every((item, i) => {
  1669. return item == this.questionList[index].ans[i];
  1670. });
  1671. //判断
  1672. } else if (item.type == 3) {
  1673. return this.questionList[index].ques == this.questionList[index].ans;
  1674. // } else if (item.type == 5) {
  1675. // if(this.questionList[index].ques.text){
  1676. // return true
  1677. // }else{
  1678. // return false
  1679. // }
  1680. } else {
  1681. return false;
  1682. }
  1683. } else {
  1684. return false;
  1685. }
  1686. },
  1687. right(bankIndex, ansIndex, option) {
  1688. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1689. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 || this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1) {
  1690. return true;
  1691. } else {
  1692. return false;
  1693. }
  1694. } else {
  1695. return false;
  1696. }
  1697. },
  1698. wrong(bankIndex, ansIndex, option) {
  1699. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1700. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 && this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1) {
  1701. return true;
  1702. } else {
  1703. return false;
  1704. }
  1705. } else {
  1706. return false;
  1707. }
  1708. },
  1709. isWrong(item, index) {
  1710. if (this.questionList[index].ques) {
  1711. //单选
  1712. if (item.type == 1) {
  1713. return this.questionList[index].ques != this.questionList[index].ans;
  1714. //多选
  1715. } else if (item.type == 2) {
  1716. //每一项都相等
  1717. return this.questionList[index].ques.some((item, index) => {
  1718. return item != this.questionList[index].ans;
  1719. });
  1720. //判断
  1721. } else if (item.type == 3) {
  1722. return this.questionList[index].ques != this.questionList[index].ans;
  1723. } else {
  1724. return false;
  1725. }
  1726. } else {
  1727. return false;
  1728. }
  1729. },
  1730. tabSelect(index, bankindex) {
  1731. this.$set(this.questionList[bankindex], 'current', index);
  1732. }
  1733. }
  1734. };
  1735. </script>
  1736. <style lang="scss" scoped>
  1737. .questionBank {
  1738. width:100%;
  1739. height:100vh;
  1740. display: flex;
  1741. flex-direction: column;
  1742. }
  1743. .swiper {
  1744. width: 100%;
  1745. flex:1;
  1746. }
  1747. .lisSty {
  1748. margin-bottom: 16rpx;
  1749. display: flex;
  1750. .flex_auto {
  1751. flex: 1;
  1752. }
  1753. }
  1754. .activeTI {
  1755. vertical-align: middle;
  1756. display: inline-block;
  1757. border: 1rpx solid #eee;
  1758. border-radius: 50rpx;
  1759. height: 48rpx;
  1760. line-height: 46rpx;
  1761. text-align: center;
  1762. width: 48rpx;
  1763. margin-right: 15rpx;
  1764. color: #666;
  1765. font-size: 30rpx;
  1766. &.right {
  1767. color: #fff;
  1768. background: green;
  1769. }
  1770. &.wrong {
  1771. color: #fff;
  1772. background: red;
  1773. }
  1774. &.checked {
  1775. color: #fff;
  1776. background: blue;
  1777. }
  1778. }
  1779. .submit_checkbox {
  1780. margin: 20rpx auto;
  1781. width: 526rpx;
  1782. height: 80rpx;
  1783. background: rgba(0, 122, 255, 1);
  1784. color: #fff;
  1785. text-align: center;
  1786. line-height: 80rpx;
  1787. font-size: 30rpx;
  1788. border-radius: 40rpx;
  1789. }
  1790. .titles {
  1791. overflow: hidden;
  1792. margin-bottom: 24rpx;
  1793. }
  1794. .titBox {
  1795. padding: 41rpx 25rpx 24rpx 25rpx;
  1796. }
  1797. .tabs {
  1798. margin: 10rpx;
  1799. display: flex;
  1800. .tab {
  1801. margin: 0 10rpx;
  1802. width: 96rpx;
  1803. height: 48rpx;
  1804. line-height: 48rpx;
  1805. text-align: center;
  1806. color: #007aff;
  1807. font-size: 28rpx;
  1808. border-radius: 16rpx;
  1809. &.current {
  1810. color: #fff;
  1811. background: #007aff;
  1812. }
  1813. }
  1814. }
  1815. .ans {
  1816. margin: 8rpx 8rpx 8rpx;
  1817. .ans_input {
  1818. border-radius: 16rpx;
  1819. background: #fff;
  1820. .top {
  1821. border-bottom: 1rpx solid #eeeeee;
  1822. padding: 16rpx;
  1823. display: flex;
  1824. align-items: center;
  1825. .icon {
  1826. margin-right: 20rpx;
  1827. width: 40rpx;
  1828. height: 38rpx;
  1829. }
  1830. .progress {
  1831. flex: 1;
  1832. }
  1833. .submit {
  1834. width: 168rpx;
  1835. height: 48rpx;
  1836. line-height: 48rpx;
  1837. text-align: center;
  1838. color: #fff;
  1839. font-size: 30rpx;
  1840. background: #007aff;
  1841. border-radius: 24rpx;
  1842. &.disabled {
  1843. opacity: 0.6;
  1844. }
  1845. }
  1846. }
  1847. .textarea {
  1848. textarea {
  1849. width: 100%;
  1850. height: 287rpx;
  1851. padding: 10rpx;
  1852. }
  1853. }
  1854. .imgs {
  1855. overflow: hidden;
  1856. display: flex;
  1857. width: 100%;
  1858. .img {
  1859. width: 104rpx;
  1860. height: 104rpx;
  1861. border-radius: 8rpx;
  1862. position: relative;
  1863. margin: 20rpx;
  1864. text {
  1865. position: absolute;
  1866. right: -15rpx;
  1867. top: -15rpx;
  1868. width: 30rpx;
  1869. height: 30rpx;
  1870. text-align: center;
  1871. line-height: 30rpx;
  1872. color: #fff;
  1873. background: red;
  1874. border-radius: 50%;
  1875. }
  1876. image {
  1877. width: 100%;
  1878. height: 100%;
  1879. }
  1880. }
  1881. }
  1882. }
  1883. .ans_submit {
  1884. padding: 16rpx;
  1885. border-radius: 16rpx;
  1886. background: #fff;
  1887. .imgs {
  1888. overflow: hidden;
  1889. display: flex;
  1890. width: 100%;
  1891. .img {
  1892. width: 104rpx;
  1893. height: 104rpx;
  1894. border-radius: 8rpx;
  1895. position: relative;
  1896. margin: 20rpx;
  1897. image {
  1898. width: 100%;
  1899. height: 100%;
  1900. }
  1901. }
  1902. }
  1903. }
  1904. }
  1905. .firstLetter {
  1906. display: flex;
  1907. justify-content: space-between;
  1908. align-items: center;
  1909. margin-bottom: 30rpx;
  1910. .leftLetters {
  1911. display: flex;
  1912. align-items: center;
  1913. width: 220rpx;
  1914. .btnType {
  1915. padding: 5rpx 10rpx;
  1916. border: 1rpx solid #007aff;
  1917. border-radius: 10rpx;
  1918. background-color: rgba(0, 122, 255, 0.1);
  1919. font-size: 28rpx;
  1920. color: #007aff;
  1921. margin-right: 15rpx;
  1922. }
  1923. }
  1924. }
  1925. .popupView {
  1926. height: 100%;
  1927. padding-bottom: 100rpx;
  1928. .popupTops {
  1929. height: 77rpx;
  1930. border-bottom: 1rpx solid #eee;
  1931. text-align: center;
  1932. line-height: 77rpx;
  1933. font-size: 24rpx;
  1934. color: #999;
  1935. position: relative;
  1936. .topIcon {
  1937. position: absolute;
  1938. top: 10rpx;
  1939. left: 50%;
  1940. transform: translateX(-50%);
  1941. width: 80rpx;
  1942. height: 8rpx;
  1943. background-color: #999;
  1944. border-radius: 4rpx;
  1945. }
  1946. }
  1947. .popupContent {
  1948. }
  1949. }
  1950. .pageContent {
  1951. position: relative;
  1952. background-color: #eaeef1;
  1953. height: 100%;
  1954. padding-top: 8rpx;
  1955. padding-bottom: 100rpx;
  1956. overflow-y: scroll;
  1957. }
  1958. .pad_8 {
  1959. background-color: #fff;
  1960. margin: 0rpx 8rpx 8rpx;
  1961. border-radius: 16rpx;
  1962. &.no-margin {
  1963. margin-top:-16rpx;
  1964. border-radius: 0 0 16rpx 16rpx;
  1965. }
  1966. }
  1967. .answer {
  1968. height: 80rpx;
  1969. line-height: 80rpx;
  1970. padding: 0rpx 24rpx;
  1971. display: flex;
  1972. align-items: center;
  1973. justify-content: space-between;
  1974. color: #666;
  1975. font-size: 30rpx;
  1976. }
  1977. .footer_btn {
  1978. background-color: #fff;
  1979. z-index: 10078;
  1980. position: fixed;
  1981. bottom: 0rpx;
  1982. display: flex;
  1983. align-items: center;
  1984. justify-content: space-between;
  1985. width: 100%;
  1986. height: 98rpx;
  1987. padding: 0rpx 38rpx;
  1988. border-top: 1rpx solid #eee;
  1989. .flex_center {
  1990. flex:1;
  1991. display: flex;
  1992. justify-content: center;
  1993. align-items: center;
  1994. flex-direction: column;
  1995. margin:0 200rpx;
  1996. font-size: 24rpx;
  1997. color: #999999;
  1998. .up-icon {
  1999. margin-bottom:18rpx;
  2000. width:100%;
  2001. display: flex;
  2002. justify-content: center;
  2003. image {
  2004. width:58rpx;
  2005. height:21rpx;
  2006. }
  2007. }
  2008. }
  2009. .collect {
  2010. visibility: hidden;
  2011. width:100rpx;
  2012. &.show {
  2013. visibility: visible;
  2014. }
  2015. >view {
  2016. display: flex;
  2017. flex-direction: column;
  2018. align-items: center;
  2019. justify-content: center;
  2020. image {
  2021. width:32rpx;
  2022. height:32rpx;
  2023. margin-bottom:6rpx;
  2024. }
  2025. view {
  2026. font-size: 24rpx;
  2027. color: #999999;
  2028. }
  2029. }
  2030. }
  2031. }
  2032. .boxSty {
  2033. padding: 44rpx 41rpx 0rpx;
  2034. }
  2035. .liListSty {
  2036. border: 1rpx solid #eeeeee;
  2037. width: 88rpx;
  2038. height: 88rpx;
  2039. border-radius: 32rpx;
  2040. text-align: center;
  2041. line-height: 88rpx;
  2042. color: #333;
  2043. font-size: 32rpx;
  2044. float: left;
  2045. margin: 20rpx 23rpx;
  2046. &.isRight {
  2047. border: 1rpx solid #eeeeee;
  2048. color: #fff;
  2049. background: green;
  2050. }
  2051. &.isWrong {
  2052. border: 1rpx solid #eeeeee;
  2053. color: #fff;
  2054. background: red;
  2055. }
  2056. }
  2057. .answerInfos {
  2058. padding: 25rpx 25rpx 25rpx 23rpx;
  2059. }
  2060. .answerTitle {
  2061. margin-bottom: 28rpx;
  2062. color: #666;
  2063. font-size: 30rpx;
  2064. }
  2065. .answerContent {
  2066. font-size: 30rpx;
  2067. color: #666;
  2068. }
  2069. .textChild {
  2070. display: inline-block;
  2071. vertical-align: middle;
  2072. }
  2073. .dialog {
  2074. position: fixed;
  2075. left: 0;
  2076. top: 0;
  2077. width: 100%;
  2078. height: 100%;
  2079. background-color: rgba(0, 0, 0, 0.8);
  2080. display: flex;
  2081. flex-direction: column;
  2082. align-items: center;
  2083. justify-content: center;
  2084. z-index: 20000;
  2085. .pointer {
  2086. width:338rpx;
  2087. height:240rpx;
  2088. }
  2089. .text {
  2090. font-size: 32rpx;
  2091. color: #ffffff;
  2092. text-align: center;
  2093. }
  2094. .btn {
  2095. width: 242rpx;
  2096. height: 82rpx;
  2097. border: 2rpx solid #ffffff;
  2098. border-radius: 16rpx;
  2099. text-align: center;
  2100. line-height: 82rpx;
  2101. margin: 41rpx auto;
  2102. color: #fff;
  2103. font-size: 32rpx;
  2104. }
  2105. }
  2106. .dialog-arrow {
  2107. padding-top:124rpx;
  2108. position: fixed;
  2109. left: 0;
  2110. top: 0;
  2111. width: 100%;
  2112. height: 100%;
  2113. background-color: rgba(0, 0, 0, 0.8);
  2114. z-index: 20000;
  2115. .pointer {
  2116. margin-left:87rpx;
  2117. display: block;
  2118. width:95rpx;
  2119. height:98rpx;
  2120. }
  2121. .text {
  2122. padding-left:177rpx;
  2123. font-size: 32rpx;
  2124. color: #ffffff;
  2125. }
  2126. .btn {
  2127. width: 242rpx;
  2128. height: 82rpx;
  2129. border: 2rpx solid #ffffff;
  2130. border-radius: 16rpx;
  2131. text-align: center;
  2132. line-height: 82rpx;
  2133. margin: 500rpx auto 0;
  2134. color: #fff;
  2135. font-size: 32rpx;
  2136. }
  2137. }
  2138. .dialog_wrap {
  2139. position: fixed;
  2140. left: 0;
  2141. top: 0;
  2142. width: 100%;
  2143. height: 100%;
  2144. z-index: 9999999999;
  2145. .bg {
  2146. background: rgba(0, 0, 0, 0.3);
  2147. position: absolute;
  2148. left: 0;
  2149. top: 0;
  2150. width: 100%;
  2151. height: 100%;
  2152. }
  2153. .dialog {
  2154. position: absolute;
  2155. left: 50%;
  2156. top: 50%;
  2157. transform: translate3D(-50%, -50%, 0);
  2158. width: 640rpx;
  2159. height: 439rpx;
  2160. background: #ffffff;
  2161. border-radius: 24rpx;
  2162. .title {
  2163. font-size: 30rpx;
  2164. font-weight: bold;
  2165. color: #333333;
  2166. line-height: 48rpx;
  2167. text-align: center;
  2168. margin-top: 40rpx;
  2169. }
  2170. .content {
  2171. margin: 35rpx 35rpx 0;
  2172. font-size: 30rpx;
  2173. color: #666666;
  2174. line-height: 48rpx;
  2175. }
  2176. .btns {
  2177. margin-top: 35rpx;
  2178. display: flex;
  2179. align-items: center;
  2180. justify-content: center;
  2181. .btn {
  2182. width: 200rpx;
  2183. height: 80rpx;
  2184. line-height: 80rpx;
  2185. text-align: center;
  2186. background: #f5f5f5;
  2187. border-radius: 40rpx;
  2188. font-size: 30rpx;
  2189. color: rgba(0, 122, 255, 1);
  2190. background: #f5f5f5;
  2191. margin: 0 20rpx;
  2192. &.active {
  2193. color: #f5f5f5;
  2194. background: rgba(0, 122, 255, 1);
  2195. }
  2196. }
  2197. }
  2198. }
  2199. }
  2200. .popboxs {
  2201. width: 100%;
  2202. height: 100%;
  2203. display: flex;
  2204. flex-direction: column;
  2205. align-items: center;
  2206. }
  2207. .classTops {
  2208. flex-shrink: 0;
  2209. padding: 39rpx 0rpx 4rpx;
  2210. font-weight: bold;
  2211. color: #333;
  2212. font-size: 30rpx;
  2213. }
  2214. .textStys {
  2215. width: 100%;
  2216. flex: 1;
  2217. padding: 36rpx;
  2218. }
  2219. .classFootsty {
  2220. flex-shrink: 0;
  2221. display: flex;
  2222. align-items: center;
  2223. justify-content: center;
  2224. padding: 10rpx 0rpx 40rpx;
  2225. .btnsty {
  2226. width: 200rpx;
  2227. height: 80rpx;
  2228. border-radius: 40rpx;
  2229. font-weight: bold;
  2230. font-size: 30rpx;
  2231. text-align: center;
  2232. line-height: 80rpx;
  2233. }
  2234. .btns1 {
  2235. background-color: #f5f5f5;
  2236. color: #007aff;
  2237. }
  2238. .btns2 {
  2239. margin-left: 40rpx;
  2240. background-color: #007aff;
  2241. color: #ffffff;
  2242. }
  2243. }
  2244. </style>