questionBank.vue 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388
  1. <template>
  2. <view id="questionBank">
  3. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
  4. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  5. <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
  6. <view class="pageContent">
  7. <view class="pad_8 titBox">
  8. <view class="firstLetter">
  9. <view class="leftLetters">
  10. <view class="btnType">
  11. <text v-if="bank.type == 1">单选</text>
  12. <text v-if="bank.type == 2">多选</text>
  13. <text v-if="bank.type == 3">判断</text>
  14. <text v-if="bank.type == 4">案例</text>
  15. <text v-if="bank.type == 5">简答</text>
  16. </view>
  17. <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
  18. </view>
  19. <view style="color: #666;font-size: 28rpx;">{{ countdown(lastTime) }}</view>
  20. <view class="leftLetters"></view>
  21. </view>
  22. <view class="titles"><rich-text :nodes="bank.content"></rich-text></view>
  23. </view>
  24. <template v-if="bank.type == 1">
  25. <view class="pad_8 titBox no-margin">
  26. <view v-if="!bank.ques">
  27. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId, bankIndex)">
  28. <view class="activeTI">{{ ast[index] }}</view>
  29. <view class="flex_auto">{{ item.content }}</view>
  30. </view>
  31. </view>
  32. <view v-if="bank.ques">
  33. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  34. <text
  35. :class="{ right: item.optionsId == bank.ques || item.optionsId == bank.ans, wrong: item.optionsId == bank.ques && bank.ques != bank.ans }"
  36. class="activeTI"
  37. >
  38. {{ ast[index] }}
  39. </text>
  40. <view class="flex_auto">{{ item.content }}</view>
  41. </view>
  42. </view>
  43. <view v-if="bank.ques">
  44. <view class="pad_8 answer">
  45. <view>正确答案:{{ ast[bank.ans - 1] }}</view>
  46. <view>我的答案:{{ ast[bank.ques - 1] }}</view>
  47. </view>
  48. <view class="pad_8 answerInfos">
  49. <view class="answerTitle">答案解析</view>
  50. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <template v-if="bank.type == 2">
  56. <view class="pad_8 titBox no-margin">
  57. <view v-if="!bank.ques">
  58. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId, bankIndex, index)">
  59. <view :class="{ checked: item.checked }" class="activeTI">{{ ast[index] }}</view>
  60. <view class="flex_auto">{{ item.content }}</view>
  61. </view>
  62. </view>
  63. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">确认答案</view>
  64. <view v-if="bank.ques">
  65. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  66. <text
  67. :class="{
  68. right: bank.ques.indexOf(item.optionsId) != -1 || bank.ans.indexOf(item.optionsId) != -1,
  69. wrong: bank.ques.indexOf(item.optionsId) != -1 && bank.ans.indexOf(item.optionsId) == -1
  70. }"
  71. class="activeTI"
  72. >
  73. {{ ast[index] }}
  74. </text>
  75. <view class="flex_auto">{{ item.content }}</view>
  76. </view>
  77. </view>
  78. <view v-if="bank.ques">
  79. <view class="pad_8 answer">
  80. <view>
  81. 正确答案:
  82. <text v-for="(ansItem,ansIndex) in bank.ans" :key="ansIndex">{{ ast[ansItem - 1] }}</text>
  83. </view>
  84. <view>
  85. 我的答案:
  86. <text v-for="(quesItem,quesIndex) in bank.ques" :key="quesIndex">{{ ast[quesItem - 1] }}</text>
  87. </view>
  88. </view>
  89. <view class="pad_8 answerInfos">
  90. <view class="answerTitle">答案解析</view>
  91. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-if="bank.type == 3">
  97. <view class="pad_8 titBox no-margin">
  98. <view v-if="!bank.ques">
  99. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index, bankIndex)">
  100. <view class="activeTI">{{ ast[index] }}</view>
  101. {{ item }}
  102. </view>
  103. </view>
  104. <view v-if="bank.ques">
  105. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  106. <text :class="{ right: index == bank.ques || index == bank.ans, wrong: index == bank.ques && bank.ques != bank.ans }" class="activeTI">
  107. {{ ast[index] }}
  108. </text>
  109. {{ item }}
  110. </view>
  111. </view>
  112. <view v-if="bank.ques">
  113. <view class="pad_8 answer">
  114. <view>正确答案:{{ ast[bank.ans] }}</view>
  115. <view>我的答案:{{ ast[bank.ques] }}</view>
  116. </view>
  117. <view class="pad_8 answerInfos">
  118. <view class="answerTitle">答案解析</view>
  119. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  120. </view>
  121. </view>
  122. </view>
  123. </template>
  124. <!-- 简答题 -->
  125. <template v-if="bank.type == 5">
  126. <view class="pad_8 titBox">
  127. <view class="ans">
  128. <view class="ans_input" v-if="!bank.ques">
  129. <view class="top flex">
  130. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/camera.png" mode=""></image>
  131. <view class="progress">{{bank.ansText.imageList.length || '0'}}/4</view>
  132. <view class="submit" :class="{disabled:!bank.ansText.text && hasImgs(bank)}" @click="submitAns(bankIndex)">确认答案</view>
  133. </view>
  134. <view class="textarea"><textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea></view>
  135. <view class="imgs">
  136. <view class="img" v-for="(img, imgIndex) in bank.ansText.imageList" :key="imgIndex">
  137. <text @click="deleteImg(imgIndex, bankIndex)">x</text>
  138. <image :src="$method.splitImgHost(img, true)"></image>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="ans_submit answerInfos" v-if="bank.ques">
  143. <view class="answerTitle">我的答案:</view>
  144. {{ bank.ques.text }}
  145. <view class="imgs"><image class="img" :key="quesIndex" v-for="(ques,quesIndex) in bank.ques.imageList" :src="$method.splitImgHost(ques, true)"></image></view>
  146. </view>
  147. </view>
  148. <view v-if="bank.ques">
  149. <view class="pad_8 answerInfos">
  150. <view class="answerTitle">答案解析:</view>
  151. <view class="answerContent"><rich-text :nodes="bank.analysisContent"></rich-text></view>
  152. </view>
  153. </view>
  154. </view>
  155. </template>
  156. <!-- 案例题 -->
  157. <template v-if="bank.type == 4">
  158. <view class="pad_8 titBox">
  159. <view class="tabs">
  160. <view
  161. class="tab"
  162. :class="{ current: tabIndex == bank.current }"
  163. :key="tabIndex"
  164. v-for="(tab, tabIndex) in bank.jsonStr"
  165. @click="tabSelect(tabIndex, bankIndex)"
  166. >
  167. 问题{{ tabIndex }}
  168. </view>
  169. </view>
  170. <view v-for="(ansItem, ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  171. <view class="titles"><rich-text :nodes="ansItem.content"></rich-text></view>
  172. <template v-if="ansItem.type == 1">
  173. <view v-if="!bank.ques[ansIndex]">
  174. <view
  175. v-for="(option, childIndex) in ansItem.optionsList"
  176. :key="childIndex"
  177. class="lisSty"
  178. @click="radioSelectChild(option.optionsId, ansIndex, bankIndex)"
  179. >
  180. <view class="activeTI">{{ ast[childIndex] }}</view>
  181. <rich-text class="textChild" :nodes="option.content"></rich-text>
  182. </view>
  183. </view>
  184. <view v-if="bank.ques[ansIndex]">
  185. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty">
  186. <text
  187. :class="{
  188. right: option.optionsId == bank.ques[ansIndex] || option.optionsId == bank.ans[ansIndex],
  189. wrong: option.optionsId == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  190. }"
  191. class="activeTI"
  192. >
  193. {{ ast[childIndex] }}
  194. </text>
  195. <rich-text :nodes="option.content"></rich-text>
  196. </view>
  197. </view>
  198. <view v-if="bank.ques[ansIndex]">
  199. <view class="pad_8 answer">
  200. <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
  201. <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
  202. </view>
  203. <view class="pad_8 answerInfos">
  204. <view class="answerTitle">答案解析</view>
  205. <view class="answerContent"><rich-text :nodes="option.analysisContent"></rich-text></view>
  206. </view>
  207. </view>
  208. </template>
  209. <template v-if="ansItem.type == 2">
  210. <view v-if="!bank.ques[ansIndex]">
  211. <view
  212. v-for="(option, childindex) in ansItem.optionsList"
  213. :key="childindex"
  214. class="lisSty"
  215. @click="checkboxSelectChild(bankIndex, ansIndex, childindex)"
  216. >
  217. <view :class="{ checked: option.checked }" class="activeTI">{{ ast[childindex] }}</view>
  218. <rich-text :nodes="option.content"></rich-text>
  219. </view>
  220. </view>
  221. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex, ansIndex)">确认答案</view>
  222. <view v-if="bank.ques && bank.ques[ansIndex]">
  223. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  224. <text :class="{ right: right(bankIndex, ansIndex, option), wrong: wrong(bankIndex, ansIndex, option) }" class="activeTI">
  225. {{ ast[childindex] }}
  226. </text>
  227. <rich-text :nodes="option.content"></rich-text>
  228. </view>
  229. </view>
  230. <view v-if="bank.ques[ansIndex]">
  231. <view class="pad_8 answer">
  232. <view>
  233. 正确答案:
  234. <text :key="ansItemIndex1" v-for="(ansItem1,ansItemIndex1) in bank.ans[ansIndex]">{{ ast[ansItem1 - 1] }}</text>
  235. </view>
  236. <view>
  237. 我的答案:
  238. <text :key="quesItemIndex" v-for="(quesItem,quesItemIndex) in bank.ques[ansIndex]">{{ ast[quesItem - 1] }}</text>
  239. </view>
  240. </view>
  241. <view class="pad_8 answerInfos">
  242. <view class="answerTitle">答案解析</view>
  243. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  244. </view>
  245. </view>
  246. </template>
  247. <template v-if="ansItem.type == 3">
  248. <view v-if="!bank.ques[ansIndex]">
  249. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex, childindex, bankIndex)">
  250. <view class="activeTI">{{ ast[childindex] }}</view>
  251. {{ option }}
  252. </view>
  253. </view>
  254. <view v-if="bank.ques[ansIndex]">
  255. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  256. <text
  257. :class="{
  258. right: childindex == bank.ques[ansIndex] || childindex == bank.ans[ansIndex],
  259. wrong: childindex == bank.ques[ansIndex] && bank.ques[ansIndex] != bank.ans[ansIndex]
  260. }"
  261. class="activeTI"
  262. >
  263. {{ ast[childindex] }}
  264. </text>
  265. {{ option }}
  266. </view>
  267. </view>
  268. <view v-if="bank.ques[ansIndex]">
  269. <view class="pad_8 answer">
  270. <view>正确答案:{{ ast[bank.ans[ansIndex]] }}</view>
  271. <view>我的答案:{{ ast[bank.ques[ansIndex]] }}</view>
  272. </view>
  273. <view class="pad_8 answerInfos">
  274. <view class="answerTitle">答案解析</view>
  275. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  276. </view>
  277. </view>
  278. </template>
  279. <!-- 简答题 -->
  280. <template v-if="ansItem.type == 5">
  281. <view class="ans">
  282. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  283. <view class="top flex">
  284. <image class="icon" @click="chooseImgChild(bankIndex, ansIndex)" src="/static/camera.png" mode=""></image>
  285. <view class="progress">{{ansItem.ansText.imageList.length || '0'}}/4</view>
  286. <view class="submit" :class="{disabled:!ansItem.ansText.text && hasImgs(ansItem)}" @click="submitAnsChild(bankIndex, ansIndex)">确认答案</view>
  287. </view>
  288. <view class="textarea"><textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea></view>
  289. <view class="imgs">
  290. <view class="img" v-for="(img, imgIndex) in ansItem.ansText.imageList" :key="imgIndex">
  291. <text @click="deleteImgChild(imgIndex, bankIndex, ansIndex)">x</text>
  292. <image :src="$method.splitImgHost(img, true)"></image>
  293. </view>
  294. </view>
  295. </view>
  296. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex]">
  297. <view class="answerTitle">答案我的</view>
  298. {{ bank.ques[ansIndex].text }}
  299. <view class="imgs">
  300. <image class="img" v-for="(ques,quesIndex) in bank.ques[ansIndex].imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image>
  301. </view>
  302. </view>
  303. </view>
  304. <view v-if="bank.ques[ansIndex]">
  305. <view class="pad_8 answerInfos">
  306. <view class="answerTitle">答案解析</view>
  307. <view class="answerContent"><rich-text :nodes="ansItem.analysisContent"></rich-text></view>
  308. </view>
  309. </view>
  310. </template>
  311. </view>
  312. </view>
  313. </template>
  314. <view class="footer_btn">
  315. <view class="collect" :class="{ show: goodsId && !isFromVideo ? true : false }" @click="collect(collectList[bankIndex], bankIndex)">
  316. <view v-if="collectList[bankIndex]">
  317. <image src="/static/icon/collected.png" mode=""></image>
  318. <view>取消收藏</view>
  319. </view>
  320. <view v-if="!collectList[bankIndex]">
  321. <image src="/static/icon/collect.png" mode=""></image>
  322. <view>收藏</view>
  323. </view>
  324. </view>
  325. <view class="flex_center" @click="openFooterTab">
  326. <view class="up-icon">
  327. <image src="/static/up.png"></image>
  328. </view>
  329. 答题卡
  330. </view>
  331. <view class="collect show" @click="pdsubmit">
  332. <view>
  333. <image src="/static/jj.png" mode=""></image>
  334. <view>交卷</view>
  335. </view>
  336. </view>
  337. </view>
  338. </view>
  339. </swiper-item>
  340. </swiper>
  341. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  342. <view class="popupView">
  343. <view class="popupTops">
  344. <view class="topIcon"></view>
  345. 点击编号即可跳转至对应题目
  346. </view>
  347. <view class="popupContent">
  348. <scroll-view scroll-y="true" style="height: 506rpx;">
  349. <view class="boxSty">
  350. <view
  351. v-for="(item, index) in questionList"
  352. :key="index"
  353. @click="changeIndex(index)"
  354. :class="{ isRight: isRight(item, index), isWrong: isWrong(item, index) }"
  355. class="liListSty"
  356. >
  357. {{ index + 1 }}
  358. </view>
  359. </view>
  360. </scroll-view>
  361. </view>
  362. </view>
  363. </u-popup>
  364. <view class="dialog" v-if="showDialog">
  365. <image class="pointer" src="/static/pointer.png" mode=""></image>
  366. <view class="text">左右滑动切换上下题</view>
  367. <view class="btn" @click="showDialog = false">我知道了</view>
  368. </view>
  369. <view class="dialog-arrow" v-if="showArrow">
  370. <image class="pointer" src="/static/arrow-left.png" mode=""></image>
  371. <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
  372. <view class="btn" @click="showArrow = false">我知道了</view>
  373. </view>
  374. <view class="dialog_wrap" v-if="testOver">
  375. <view class="bg"></view>
  376. <view class="dialog">
  377. <view class="title">温馨提示</view>
  378. <view class="content">
  379. <view>您已完成所有题目,</view>
  380. <view>快去交卷吧!</view>
  381. </view>
  382. <view class="btns">
  383. <view class="btn" @click="noSubmit()">暂不交卷</view>
  384. <view class="btn active" @click="submitNow()">立即交卷</view>
  385. </view>
  386. </view>
  387. </view>
  388. <view class="dialog_wrap" v-if="isLastCount">
  389. <view class="bg"></view>
  390. <view class="dialog">
  391. <view class="title">温馨提示</view>
  392. <view class="content">
  393. <view>您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view>
  394. </view>
  395. <view class="btns">
  396. <view class="btn" @click="noLeave()">暂不离开</view>
  397. <view class="btn active" @click="leaveNow()">继续离开</view>
  398. </view>
  399. </view>
  400. </view>
  401. <u-popup v-model="showpopups" mode="center" border-radius="24" height="439rpx" width="640rpx" :mask-close-able="false">
  402. <view class="popboxs">
  403. <view class="classTops">温馨提示</view>
  404. <view class="textStys">
  405. {{
  406. cgType === 7
  407. ? '您还未交卷,确定结束做题吗?'
  408. : cgType === 8
  409. ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
  410. : cgType === 6
  411. ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
  412. : ''
  413. }}
  414. </view>
  415. <view class="classFootsty" v-if="cgType === 6">
  416. <view class="btnsty btns1" @click="submit">立即交卷</view>
  417. <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
  418. </view>
  419. <view class="classFootsty" v-if="cgType === 7">
  420. <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
  421. <view class="btnsty btns2" @click="backPages">结束做题</view>
  422. </view>
  423. <view class="classFootsty" v-if="cgType === 8">
  424. <view class="btnsty btns1" @click="backPages()">下次继续</view>
  425. <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
  426. </view>
  427. </view>
  428. </u-popup>
  429. </view>
  430. </template>
  431. <script>
  432. export default {
  433. data() {
  434. return {
  435. showpopups: false,
  436. id: '',
  437. current: 0,
  438. questionList: [],
  439. ast: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
  440. judge: ['错误', '正确'],
  441. ans: [],
  442. ques: [],
  443. show: false,
  444. showDialog: false,
  445. bankList: [],
  446. collectList: [],
  447. goodsId: '',
  448. recordId: '',
  449. isSubmit: false,
  450. lastTime: 0, //剩余考试时长
  451. allTimes: 0, //总考试时长
  452. timer: null,
  453. wrongList: [],
  454. bankType: 0, //试卷类型
  455. needBack: false, //是否是考试
  456. testOver: false,
  457. isLastCount: false, //是否有未答题目
  458. lastCount: 0, //剩余没有回答的题目数
  459. chapterId: 0,
  460. moduleId: 0,
  461. showArrow:false, //退出提示
  462. isFromVideo:'',
  463. gradeId:'',
  464. cgType: 0 //对应设计稿弹窗编码
  465. };
  466. },
  467. onLoad(option) {
  468. this.id = option.id;
  469. this.goodsId = option.goodsid;
  470. this.chapterId = option.chapterId;
  471. this.moduleId = option.moduleId;
  472. this.isFromVideo = option.isFromVideo||'';
  473. this.gradeId = option.gradeId || '';
  474. let isBack = option.isback;
  475. let showDialog = uni.getStorageSync('showDialog');
  476. if(showDialog) {
  477. this.showDialog = false;
  478. } else {
  479. this.showDialog = true;
  480. uni.setStorageSync('showDialog','1');
  481. }
  482. if (isBack) {
  483. let app = getApp();
  484. let globalData = app.globalData;
  485. for (var k in globalData.bankData) {
  486. this[k] = globalData.bankData[k];
  487. }
  488. this.showArrow = true;
  489. this.timer = setInterval(() => {
  490. if (this.lastTime <= 0) {
  491. clearInterval(this.timer);
  492. uni.showToast({
  493. icon:'none',
  494. mask:true,
  495. title:'考试时间到,自动交卷',
  496. duration:2000
  497. })
  498. setTimeout(() => {
  499. this.submit();
  500. }, 1000);
  501. return;
  502. }
  503. this.lastTime--;
  504. }, 1000);
  505. } else {
  506. this.goodsQuestionList();
  507. this.bankExam();
  508. }
  509. },
  510. onUnload() {
  511. if (this.isSubmit) {
  512. clearInterval(this.timer)
  513. return;
  514. }
  515. //考试试卷 阻止ios手势返回,自动跳回答题页
  516. if (this.needBack) {
  517. let app = getApp();
  518. app.globalData.bankData = this.$data;
  519. clearInterval(this.timer);
  520. uni.navigateTo({
  521. url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
  522. });
  523. } else {
  524. //点击返回按钮确认允许退出,记录答题记录
  525. clearInterval(this.timer)
  526. this.examRecordEdit();
  527. }
  528. },
  529. methods: {
  530. /**
  531. * 是否有上传图片
  532. */
  533. hasImgs(bank) {
  534. return bank.ansText.imageList.length == 0;
  535. },
  536. /**
  537. * 获取试卷类型2考试,1练习
  538. */
  539. bankExam() {
  540. this.$api.bankExam(this.id).then(res => {
  541. this.bankType = res.data.data.doType;
  542. if (this.bankType == 2) {
  543. this.needBack = true;
  544. }
  545. });
  546. },
  547. /**
  548. * 点击后退按钮
  549. */
  550. clickLeft() {
  551. if (this.bankType == 1) {
  552. let ansCount = this.questionOverNum(true); //已答题数
  553. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  554. //所有题目答完
  555. if (this.lastCount == 0) {
  556. // this.testOver = true;
  557. this.cgType = 7;
  558. //未答完
  559. } else {
  560. this.cgType = 8;
  561. // this.isLastCount = true;
  562. }
  563. this.showpopups = true;
  564. } else if (this.bankType == 2) {
  565. let ansCount = this.questionOverNum(true); //已答题数
  566. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  567. //所有题目答完
  568. if (this.lastCount == 0) {
  569. this.testOver = true;
  570. //未答完
  571. } else {
  572. this.isLastCount = true;
  573. }
  574. }
  575. },
  576. /**
  577. * 返回上一页
  578. */
  579. backPages() {
  580. this.needBack = false;
  581. uni.navigateBack({
  582. delta: 1
  583. });
  584. },
  585. /**
  586. * 获取已经回答的题目数
  587. * hasSpecail (是否包含简答和案例)
  588. */
  589. questionOverNum(hasSpecail) {
  590. let count = 0;
  591. this.questionList.forEach(item => {
  592. if (item.type == 1 || item.type == 2 || item.type == 3) {
  593. if (item.ques) {
  594. count++;
  595. }
  596. } else if (item.type == 4) {
  597. //案例题
  598. if(hasSpecail) {
  599. let isOver = item.jsonStr.every((jsonItem, indexs) => {
  600. if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
  601. if (item.ques[indexs]) {
  602. return true;
  603. } else {
  604. return false;
  605. }
  606. } else if (jsonItem.type == 5) {
  607. if (item.ques[indexs] && (item.ques[indexs].text.length || item.ques[indexs].imageList.length)) {
  608. return true;
  609. } else {
  610. return false;
  611. }
  612. }
  613. });
  614. if (isOver) {
  615. count++;
  616. console.log(item, 444);
  617. }
  618. }
  619. } else if (item.type == 5) {
  620. //简答题
  621. if(hasSpecail) {
  622. if (item.ansText && (item.ansText.text.length || item.ansText.imageList.length)) {
  623. count++;
  624. }
  625. }
  626. }
  627. });
  628. return count;
  629. },
  630. /**
  631. * 暂不交卷
  632. */
  633. noSubmit() {
  634. //设为允许退出页面
  635. this.needBack = false;
  636. uni.navigateBack({
  637. delta: 1
  638. });
  639. },
  640. /**
  641. * 不离开
  642. */
  643. noLeave() {
  644. this.isLastCount = false;
  645. },
  646. /**
  647. * 立即离开并交卷
  648. */
  649. leaveNow() {
  650. this.needBack = false;
  651. this.isSubmit = true;
  652. uni.navigateBack({
  653. delta: 1
  654. });
  655. let score = 0; //计算总分
  656. let reportStatus = 0;
  657. let number = 0; //做对的题目数量
  658. let doQuestionNum = 0; //做过的题目数量
  659. let allScore = 0; //总分
  660. let passScore = 0;
  661. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  662. let doQuestionIds = []; //做过的题目id
  663. let rightQuestionIds = []; //做对的题目id
  664. this.questionList.forEach((item, index) => {
  665. // passScore = item.passScore
  666. if (item.type == 1) {
  667. //正确
  668. if (item.ques == item.ans) {
  669. item.scoreResult = item.score;
  670. score += item.score;
  671. number++;
  672. rightQuestionIds.push(item.questionId)
  673. } else { //错误
  674. item.scoreResult = 0;
  675. doWrongQuestionIds.push(item.questionId)
  676. }
  677. allScore += item.score;
  678. if (item.ques) {
  679. doQuestionNum++;
  680. doQuestionIds.push(item.questionId)
  681. }
  682. } else if (item.type == 2) {
  683. let isRight =
  684. item.ans &&
  685. item.ans.every((quesItem, quesIndex) => {
  686. if(item.ques) {
  687. return item.ques[quesIndex] == item.ans[quesIndex];
  688. } else {
  689. return false;
  690. }
  691. });
  692. if (isRight) {
  693. score += item.score;
  694. number++;
  695. item.scoreResult = item.score;
  696. rightQuestionIds.push(item.questionId)
  697. } else {
  698. let checkboxScore = item.score; //获取单题总分数
  699. item.ques && item.ques.forEach((ques,quesIndex) => {
  700. //选错一个全扣
  701. if(item.ques) {
  702. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  703. checkboxScore = 0;
  704. }
  705. } else {
  706. checkboxScore = 0;
  707. }
  708. })
  709. console.log(checkboxScore)
  710. //没选错
  711. if(checkboxScore) {
  712. item.ans.forEach((ans,quesIndex) => {
  713. //漏选扣一部分
  714. if(item.ques) {
  715. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  716. checkboxScore -= item.partScore;
  717. }
  718. } else {
  719. checkboxScore = 0;
  720. }
  721. })
  722. }
  723. if(checkboxScore <= 0) { //0分
  724. item.scoreResult = 0;
  725. doWrongQuestionIds.push(item.questionId)
  726. } else { //部分分
  727. number++;
  728. item.scoreResult = checkboxScore;
  729. score += checkboxScore;
  730. rightQuestionIds.push(item.questionId)
  731. }
  732. }
  733. allScore += item.score;
  734. if (item.ques && item.ques.length) {
  735. doQuestionNum++;
  736. doQuestionIds.push(item.questionId)
  737. }
  738. } else if (item.type == 3) {
  739. if (item.ques == item.ans) {
  740. item.scoreResult = item.score;
  741. score += item.score;
  742. number++;
  743. rightQuestionIds.push(item.questionId)
  744. } else {
  745. item.scoreResult = 0;
  746. doWrongQuestionIds.push(item.questionId)
  747. }
  748. allScore += item.score;
  749. if (item.ques) {
  750. doQuestionNum++;
  751. doQuestionIds.push(item.questionId)
  752. }
  753. } else if (item.type == 4) {
  754. if (item.ques && item.ques.length) {
  755. doQuestionNum++;
  756. }
  757. } else if (item.type == 5) {
  758. if (item.ques) {
  759. doQuestionNum++;
  760. }
  761. }
  762. });
  763. //大于60分及格
  764. if(score >= 60) {
  765. reportStatus = 1
  766. } else {
  767. reportStatus = 0
  768. }
  769. //交卷
  770. this.$api
  771. .examRecordEdit({
  772. examId: this.id,
  773. goodsId: this.goodsId,
  774. reportStatus:reportStatus,
  775. recordId: this.recordId,
  776. rightQuestionNum: number,
  777. status: 1,
  778. moduleExamId:this.moduleId || 0,
  779. chapterExamId:this.chapterId || 0,
  780. doQuestionIds:doQuestionIds.join(','),
  781. rightQuestionIds:rightQuestionIds.join(','),
  782. doQuestionNum: doQuestionNum,
  783. performance: score,
  784. totalScore: allScore,
  785. examTime: parseInt(this.allTimes),
  786. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  787. historyExamJson: JSON.stringify(this.questionList)
  788. })
  789. .then(res => {
  790. this.isSubmit = true;
  791. if (res.data.code == 200) {
  792. }
  793. });
  794. //错题集id提交(客观题)
  795. this.$api.examWrongRecord({
  796. moduleExamId:this.moduleId || 0,
  797. chapterExamId:this.chapterId || 0,
  798. examId: this.id,
  799. goodsId: this.goodsId,
  800. questionIds: doWrongQuestionIds,
  801. recordId: this.recordId
  802. }).then(res => {
  803. });
  804. },
  805. /**
  806. * 立即交卷
  807. */
  808. submitNow() {
  809. this.showpopups = false;
  810. this.needBack = false;
  811. this.submit();
  812. },
  813. /**
  814. * 离开页面统计回答正确题数
  815. */
  816. examRecordEdit() {
  817. if (!this.isSubmit) {
  818. let number = 0;
  819. let score = 0;
  820. let doQuestionNum = 0;
  821. this.questionList.forEach((item, index) => {
  822. if (item.type == 1) {
  823. if (item.ques == item.ans) {
  824. score += item.score;
  825. number++;
  826. }
  827. if (item.ques) {
  828. doQuestionNum++;
  829. }
  830. } else if (item.type == 2) {
  831. let isRight =
  832. item.ans &&
  833. item.ans.every((quesItem, quesIndex) => {
  834. if(item.ques) {
  835. return item.ques[quesIndex] == item.ans[quesIndex];
  836. } else {
  837. return false;
  838. }
  839. });
  840. if (isRight) {
  841. score += item.score;
  842. number++;
  843. } else {
  844. let checkboxScore = item.score; //获取单题总分数
  845. item.ques && item.ques.forEach((ques,quesIndex) => {
  846. //选错一个全扣
  847. if(item.ques) {
  848. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  849. checkboxScore = 0;
  850. }
  851. } else {
  852. checkboxScore = 0;
  853. }
  854. })
  855. console.log(checkboxScore)
  856. //没选错
  857. if(checkboxScore) {
  858. item.ans.forEach((ans,quesIndex) => {
  859. //漏选扣一部分
  860. if(item.ques) {
  861. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  862. checkboxScore -= item.partScore;
  863. }
  864. } else {
  865. checkboxScore = 0;
  866. }
  867. })
  868. }
  869. if(checkboxScore <= 0) { //0分
  870. } else { //部分分
  871. number++;
  872. score += checkboxScore;
  873. }
  874. }
  875. if (item.ques && item.ques.length) {
  876. doQuestionNum++;
  877. }
  878. } else if (item.type == 3) {
  879. if (item.ques == item.ans) {
  880. score += item.score;
  881. number++;
  882. }
  883. if (item.ques) {
  884. doQuestionNum++;
  885. }
  886. } else if (item == 4) {
  887. if (item.ques.length) {
  888. doQuestionNum++;
  889. }
  890. } else if (item.type == 5) {
  891. if (item.ques) {
  892. doQuestionNum++;
  893. }
  894. }
  895. });
  896. this.$api
  897. .examRecordEdit({
  898. examId: this.id,
  899. goodsId: this.goodsId,
  900. recordId: this.recordId,
  901. rightQuestionNum: number,
  902. moduleExamId:this.moduleId || 0,
  903. chapterExamId:this.chapterId || 0,
  904. status: 0,
  905. doQuestionNum: doQuestionNum,
  906. historyExamJson: JSON.stringify(this.questionList)
  907. })
  908. .then(res => {});
  909. }
  910. },
  911. /**
  912. * 记录总题数
  913. * hasSpecial (是否包含简答和案例) true 包含 false 不包含
  914. */
  915. examRecord(hasSpecial) {
  916. let questionList = 0;
  917. if(!hasSpecial) {
  918. this.questionList.forEach((item, index) => {
  919. if(item.type == 1 || item.type == 2 || item.type == 3) {
  920. questionList++;
  921. }
  922. })
  923. } else {
  924. questionList = this.questionList.length;
  925. }
  926. if(this.isFromVideo) { //视频课程
  927. this.$api
  928. .bankRecord({
  929. chapterExamId: this.chapterId || 0,
  930. moduleExamId: this.moduleId || 0,
  931. examId: this.id,
  932. goodsId: this.goodsId,
  933. gradeId:this.gradeId,
  934. totalQuestionNum: questionList
  935. })
  936. .then(res => {
  937. this.recordId = res.data.data;
  938. });
  939. } else { //题库
  940. this.$api
  941. .examRecord({
  942. chapterExamId: this.chapterId || 0,
  943. moduleExamId: this.moduleId || 0,
  944. examId: this.id,
  945. goodsId: this.goodsId,
  946. totalQuestionNum: questionList
  947. })
  948. .then(res => {
  949. this.recordId = res.data.data;
  950. });
  951. }
  952. },
  953. /**
  954. * @param {Object} second倒计时过滤器
  955. */
  956. countdown(second) {
  957. if (second) {
  958. let h = parseInt((second / 60 / 60) % 24); // 计算小时
  959. let m = parseInt((second / 60) % 60); // 计算分数
  960. let s = parseInt(second % 60); // 计算当前秒数
  961. if (h < 10) h = '0' + h;
  962. if (m < 10) m = '0' + m;
  963. if (s < 10) s = '0' + s;
  964. return h + ':' + m + ':' + s;
  965. } else {
  966. return '';
  967. }
  968. },
  969. /**
  970. * 请求题目列表
  971. */
  972. goodsQuestionList() {
  973. this.$api
  974. .goodsQuestionList({
  975. examId: this.id
  976. })
  977. .then(res => {
  978. if (!res.data.data.length) {
  979. this.hideDialog();
  980. uni.showModal({
  981. showCancel: false,
  982. content: '该试卷暂无题目',
  983. success: function(k) {
  984. if (k.confirm) {
  985. uni.navigateBack();
  986. }
  987. }
  988. });
  989. return;
  990. }
  991. this.allTimes = res.data.data[0].answerTime * 60;
  992. this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  993. //考试时间到了自动交卷
  994. if (this.lastTime) {
  995. this.timer = setInterval(() => {
  996. if (this.lastTime <= 0) {
  997. clearInterval(this.timer);
  998. uni.showToast({
  999. icon:'none',
  1000. title:'考试时间到,自动交卷',
  1001. duration:1000
  1002. })
  1003. setTimeout(() => {
  1004. this.submit();
  1005. }, 1000);
  1006. return;
  1007. }
  1008. this.lastTime--;
  1009. }, 1000);
  1010. } else {
  1011. }
  1012. res.data.data.forEach((item, index) => {
  1013. if (typeof item.jsonStr == 'string') {
  1014. item.jsonStr = JSON.parse(item.jsonStr);
  1015. if (item.type == 2) {
  1016. //多选
  1017. item.jsonStr.forEach(str => {
  1018. str.optionsId = '' + str.optionsId;
  1019. });
  1020. let arr = item.answerQuestion.split(',');
  1021. arr.forEach((a, i) => {
  1022. arr[i] = '' + a;
  1023. });
  1024. item.ans = arr;
  1025. return;
  1026. } else if (item.type == 5) {
  1027. //简答题
  1028. item.ansText = {
  1029. text: '',
  1030. imageList: []
  1031. };
  1032. } else if (item.type == 4) {
  1033. //案例题
  1034. console.log(item.jsonStr);
  1035. item.ques = [];
  1036. item.current = 0;
  1037. let ansArr = [];
  1038. item.jsonStr.forEach((json, index) => {
  1039. if (json.type == 1) {
  1040. ansArr[index] = json.answerQuestion;
  1041. } else if (json.type == 2) {
  1042. json.optionsList.forEach(str => {
  1043. str.optionsId = '' + str.optionsId;
  1044. });
  1045. let arr = json.answerQuestion.split(',');
  1046. arr.forEach((a, i) => {
  1047. arr[i] = '' + a;
  1048. });
  1049. ansArr[index] = arr;
  1050. } else if (json.type == 3) {
  1051. ansArr[index] = json.answerQuestion;
  1052. } else if (json.type == 5) {
  1053. ansArr[index] = {
  1054. text: '',
  1055. imageList: []
  1056. };
  1057. json.ansText = {
  1058. text: '',
  1059. imageList: []
  1060. };
  1061. }
  1062. });
  1063. item.ans = ansArr;
  1064. return;
  1065. }
  1066. item.ans = item.answerQuestion;
  1067. }
  1068. });
  1069. this.questionList = res.data.data;
  1070. this.lastCount = this.questionList.length;
  1071. this.examRecord();
  1072. this.getCollectInfo(this.current);
  1073. });
  1074. },
  1075. /**
  1076. * @param {Object} e单选点击
  1077. */
  1078. radioSelect(optionsId, bindex) {
  1079. if (this.questionList[bindex].ques) return;
  1080. this.$set(this.questionList[bindex], 'ques', optionsId);
  1081. // 回答错误
  1082. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1083. this.$api
  1084. .examWrongRecord({
  1085. examId: this.id,
  1086. goodsId: this.goodsId,
  1087. moduleExamId:this.moduleId || 0,
  1088. chapterExamId:this.chapterId || 0,
  1089. questionIds: [this.questionList[bindex].questionId],
  1090. recordId: this.recordId
  1091. })
  1092. .then(res => {});
  1093. } else {
  1094. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1095. // if(question) {
  1096. // this.$api.wrongRecordDelete({
  1097. // "examId": +this.id,
  1098. // "goodsId": +this.goodsId,
  1099. // "questionId": this.questionList[bindex].questionId,
  1100. // }).then(res => {
  1101. // })
  1102. // }
  1103. }
  1104. },
  1105. /**
  1106. * @param {Object} e案例单选点击
  1107. */
  1108. radioSelectChild(optionsId, ansIndex, bindex) {
  1109. if (this.questionList[bindex].ques[ansIndex]) return;
  1110. this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
  1111. },
  1112. /**
  1113. * @param {Object} 多选点击
  1114. */
  1115. checkboxSelect(optionsId, bindex, index) {
  1116. this.$set(this.questionList[bindex].jsonStr[index], 'checked', !this.questionList[bindex].jsonStr[index].checked);
  1117. },
  1118. /**
  1119. * @param {Object} 案例多选点击
  1120. */
  1121. checkboxSelectChild(bindex, ansIndex, childIndex) {
  1122. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex], 'checked', !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked);
  1123. },
  1124. /**
  1125. * @param {Object} 多选确认
  1126. */
  1127. checkboxSubmit(bindex) {
  1128. if (this.questionList[bindex].ques) return;
  1129. let arr = [];
  1130. this.questionList[bindex].jsonStr.forEach(item => {
  1131. if (item.checked) {
  1132. arr.push(item.optionsId);
  1133. }
  1134. });
  1135. this.$set(this.questionList[bindex], 'ques', arr);
  1136. let isWrong = this.questionList[bindex].ques.some((quesItem, quesIndex) => {
  1137. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex];
  1138. });
  1139. // 回答错误
  1140. if (isWrong) {
  1141. this.$api
  1142. .examWrongRecord({
  1143. examId: this.id,
  1144. goodsId: this.goodsId,
  1145. moduleExamId:this.moduleId || 0,
  1146. chapterExamId:this.chapterId || 0,
  1147. questionIds: [this.questionList[bindex].questionId],
  1148. recordId: this.recordId
  1149. })
  1150. .then(res => {});
  1151. } else {
  1152. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1153. // if(question) {
  1154. // this.$api.wrongRecordDelete({
  1155. // "examId": +this.id,
  1156. // "goodsId": +this.goodsId,
  1157. // "questionId": this.questionList[bindex].questionId,
  1158. // }).then(res => {
  1159. // })
  1160. // }
  1161. }
  1162. },
  1163. /**
  1164. * @param {Object} 案例多选确认
  1165. */
  1166. checkboxSubmitChild(bindex, ansIndex) {
  1167. if (this.questionList[bindex].ques[ansIndex]) return;
  1168. let arr = [];
  1169. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  1170. if (item.checked) {
  1171. arr.push(item.optionsId);
  1172. }
  1173. });
  1174. this.$set(this.questionList[bindex].ques, ansIndex, arr);
  1175. },
  1176. /**
  1177. * @param {Object} index
  1178. * @param {Object} bindex
  1179. * 判断题
  1180. */
  1181. judgeSelect(index, bindex) {
  1182. if (this.questionList[bindex].ques) return;
  1183. this.$set(this.questionList[bindex], 'ques', index + '');
  1184. // 回答错误
  1185. if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
  1186. this.$api
  1187. .examWrongRecord({
  1188. examId: this.id,
  1189. goodsId: this.goodsId,
  1190. moduleExamId:this.moduleId || 0,
  1191. chapterExamId:this.chapterId || 0,
  1192. questionIds:[this.questionList[bindex].questionId],
  1193. recordId: this.recordId
  1194. })
  1195. .then(res => {});
  1196. } else {
  1197. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  1198. // if(question) {
  1199. // this.$api.wrongRecordDelete({
  1200. // "examId": +this.id,
  1201. // "goodsId": +this.goodsId,
  1202. // "questionId": this.questionList[bindex].questionId,
  1203. // }).then(res => {
  1204. // })
  1205. // }
  1206. }
  1207. },
  1208. /**
  1209. * @param {Object} ansindex
  1210. * @param {Object} childindex
  1211. * @param {Object} bindex
  1212. * 案例判断题
  1213. */
  1214. judgeSelectChild(ansindex, childindex, bindex) {
  1215. if (this.questionList[bindex].ques[ansindex]) return;
  1216. this.$set(this.questionList[bindex].ques, ansindex, childindex + '');
  1217. },
  1218. openFooterTab() {
  1219. this.show = true;
  1220. },
  1221. changeIndex(index) {
  1222. this.current = index;
  1223. },
  1224. swiperChange(e) {
  1225. this.current = e.detail.current;
  1226. this.getCollectInfo(this.current);
  1227. },
  1228. /**
  1229. * @param {Object} current
  1230. * 获取收藏信息
  1231. */
  1232. getCollectInfo(current) {
  1233. this.$api
  1234. .getCollectInfo({
  1235. examId: this.id,
  1236. questionId: this.questionList[current].questionId,
  1237. goodsId: this.goodsId
  1238. })
  1239. .then(res => {
  1240. if (res.data.code == 500) {
  1241. this.$set(this.collectList, current, false);
  1242. } else if (res.data.code == 200) {
  1243. this.$set(this.collectList, current, res.data.data);
  1244. }
  1245. });
  1246. },
  1247. pdsubmit() {
  1248. // if (this.bankType == 1) {
  1249. let ansCount = this.questionOverNum(true); //已答题数
  1250. this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
  1251. //没有答完
  1252. if (this.lastCount !== 0) {
  1253. this.cgType = 6;
  1254. this.showpopups = true;
  1255. return;
  1256. }
  1257. // }
  1258. this.submit();
  1259. },
  1260. /**
  1261. * 交卷
  1262. */
  1263. submit() {
  1264. let score = 0; //计算总分
  1265. let reportStatus = 0;
  1266. let number = 0; //做对的题目数量
  1267. let doQuestionNum = 0; //做过的题目数量
  1268. let allScore = 0; //总分
  1269. let passScore = 0;
  1270. let doWrongQuestionIds = []; //错题和未做题id(客观题)
  1271. let doQuestionIds = []; //做过的题目id
  1272. let rightQuestionIds = []; //做对的题目id
  1273. this.questionList.forEach((item, index) => {
  1274. passScore = item.passScore
  1275. if (item.type == 1) {
  1276. //正确
  1277. if (item.ques == item.ans) {
  1278. item.scoreResult = item.score;
  1279. score += item.score;
  1280. number++;
  1281. rightQuestionIds.push(item.questionId)
  1282. } else { //错误
  1283. item.scoreResult = 0;
  1284. doWrongQuestionIds.push(item.questionId)
  1285. }
  1286. allScore += item.score;
  1287. if (item.ques) {
  1288. doQuestionNum++;
  1289. doQuestionIds.push(item.questionId)
  1290. }
  1291. } else if (item.type == 2) {
  1292. let isRight =
  1293. item.ans &&
  1294. item.ans.every((quesItem, quesIndex) => {
  1295. if(item.ques) {
  1296. return item.ques[quesIndex] == item.ans[quesIndex];
  1297. } else {
  1298. return false;
  1299. }
  1300. });
  1301. if (isRight) {
  1302. score += item.score;
  1303. number++;
  1304. item.scoreResult = item.score;
  1305. rightQuestionIds.push(item.questionId)
  1306. } else {
  1307. let checkboxScore = item.score; //获取单题总分数
  1308. item.ques && item.ques.forEach((ques,quesIndex) => {
  1309. //选错一个全扣
  1310. if(item.ques) {
  1311. if(item.ans.indexOf(item.ques[quesIndex]) == -1) {
  1312. checkboxScore = 0;
  1313. }
  1314. } else {
  1315. checkboxScore = 0;
  1316. }
  1317. })
  1318. console.log(checkboxScore)
  1319. //没选错
  1320. if(checkboxScore) {
  1321. item.ans.forEach((ans,quesIndex) => {
  1322. //漏选扣一部分
  1323. if(item.ques) {
  1324. if(item.ques.indexOf(item.ans[quesIndex]) == -1) {
  1325. checkboxScore -= item.partScore;
  1326. }
  1327. } else {
  1328. checkboxScore = 0;
  1329. }
  1330. })
  1331. }
  1332. if(checkboxScore <= 0) { //0分
  1333. item.scoreResult = 0;
  1334. doWrongQuestionIds.push(item.questionId)
  1335. } else { //部分分
  1336. number++;
  1337. item.scoreResult = checkboxScore;
  1338. score += checkboxScore;
  1339. rightQuestionIds.push(item.questionId)
  1340. }
  1341. }
  1342. allScore += item.score;
  1343. if (item.ques && item.ques.length) {
  1344. doQuestionNum++;
  1345. doQuestionIds.push(item.questionId)
  1346. }
  1347. } else if (item.type == 3) {
  1348. if (item.ques == item.ans) {
  1349. item.scoreResult = item.score;
  1350. score += item.score;
  1351. number++;
  1352. rightQuestionIds.push(item.questionId)
  1353. } else {
  1354. item.scoreResult = 0;
  1355. doWrongQuestionIds.push(item.questionId)
  1356. }
  1357. allScore += item.score;
  1358. if (item.ques) {
  1359. doQuestionNum++;
  1360. doQuestionIds.push(item.questionId)
  1361. }
  1362. } else if (item.type == 4) {
  1363. if (item.ques && item.ques.length) {
  1364. doQuestionNum++;
  1365. }
  1366. } else if (item.type == 5) {
  1367. if (item.ques) {
  1368. doQuestionNum++;
  1369. }
  1370. }
  1371. });
  1372. //大于及格
  1373. if(score >= passScore) {
  1374. reportStatus = 1
  1375. } else {
  1376. reportStatus = 0
  1377. }
  1378. //交卷
  1379. this.$api
  1380. .examRecordEdit({
  1381. examId: this.id,
  1382. goodsId: this.goodsId,
  1383. reportStatus:reportStatus,
  1384. recordId: this.recordId,
  1385. rightQuestionNum: number,
  1386. status: 1,
  1387. moduleExamId:this.moduleId || 0,
  1388. chapterExamId:this.chapterId || 0,
  1389. doQuestionIds:doQuestionIds.join(','),
  1390. rightQuestionIds:rightQuestionIds.join(','),
  1391. doQuestionNum: doQuestionNum,
  1392. performance: score,
  1393. totalScore: allScore,
  1394. examTime: parseInt(this.allTimes),
  1395. doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
  1396. historyExamJson: JSON.stringify(this.questionList)
  1397. })
  1398. .then(res => {
  1399. this.isSubmit = true;
  1400. if (res.data.code == 200) {
  1401. uni.showToast({
  1402. title: '交卷成功',
  1403. duration: 1000,
  1404. icon: 'none'
  1405. });
  1406. setTimeout(() => {
  1407. uni.redirectTo({
  1408. url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
  1409. });
  1410. }, 1000);
  1411. }
  1412. });
  1413. //错题集id提交(客观题)
  1414. this.$api.examWrongRecord({
  1415. examId: this.id,
  1416. goodsId: this.goodsId,
  1417. questionIds: doWrongQuestionIds,
  1418. recordId: this.recordId
  1419. }).then(res => {
  1420. });
  1421. },
  1422. /**
  1423. * @param {Object} state
  1424. * @param {Object} index
  1425. * 收藏
  1426. */
  1427. collect(state, index) {
  1428. if (!state) {
  1429. this.$api
  1430. .collectQuestion({
  1431. examId: this.id,
  1432. questionId: this.questionList[index].questionId,
  1433. goodsId: this.goodsId || ''
  1434. })
  1435. .then(res => {
  1436. if (res.data.code == 200) {
  1437. this.$set(this.collectList, index, true);
  1438. uni.showToast({
  1439. title: '收藏成功',
  1440. duration: 2000,
  1441. icon: 'none'
  1442. });
  1443. this.getCollectInfo(index)
  1444. }
  1445. });
  1446. } else {
  1447. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  1448. if (res.data.code == 200) {
  1449. this.$set(this.collectList, index, false);
  1450. uni.showToast({
  1451. title: '取消收藏成功',
  1452. duration: 2000,
  1453. icon: 'none'
  1454. });
  1455. }
  1456. });
  1457. }
  1458. return;
  1459. },
  1460. /**
  1461. * @param {Object} imgIndex
  1462. * @param {Object} bankIndex
  1463. * 删除简答图片
  1464. */
  1465. deleteImg(imgIndex, bankIndex) {
  1466. this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
  1467. },
  1468. /**
  1469. * @param {Object} imgIndex
  1470. * @param {Object} bankIndex
  1471. * @param {Object} ansIndex
  1472. * 删除案例题简答图片
  1473. */
  1474. deleteImgChild(imgIndex, bankIndex, ansIndex) {
  1475. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex, 1);
  1476. },
  1477. /**
  1478. * @param {Object} bankindex
  1479. * 选择上传图片
  1480. */
  1481. chooseImg(bankindex) {
  1482. if(this.questionList[bankindex] && this.questionList[bankindex].ansText && this.questionList[bankindex].ansText.imageList.length >= 4) {
  1483. uni.showToast({
  1484. icon:'none',
  1485. title:'最多选择4张'
  1486. })
  1487. return;
  1488. }
  1489. uni.chooseImage({
  1490. count: 1, //默认9
  1491. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1492. sourceType: ['album', 'camera'], //从相册选择
  1493. success: res => {
  1494. let self = this;
  1495. // console.log(JSON.stringify(res.tempFilePaths));
  1496. let img = res.tempFilePaths[0];
  1497. uni.getImageInfo({
  1498. src: img,
  1499. success: async res => {
  1500. let canvasWidth = res.width; //图片原始长宽
  1501. let canvasHeight = res.height;
  1502. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1503. uni.compressImage({
  1504. src: img,
  1505. quality: 75,
  1506. width: '50%',
  1507. height: '50%',
  1508. success: async rest => {
  1509. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1510. this.questionList[bankindex].ansText.imageList.push(dir);
  1511. }
  1512. });
  1513. } else {
  1514. const dir = await self.uploadFile(img, 0);
  1515. this.questionList[bankindex].ansText.imageList.push(dir);
  1516. }
  1517. }
  1518. });
  1519. }
  1520. });
  1521. },
  1522. /**
  1523. * @param {Object} bankindex
  1524. * @param {Object} ansindex
  1525. * 案例题选择上传图片
  1526. */
  1527. chooseImgChild(bankindex, ansindex) {
  1528. if(this.questionList[bankindex].jsonStr[ansindex] && this.questionList[bankindex].jsonStr[ansindex].ansText && this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length >= 4) {
  1529. uni.showToast({
  1530. icon:'none',
  1531. title:'最多选择4张'
  1532. })
  1533. return;
  1534. }
  1535. uni.chooseImage({
  1536. count: 1, //默认9
  1537. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  1538. sourceType: ['album', 'camera'], //从相册选择
  1539. success: res => {
  1540. let self = this;
  1541. // console.log(JSON.stringify(res.tempFilePaths));
  1542. let img = res.tempFilePaths[0];
  1543. uni.getImageInfo({
  1544. src: img,
  1545. success: async res => {
  1546. let canvasWidth = res.width; //图片原始长宽
  1547. let canvasHeight = res.height;
  1548. if (canvasWidth > 1000 || canvasHeight > 1000) {
  1549. uni.compressImage({
  1550. src: img,
  1551. quality: 75,
  1552. width: '50%',
  1553. height: '50%',
  1554. success: async rest => {
  1555. const dir = await self.uploadFile(rest.tempFilePath, 0);
  1556. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1557. }
  1558. });
  1559. } else {
  1560. const dir = await self.uploadFile(img, 0);
  1561. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir);
  1562. }
  1563. }
  1564. });
  1565. }
  1566. });
  1567. },
  1568. uploadFile(options, int) {
  1569. var self = this;
  1570. return new Promise((resolve, reject) => {
  1571. var data = {
  1572. imageStatus: int
  1573. };
  1574. self.$api.aliyunpolicy(data).then(res => {
  1575. console.log(res.data, 6);
  1576. if (res.data.code != 200) {
  1577. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  1578. return;
  1579. }
  1580. var ossToken = res.data.data.resultContent;
  1581. if (ossToken.host == null || ossToken.host == undefined) {
  1582. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  1583. return;
  1584. }
  1585. uni.uploadFile({
  1586. url: ossToken.host,
  1587. name: 'file',
  1588. filePath: options,
  1589. fileType: 'image',
  1590. header: {
  1591. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1592. },
  1593. formData: {
  1594. key: ossToken.dir,
  1595. OSSAccessKeyId: ossToken.accessid,
  1596. policy: ossToken.policy,
  1597. Signature: ossToken.signature,
  1598. callback: ossToken.callback,
  1599. success_action_status: 200
  1600. },
  1601. success: result => {
  1602. if (result.statusCode === 200) {
  1603. resolve(ossToken.dir);
  1604. } else {
  1605. uni.showToast({
  1606. title: '上传失败',
  1607. icon: 'none'
  1608. });
  1609. return;
  1610. }
  1611. },
  1612. fail: error => {
  1613. uni.showToast({
  1614. title: '上传接口报错' + error,
  1615. icon: 'none'
  1616. });
  1617. return;
  1618. }
  1619. });
  1620. });
  1621. });
  1622. },
  1623. /**
  1624. * @param {Object} type
  1625. * @param {Object} bankindex
  1626. * 简答题答案确认
  1627. */
  1628. submitAns(bankindex) {
  1629. console.log(this.questionList[bankindex]);
  1630. if (!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  1631. uni.showToast({
  1632. title: '请输入内容或上传图片',
  1633. duration: 2000,
  1634. icon: 'none'
  1635. });
  1636. return;
  1637. }
  1638. this.$set(this.questionList[bankindex], 'ques', {
  1639. imageList: this.questionList[bankindex].ansText.imageList,
  1640. text: this.questionList[bankindex].ansText.text
  1641. });
  1642. },
  1643. /**
  1644. * @param {Object} bankindex
  1645. * @param {Object} ansindex
  1646. * 案例题简答答案确认
  1647. */
  1648. submitAnsChild(bankindex, ansindex) {
  1649. if (!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  1650. uni.showToast({
  1651. title: '请输入内容或上传图片',
  1652. duration: 2000,
  1653. icon: 'none'
  1654. });
  1655. return;
  1656. }
  1657. this.$set(this.questionList[bankindex].ques, ansindex, {
  1658. imageList: this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  1659. text: this.questionList[bankindex].jsonStr[ansindex].ansText.text
  1660. });
  1661. },
  1662. isRight(item, index) {
  1663. //单选
  1664. if (this.questionList[index].ques) {
  1665. if (item.type == 1) {
  1666. return this.questionList[index].ques == this.questionList[index].ans;
  1667. //多选
  1668. } else if (item.type == 2) {
  1669. //每一项都相等
  1670. return this.questionList[index].ques.every((item, i) => {
  1671. return item == this.questionList[index].ans[i];
  1672. });
  1673. //判断
  1674. } else if (item.type == 3) {
  1675. return this.questionList[index].ques == this.questionList[index].ans;
  1676. // } else if (item.type == 5) {
  1677. // if(this.questionList[index].ques.text){
  1678. // return true
  1679. // }else{
  1680. // return false
  1681. // }
  1682. } else {
  1683. return false;
  1684. }
  1685. } else {
  1686. return false;
  1687. }
  1688. },
  1689. right(bankIndex, ansIndex, option) {
  1690. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1691. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 || this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1) {
  1692. return true;
  1693. } else {
  1694. return false;
  1695. }
  1696. } else {
  1697. return false;
  1698. }
  1699. },
  1700. wrong(bankIndex, ansIndex, option) {
  1701. if (this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  1702. if (this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 && this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1) {
  1703. return true;
  1704. } else {
  1705. return false;
  1706. }
  1707. } else {
  1708. return false;
  1709. }
  1710. },
  1711. isWrong(item, index) {
  1712. if (this.questionList[index].ques) {
  1713. //单选
  1714. if (item.type == 1) {
  1715. return this.questionList[index].ques != this.questionList[index].ans;
  1716. //多选
  1717. } else if (item.type == 2) {
  1718. //每一项都相等
  1719. return this.questionList[index].ques.some((item, index) => {
  1720. return item != this.questionList[index].ans;
  1721. });
  1722. //判断
  1723. } else if (item.type == 3) {
  1724. return this.questionList[index].ques != this.questionList[index].ans;
  1725. } else {
  1726. return false;
  1727. }
  1728. } else {
  1729. return false;
  1730. }
  1731. },
  1732. tabSelect(index, bankindex) {
  1733. this.$set(this.questionList[bankindex], 'current', index);
  1734. }
  1735. }
  1736. };
  1737. </script>
  1738. <style lang="scss" scoped>
  1739. .swiper {
  1740. width: 100%;
  1741. height: calc(100vh - 65px);
  1742. }
  1743. .lisSty {
  1744. margin-bottom: 16rpx;
  1745. display: flex;
  1746. .flex_auto {
  1747. flex: 1;
  1748. }
  1749. }
  1750. .activeTI {
  1751. vertical-align: middle;
  1752. display: inline-block;
  1753. border: 1rpx solid #eee;
  1754. border-radius: 50rpx;
  1755. height: 48rpx;
  1756. line-height: 46rpx;
  1757. text-align: center;
  1758. width: 48rpx;
  1759. margin-right: 15rpx;
  1760. color: #666;
  1761. font-size: 30rpx;
  1762. &.right {
  1763. color: #fff;
  1764. background: green;
  1765. }
  1766. &.wrong {
  1767. color: #fff;
  1768. background: red;
  1769. }
  1770. &.checked {
  1771. color: #fff;
  1772. background: blue;
  1773. }
  1774. }
  1775. .submit_checkbox {
  1776. margin: 20rpx auto;
  1777. width: 526rpx;
  1778. height: 80rpx;
  1779. background: rgba(0, 122, 255, 1);
  1780. color: #fff;
  1781. text-align: center;
  1782. line-height: 80rpx;
  1783. font-size: 30rpx;
  1784. border-radius: 40rpx;
  1785. }
  1786. .titles {
  1787. overflow: hidden;
  1788. margin-bottom: 24rpx;
  1789. }
  1790. .titBox {
  1791. padding: 41rpx 25rpx 24rpx 25rpx;
  1792. }
  1793. .tabs {
  1794. margin: 10rpx;
  1795. display: flex;
  1796. .tab {
  1797. margin: 0 10rpx;
  1798. width: 96rpx;
  1799. height: 48rpx;
  1800. line-height: 48rpx;
  1801. text-align: center;
  1802. color: #007aff;
  1803. font-size: 28rpx;
  1804. border-radius: 16rpx;
  1805. &.current {
  1806. color: #fff;
  1807. background: #007aff;
  1808. }
  1809. }
  1810. }
  1811. .ans {
  1812. margin: 8rpx 8rpx 8rpx;
  1813. .ans_input {
  1814. border-radius: 16rpx;
  1815. background: #fff;
  1816. .top {
  1817. border-bottom: 1rpx solid #eeeeee;
  1818. padding: 16rpx;
  1819. display: flex;
  1820. align-items: center;
  1821. .icon {
  1822. margin-right: 20rpx;
  1823. width: 40rpx;
  1824. height: 38rpx;
  1825. }
  1826. .progress {
  1827. flex: 1;
  1828. }
  1829. .submit {
  1830. width: 168rpx;
  1831. height: 48rpx;
  1832. line-height: 48rpx;
  1833. text-align: center;
  1834. color: #fff;
  1835. font-size: 30rpx;
  1836. background: #007aff;
  1837. border-radius: 24rpx;
  1838. &.disabled {
  1839. opacity: 0.6;
  1840. }
  1841. }
  1842. }
  1843. .textarea {
  1844. textarea {
  1845. width: 100%;
  1846. height: 287rpx;
  1847. padding: 10rpx;
  1848. }
  1849. }
  1850. .imgs {
  1851. overflow: hidden;
  1852. display: flex;
  1853. width: 100%;
  1854. .img {
  1855. width: 104rpx;
  1856. height: 104rpx;
  1857. border-radius: 8rpx;
  1858. position: relative;
  1859. margin: 20rpx;
  1860. text {
  1861. position: absolute;
  1862. right: -15rpx;
  1863. top: -15rpx;
  1864. width: 30rpx;
  1865. height: 30rpx;
  1866. text-align: center;
  1867. line-height: 30rpx;
  1868. color: #fff;
  1869. background: red;
  1870. border-radius: 50%;
  1871. }
  1872. image {
  1873. width: 100%;
  1874. height: 100%;
  1875. }
  1876. }
  1877. }
  1878. }
  1879. .ans_submit {
  1880. padding: 16rpx;
  1881. border-radius: 16rpx;
  1882. background: #fff;
  1883. .imgs {
  1884. overflow: hidden;
  1885. display: flex;
  1886. width: 100%;
  1887. .img {
  1888. width: 104rpx;
  1889. height: 104rpx;
  1890. border-radius: 8rpx;
  1891. position: relative;
  1892. margin: 20rpx;
  1893. image {
  1894. width: 100%;
  1895. height: 100%;
  1896. }
  1897. }
  1898. }
  1899. }
  1900. }
  1901. .firstLetter {
  1902. display: flex;
  1903. justify-content: space-between;
  1904. align-items: center;
  1905. margin-bottom: 30rpx;
  1906. .leftLetters {
  1907. display: flex;
  1908. align-items: center;
  1909. width: 220rpx;
  1910. .btnType {
  1911. padding: 5rpx 10rpx;
  1912. border: 1rpx solid #007aff;
  1913. border-radius: 10rpx;
  1914. background-color: rgba(0, 122, 255, 0.1);
  1915. font-size: 28rpx;
  1916. color: #007aff;
  1917. margin-right: 15rpx;
  1918. }
  1919. }
  1920. }
  1921. .popupView {
  1922. height: 100%;
  1923. padding-bottom: 100rpx;
  1924. .popupTops {
  1925. height: 77rpx;
  1926. border-bottom: 1rpx solid #eee;
  1927. text-align: center;
  1928. line-height: 77rpx;
  1929. font-size: 24rpx;
  1930. color: #999;
  1931. position: relative;
  1932. .topIcon {
  1933. position: absolute;
  1934. top: 10rpx;
  1935. left: 50%;
  1936. transform: translateX(-50%);
  1937. width: 80rpx;
  1938. height: 8rpx;
  1939. background-color: #999;
  1940. border-radius: 4rpx;
  1941. }
  1942. }
  1943. .popupContent {
  1944. }
  1945. }
  1946. .pageContent {
  1947. position: relative;
  1948. background-color: #eaeef1;
  1949. height: 100%;
  1950. padding-top: 8rpx;
  1951. padding-bottom: 100rpx;
  1952. overflow-y: scroll;
  1953. }
  1954. .pad_8 {
  1955. background-color: #fff;
  1956. margin: 0rpx 8rpx 8rpx;
  1957. border-radius: 16rpx;
  1958. &.no-margin {
  1959. margin-top:-16rpx;
  1960. border-radius: 0 0 16rpx 16rpx;
  1961. }
  1962. }
  1963. .answer {
  1964. height: 80rpx;
  1965. line-height: 80rpx;
  1966. padding: 0rpx 24rpx;
  1967. display: flex;
  1968. align-items: center;
  1969. justify-content: space-between;
  1970. color: #666;
  1971. font-size: 30rpx;
  1972. }
  1973. .footer_btn {
  1974. background-color: #fff;
  1975. z-index: 10078;
  1976. position: fixed;
  1977. bottom: 0rpx;
  1978. display: flex;
  1979. align-items: center;
  1980. justify-content: space-between;
  1981. width: 100%;
  1982. height: 98rpx;
  1983. padding: 0rpx 38rpx;
  1984. border-top: 1rpx solid #eee;
  1985. .flex_center {
  1986. flex:1;
  1987. display: flex;
  1988. justify-content: center;
  1989. align-items: center;
  1990. flex-direction: column;
  1991. margin:0 200rpx;
  1992. font-size: 24rpx;
  1993. color: #999999;
  1994. .up-icon {
  1995. margin-bottom:18rpx;
  1996. width:100%;
  1997. display: flex;
  1998. justify-content: center;
  1999. image {
  2000. width:58rpx;
  2001. height:21rpx;
  2002. }
  2003. }
  2004. }
  2005. .collect {
  2006. visibility: hidden;
  2007. width:100rpx;
  2008. &.show {
  2009. visibility: visible;
  2010. }
  2011. >view {
  2012. display: flex;
  2013. flex-direction: column;
  2014. align-items: center;
  2015. justify-content: center;
  2016. image {
  2017. width:32rpx;
  2018. height:32rpx;
  2019. margin-bottom:6rpx;
  2020. }
  2021. view {
  2022. font-size: 24rpx;
  2023. color: #999999;
  2024. }
  2025. }
  2026. }
  2027. }
  2028. .boxSty {
  2029. padding: 44rpx 41rpx 0rpx;
  2030. }
  2031. .liListSty {
  2032. border: 1rpx solid #eeeeee;
  2033. width: 88rpx;
  2034. height: 88rpx;
  2035. border-radius: 32rpx;
  2036. text-align: center;
  2037. line-height: 88rpx;
  2038. color: #333;
  2039. font-size: 32rpx;
  2040. float: left;
  2041. margin: 20rpx 23rpx;
  2042. &.isRight {
  2043. border: 1rpx solid #eeeeee;
  2044. color: #fff;
  2045. background: green;
  2046. }
  2047. &.isWrong {
  2048. border: 1rpx solid #eeeeee;
  2049. color: #fff;
  2050. background: red;
  2051. }
  2052. }
  2053. .answerInfos {
  2054. padding: 25rpx 25rpx 25rpx 23rpx;
  2055. }
  2056. .answerTitle {
  2057. margin-bottom: 28rpx;
  2058. color: #666;
  2059. font-size: 30rpx;
  2060. }
  2061. .answerContent {
  2062. font-size: 30rpx;
  2063. color: #666;
  2064. }
  2065. .textChild {
  2066. display: inline-block;
  2067. vertical-align: middle;
  2068. }
  2069. .dialog {
  2070. position: fixed;
  2071. left: 0;
  2072. top: 0;
  2073. width: 100%;
  2074. height: 100%;
  2075. background-color: rgba(0, 0, 0, 0.8);
  2076. display: flex;
  2077. flex-direction: column;
  2078. align-items: center;
  2079. justify-content: center;
  2080. z-index: 20000;
  2081. .pointer {
  2082. width:338rpx;
  2083. height:240rpx;
  2084. }
  2085. .text {
  2086. font-size: 32rpx;
  2087. color: #ffffff;
  2088. text-align: center;
  2089. }
  2090. .btn {
  2091. width: 242rpx;
  2092. height: 82rpx;
  2093. border: 2rpx solid #ffffff;
  2094. border-radius: 16rpx;
  2095. text-align: center;
  2096. line-height: 82rpx;
  2097. margin: 41rpx auto;
  2098. color: #fff;
  2099. font-size: 32rpx;
  2100. }
  2101. }
  2102. .dialog-arrow {
  2103. padding-top:124rpx;
  2104. position: fixed;
  2105. left: 0;
  2106. top: 0;
  2107. width: 100%;
  2108. height: 100%;
  2109. background-color: rgba(0, 0, 0, 0.8);
  2110. z-index: 20000;
  2111. .pointer {
  2112. margin-left:87rpx;
  2113. display: block;
  2114. width:95rpx;
  2115. height:98rpx;
  2116. }
  2117. .text {
  2118. padding-left:177rpx;
  2119. font-size: 32rpx;
  2120. color: #ffffff;
  2121. }
  2122. .btn {
  2123. width: 242rpx;
  2124. height: 82rpx;
  2125. border: 2rpx solid #ffffff;
  2126. border-radius: 16rpx;
  2127. text-align: center;
  2128. line-height: 82rpx;
  2129. margin: 500rpx auto 0;
  2130. color: #fff;
  2131. font-size: 32rpx;
  2132. }
  2133. }
  2134. .dialog_wrap {
  2135. position: fixed;
  2136. left: 0;
  2137. top: 0;
  2138. width: 100%;
  2139. height: 100%;
  2140. z-index: 9999999999;
  2141. .bg {
  2142. background: rgba(0, 0, 0, 0.3);
  2143. position: absolute;
  2144. left: 0;
  2145. top: 0;
  2146. width: 100%;
  2147. height: 100%;
  2148. }
  2149. .dialog {
  2150. position: absolute;
  2151. left: 50%;
  2152. top: 50%;
  2153. transform: translate3D(-50%, -50%, 0);
  2154. width: 640rpx;
  2155. height: 439rpx;
  2156. background: #ffffff;
  2157. border-radius: 24rpx;
  2158. .title {
  2159. font-size: 30rpx;
  2160. font-weight: bold;
  2161. color: #333333;
  2162. line-height: 48rpx;
  2163. text-align: center;
  2164. margin-top: 40rpx;
  2165. }
  2166. .content {
  2167. margin: 35rpx 35rpx 0;
  2168. font-size: 30rpx;
  2169. color: #666666;
  2170. line-height: 48rpx;
  2171. }
  2172. .btns {
  2173. margin-top: 35rpx;
  2174. display: flex;
  2175. align-items: center;
  2176. justify-content: center;
  2177. .btn {
  2178. width: 200rpx;
  2179. height: 80rpx;
  2180. line-height: 80rpx;
  2181. text-align: center;
  2182. background: #f5f5f5;
  2183. border-radius: 40rpx;
  2184. font-size: 30rpx;
  2185. color: rgba(0, 122, 255, 1);
  2186. background: #f5f5f5;
  2187. margin: 0 20rpx;
  2188. &.active {
  2189. color: #f5f5f5;
  2190. background: rgba(0, 122, 255, 1);
  2191. }
  2192. }
  2193. }
  2194. }
  2195. }
  2196. .popboxs {
  2197. width: 100%;
  2198. height: 100%;
  2199. display: flex;
  2200. flex-direction: column;
  2201. align-items: center;
  2202. }
  2203. .classTops {
  2204. flex-shrink: 0;
  2205. padding: 39rpx 0rpx 4rpx;
  2206. font-weight: bold;
  2207. color: #333;
  2208. font-size: 30rpx;
  2209. }
  2210. .textStys {
  2211. width: 100%;
  2212. flex: 1;
  2213. padding: 36rpx;
  2214. }
  2215. .classFootsty {
  2216. flex-shrink: 0;
  2217. display: flex;
  2218. align-items: center;
  2219. justify-content: center;
  2220. padding: 10rpx 0rpx 40rpx;
  2221. .btnsty {
  2222. width: 200rpx;
  2223. height: 80rpx;
  2224. border-radius: 40rpx;
  2225. font-weight: bold;
  2226. font-size: 30rpx;
  2227. text-align: center;
  2228. line-height: 80rpx;
  2229. }
  2230. .btns1 {
  2231. background-color: #f5f5f5;
  2232. color: #007aff;
  2233. }
  2234. .btns2 {
  2235. margin-left: 40rpx;
  2236. background-color: #007aff;
  2237. color: #ffffff;
  2238. }
  2239. }
  2240. </style>