index.vue 91 KB

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