questionBank.vue 63 KB

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