questionBank.vue 89 KB

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