questionBank.vue 93 KB

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