index.vue 94 KB

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