questionBank.vue 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488
  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. .flex_auto {
  1825. flex: 1;
  1826. }
  1827. }
  1828. .activeTI {
  1829. vertical-align: middle;
  1830. display: inline-block;
  1831. border: 1rpx solid #eee;
  1832. border-radius: 50rpx;
  1833. height: 48rpx;
  1834. line-height: 46rpx;
  1835. text-align: center;
  1836. width: 48rpx;
  1837. margin-right: 15rpx;
  1838. color: #666;
  1839. font-size: 30rpx;
  1840. &.right {
  1841. color: #fff;
  1842. background: green;
  1843. }
  1844. &.wrong {
  1845. color: #fff;
  1846. background: red;
  1847. }
  1848. &.checked {
  1849. color: #fff;
  1850. background: blue;
  1851. }
  1852. }
  1853. .submit_checkbox {
  1854. margin: 20rpx auto;
  1855. width: 526rpx;
  1856. height: 80rpx;
  1857. background: rgba(0, 122, 255, 1);
  1858. color: #fff;
  1859. text-align: center;
  1860. line-height: 80rpx;
  1861. font-size: 30rpx;
  1862. border-radius: 40rpx;
  1863. &.disabled {
  1864. opacity: 0.6;
  1865. }
  1866. }
  1867. .titles {
  1868. overflow: hidden;
  1869. margin-bottom: 24rpx;
  1870. }
  1871. .titBox {
  1872. padding: 41rpx 25rpx 24rpx 25rpx;
  1873. }
  1874. .titBox_title {
  1875. padding: 21rpx;
  1876. }
  1877. .tabs {
  1878. margin: 10rpx;
  1879. display: flex;
  1880. .tab {
  1881. margin: 0 4rpx;
  1882. padding:10rpx 13rpx;
  1883. text-align: center;
  1884. color: #007aff;
  1885. font-size: 28rpx;
  1886. border-radius: 16rpx;
  1887. background:#fff;
  1888. &.current {
  1889. color: #fff;
  1890. background: #007aff;
  1891. }
  1892. }
  1893. }
  1894. .ans {
  1895. margin: 8rpx 8rpx 8rpx;
  1896. .ans_input {
  1897. border-radius: 16rpx;
  1898. background: #fff;
  1899. .top {
  1900. border-bottom: 1rpx solid #eeeeee;
  1901. padding: 16rpx;
  1902. display: flex;
  1903. align-items: center;
  1904. .icon {
  1905. margin-right: 20rpx;
  1906. width: 40rpx;
  1907. height: 38rpx;
  1908. }
  1909. .progress {
  1910. flex: 1;
  1911. }
  1912. .submit {
  1913. width: 168rpx;
  1914. height: 48rpx;
  1915. line-height: 48rpx;
  1916. text-align: center;
  1917. color: #fff;
  1918. font-size: 30rpx;
  1919. background: #007aff;
  1920. border-radius: 24rpx;
  1921. &.disabled {
  1922. opacity: 0.6;
  1923. }
  1924. }
  1925. }
  1926. .textarea {
  1927. textarea {
  1928. width: 100%;
  1929. height: 287rpx;
  1930. padding: 10rpx;
  1931. }
  1932. }
  1933. .imgs {
  1934. overflow: hidden;
  1935. display: flex;
  1936. width: 100%;
  1937. .img {
  1938. width: 104rpx;
  1939. height: 104rpx;
  1940. border-radius: 8rpx;
  1941. position: relative;
  1942. margin: 20rpx;
  1943. text {
  1944. position: absolute;
  1945. right: -15rpx;
  1946. top: -15rpx;
  1947. width: 30rpx;
  1948. height: 30rpx;
  1949. text-align: center;
  1950. line-height: 30rpx;
  1951. color: #fff;
  1952. background: red;
  1953. border-radius: 50%;
  1954. }
  1955. image {
  1956. width: 100%;
  1957. height: 100%;
  1958. }
  1959. }
  1960. }
  1961. }
  1962. .ans_submit {
  1963. padding: 16rpx;
  1964. border-radius: 16rpx;
  1965. background: #fff;
  1966. .imgs {
  1967. overflow: hidden;
  1968. display: flex;
  1969. width: 100%;
  1970. .img {
  1971. width: 104rpx;
  1972. height: 104rpx;
  1973. border-radius: 8rpx;
  1974. position: relative;
  1975. margin: 20rpx;
  1976. image {
  1977. width: 100%;
  1978. height: 100%;
  1979. }
  1980. }
  1981. }
  1982. }
  1983. }
  1984. .firstLetter {
  1985. display: flex;
  1986. justify-content: space-between;
  1987. align-items: center;
  1988. margin-bottom: 30rpx;
  1989. .leftLetters {
  1990. display: flex;
  1991. align-items: center;
  1992. width: 220rpx;
  1993. .btnType {
  1994. padding: 5rpx 10rpx;
  1995. border: 1rpx solid #007aff;
  1996. border-radius: 10rpx;
  1997. background-color: rgba(0, 122, 255, 0.1);
  1998. font-size: 28rpx;
  1999. color: #007aff;
  2000. margin-right: 15rpx;
  2001. }
  2002. }
  2003. }
  2004. .popupView {
  2005. height: 100%;
  2006. padding-bottom: 100rpx;
  2007. .popupTops {
  2008. height: 77rpx;
  2009. border-bottom: 1rpx solid #eee;
  2010. text-align: center;
  2011. line-height: 77rpx;
  2012. font-size: 24rpx;
  2013. color: #999;
  2014. position: relative;
  2015. .topIcon {
  2016. position: absolute;
  2017. top: 10rpx;
  2018. left: 50%;
  2019. transform: translateX(-50%);
  2020. width: 80rpx;
  2021. height: 8rpx;
  2022. background-color: #999;
  2023. border-radius: 4rpx;
  2024. }
  2025. }
  2026. .popupContent {
  2027. }
  2028. }
  2029. .pageContent {
  2030. position: relative;
  2031. background-color: #eaeef1;
  2032. height: 100%;
  2033. padding-top: 8rpx;
  2034. padding-bottom: 100rpx;
  2035. overflow-y: scroll;
  2036. }
  2037. .pad_8 {
  2038. background-color: #fff;
  2039. margin: 0rpx 8rpx 8rpx;
  2040. border-radius: 16rpx;
  2041. &.no-margin {
  2042. margin-top:-16rpx;
  2043. border-radius: 0 0 16rpx 16rpx;
  2044. }
  2045. }
  2046. .answer {
  2047. height: 80rpx;
  2048. line-height: 80rpx;
  2049. padding: 0rpx 24rpx;
  2050. display: flex;
  2051. align-items: center;
  2052. justify-content: space-between;
  2053. color: #666;
  2054. font-size: 30rpx;
  2055. }
  2056. .footer_btn {
  2057. background-color: #fff;
  2058. z-index: 10078;
  2059. position: fixed;
  2060. bottom: 0rpx;
  2061. display: flex;
  2062. align-items: center;
  2063. justify-content: space-between;
  2064. width: 100%;
  2065. height: 98rpx;
  2066. padding: 0rpx 38rpx;
  2067. border-top: 1rpx solid #eee;
  2068. .flex_center {
  2069. flex:1;
  2070. display: flex;
  2071. justify-content: center;
  2072. align-items: center;
  2073. flex-direction: column;
  2074. margin:0 200rpx;
  2075. font-size: 24rpx;
  2076. color: #999999;
  2077. .up-icon {
  2078. margin-bottom:18rpx;
  2079. width:100%;
  2080. display: flex;
  2081. justify-content: center;
  2082. image {
  2083. width:58rpx;
  2084. height:21rpx;
  2085. }
  2086. }
  2087. }
  2088. .collect {
  2089. visibility: hidden;
  2090. width:100rpx;
  2091. &.show {
  2092. visibility: visible;
  2093. }
  2094. >view {
  2095. display: flex;
  2096. flex-direction: column;
  2097. align-items: center;
  2098. justify-content: center;
  2099. image {
  2100. width:32rpx;
  2101. height:32rpx;
  2102. margin-bottom:6rpx;
  2103. }
  2104. view {
  2105. font-size: 24rpx;
  2106. color: #999999;
  2107. }
  2108. }
  2109. }
  2110. }
  2111. .boxSty {
  2112. padding: 44rpx 41rpx 0rpx;
  2113. }
  2114. .liListSty {
  2115. border: 1rpx solid #eeeeee;
  2116. width: 88rpx;
  2117. height: 88rpx;
  2118. border-radius: 32rpx;
  2119. text-align: center;
  2120. line-height: 88rpx;
  2121. color: #333;
  2122. font-size: 32rpx;
  2123. float: left;
  2124. margin: 20rpx 23rpx;
  2125. &.isRight {
  2126. border: 1rpx solid #eeeeee;
  2127. color: #fff;
  2128. background: green;
  2129. }
  2130. &.isWrong {
  2131. border: 1rpx solid #eeeeee;
  2132. color: #fff;
  2133. background: red;
  2134. }
  2135. }
  2136. .answerInfos {
  2137. padding: 25rpx 25rpx 25rpx 23rpx;
  2138. }
  2139. .answerTitle {
  2140. margin-bottom: 28rpx;
  2141. color: #666;
  2142. font-size: 30rpx;
  2143. }
  2144. .answerContent {
  2145. font-size: 30rpx;
  2146. color: #666;
  2147. }
  2148. .textChild {
  2149. display: inline-block;
  2150. vertical-align: middle;
  2151. }
  2152. .dialog {
  2153. position: fixed;
  2154. left: 0;
  2155. top: 0;
  2156. width: 100%;
  2157. height: 100%;
  2158. background-color: rgba(0, 0, 0, 0.8);
  2159. display: flex;
  2160. flex-direction: column;
  2161. align-items: center;
  2162. justify-content: center;
  2163. z-index: 20000;
  2164. .pointer {
  2165. width:338rpx;
  2166. height:240rpx;
  2167. }
  2168. .text {
  2169. font-size: 32rpx;
  2170. color: #ffffff;
  2171. text-align: center;
  2172. }
  2173. .btn {
  2174. width: 242rpx;
  2175. height: 82rpx;
  2176. border: 2rpx solid #ffffff;
  2177. border-radius: 16rpx;
  2178. text-align: center;
  2179. line-height: 82rpx;
  2180. margin: 41rpx auto;
  2181. color: #fff;
  2182. font-size: 32rpx;
  2183. }
  2184. }
  2185. .dialog-arrow {
  2186. padding-top:124rpx;
  2187. position: fixed;
  2188. left: 0;
  2189. top: 0;
  2190. width: 100%;
  2191. height: 100%;
  2192. background-color: rgba(0, 0, 0, 0.8);
  2193. z-index: 20000;
  2194. .pointer {
  2195. margin-left:87rpx;
  2196. display: block;
  2197. width:95rpx;
  2198. height:98rpx;
  2199. }
  2200. .text {
  2201. padding-left:177rpx;
  2202. font-size: 32rpx;
  2203. color: #ffffff;
  2204. }
  2205. .btn {
  2206. width: 242rpx;
  2207. height: 82rpx;
  2208. border: 2rpx solid #ffffff;
  2209. border-radius: 16rpx;
  2210. text-align: center;
  2211. line-height: 82rpx;
  2212. margin: 500rpx auto 0;
  2213. color: #fff;
  2214. font-size: 32rpx;
  2215. }
  2216. }
  2217. .dialog_wrap {
  2218. position: fixed;
  2219. left: 0;
  2220. top: 0;
  2221. width: 100%;
  2222. height: 100%;
  2223. z-index: 9999999999;
  2224. .bg {
  2225. background: rgba(0, 0, 0, 0.3);
  2226. position: absolute;
  2227. left: 0;
  2228. top: 0;
  2229. width: 100%;
  2230. height: 100%;
  2231. }
  2232. .dialog {
  2233. position: absolute;
  2234. left: 50%;
  2235. top: 50%;
  2236. transform: translate3D(-50%, -50%, 0);
  2237. width: 640rpx;
  2238. height: 439rpx;
  2239. background: #ffffff;
  2240. border-radius: 24rpx;
  2241. .title {
  2242. font-size: 30rpx;
  2243. font-weight: bold;
  2244. color: #333333;
  2245. line-height: 48rpx;
  2246. text-align: center;
  2247. margin-top: 40rpx;
  2248. }
  2249. .content {
  2250. margin: 35rpx 35rpx 0;
  2251. font-size: 30rpx;
  2252. color: #666666;
  2253. line-height: 48rpx;
  2254. }
  2255. .btns {
  2256. margin-top: 35rpx;
  2257. display: flex;
  2258. align-items: center;
  2259. justify-content: center;
  2260. .btn {
  2261. width: 200rpx;
  2262. height: 80rpx;
  2263. line-height: 80rpx;
  2264. text-align: center;
  2265. background: #f5f5f5;
  2266. border-radius: 40rpx;
  2267. font-size: 30rpx;
  2268. color: rgba(0, 122, 255, 1);
  2269. background: #f5f5f5;
  2270. margin: 0 20rpx;
  2271. &.active {
  2272. color: #f5f5f5;
  2273. background: rgba(0, 122, 255, 1);
  2274. }
  2275. }
  2276. }
  2277. }
  2278. }
  2279. .popboxs {
  2280. width: 100%;
  2281. height: 100%;
  2282. display: flex;
  2283. flex-direction: column;
  2284. align-items: center;
  2285. }
  2286. .classTops {
  2287. flex-shrink: 0;
  2288. padding: 39rpx 0rpx 4rpx;
  2289. font-weight: bold;
  2290. color: #333;
  2291. font-size: 30rpx;
  2292. }
  2293. .textStys {
  2294. width: 100%;
  2295. flex: 1;
  2296. padding: 36rpx;
  2297. }
  2298. .classFootsty {
  2299. flex-shrink: 0;
  2300. display: flex;
  2301. align-items: center;
  2302. justify-content: center;
  2303. padding: 10rpx 0rpx 40rpx;
  2304. .btnsty {
  2305. width: 200rpx;
  2306. height: 80rpx;
  2307. border-radius: 40rpx;
  2308. font-weight: bold;
  2309. font-size: 30rpx;
  2310. text-align: center;
  2311. line-height: 80rpx;
  2312. }
  2313. .btns1 {
  2314. background-color: #f5f5f5;
  2315. color: #007aff;
  2316. }
  2317. .btns2 {
  2318. margin-left: 40rpx;
  2319. background-color: #007aff;
  2320. color: #ffffff;
  2321. }
  2322. }
  2323. </style>