questionBank.vue 57 KB

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