questionBank.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. <template>
  2. <view id="questionBank">
  3. <swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
  4. <swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
  5. <view class="pageContent">
  6. <view class="pad_8 titBox" >
  7. <view class="firstLetter">
  8. <view class="leftLetters">
  9. <view class="btnType">
  10. <text v-if="bank.type==1">单选</text>
  11. <text v-if="bank.type==2">多选</text>
  12. <text v-if="bank.type==3">判断</text>
  13. <text v-if="bank.type==4">案例题</text>
  14. <text v-if="bank.type==5">简答题</text>
  15. </view>
  16. <text>{{bankIndex+1}}/{{questionList.length}}</text>
  17. </view>
  18. <view style="color: #666;font-size: 28rpx;">{{countdown(lastTime)}}</view>
  19. <view class="leftLetters"></view>
  20. </view>
  21. <view class="titles">
  22. <rich-text :nodes="bank.content"></rich-text>
  23. </view>
  24. </view>
  25. <view class="pad_8 titBox">
  26. <template v-if="bank.type == 1">
  27. <view v-if="!bank.ques">
  28. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="radioSelect(item.optionsId,bankIndex)">
  29. <view class="activeTI">{{ ast[index] }}</view>
  30. <view class="flex_auto">{{ item.content }}</view>
  31. </view>
  32. </view>
  33. <view v-if="bank.ques">
  34. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  35. <text :class="{right:(item.optionsId == bank.ques) || (item.optionsId == bank.ans),wrong:(item.optionsId == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  36. <view class="flex_auto">{{ item.content }}</view>
  37. </view>
  38. </view>
  39. <view v-if="bank.ques">
  40. <view class="pad_8 answer">
  41. <view>正确答案:{{ast[bank.ans-1]}}</view>
  42. <view>我的答案:{{ast[bank.ques-1]}}</view>
  43. </view>
  44. <view class="pad_8 answerInfos">
  45. <view class="answerTitle">答案解析</view>
  46. <view class="answerContent">
  47. <rich-text :nodes="bank.analysisContent"></rich-text>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <template v-if="bank.type == 2">
  53. <view v-if="!bank.ques">
  54. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty" @click="checkboxSelect(item.optionsId,bankIndex,index)">
  55. <view :class="{checked:item.checked}" class="activeTI">{{ ast[index] }}</view>
  56. <view class="flex_auto">{{ item.content }}</view>
  57. </view>
  58. </view>
  59. <view v-if="!bank.ques" class="submit_checkbox" @click="checkboxSubmit(bankIndex)">
  60. 确认答案
  61. </view>
  62. <view v-if="bank.ques">
  63. <view v-for="(item, index) in bank.jsonStr" :key="index" class="lisSty">
  64. <text :class="{right:(bank.ques.indexOf(item.optionsId) != -1 ) || (bank.ans.indexOf(item.optionsId) != -1),wrong:(bank.ques.indexOf(item.optionsId) != -1 ) && (bank.ans.indexOf(item.optionsId) == -1)}" class="activeTI">{{ ast[index] }}</text>
  65. <view class="flex_auto">{{ item.content }}</view>
  66. </view>
  67. </view>
  68. <view v-if="bank.ques">
  69. <view class="pad_8 answer">
  70. <view>正确答案:
  71. <text v-for="ansItem in bank.ans">{{ast[ansItem-1]}}</text>
  72. </view>
  73. <view>我的答案:
  74. <text v-for="quesItem in bank.ques">{{ast[quesItem-1]}}</text>
  75. </view>
  76. </view>
  77. <view class="pad_8 answerInfos">
  78. <view class="answerTitle">答案解析</view>
  79. <view class="answerContent">
  80. <rich-text :nodes="bank.analysisContent"></rich-text>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <template v-if="bank.type == 3">
  86. <view v-if="!bank.ques">
  87. <view v-for="(item, index) in judge" :key="index" class="lisSty" @click="judgeSelect(index,bankIndex)">
  88. <view class="activeTI">{{ ast[index] }}</view>
  89. {{ item }}
  90. </view>
  91. </view>
  92. <view v-if="bank.ques">
  93. <view v-for="(item, index) in judge" :key="index" class="lisSty">
  94. <text :class="{right:(index == bank.ques) || (index == bank.ans),wrong:(index == bank.ques) && (bank.ques != bank.ans)}" class="activeTI">{{ ast[index] }}</text>
  95. {{ item }}
  96. </view>
  97. </view>
  98. <view v-if="bank.ques">
  99. <view class="pad_8 answer">
  100. <view>正确答案:{{ast[bank.ans]}}</view>
  101. <view>我的答案:{{ast[bank.ques]}}</view>
  102. </view>
  103. <view class="pad_8 answerInfos">
  104. <view class="answerTitle">答案解析</view>
  105. <view class="answerContent">
  106. <rich-text :nodes="bank.analysisContent"></rich-text>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <!-- 简答题 -->
  112. <template v-if="bank.type == 5">
  113. <view class="ans">
  114. <view class="ans_input" v-if="!bank.ques">
  115. <view class="top flex">
  116. <image :data-index="bankIndex" class="icon" @click="chooseImg(bankIndex)" src="/static/08-10_032.jpg" mode=""></image>
  117. <view class="progress">0/4</view>
  118. <view class="submit" @click="submitAns(bankIndex)" >确认答案</view>
  119. </view>
  120. <view class="textarea">
  121. <textarea v-model="bank.ansText.text" placeholder="在此输入答案"></textarea>
  122. </view>
  123. <view class="imgs">
  124. <view class="img" v-for="(img,imgIndex) in bank.ansText.imageList" >
  125. <text @click="deleteImg(imgIndex,bankIndex)">x</text>
  126. <image :src="$method.splitImgHost(img, true)"></image>
  127. </view>
  128. </view>
  129. </view>
  130. <view class="ans_submit answerInfos" v-if="bank.ques">
  131. <view class="answerTitle">答案我的</view>
  132. {{bank.ques.text}}
  133. <view class="imgs">
  134. <image class="img" v-for="ques in bank.ques.imageList" :src="ques"></image>
  135. </view>
  136. </view>
  137. </view>
  138. <view v-if="bank.ques">
  139. <view class="pad_8 answerInfos">
  140. <view class="answerTitle">答案解析</view>
  141. <view class="answerContent">
  142. <rich-text :nodes="bank.analysisContent"></rich-text>
  143. </view>
  144. </view>
  145. </view>
  146. </template>
  147. <!-- 案例题 -->
  148. <template v-if="bank.type == 4">
  149. <view class="tabs">
  150. <view class="tab" :class="{current:tabIndex == bank.current}" :key="tabIndex" v-for="(tab,tabIndex) in bank.jsonStr" @click="tabSelect(tabIndex,bankIndex)">问题{{tabIndex}}</view>
  151. </view>
  152. <view v-for="(ansItem,ansIndex) in bank.jsonStr" v-if="bank.current == ansIndex" :key="ansIndex">
  153. <view class="titles">
  154. <rich-text :nodes="ansItem.content"></rich-text>
  155. </view>
  156. <template v-if="ansItem.type == 1">
  157. <view v-if="!bank.ques[ansIndex]">
  158. <view v-for="(option, childIndex) in ansItem.optionsList" :key="childIndex" class="lisSty" @click="radioSelectChild(option.optionsId,ansIndex,bankIndex)">
  159. <view class="activeTI">{{ ast[childIndex] }}</view>
  160. <rich-text class="textChild" :nodes="option.content"></rich-text>
  161. </view>
  162. </view>
  163. <view v-if="bank.ques[ansIndex]">
  164. <view v-for="(option, childIndex) in ansItem.optionsList" :key="index" class="lisSty">
  165. <text :class="{right:(option.optionsId == bank.ques[ansIndex]) || (option.optionsId == bank.ans[ansIndex]),wrong:(option.optionsId == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childIndex] }}</text>
  166. <rich-text :nodes="option.content"></rich-text>
  167. </view>
  168. </view>
  169. <view v-if="bank.ques[ansIndex]">
  170. <view class="pad_8 answer">
  171. <view>正确答案:{{ast[bank.ans[ansIndex]-1]}}</view>
  172. <view>我的答案:{{ast[bank.ques[ansIndex]-1]}}</view>
  173. </view>
  174. <view class="pad_8 answerInfos">
  175. <view class="answerTitle">答案解析</view>
  176. <view class="answerContent">
  177. <rich-text :nodes="option.analysisContent"></rich-text>
  178. </view>
  179. </view>
  180. </view>
  181. </template>
  182. <template v-if="ansItem.type == 2">
  183. <view v-if="!bank.ques[ansIndex]">
  184. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty" @click="checkboxSelectChild(bankIndex,ansIndex,childindex)">
  185. <view :class="{checked:option.checked}" class="activeTI">{{ ast[childindex] }}</view>
  186. <rich-text :nodes="option.content"></rich-text>
  187. </view>
  188. </view>
  189. <view v-if="!bank.ques[ansIndex]" class="submit_checkbox" @click="checkboxSubmitChild(bankIndex,ansIndex)">
  190. 确认答案
  191. </view>
  192. <view v-if="bank.ques && bank.ques[ansIndex]">
  193. <view v-for="(option, childindex) in ansItem.optionsList" :key="childindex" class="lisSty">
  194. <text :class="{right:right(bankIndex,ansIndex,option),wrong:wrong(bankIndex,ansIndex,option)}" class="activeTI">{{ ast[childindex] }}</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>正确答案:
  201. <text v-for="ansItem1 in bank.ans[ansIndex]">{{ast[ansItem1-1]}}</text>
  202. </view>
  203. <view>我的答案:
  204. <text v-for="quesItem in bank.ques[ansIndex]">{{ast[quesItem-1]}}</text>
  205. </view>
  206. </view>
  207. <view class="pad_8 answerInfos">
  208. <view class="answerTitle">答案解析</view>
  209. <view class="answerContent">
  210. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  211. </view>
  212. </view>
  213. </view>
  214. </template>
  215. <template v-if="ansItem.type == 3">
  216. <view v-if="!bank.ques[ansIndex]">
  217. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty" @click="judgeSelectChild(ansIndex,childindex,bankIndex)">
  218. <view class="activeTI">{{ ast[childindex] }}</view>
  219. {{ option }}
  220. </view>
  221. </view>
  222. <view v-if="bank.ques[ansIndex]">
  223. <view v-for="(option, childindex) in judge" :key="childindex" class="lisSty">
  224. <text :class="{right:(childindex == bank.ques[ansIndex]) || (childindex == bank.ans[ansIndex]),wrong:(childindex == bank.ques[ansIndex]) && (bank.ques[ansIndex] != bank.ans[ansIndex])}" class="activeTI">{{ ast[childindex] }}</text>
  225. {{ option }}
  226. </view>
  227. </view>
  228. <view v-if="bank.ques[ansIndex]">
  229. <view class="pad_8 answer">
  230. <view>正确答案:{{ast[bank.ans[ansIndex]]}}</view>
  231. <view>我的答案:{{ast[bank.ques[ansIndex]]}}</view>
  232. </view>
  233. <view class="pad_8 answerInfos">
  234. <view class="answerTitle">答案解析</view>
  235. <view class="answerContent">
  236. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  237. </view>
  238. </view>
  239. </view>
  240. </template>
  241. <!-- 简答题 -->
  242. <template v-if="ansItem.type == 5">
  243. <view class="ans">
  244. <view class="ans_input" v-if="!bank.ques[ansIndex]">
  245. <view class="top flex">
  246. <image class="icon" @click="chooseImgChild(bankIndex,ansIndex)" src="/static/08-10_032.jpg" mode=""></image>
  247. <view class="progress">0/4</view>
  248. <view class="submit" @click="submitAnsChild(bankIndex,ansIndex)">确认答案</view>
  249. </view>
  250. <view class="textarea">
  251. <textarea v-model="ansItem.ansText.text" placeholder="在此输入答案"></textarea>
  252. </view>
  253. <view class="imgs">
  254. <view class="img" v-for="(img,imgIndex) in ansItem.ansText.imageList" >
  255. <text @click="deleteImgChild(imgIndex,bankIndex,ansIndex)">x</text>
  256. <image :src="$method.splitImgHost(img, true)"></image>
  257. </view>
  258. </view>
  259. </view>
  260. <view class="ans_submit answerInfos" v-if="bank.ques[ansIndex]">
  261. <view class="answerTitle">答案我的</view>
  262. {{bank.ques[ansIndex].text}}
  263. <view class="imgs">
  264. <image class="img" v-for="ques in bank.ques[ansIndex].imageList" :src="ques"></image>
  265. </view>
  266. </view>
  267. </view>
  268. <view v-if="bank.ques[ansIndex]">
  269. <view class="pad_8 answerInfos">
  270. <view class="answerTitle">答案解析</view>
  271. <view class="answerContent">
  272. <rich-text :nodes="ansItem.analysisContent"></rich-text>
  273. </view>
  274. </view>
  275. </view>
  276. </template>
  277. </view>
  278. </template>
  279. </view>
  280. <view class="footer_btn">
  281. <view class="collect" :class="{show:goodsId?true:false}" @click="collect(collectList[bankIndex],bankIndex)">{{collectList[bankIndex] ?'已收藏' : '未收藏' }}</view>
  282. <view @click="openFooterTab">答题卡</view>
  283. <view @click="submit">交卷</view>
  284. </view>
  285. </view>
  286. </swiper-item>
  287. </swiper>
  288. <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
  289. <view class="popupView">
  290. <view class="popupTops">
  291. <view class="topIcon"></view>
  292. 点击编号即可跳转至对应题目
  293. </view>
  294. <view class="popupContent">
  295. <scroll-view scroll-y="true" style="height: 506rpx;">
  296. <view class="boxSty">
  297. <view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
  298. </view>
  299. </scroll-view>
  300. </view>
  301. </view>
  302. </u-popup>
  303. <view class="dialog" v-if="showDialog">
  304. <view class="text">左右滑动切换上下题</view>
  305. <view class="btn" @click="hideDialog">我知道了</view>
  306. </view>
  307. </view>
  308. </template>
  309. <script>
  310. export default {
  311. data() {
  312. return {
  313. id:'',
  314. current:0,
  315. questionList:[],
  316. ast: ['A', 'B', 'C', 'D','E','F','G'],
  317. judge:['错误','正确'],
  318. ans:[],
  319. ques:[],
  320. show: false,
  321. showDialog:true,
  322. bankList: [],
  323. collectList:[],
  324. goodsId:'',
  325. recordId:'',
  326. isSubmit:false,
  327. lastTime:0,
  328. timer :null,
  329. wrongList:[]
  330. };
  331. },
  332. onLoad(option){
  333. this.id = option.id;
  334. this.goodsId = option.goodsid;
  335. this.goodsQuestionList();
  336. this.wrongRecordExamQuestionList();
  337. },
  338. onUnload() {
  339. console.log(this.ans)
  340. this.examRecordEdit();
  341. },
  342. methods: {
  343. /**
  344. * 获取错题集
  345. */
  346. wrongRecordExamQuestionList() {
  347. this.$api.wrongRecordExamQuestionList({
  348. examId:this.id,
  349. goodsId:this.goodsId
  350. }).then(res => {
  351. this.wrongList = res.data.rows
  352. })
  353. },
  354. /**
  355. * 离开页面统计回答正确题数
  356. */
  357. examRecordEdit() {
  358. if(!this.isSubmit) {
  359. let number = 0;
  360. this.questionList.forEach((item,index) => {
  361. if(item.type == 1) {
  362. if(item.ques == item.ans) {
  363. score += item.score;
  364. number++
  365. }
  366. } else if(item.type == 2) {
  367. let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
  368. return item.ques[quesIndex] == item.ans[quesIndex]
  369. })
  370. if(isRight) {
  371. score += item.score;
  372. number++
  373. }
  374. } else if(item.type == 3) {
  375. if(item.ques == item.ans) {
  376. score += item.score;
  377. number++
  378. }
  379. }
  380. })
  381. this.$api.examRecordEdit({
  382. examId:this.id,
  383. goodsId:this.goodsId,
  384. recordId: this.recordId,
  385. rightQuestionNum:number,
  386. status:0,
  387. historyExamJson:JSON.stringify({ans:this.ans,ques:this.ques})
  388. }).then(res => {
  389. })
  390. }
  391. },
  392. /**
  393. * 记录总题数
  394. */
  395. examRecord() {
  396. this.$api.examRecord({
  397. examId:this.id,
  398. goodsId:this.goodsId,
  399. totalQuestionNum:this.questionList.length,
  400. }).then(res => {
  401. this.recordId = res.data.data;
  402. })
  403. },
  404. /**
  405. * @param {Object} second倒计时过滤器
  406. */
  407. countdown(second) {
  408. if(second) {
  409. let h = parseInt(second/60/60 %24); // 计算小时
  410. let m = parseInt(second/60%60); // 计算分数
  411. let s = parseInt(second%60); // 计算当前秒数
  412. if(h < 10) h = '0'+h;
  413. if(m < 10) m = '0'+m;
  414. if(s < 10) s = '0'+s;
  415. return h+':'+m+':'+s
  416. } else {
  417. return '';
  418. }
  419. },
  420. /**
  421. * 请求题目列表
  422. */
  423. goodsQuestionList() {
  424. this.$api.goodsQuestionList({
  425. examId:this.id
  426. }).then(res => {
  427. this.lastTime = res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
  428. //考试时间到了自动交卷
  429. if(this.lastTime) {
  430. this.timer = setInterval(()=>{
  431. if(this.lastTime <= 0) {
  432. clearInterval(this.timer)
  433. uni.showModal({
  434. title: '提示',
  435. content: '考试时间到,自动交卷',
  436. confirmText:'确定',
  437. showCancel:false,
  438. success: (res) => {
  439. this.submit();
  440. }
  441. });
  442. return;
  443. }
  444. this.lastTime --;
  445. },1000)
  446. } else {
  447. }
  448. res.data.data.forEach((item,index) => {
  449. if(typeof item.jsonStr == 'string') {
  450. item.jsonStr = JSON.parse(item.jsonStr)
  451. if(item.type == 2) { //多选
  452. item.jsonStr.forEach(str => {
  453. str.optionsId = ''+str.optionsId;
  454. })
  455. let arr = item.answerQuestion.split(',');
  456. arr.forEach((a,i) => {
  457. arr[i] = ''+a;
  458. })
  459. item.ans = arr;
  460. return;
  461. } else if(item.type == 5) { //简答题
  462. item.ansText = {
  463. text: '',
  464. imageList: []
  465. }
  466. } else if(item.type == 4) { //案例题
  467. console.log(item.jsonStr)
  468. item.ques = []
  469. item.current = 0;
  470. let ansArr = [];
  471. item.jsonStr.forEach((json,index) => {
  472. if(json.type == 1) {
  473. ansArr[index] = json.answerQuestion;
  474. } else if(json.type == 2) {
  475. json.optionsList.forEach(str => {
  476. str.optionsId = ''+str.optionsId;
  477. })
  478. let arr = json.answerQuestion.split(',');
  479. arr.forEach((a,i) => {
  480. arr[i] = ''+a;
  481. })
  482. ansArr[index] = arr
  483. } else if(json.type == 3) {
  484. ansArr[index] = json.answerQuestion;
  485. } else if(json.type == 5) {
  486. ansArr[index] = {
  487. text: '',
  488. imageList: []
  489. }
  490. json.ansText = {
  491. text: '',
  492. imageList: []
  493. }
  494. }
  495. })
  496. item.ans = ansArr
  497. return;
  498. }
  499. item.ans = item.answerQuestion
  500. }
  501. })
  502. this.questionList = res.data.data;
  503. this.examRecord()
  504. this.getCollectInfo(this.current)
  505. })
  506. },
  507. /**
  508. * @param {Object} e单选点击
  509. */
  510. radioSelect(optionsId,bindex) {
  511. if(this.questionList[bindex].ques) return;
  512. this.$set(this.questionList[bindex],'ques',optionsId)
  513. // 回答错误
  514. if(this.questionList[bindex].ques != this.questionList[bindex].ans) {
  515. this.$api.examWrongRecord({
  516. "examId": this.id,
  517. "goodsId": this.goodsId,
  518. "questionId": this.questionList[bindex].questionId,
  519. "recordId": this.recordId,
  520. }).then(res => {
  521. })
  522. } else {
  523. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  524. // if(question) {
  525. // this.$api.wrongRecordDelete({
  526. // "examId": +this.id,
  527. // "goodsId": +this.goodsId,
  528. // "questionId": this.questionList[bindex].questionId,
  529. // }).then(res => {
  530. // })
  531. // }
  532. }
  533. },
  534. /**
  535. * @param {Object} e案例单选点击
  536. */
  537. radioSelectChild(optionsId,ansIndex,bindex) {
  538. if(this.questionList[bindex].ques[ansIndex]) return;
  539. this.$set(this.questionList[bindex].ques,ansIndex,optionsId)
  540. },
  541. /**
  542. * @param {Object} 多选点击
  543. */
  544. checkboxSelect(optionsId,bindex,index) {
  545. this.$set(this.questionList[bindex].jsonStr[index],'checked',!this.questionList[bindex].jsonStr[index].checked)
  546. },
  547. /**
  548. * @param {Object} 案例多选点击
  549. */
  550. checkboxSelectChild(bindex,ansIndex,childIndex) {
  551. this.$set(this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],'checked',!this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex].checked)
  552. },
  553. /**
  554. * @param {Object} 多选确认
  555. */
  556. checkboxSubmit(bindex) {
  557. if(this.questionList[bindex].ques) return;
  558. let arr = [];
  559. this.questionList[bindex].jsonStr.forEach(item => {
  560. if(item.checked) {
  561. arr.push(item.optionsId)
  562. }
  563. })
  564. this.$set(this.questionList[bindex],'ques',arr)
  565. let isWrong = this.questionList[bindex].ques.some((quesItem,quesIndex) => {
  566. return this.questionList[bindex].ques[quesIndex] != this.questionList[bindex].ans[quesIndex]
  567. })
  568. // 回答错误
  569. if(isWrong) {
  570. this.$api.examWrongRecord({
  571. "examId": this.id,
  572. "goodsId": this.goodsId,
  573. "questionId": this.questionList[bindex].questionId,
  574. "recordId": this.recordId,
  575. }).then(res => {
  576. })
  577. } else {
  578. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  579. // if(question) {
  580. // this.$api.wrongRecordDelete({
  581. // "examId": +this.id,
  582. // "goodsId": +this.goodsId,
  583. // "questionId": this.questionList[bindex].questionId,
  584. // }).then(res => {
  585. // })
  586. // }
  587. }
  588. },
  589. /**
  590. * @param {Object} 案例多选确认
  591. */
  592. checkboxSubmitChild(bindex,ansIndex) {
  593. if(this.questionList[bindex].ques[ansIndex]) return;
  594. let arr = [];
  595. this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(item => {
  596. if(item.checked) {
  597. arr.push(item.optionsId)
  598. }
  599. })
  600. this.$set(this.questionList[bindex].ques,ansIndex,arr)
  601. },
  602. /**
  603. * @param {Object} index
  604. * @param {Object} bindex
  605. * 判断题
  606. */
  607. judgeSelect(index,bindex) {
  608. if(this.questionList[bindex].ques) return;
  609. this.$set(this.questionList[bindex],'ques',index+'')
  610. // 回答错误
  611. if(this.questionList[bindex].ques != this.questionList[bindex].ans) {
  612. this.$api.examWrongRecord({
  613. "examId": this.id,
  614. "goodsId": this.goodsId,
  615. "questionId": this.questionList[bindex].questionId,
  616. "recordId": this.recordId,
  617. }).then(res => {
  618. })
  619. } else {
  620. // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
  621. // if(question) {
  622. // this.$api.wrongRecordDelete({
  623. // "examId": +this.id,
  624. // "goodsId": +this.goodsId,
  625. // "questionId": this.questionList[bindex].questionId,
  626. // }).then(res => {
  627. // })
  628. // }
  629. }
  630. },
  631. /**
  632. * @param {Object} ansindex
  633. * @param {Object} childindex
  634. * @param {Object} bindex
  635. * 案例判断题
  636. */
  637. judgeSelectChild(ansindex,childindex,bindex) {
  638. if(this.questionList[bindex].ques[ansindex]) return;
  639. this.$set(this.questionList[bindex].ques,ansindex,childindex+'')
  640. },
  641. openFooterTab() {
  642. this.show = true;
  643. },
  644. hideDialog() {
  645. this.showDialog = false
  646. },
  647. changeIndex(index) {
  648. this.current = index
  649. },
  650. swiperChange(e) {
  651. this.current = e.detail.current;
  652. this.getCollectInfo(this.current)
  653. },
  654. /**
  655. * @param {Object} current
  656. * 获取收藏信息
  657. */
  658. getCollectInfo(current) {
  659. this.$api.getCollectInfo({
  660. examId:this.id,
  661. questionId:this.questionList[current].questionId,
  662. goodsId:this.goodsId,
  663. }).then(res => {
  664. if(res.data.code == 500) {
  665. this.$set(this.collectList,current,false)
  666. } else if(res.data.code == 200) {
  667. this.$set(this.collectList,current,res.data.data)
  668. }
  669. })
  670. },
  671. /**
  672. * 提交数据
  673. */
  674. submit() {
  675. let score = 0; //计算总分
  676. let reportStatus = 0;
  677. let number = 0;
  678. this.questionList.forEach((item,index) => {
  679. if(item.type == 1) {
  680. if(item.ques == item.ans) {
  681. score += item.score;
  682. number++
  683. }
  684. } else if(item.type == 2) {
  685. let isRight = item.ques && item.ques.every((quesItem,quesIndex) => {
  686. return item.ques[quesIndex] == item.ans[quesIndex]
  687. })
  688. if(isRight) {
  689. score += item.score;
  690. number++
  691. }
  692. } else if(item.type == 3) {
  693. if(item.ques == item.ans) {
  694. score += item.score;
  695. number++
  696. }
  697. }
  698. })
  699. // if(score >= 60) {
  700. // reportStatus = 1
  701. // } else {
  702. // reportStatus = 0
  703. // }
  704. this.$api.examRecordEdit({
  705. examId:this.id,
  706. goodsId:this.goodsId,
  707. // reportStatus:reportStatus,
  708. recordId: this.recordId,
  709. rightQuestionNum:number,
  710. status:1,
  711. score:score,
  712. historyExamJson:JSON.stringify(this.questionList)
  713. }).then(res => {
  714. this.isSubmit = true;
  715. if(res.data.code == 200) {
  716. uni.showToast({
  717. title: '交卷成功',
  718. duration: 2000,
  719. icon:'none'
  720. });
  721. setTimeout(() => {
  722. uni.navigateBack({
  723. delta: 1
  724. });
  725. },2000)
  726. }
  727. })
  728. },
  729. /**
  730. * @param {Object} state
  731. * @param {Object} index
  732. * 收藏
  733. */
  734. collect(state,index) {
  735. if(!state) {
  736. this.$api.collectQuestion({
  737. examId:this.id,
  738. questionId:this.questionList[index].questionId,
  739. goodsId:this.goodsId || '',
  740. }).then(res => {
  741. if(res.data.code==200){
  742. this.$set(this.collectList,index,true)
  743. uni.showToast({
  744. title: '收藏成功',
  745. duration: 2000,
  746. icon:'none'
  747. });
  748. }
  749. })
  750. } else {
  751. this.$api.deleteCollectQuestion(this.collectList[index].collectQuestionId).then(res => {
  752. if(res.data.code==200){
  753. this.$set(this.collectList,index,false)
  754. uni.showToast({
  755. title: '取消收藏成功',
  756. duration: 2000,
  757. icon:'none'
  758. });
  759. }
  760. })
  761. }
  762. return;
  763. },
  764. /**
  765. * @param {Object} imgIndex
  766. * @param {Object} bankIndex
  767. * 删除简答图片
  768. */
  769. deleteImg(imgIndex,bankIndex) {
  770. this.questionList[bankIndex].ansText.imageList.splice(imgIndex,1)
  771. },
  772. /**
  773. * @param {Object} imgIndex
  774. * @param {Object} bankIndex
  775. * @param {Object} ansIndex
  776. * 删除案例题简答图片
  777. */
  778. deleteImgChild(imgIndex,bankIndex,ansIndex) {
  779. this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(imgIndex,1)
  780. },
  781. /**
  782. * @param {Object} bankindex
  783. * 选择上传图片
  784. */
  785. chooseImg(bankindex) {
  786. uni.chooseImage({
  787. count: 1, //默认9
  788. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  789. sourceType: ['album','camera'], //从相册选择
  790. success: (res) => {
  791. let self = this;
  792. // console.log(JSON.stringify(res.tempFilePaths));
  793. let img = res.tempFilePaths[0];
  794. uni.getImageInfo({
  795. src: img,
  796. success: async res => {
  797. let canvasWidth = res.width; //图片原始长宽
  798. let canvasHeight = res.height;
  799. if (canvasWidth > 1000 || canvasHeight > 1000) {
  800. uni.compressImage({
  801. src: img,
  802. quality: 75,
  803. width: '50%',
  804. height: '50%',
  805. success: async rest => {
  806. const dir = await self.uploadFile(rest.tempFilePath, 0);
  807. this.questionList[bankindex].ansText.imageList.push(dir)
  808. }
  809. });
  810. } else {
  811. const dir = await self.uploadFile(img, 0);
  812. this.questionList[bankindex].ansText.imageList.push(dir)
  813. }
  814. }
  815. });
  816. }
  817. })
  818. },
  819. /**
  820. * @param {Object} bankindex
  821. * @param {Object} ansindex
  822. * 案例题选择上传图片
  823. */
  824. chooseImgChild(bankindex,ansindex) {
  825. uni.chooseImage({
  826. count: 1, //默认9
  827. sizeType: ['compressed', ], //可以指定是原图还是压缩图,默认二者都有
  828. sourceType: ['album','camera'], //从相册选择
  829. success: (res) => {
  830. let self = this;
  831. // console.log(JSON.stringify(res.tempFilePaths));
  832. let img = res.tempFilePaths[0];
  833. uni.getImageInfo({
  834. src: img,
  835. success: async res => {
  836. let canvasWidth = res.width; //图片原始长宽
  837. let canvasHeight = res.height;
  838. if (canvasWidth > 1000 || canvasHeight > 1000) {
  839. uni.compressImage({
  840. src: img,
  841. quality: 75,
  842. width: '50%',
  843. height: '50%',
  844. success: async rest => {
  845. const dir = await self.uploadFile(rest.tempFilePath, 0);
  846. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  847. }
  848. });
  849. } else {
  850. const dir = await self.uploadFile(img, 0);
  851. this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.push(dir)
  852. }
  853. }
  854. });
  855. }
  856. })
  857. },
  858. uploadFile(options, int) {
  859. var self = this;
  860. return new Promise((resolve, reject) => {
  861. var data = {
  862. imageStatus: int
  863. };
  864. self.$api.aliyunpolicy(data).then(res => {
  865. console.log(res.data,6)
  866. if(res.data.code!=200){
  867. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  868. return
  869. }
  870. var ossToken = res.data.data.resultContent;
  871. if(ossToken.host==null||ossToken.host==undefined){
  872. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  873. return
  874. }
  875. uni.uploadFile({
  876. url: ossToken.host,
  877. name: 'file',
  878. filePath: options,
  879. fileType: 'image',
  880. header: {
  881. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  882. },
  883. formData: {
  884. key: ossToken.dir,
  885. OSSAccessKeyId: ossToken.accessid,
  886. policy: ossToken.policy,
  887. Signature: ossToken.signature,
  888. callback: ossToken.callback,
  889. success_action_status: 200
  890. },
  891. success: result => {
  892. if (result.statusCode === 200) {
  893. resolve(ossToken.dir);
  894. } else {
  895. uni.showToast({
  896. title: '上传失败',
  897. icon: 'none'
  898. });
  899. return;
  900. }
  901. },
  902. fail: error => {
  903. uni.showToast({
  904. title: '上传接口报错'+error,
  905. icon: 'none'
  906. });
  907. return;
  908. }
  909. });
  910. });
  911. });
  912. },
  913. /**
  914. * @param {Object} type
  915. * @param {Object} bankindex
  916. * 简答题答案确认
  917. */
  918. submitAns(type,bankindex) {
  919. console.log(this.questionList[bankindex])
  920. if(!this.questionList[bankindex].ansText.text && !this.questionList[bankindex].ansText.imageList.length) {
  921. uni.showToast({
  922. title: '请输入内容或上传图片',
  923. duration: 2000,
  924. icon:'none'
  925. });
  926. return
  927. }
  928. this.$set(this.ques,bankindex,{
  929. imageList:this.questionList[bankindex].ansText.imageList,
  930. text:this.questionList[bankindex].ansText.text,
  931. })
  932. },
  933. /**
  934. * @param {Object} bankindex
  935. * @param {Object} ansindex
  936. * 案例题简答答案确认
  937. */
  938. submitAnsChild(bankindex,ansindex) {
  939. if(!this.questionList[bankindex].jsonStr[ansindex].ansText.text && !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length) {
  940. uni.showToast({
  941. title: '请输入内容或上传图片',
  942. duration: 2000,
  943. icon:'none'
  944. });
  945. return
  946. }
  947. this.$set(this.questionList[bankindex].ques,ansindex,{
  948. imageList:this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
  949. text:this.questionList[bankindex].jsonStr[ansindex].ansText.text,
  950. })
  951. },
  952. isRight(item,index) {
  953. //单选
  954. if(this.questionList[index].ques) {
  955. if(item.type == 1) {
  956. return this.questionList[index].ques == this.questionList[index].ans;
  957. //多选
  958. } else if(item.type == 2) {
  959. //每一项都相等
  960. return this.questionList[index].ques.every((item,index) => {
  961. return item == this.questionList[index].ans;
  962. })
  963. //判断
  964. } else if(item.type == 3) {
  965. return this.questionList[index].ques == this.questionList[index].ans;
  966. } else {
  967. return false;
  968. }
  969. } else {
  970. return false;
  971. }
  972. },
  973. right(bankIndex,ansIndex,option) {
  974. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  975. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) || (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) != -1)) {
  976. return true
  977. } else {
  978. return false;
  979. }
  980. } else {
  981. return false;
  982. }
  983. },
  984. wrong(bankIndex,ansIndex,option) {
  985. if(this.questionList[bankIndex].ques[ansIndex] && this.questionList[bankIndex].ans[ansIndex]) {
  986. if((this.questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1 ) && (this.questionList[bankIndex].ans[ansIndex].indexOf(option.optionsId) == -1)) {
  987. return true;
  988. } else {
  989. return false;
  990. }
  991. } else {
  992. return false;
  993. }
  994. },
  995. isWrong(item,index) {
  996. if(this.questionList[index].ques) {
  997. //单选
  998. if(item.type == 1) {
  999. return this.questionList[index].ques != this.questionList[index].ans;
  1000. //多选
  1001. } else if(item.type == 2) {
  1002. //每一项都相等
  1003. return this.questionList[index].ques.some((item,index) => {
  1004. return item != this.questionList[index].ans;
  1005. })
  1006. //判断
  1007. } else if(item.type == 3) {
  1008. return this.questionList[index].ques != this.questionList[index].ans;
  1009. } else {
  1010. return false;
  1011. }
  1012. } else {
  1013. return false;
  1014. }
  1015. },
  1016. tabSelect(index,bankindex) {
  1017. this.$set(this.questionList[bankindex],'current',index)
  1018. },
  1019. }
  1020. };
  1021. </script>
  1022. <style lang="scss" scoped>
  1023. .swiper {
  1024. width:100%;
  1025. height:100vh;
  1026. }
  1027. .lisSty {
  1028. margin-bottom: 16rpx;
  1029. display: flex;
  1030. .flex_auto {
  1031. flex:1;
  1032. }
  1033. }
  1034. .activeTI {
  1035. vertical-align: middle;
  1036. display: inline-block;
  1037. border: 1rpx solid #eee;
  1038. border-radius: 50rpx;
  1039. height: 48rpx;
  1040. line-height: 46rpx;
  1041. text-align: center;
  1042. width: 48rpx;
  1043. margin-right: 15rpx;
  1044. color: #666;
  1045. font-size: 30rpx;
  1046. &.right {
  1047. color:#fff;
  1048. background:green;
  1049. }
  1050. &.wrong {
  1051. color:#fff;
  1052. background:red;
  1053. }
  1054. &.checked {
  1055. color:#fff;
  1056. background:blue;
  1057. }
  1058. }
  1059. .submit_checkbox {
  1060. margin:20rpx auto;
  1061. width: 526rpx;
  1062. height: 80rpx;
  1063. background: rgba(0, 122, 255, 1);
  1064. color:#fff;
  1065. text-align: center;
  1066. line-height: 80rpx;
  1067. font-size: 30rpx;
  1068. border-radius: 40rpx;
  1069. }
  1070. .titles {
  1071. overflow: hidden;
  1072. margin-bottom: 24rpx;
  1073. }
  1074. .titBox {
  1075. padding: 41rpx 25rpx 24rpx 25rpx;
  1076. }
  1077. .tabs {
  1078. margin:10rpx;
  1079. display: flex;
  1080. .tab {
  1081. margin:0 10rpx;
  1082. width: 96rpx;
  1083. height: 48rpx;
  1084. line-height: 48rpx;
  1085. text-align: center;
  1086. color:#007AFF;
  1087. font-size: 28rpx;
  1088. border-radius: 16rpx;
  1089. &.current {
  1090. color:#fff;
  1091. background: #007AFF;
  1092. }
  1093. }
  1094. }
  1095. .ans {
  1096. margin:8rpx 8rpx 8rpx;
  1097. .ans_input {
  1098. border-radius: 16rpx;
  1099. background:#fff;
  1100. .top {
  1101. border-bottom:1rpx solid #EEEEEE;
  1102. padding: 16rpx;
  1103. display: flex;
  1104. align-items: center;
  1105. .icon {
  1106. margin-right:20rpx;
  1107. width: 40rpx;
  1108. height: 38rpx;
  1109. }
  1110. .progress {
  1111. flex:1;
  1112. }
  1113. .submit {
  1114. width: 168rpx;
  1115. height: 48rpx;
  1116. line-height: 48rpx;
  1117. text-align: center;
  1118. color:#fff;
  1119. font-size: 30rpx;
  1120. background: #007AFF;
  1121. border-radius: 24rpx;
  1122. }
  1123. }
  1124. .textarea {
  1125. textarea {
  1126. width:100%;
  1127. height:287rpx;
  1128. padding:10rpx;
  1129. }
  1130. }
  1131. .imgs {
  1132. overflow: hidden;
  1133. display: flex;
  1134. width:100%;
  1135. .img {
  1136. width: 104rpx;
  1137. height: 104rpx;
  1138. border-radius: 8rpx;
  1139. position:relative;
  1140. margin:20rpx;
  1141. text {
  1142. position:absolute;
  1143. right:-15rpx;
  1144. top:-15rpx;
  1145. width:30rpx;
  1146. height:30rpx;
  1147. text-align: center;
  1148. line-height: 30rpx;
  1149. color:#fff;
  1150. background:red;
  1151. border-radius:50%;
  1152. }
  1153. image {
  1154. width:100%;
  1155. height:100%;
  1156. }
  1157. }
  1158. }
  1159. }
  1160. .ans_submit {
  1161. padding:16rpx;
  1162. border-radius: 16rpx;
  1163. background:#fff;
  1164. .imgs {
  1165. overflow: hidden;
  1166. display: flex;
  1167. width:100%;
  1168. .img {
  1169. width: 104rpx;
  1170. height: 104rpx;
  1171. border-radius: 8rpx;
  1172. position:relative;
  1173. margin:20rpx;
  1174. image {
  1175. width:100%;
  1176. height:100%;
  1177. }
  1178. }
  1179. }
  1180. }
  1181. }
  1182. .firstLetter {
  1183. display: flex;
  1184. justify-content: space-between;
  1185. align-items: center;
  1186. margin-bottom: 30rpx;
  1187. .leftLetters {
  1188. display: flex;
  1189. align-items: center;
  1190. width: 220rpx;
  1191. .btnType {
  1192. padding: 5rpx 10rpx;
  1193. border: 1rpx solid #007aff;
  1194. border-radius: 10rpx;
  1195. background-color: rgba(0, 122, 255, 0.1);
  1196. font-size: 28rpx;
  1197. color: #007aff;
  1198. margin-right: 15rpx;
  1199. }
  1200. }
  1201. }
  1202. .popupView {
  1203. height: 100%;
  1204. padding-bottom: 100rpx;
  1205. .popupTops {
  1206. height: 77rpx;
  1207. border-bottom: 1rpx solid #eee;
  1208. text-align: center;
  1209. line-height: 77rpx;
  1210. font-size: 24rpx;
  1211. color: #999;
  1212. position: relative;
  1213. .topIcon {
  1214. position: absolute;
  1215. top: 10rpx;
  1216. left: 50%;
  1217. transform: translateX(-50%);
  1218. width: 80rpx;
  1219. height: 8rpx;
  1220. background-color: #999;
  1221. border-radius: 4rpx;
  1222. }
  1223. }
  1224. .popupContent {
  1225. }
  1226. }
  1227. .pageContent {
  1228. position:relative;
  1229. background-color: #eaeef1;
  1230. min-height: 100vh;
  1231. padding-top: 8rpx;
  1232. padding-bottom: 100rpx;
  1233. }
  1234. .pad_8 {
  1235. background-color: #fff;
  1236. margin: 0rpx 8rpx 8rpx;
  1237. border-radius: 16rpx;
  1238. }
  1239. .answer {
  1240. height: 80rpx;
  1241. line-height: 80rpx;
  1242. padding: 0rpx 24rpx;
  1243. display: flex;
  1244. align-items: center;
  1245. justify-content: space-between;
  1246. color: #666;
  1247. font-size: 30rpx;
  1248. }
  1249. .footer_btn {
  1250. background-color: #fff;
  1251. z-index: 10078;
  1252. position: fixed;
  1253. bottom: 0rpx;
  1254. display: flex;
  1255. align-items: center;
  1256. justify-content: space-between;
  1257. width: 100%;
  1258. height: 98rpx;
  1259. padding: 0rpx 38rpx;
  1260. border-top: 1rpx solid #eee;
  1261. .collect {
  1262. visibility: hidden;
  1263. &.show {
  1264. visibility: visible;
  1265. }
  1266. }
  1267. }
  1268. .boxSty {
  1269. padding: 44rpx 41rpx 0rpx;
  1270. }
  1271. .liListSty {
  1272. border:1rpx solid #EEEEEE;
  1273. width: 88rpx;
  1274. height: 88rpx;
  1275. border-radius: 32rpx;
  1276. text-align: center;
  1277. line-height: 88rpx;
  1278. color: #333;
  1279. font-size: 32rpx;
  1280. float: left;
  1281. margin: 20rpx 23rpx;
  1282. &.isRight {
  1283. border:1rpx solid #EEEEEE;
  1284. color:#fff;
  1285. background: green;
  1286. }
  1287. &.isWrong {
  1288. border:1rpx solid #EEEEEE;
  1289. color:#fff;
  1290. background: red;
  1291. }
  1292. }
  1293. .answerInfos {
  1294. padding: 25rpx 25rpx 25rpx 23rpx;
  1295. }
  1296. .answerTitle {
  1297. margin-bottom: 28rpx;
  1298. color: #666;
  1299. font-size: 30rpx;
  1300. }
  1301. .answerContent {
  1302. font-size: 30rpx;
  1303. color: #666;
  1304. }
  1305. .textChild {
  1306. display: inline-block;
  1307. vertical-align: middle;
  1308. }
  1309. .dialog {
  1310. position: fixed;
  1311. left:0;
  1312. top:0;
  1313. width:100%;
  1314. height:100%;
  1315. background-color: rgba(0,0,0,0.8);
  1316. display: flex;
  1317. flex-direction: column;
  1318. align-items: center;
  1319. justify-content: center;
  1320. z-index: 20000;
  1321. .text {
  1322. font-size: 32rpx;
  1323. color: #FFFFFF;
  1324. text-align: center;
  1325. }
  1326. .btn {
  1327. width: 242rpx;
  1328. height: 82rpx;
  1329. border: 2rpx solid #FFFFFF;
  1330. border-radius: 16rpx;
  1331. text-align: center;
  1332. line-height: 82rpx;
  1333. margin:41rpx auto;
  1334. color:#fff;
  1335. font-size: 32rpx;
  1336. }
  1337. }
  1338. </style>