index.vue 91 KB

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