examStart.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834
  1. <template>
  2. <view class="container">
  3. <view>
  4. <!-- 提示信息弹窗 -->
  5. <uni-popup ref="message" type="message">
  6. <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
  7. </uni-popup>
  8. </view>
  9. </view>
  10. <view style="font-family: '微软雅黑', serif;
  11. font-size: 40px;
  12. color: #7f7f44;height: 30px;text-align: center;padding:20px;padding-bottom: 0;">
  13. {{examObject.examTitle}}
  14. </view>
  15. <button type="primary"
  16. style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;"
  17. @click="reload">҉</button>
  18. <uni-row>
  19. <uni-col :span="4" style="margin-top: 30px">
  20. <uni-card style="height: 85vh;">
  21. <l-divider color="#00a60d">
  22. <view style="font-size: 2vmin;">考生信息</view>
  23. </l-divider>
  24. <view
  25. style="font-family: '微软雅黑' , serif;font-size: 2vmin;color: #8c8c8c;height: 30px;text-align: center;padding:1%;">
  26. 姓名:{{user.realname}}
  27. </view>
  28. <view
  29. style="font-family: '微软雅黑', serif;font-size: 2vmin;color: #8c8c8c;height: 30px;text-align: center;padding:1%;">
  30. 考号:{{user.username}}
  31. </view>
  32. <l-divider color="#00a60d">
  33. <view style="font-size: 2vmin;">试卷名称</view>
  34. </l-divider>
  35. <radio-group>
  36. <label v-for="(item, index) in examObject.examPapersList" :key="item.value">
  37. <view>
  38. <view class="paperCss"
  39. :style="'background-color: '+(item.state === 0?'#b5aa09;':(item.state === 9?'#ececec':'#00f545'))">
  40. <view style="color: #000000;"> <strong style="font-size: 2vmin;">{{item.title}}</strong>
  41. </view>
  42. </view>
  43. </view>
  44. </label>
  45. </radio-group>
  46. <l-divider color="#b3b3b3">
  47. </l-divider>
  48. <button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="subExam">交卷</button>
  49. </uni-card>
  50. </uni-col>
  51. <uni-col :span="16" style="margin-top: 30px">
  52. <uni-card style="height: 85vh;">
  53. <scroll-view scroll-y="true" scroll-x="true" class="scroll-Y">
  54. <uni-section :title="scantron.questionIndex+'、'+scantron.questionTypeName" type="line" padding>
  55. <view v-if="scantron.questionType!==7&&scantron.questionType!==8" id="scantronNodes"
  56. style="height: 45vh;">
  57. </view>
  58. <view v-if="scantron.questionType==7||scantron.questionType==8" id="scantronNodes"
  59. style="height: 5vh;">
  60. </view>
  61. <template v-if="scantron.questionType===1||scantron.questionType===3">
  62. <view>
  63. <l-divider color="#aaaa7f">
  64. </l-divider>
  65. </view>
  66. <view>
  67. <radio-group>
  68. <label v-for="(item, index) in scantron.question.answerList" :key="item">
  69. <view>
  70. <button @click="radioAdd(item,index,scantron)"
  71. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  72. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  73. </view>
  74. </label>
  75. </radio-group>
  76. </view>
  77. </template>
  78. <template v-if="scantron.questionType===2">
  79. <view>
  80. <l-divider color="#aaaa7f">
  81. </l-divider>
  82. </view>
  83. <view>
  84. <radio-group>
  85. <label v-for="(item, index) in scantron.question.answerList" :key="item.value">
  86. <view>
  87. <button @click="item.isRight=!item.isRight;radioAdd(item,index,scantron);"
  88. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  89. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  90. </view>
  91. </label>
  92. </radio-group>
  93. </view>
  94. </template>
  95. <template v-if="scantron.questionType===4">
  96. <view>
  97. <l-divider color="#aaaa7f">
  98. </l-divider>
  99. </view>
  100. <view>
  101. <view>
  102. <view class="uni-textarea"
  103. style="border: #8c8c8c solid 2px;border-radius: 5px;height: 20vh;">
  104. <textarea @blur="radioAdd(null,null,scantron)"
  105. v-model="scantron.question.subjectiveAnswer"
  106. placeholder-style="color:#c7c7c7" placeholder="请输入答案" />
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <template v-if="scantron.questionType===5">
  112. <view>
  113. <l-divider color="#aaaa7f">
  114. </l-divider>
  115. </view>
  116. <view>
  117. <label v-for="(item, index) in scantron.question.answerList" :key="item.value">
  118. <view class="allceter"
  119. style="background-color: #e7f4ff; text-align: left;padding: 10px;margin-bottom: 10px;border: #2a7eeb solid 1px;border-radius: 5px;">
  120. <view style="display: inline-block;padding-left: 10px;">
  121. <strong style="font-size: 20px;color: #0072eb;">{{item.tag}}</strong>
  122. </view>
  123. <input @blur="radioAdd(item.blankcontent,item.tag,scantron)" class="uni-input"
  124. style="display: inline-block;background-color: white;" type="text"
  125. v-model="item.blankcontent" :placeholder="item.tag" />
  126. </view>
  127. </label>
  128. </view>
  129. </template>
  130. <template v-if="scantron.questionType===6">
  131. <view>
  132. <l-divider color="#aaaa7f">
  133. </l-divider>
  134. </view>
  135. <view class="" v-for="(combinationItem,index) in scantron.subQuestionList">
  136. <uni-card>
  137. <strong>{{scantron.questionIndex+'.'+combinationItem.questionIndex+'、'+combinationItem.questionTypeName}}</strong>
  138. <view :id="'combinationItemNodes'+index" style="height: 45vh;">
  139. <!-- <rich-text :nodes="combinationItem.question.content"></rich-text> -->
  140. </view>
  141. <template v-if="combinationItem.questionType===1||combinationItem.questionType===3">
  142. <view>
  143. <l-divider color="#aaaa7f">
  144. </l-divider>
  145. </view>
  146. <view>
  147. <radio-group>
  148. <label v-for="(item, index0) in combinationItem.question.answerList"
  149. :key="item">
  150. <view>
  151. <button @click="radioAdd(item,index0,scantron,combinationItem)"
  152. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  153. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  154. </view>
  155. </label>
  156. </radio-group>
  157. </view>
  158. </template>
  159. <template v-if="combinationItem.questionType===2">
  160. <view>
  161. <l-divider color="#aaaa7f">
  162. </l-divider>
  163. </view>
  164. <view>
  165. <radio-group>
  166. <label v-for="(item, index) in combinationItem.question.answerList"
  167. :key="item.value">
  168. <view>
  169. <button
  170. @click="item.isRight=!item.isRight;radioAdd(item,index0,scantron,combinationItem);"
  171. :style="'margin-top: 15px;padding-left:15px;font-size: 20px;text-align: left;background-color: '+(item.isRight?'#f9ea0d;':'#f0eff0')"><strong
  172. style="color: #0072eb;">{{item.tag+"、"}}</strong>{{item.content}}</button>
  173. </view>
  174. </label>
  175. </radio-group>
  176. </view>
  177. </template>
  178. <template v-if="combinationItem.questionType===4">
  179. <view>
  180. <l-divider color="#aaaa7f">
  181. </l-divider>
  182. </view>
  183. <view>
  184. <view>
  185. <view class="uni-textarea"
  186. style="border: #8c8c8c solid 2px;border-radius: 5px;height: 20vh;">
  187. <textarea v-model="combinationItem.question.subjectiveAnswer"
  188. placeholder-style="color:#c7c7c7" placeholder="请输入答案" />
  189. </view>
  190. </view>
  191. </view>
  192. </template>
  193. <template v-if="combinationItem.questionType===5">
  194. <view>
  195. <l-divider color="#aaaa7f">
  196. </l-divider>
  197. </view>
  198. <view>
  199. <label v-for="(item, index) in combinationItem.question.answerList"
  200. :key="item.value">
  201. <view class="allceter"
  202. style="background-color: #e7f4ff; text-align: left;padding: 10px;margin-bottom: 10px;border: #2a7eeb solid 1px;border-radius: 5px;">
  203. <view style="display: inline-block;padding-left: 10px;">
  204. <strong
  205. style="font-size: 20px;color: #0072eb;">{{item.tag}}</strong>
  206. </view>
  207. <input
  208. @blur="radioAdd(item.blankcontent,item.tag,scantron,combinationItem)"
  209. class="uni-input"
  210. style="display: inline-block;background-color: white;"
  211. type="text" v-model="item.blankcontent"
  212. :placeholder="item.tag" />
  213. </view>
  214. </label>
  215. </view>
  216. </template>
  217. </uni-card>
  218. </view>
  219. </template>
  220. <template v-if="scantron.questionType===7">
  221. <button @click="restart">重置</button>
  222. <view>
  223. <l-divider color="#aaaa7f">
  224. </l-divider>
  225. </view>
  226. <view style="height: 600px;width: 800;background-color: #ffffff;">
  227. <movable-area
  228. :style="`height: 500px;width: 700px;background-color: #8c8c8c;margin: auto;background-image: url('${drag[this.scantron.sort].background.url}');background-size:${drag[this.scantron.sort].background.width}px ${drag[this.scantron.sort].background.height}px;background-repeat: no-repeat;`">
  229. <!-- <rich-text :nodes="scantron.question.content"></rich-text> -->
  230. <!-- <img v-if="drag.background.url!==''" :style="`width:${drag.background.width} px;height:${drag.background.height} px;`" :src="drag.background.url"/> -->
  231. <template v-for="item in drag[this.scantron.sort].answer">
  232. <view
  233. :style="`position: absolute;width: ${item.width}px;height: ${item.height}px;border:solid 1px black;left:${item.x}px;top:${item.y}px;`">
  234. </view>
  235. </template>
  236. <template v-for="item in drag[this.scantron.sort].option">
  237. <movable-view v-if="mbvShow" :id="item.id" :disabled="!disabledDrag"
  238. :style="'width: '+item.width+'px;height: '+item.height+'px;background-color: '+item.backgroundColor+';'"
  239. direction="all" :x="item.x" :y="item.y" @mousedown="onMousedown(item)"
  240. @change="onChange">
  241. </movable-view>
  242. <movable-view v-if="!mbvShow" :id="item.id" :disabled="!disabledDrag"
  243. :style="'width: '+item.width+'px;height: '+item.height+'px;background-color: '+item.backgroundColor+';'"
  244. direction="all" :x="item.x" :y="item.y" @mousedown="onMousedown(item)"
  245. @change="onChange">
  246. </movable-view>
  247. </template>
  248. </movable-area>
  249. </view>
  250. </template>
  251. <template v-if="scantron.questionType===8">
  252. <view style="height: 5vh;">
  253. </view>
  254. <view>
  255. <l-divider color="#aaaa7f">
  256. </l-divider>
  257. </view>
  258. <view>
  259. <view
  260. style="height: 600px;width: 800px;background-color: #8c8c8c;margin: auto;padding-top: 50px;">
  261. <movable-area
  262. style="height: 550px;width: 700px;background-color: #f6f6f6;margin: auto;">
  263. <canvas canvas-id="lineCanvas" style="width: 700px; height: 500px;">
  264. <template v-for="(item,index) in connectionHtml">
  265. <view
  266. style="display: inline-block;margin-top: 30px;margin-left: 30px;margin-right: 70px;">
  267. <!-- <rich-text :nodes="item.innerHTML"></rich-text> -->
  268. <view v-for="(item0,index0) in item.children" :key="index">
  269. <view :id="'option'+index+'-'+(index0+1)"
  270. style="width: 90px;height: 100px;padding: 10px;padding-bottom:0 ;margin-bottom: 10px;border-radius: 5px;border: #007aff solid 1px;background-color: #e0eef9;overflow: hidden;">
  271. </view>
  272. </view>
  273. </view>
  274. </template>
  275. </canvas>
  276. </movable-area>
  277. </view>
  278. </view>
  279. </template>
  280. </uni-section>
  281. </scroll-view>
  282. </uni-card>
  283. </uni-col>
  284. <uni-col :span="4" style="margin-top: 30px">
  285. <uni-card style="height: 85vh;">
  286. <l-divider color="#8f960c" style="margin-top: 2%;">
  287. <view style="font-size: 1vw;">当前试卷时间</view>
  288. </l-divider>
  289. <view style="font-family: '微软雅黑', serif;color: #f90005;height: 4vh;text-align: center;padding:2%;">
  290. <strong style="font-size: 3vmin;">{{paperTime}}</strong>
  291. </view>
  292. <!-- <l-divider color="#8f960c">
  293. <view style="font-size: 2vmin;">考试时间</view>
  294. </l-divider>
  295. <view
  296. style="font-family: '微软雅黑', serif;font-size: 2vmin;color: #00aaf9;height: 30px;text-align: center;padding:10px;">
  297. 剩余:{{examTime}}
  298. </view> -->
  299. <l-divider color="#251e75">
  300. <view style="font-size: 2vmin;">答题卡</view>
  301. </l-divider>
  302. <view>
  303. <scroll-view scroll-y="true" style="height: 50vh;">
  304. <label v-for="(item, index) in examObject.answerCardList2" :key="item">
  305. <uni-section class="mb-10" :title="item.questionTypeName" type="line">
  306. <template v-for="sort in item.indexList">
  307. <view style="display: inline-block;margin-left: 5px;"
  308. @mousedown="radioScantron(sort)">
  309. <view>
  310. <button type="radio"
  311. :style="'width: 30px;height: 30px;padding:0px;color:#FFFFFF;font-size: 12px;text-align: center;background-color: '+(sort === scantron.questionIndex?'#b5aa09;':(this.examObject.userExamQuestionList[sort-1].question.isAnswer?'#18da59':'#007aff'))">{{sort}}</button>
  312. </view>
  313. <view>
  314. {{item.questionTypeName.replace("题","")}}
  315. </view>
  316. </view>
  317. </template>
  318. </uni-section>
  319. </label>
  320. </scroll-view>
  321. </view>
  322. <l-divider color="#251e75" />
  323. <view>
  324. <button type="primary" style="margin-top: 10px;font-size: 2vmin;"
  325. @click="previousQuestion">上一题</button>
  326. <button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="nextQuestion">下一题</button>
  327. </view>
  328. </uni-card>
  329. </uni-col>
  330. </uni-row>
  331. <uni-popup ref="message" type="message">
  332. <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
  333. </uni-popup>
  334. <uni-popup ref="inputDialog" type="dialog">
  335. <uni-popup-dialog ref="inputClose" title="提交试卷" @confirm="dialogInputConfirm">
  336. <view>
  337. <view>1、提交当前试卷后不可再次作答</view>
  338. <view>2、本试卷剩余时间不计入下一套</view>
  339. <view>3、最终试卷提交将结束考试</view>
  340. <view style="text-align: center;">确认提交?</view>
  341. </view>
  342. </uni-popup-dialog>
  343. </uni-popup>
  344. <uni-popup ref="cheat" type="dialog">
  345. <uni-popup-dialog style="width: 50vh;" ref="inputClose" title="作弊提醒">
  346. <view style="color: red;">
  347. <view>1、鼠标请勿点击窗口之外的地方</view>
  348. <view>2、如果不小心退出全屏,请按F11恢复到全屏</view>
  349. <view>3、鼠标多次点击窗口之外的地方将按作弊处理</view>
  350. </view>
  351. </uni-popup-dialog>
  352. </uni-popup>
  353. <uni-popup ref="answerFinal" type="dialog">
  354. <uni-popup-dialog style="width: 50vh;" ref="inputClose" title="当前已经到最后一题">
  355. <view style="color: #0b0ba5 ;">
  356. <view>请检查是否存在漏答题目,检查无误后,请点击“<strong style="font-size: 20px;color: #f00004 ;">交卷</strong>”</view>
  357. </view>
  358. </uni-popup-dialog>
  359. </uni-popup>
  360. </template>
  361. <script>
  362. import {
  363. exit,
  364. request,
  365. getExamDetail,
  366. cacheExamAnswer,
  367. getCacheAnswer,
  368. submitExamPaper,
  369. getExamQueryById
  370. } from '../../examJs/examRequest';
  371. import screenfull from "screenfull";
  372. import {
  373. redirectTo,
  374. toLogin
  375. } from '../../examJs/examRoute';
  376. import {
  377. windowState
  378. } from '../../util/examStartUtil';
  379. export default {
  380. name: "examStart",
  381. data() {
  382. return {
  383. // 所有方块============拖拽
  384. drag: [],
  385. // 拖拽元素刷新
  386. mbvShow: true,
  387. // 拖拽的方块信息
  388. dragItem: {},
  389. // 拖拽位置记录
  390. subDrag: [],
  391. // 拖拽后动作未完成禁用
  392. disabledDrag: true,
  393. // ==================================
  394. // 连线===============================
  395. // 连线题内容页面展示
  396. connectionHtml: [],
  397. // 连线题中间存储
  398. connectionInfo: [],
  399. // 连线题连线内容保存
  400. connectionContentALL: [],
  401. // 连线绘制
  402. ctx: null,
  403. // 点击过程颜色
  404. clickColor: '0px 0px 5px 2px rgba(80, 85, 83, 0.7)',
  405. // 点击结束颜色
  406. connectionColor: ['#ffaa00', '#00ff7f', '#6ca7ff', '#1d00ff', '#aa00ff', '#ffff00', '#550000', '#ff0000'],
  407. // ==============================
  408. // 所有试卷和试题
  409. examObject: {},
  410. // 当前题目
  411. examTopic: {},
  412. // 答题卡
  413. scantron: '',
  414. //选项
  415. answer: {},
  416. typeThree: '',
  417. userExamAnswers: [],
  418. user: {},
  419. // 拖动监听测试
  420. b: true,
  421. canvasWidth: 300,
  422. canvasHeight: 300,
  423. // 用户当前考试
  424. userExamPaper: {},
  425. // 倒计时实际时间
  426. examPaperTime: 0,
  427. // 除当前试卷的其他时间
  428. papersTime: 0,
  429. // 倒计时试卷显示时间
  430. paperTime: '',
  431. // 倒计时考试显示时间
  432. examTime: '',
  433. // 倒计时函数
  434. intervalId: null,
  435. // 切屏记录========================
  436. windowCheat: 0,
  437. // 切屏状态
  438. cheat: null,
  439. // 消息弹窗记录=================
  440. msgType: 'success',
  441. messageText: '这是一条成功提示',
  442. };
  443. },
  444. methods: {
  445. // 页面刷新
  446. reload() {
  447. cacheExamAnswer({
  448. 'examAnswers': this.userExamAnswers,
  449. 'userExamId': sessionStorage.getItem('examId'),
  450. 'leaveTime': this.windowCheat,
  451. 'paperId': this.userExamPaper.paperId,
  452. 'limitTime': this.userExamPaper.limitTime
  453. }).then(data => {
  454. console.log(data);
  455. window.location.reload()
  456. })
  457. },
  458. // 消息提示
  459. messageToggle(type, message) {
  460. this.msgType = type
  461. this.messageText = message
  462. this.$refs.message.open()
  463. },
  464. // 弹窗内容
  465. dialogInputConfirm(val) {
  466. this.submitExam()
  467. },
  468. // 提交试卷弹窗提示打开
  469. subExam() {
  470. this.$refs.inputDialog.open()
  471. },
  472. // 提交试卷
  473. submitExam(ins) {
  474. console.log(ins);
  475. submitExamPaper({
  476. 'examAnswers': this.userExamAnswers,
  477. 'userExamId': sessionStorage.getItem('examId'),
  478. 'paperId': this.userExamPaper.paperId,
  479. }).then(data => {
  480. if (data.data.result !== null && data.data.success) {
  481. if (ins !== 0 && ins !== 'cheat') {
  482. this.messageToggle('success', "本试卷提交成功,即将开始下一张试卷······")
  483. }
  484. this.userExamAnswers = []
  485. clearInterval(this.intervalId);
  486. this.examObject = data.data.result
  487. this.scantron = this.examObject.userExamQuestionList[0]
  488. this.userExamPaper = this.examObject.userExamPapersList[0]
  489. this.examPaperTime = this.addExamPaperTime(new Date(this.userExamPaper.systemTime),
  490. new Date(this
  491. .userExamPaper.limitTime))
  492. // 试卷计时
  493. this.papersTime = this.examPapersTime()
  494. this.intervalId = setInterval(this.updateCountDown, 1000);
  495. this.examTime = this.paperTime
  496. } else {
  497. if (ins === 'cheat') {
  498. this.messageToggle('error', "多次切屏,考试强行终止")
  499. } else if (ins !== 0) {
  500. this.messageToggle('success', "考试已结束,即将退出!")
  501. } else {
  502. this.messageToggle('warn', "时间已到,已为您自动交卷")
  503. }
  504. setTimeout(() => {
  505. screenfull.exit();
  506. window.removeEventListener('blur', this.handleBlur);
  507. window.removeEventListener('focus', this.handleFocus);
  508. exit()
  509. }, 2000)
  510. }
  511. if (data.data.result !== null && data.data.success && ins === 'cheat') {
  512. this.handleBlur(0)
  513. }
  514. })
  515. },
  516. // 重置
  517. restart() {
  518. this.disabledDrag = true
  519. this.drag[this.scantron.sort].answer = []
  520. this.drag[this.scantron.sort].option = []
  521. let content = this.stringToHTML(this.scantron.question.content)
  522. console.log(content);
  523. for (var i = 0; i < content.children.length; i++) {
  524. let thisTop = content.children[i].style.top.toString().replace("px", "")
  525. let thisLeft = content.children[i].style.left.toString().replace("px", "")
  526. let thisWidth = content.children[i].style.width.toString().replace("px", "")
  527. let thisHeight = content.children[i].style.height.toString().replace("px", "")
  528. let thisBackgroundColor = content.children[i].style.backgroundColor
  529. let thisInnerHTML = content.children[i].innerHTML
  530. if (content.children[i].id.includes("option")) {
  531. this.drag[this.scantron.sort].option.push({
  532. id: content.children[i].id,
  533. x: Number(thisLeft),
  534. y: Number(thisTop),
  535. old: {
  536. x: 0,
  537. y: 0,
  538. ax: Number(thisLeft),
  539. by: Number(thisTop)
  540. },
  541. // 只添加一次拖拽监听
  542. b: true,
  543. width: thisWidth,
  544. height: thisHeight,
  545. backgroundColor: thisBackgroundColor,
  546. innerHTML: thisInnerHTML
  547. })
  548. }
  549. if (content.children[i].id.includes("answer")) {
  550. this.drag[this.scantron.sort].answer.push({
  551. id: content.children[i].id,
  552. x: Number(thisLeft),
  553. y: Number(thisTop),
  554. old: {
  555. x: 0,
  556. y: 0
  557. },
  558. width: thisWidth,
  559. height: thisHeight,
  560. backgroundColor: thisBackgroundColor
  561. })
  562. }
  563. }
  564. },
  565. // 上一题目
  566. previousQuestion() {
  567. if (this.scantron.sort > 1) {
  568. this.radioScantron(this.scantron.sort - 1)
  569. }
  570. },
  571. // 下一题目
  572. nextQuestion() {
  573. if (this.scantron.sort < this.examObject.userExamQuestionList.length) {
  574. // this.scantron = this.examObject.userExamQuestionList[this.scantron.sort]
  575. this.radioScantron(this.scantron.sort + 1)
  576. } else {
  577. this.$refs.answerFinal.open()
  578. }
  579. },
  580. // 答题卡单击题目
  581. radioScantron(value) {
  582. screenfull.request()
  583. this.scantron = this.examObject.userExamQuestionList[value - 1]
  584. if (this.scantron.questionType !== 7 && this.scantron.questionType !== 8) {
  585. document.getElementById('scantronNodes').innerHTML = this.scantron.question.content
  586. } else {
  587. console.log(this.scantron.question.content.split('%||||||||%')[0]);
  588. document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split(
  589. '%||||||||%')[0]
  590. }
  591. let combination = setInterval(() => {
  592. if (this.scantron.questionType == 6) {
  593. for (var i = 0; i < this.scantron.subQuestionList.length; i++) {
  594. if (document.getElementById('combinationItemNodes' + i) === null) {
  595. console.log("加载中");
  596. break;
  597. }
  598. document.getElementById('combinationItemNodes' + i).innerHTML = this.scantron
  599. .subQuestionList[i].question.content
  600. }
  601. clearInterval(combination);
  602. }
  603. }, 10)
  604. cacheExamAnswer({
  605. 'examAnswers': this.userExamAnswers,
  606. 'userExamId': sessionStorage.getItem('examId'),
  607. 'leaveTime': this.windowCheat,
  608. 'paperId': this.userExamPaper.paperId,
  609. 'limitTime': this.userExamPaper.limitTime
  610. })
  611. // 拖拽加载
  612. if (this.scantron.questionType == 7) {
  613. this.mbvShow = !this.mbvShow
  614. this.disabledDrag = true
  615. console.log(this.drag[this.scantron.questionIndex]);
  616. if (this.drag[this.scantron.questionIndex] !== undefined) {
  617. setTimeout(() => {
  618. for (var i = 0; i < this.drag[this.scantron.sort].option.length; i++) {
  619. let drags = this.drag[this.scantron.sort].option[i]
  620. console.log(document.getElementById(drags.id));
  621. document.getElementById(drags.id).innerHTML = drags.innerHTML
  622. }
  623. }, 10)
  624. return
  625. }
  626. this.drag[this.scantron.questionIndex] = {}
  627. this.drag[this.scantron.questionIndex].answer = []
  628. this.drag[this.scantron.questionIndex].option = []
  629. this.drag[this.scantron.questionIndex].background = {}
  630. let content = this.stringToHTML(this.scantron.question.content)
  631. for (var i = 0; i < content.children.length; i++) {
  632. let thisTop = content.children[i].style.top.toString().replace("px", "")
  633. let thisLeft = content.children[i].style.left.toString().replace("px", "")
  634. let thisWidth = content.children[i].style.width.toString().replace("px", "")
  635. let thisHeight = content.children[i].style.height.toString().replace("px", "")
  636. let thisBackgroundColor = content.children[i].style.backgroundColor
  637. let thisInnerHTML = content.children[i].innerHTML
  638. if (content.children[i].id.includes("option")) {
  639. this.drag[this.scantron.sort].option.push({
  640. id: content.children[i].id,
  641. x: Number(thisLeft),
  642. y: Number(thisTop),
  643. old: {
  644. x: 0,
  645. y: 0,
  646. ax: Number(thisLeft),
  647. by: Number(thisTop)
  648. },
  649. // 只添加一次拖拽监听
  650. b: true,
  651. width: thisWidth,
  652. height: thisHeight,
  653. backgroundColor: thisBackgroundColor,
  654. innerHTML: thisInnerHTML
  655. })
  656. }
  657. if (content.children[i].id.includes("answer")) {
  658. this.drag[this.scantron.sort].answer.push({
  659. id: content.children[i].id,
  660. x: Number(thisLeft),
  661. y: Number(thisTop),
  662. old: {
  663. x: 0,
  664. y: 0
  665. },
  666. width: thisWidth,
  667. height: thisHeight,
  668. backgroundColor: thisBackgroundColor
  669. })
  670. }
  671. if (content.children[i].tagName === 'IMG') {
  672. this.drag[this.scantron.sort].background.url = content.children[i].src
  673. this.drag[this.scantron.sort].background.width = content.children[i].style.width.toString()
  674. .replace("px", "")
  675. this.drag[this.scantron.sort].background.height = content.children[i].style.height.toString()
  676. .replace("px", "")
  677. }
  678. }
  679. console.log(this.drag[this.scantron.sort].option.length);
  680. setTimeout(() => {
  681. for (var i = 0; i < this.drag[this.scantron.sort].option.length; i++) {
  682. let drags = this.drag[this.scantron.sort].option[i]
  683. console.log(document.getElementById(drags.id));
  684. document.getElementById(drags.id).innerHTML = drags.innerHTML
  685. }
  686. }, 10)
  687. }
  688. // 连线题添加监听
  689. if (this.scantron.questionType == 8) {
  690. this.connectionHtml = []
  691. let content = this.stringToHTML(this.scantron.question.content)
  692. for (var i = 0; i < content.children.length; i++) {
  693. let child = content.children[i]
  694. for (var j = 0; j < child.children.length; j++) {
  695. if (child.children[j].id !== undefined && child.children[j].id.includes("option")) {
  696. this.connectionHtml.push(child.children[j])
  697. }
  698. }
  699. }
  700. if (this.connectionContentALL[value] === undefined) {
  701. this.connectionContentALL[value] = []
  702. }
  703. this.connectionInfo = []
  704. setTimeout(() => {
  705. // 画内容
  706. this.drawLineWriteContent()
  707. // 画缓存线
  708. this.drawLineWrite(value)
  709. }, 100)
  710. for (var i = 0; i < this.connectionHtml.length; i++) {
  711. let option = this.connectionHtml[i]
  712. for (var j = 0; j < option.children.length; j++) {
  713. let ids = "option" + i + "-" + (j + 1)
  714. if (document.getElementById(ids) === null) {
  715. setTimeout(() => {
  716. let optionCol = document.getElementById(ids)
  717. optionCol.addEventListener("mousedown", (event) => {
  718. console.log(event);
  719. let id = event.currentTarget.id
  720. console.log(id);
  721. let colId = Number(id.replace('option', '').split('-')[0])
  722. let rowId = Number(id.replace('option', '').split('-')[1])
  723. let left = event.target.offsetLeft
  724. let right = Number(event.target.offsetLeft + event.target
  725. .offsetWidth)
  726. let top = Number(event.target.offsetTop + event.target
  727. .offsetHeight / 2)
  728. if (this.connectionInfo.length === this.connectionHtml.length &&
  729. colId === 0) {
  730. this.connectionContentALL[this.scantron.sort].push(this
  731. .connectionInfo)
  732. this.radioAdd(this.connectionInfo, this
  733. .connectionInfo[0].id.replace('option', '').split('-')[
  734. 1], this.scantron)
  735. this.connectionInfo = []
  736. }
  737. let arr = []
  738. for (var i = 0; i < this.connectionContentALL[this.scantron.sort]
  739. .length; i++) {
  740. let all = this.connectionContentALL[this.scantron.sort][i]
  741. if (all[0].id !== id) {
  742. arr.push(this.connectionContentALL[this.scantron.sort][i])
  743. }
  744. }
  745. this.connectionContentALL[this.scantron.sort] = arr
  746. let infoLength = this.connectionInfo.length
  747. if (infoLength <= this.connectionHtml.length) {
  748. if (infoLength !== 0) {
  749. if (!this.isLine(id, this.scantron.sort)) {
  750. this.messageToggle('error', "这个已经连过了")
  751. this.drawLineWrite(this.scantron.sort)
  752. return
  753. }
  754. let last = this.connectionInfo[infoLength -
  755. 1]
  756. let lastId = Number(last.id.replace('option', '').split(
  757. '-')[0])
  758. if (lastId + 1 === colId) {
  759. this.connectionInfo.push({
  760. 'id': id,
  761. 'left': left,
  762. 'right': right,
  763. 'top': top
  764. })
  765. }
  766. if (lastId === colId && colId !== this.connectionHtml
  767. .length - 1) {
  768. this.connectionInfo[infoLength - 1] = {
  769. 'id': id,
  770. 'left': left,
  771. 'right': right,
  772. 'top': top
  773. }
  774. document.getElementById(ids).style.boxShadow = this
  775. .clickColor
  776. if (Number(last.id.replace('option', '').split(
  777. '-')[1]) === rowId &&
  778. this.connectionInfo.length === this.connectionHtml
  779. .length) {
  780. this.connectionContentALL[this.scantron.sort].push(
  781. this.connectionInfo)
  782. console.log(this.connectionContentALL[this.scantron
  783. .sort]);
  784. this.radioAdd(this.connectionInfo, this
  785. .connectionInfo[0].id.replace('option', '')
  786. .split('-')[1], this.scantron)
  787. this.connectionInfo = []
  788. }
  789. } else if (colId === this.connectionHtml.length - 1) {
  790. this.connectionContentALL[this.scantron.sort].push(
  791. this.connectionInfo)
  792. console.log(this.connectionContentALL[this.scantron
  793. .sort]);
  794. this.radioAdd(this.connectionInfo, this
  795. .connectionInfo[0].id.replace('option', '')
  796. .split('-')[1], this.scantron)
  797. this.connectionInfo = []
  798. }
  799. } else if (infoLength === 0) {
  800. if (colId === 0) {
  801. this.connectionInfo.push({
  802. 'id': id,
  803. 'left': left,
  804. 'right': right,
  805. 'top': top
  806. })
  807. console.log(document.getElementById(id + ''));
  808. document.getElementById(id + '').style.boxShadow = this
  809. .clickColor
  810. console.log(document.getElementById(id));
  811. }
  812. }
  813. }
  814. this.shadowClean()
  815. this.drawLineWrite(this.scantron.sort)
  816. })
  817. }, 10)
  818. } else {
  819. setTimeout(() => {
  820. this.shadowClean()
  821. }, 10)
  822. }
  823. }
  824. }
  825. }
  826. },
  827. // 连线绘制
  828. drawLine(x1, y1, x2, y2, index) {
  829. this.ctx = uni.createCanvasContext('lineCanvas');
  830. this.ctx.beginPath();
  831. let color = this.connectionColor[index]
  832. if (index === -1) {
  833. color = '#000000'
  834. this.ctx.shadowColor = 'red';
  835. // 设置阴影的模糊级别
  836. this.ctx.setshadowBlur = 100;
  837. // 设置阴影的水平偏移
  838. this.ctx.shadowOffsetX = 1;
  839. // 设置阴影的垂直偏移
  840. this.ctx.shadowOffsetY = 1;
  841. } else {
  842. this.ctx.shadowColor = '#000000';
  843. this.ctx.setshadowBlur = 0;
  844. this.ctx.shadowOffsetX = 0;
  845. this.ctx.shadowOffsetY = 0;
  846. }
  847. this.ctx.setStrokeStyle(color)
  848. this.ctx.lineWidth = 3
  849. this.ctx.moveTo(x1, y1); // 开始点
  850. this.ctx.lineTo(x2, y2); // 结束点
  851. this.ctx.stroke(); // 绘制线条
  852. this.ctx.draw(true);
  853. },
  854. // 连线清理
  855. clearRect() {
  856. const canvas = uni.createCanvasContext('lineCanvas');
  857. // 使用clearRect方法清空整个画布
  858. canvas.clearRect(0, 0, 700, 500); // 这里的300x300是画布的宽高,应该与你的实际画布尺寸相匹配
  859. canvas.draw(true); // 调用draw方法将清空操作应用到画布上
  860. },
  861. // 阴影清理
  862. shadowClean() {
  863. for (var i = 0; i < this.connectionHtml.length; i++) {
  864. let option = this.connectionHtml[i]
  865. for (var j = 0; j < option.children.length; j++) {
  866. let ids = "option" + i + "-" + (j + 1)
  867. document.getElementById(ids).style.boxShadow = ''
  868. }
  869. }
  870. },
  871. isLine(id, value) {
  872. for (var i = 0; i < this.connectionContentALL[value].length; i++) {
  873. let option = this.connectionContentALL[value][i]
  874. for (var j = 0; j < option.length; j++) {
  875. let oldId = option[j].id
  876. if (oldId === id) {
  877. return false
  878. }
  879. }
  880. }
  881. return true
  882. },
  883. // 连线题画内容
  884. drawLineWriteContent() {
  885. for (var i = 0; i < this.connectionHtml.length; i++) {
  886. let option = this.connectionHtml[i]
  887. for (var j = 0; j < option.children.length; j++) {
  888. let ids = "option" + i + "-" + (j + 1)
  889. document.getElementById(ids).innerHTML = option.children[j].innerHTML
  890. }
  891. }
  892. }, // 连线画线
  893. drawLineWrite(value) {
  894. this.clearRect()
  895. if (this.connectionInfo.length >= 2) {
  896. for (var i = 0; i < this.connectionInfo.length - 1; i++) {
  897. let one = this.connectionInfo[i]
  898. let two = this.connectionInfo[i + 1]
  899. // box-shadow: ;
  900. document.getElementById(one.id).style.boxShadow = this.clickColor
  901. document.getElementById(two.id).style.boxShadow = this.clickColor
  902. this.drawLine(one.right, one.top, two.left, two.top, -1)
  903. }
  904. } else if (this.connectionInfo.length === 1) {
  905. document.getElementById(this.connectionInfo[0].id).style.boxShadow = this.clickColor
  906. }
  907. for (var i = 0; i < this.connectionContentALL[value].length; i++) {
  908. let option = this.connectionContentALL[value][i]
  909. for (var j = 0; j < option.length - 1; j++) {
  910. let one = option[j]
  911. let two = option[j + 1]
  912. document.getElementById(one.id).style.boxShadow = '0px 0px 5px 2px ' + this.connectionColor[i]
  913. document.getElementById(two.id).style.boxShadow = '0px 0px 5px 2px ' + this.connectionColor[i]
  914. this.drawLine(one.right, one.top, two.left, two.top, i)
  915. }
  916. }
  917. },
  918. // 字符转换html对象
  919. stringToHTML(str) {
  920. var dom = document.createElement('div');
  921. dom.innerHTML = str;
  922. return dom;
  923. },
  924. // 拖动位置固定
  925. tap(index, subX, subY) {
  926. let x = subX
  927. let y = subY
  928. this.drag[this.scantron.sort].option[index].x = this.drag[this.scantron.sort].option[index].old.x
  929. this.drag[this.scantron.sort].option[index].y = this.drag[this.scantron.sort].option[index].old.y
  930. this.$nextTick(function() {
  931. this.drag[this.scantron.sort].option[index].x = x
  932. this.drag[this.scantron.sort].option[index].y = y
  933. })
  934. },
  935. // 鼠标按下
  936. onMousedown(item) {
  937. console.log(this.drag[this.scantron.sort].option.length);
  938. this.dragItem = item;
  939. },
  940. // 拖动监听
  941. onChange: function(e) {
  942. if (!this.disabledDrag) {
  943. return
  944. }
  945. let index = -1
  946. for (var j = 0; j < this.drag[this.scantron.sort].option.length; j++) {
  947. let option = this.drag[this.scantron.sort].option[j]
  948. if (option.id === this.dragItem.id) {
  949. index = j
  950. break;
  951. }
  952. }
  953. this.drag[this.scantron.sort].option[index].old.x = e.detail.x
  954. this.drag[this.scantron.sort].option[index].old.y = e.detail.y
  955. let asda = (event) => {
  956. document.removeEventListener('mouseup', asda)
  957. this.disabledDrag = false
  958. let dragOne;
  959. let bxs = true
  960. // 处理鼠标抬起事件
  961. for (var i = 0; i < this.drag[this.scantron.sort].answer.length; i++) {
  962. let drag = this.drag[this.scantron.sort].answer[i]
  963. let x = drag.x
  964. let y = drag.y
  965. if (
  966. (Number(this.drag[this.scantron.sort].option[index].old.x) <= (Number(drag.x) + Number(
  967. drag
  968. .width))) &&
  969. (Number(this.drag[this.scantron.sort].option[index].old.x) + Number(this.drag[this
  970. .scantron.sort].option[index]
  971. .width)) >= drag.x &&
  972. (Number(this.drag[this.scantron.sort].option[index].old.y) <= (Number(drag.y) + Number(
  973. drag
  974. .height))) &&
  975. (Number(this.drag[this.scantron.sort].option[index].old.y) + Number(this.drag[this
  976. .scantron.sort].option[index]
  977. .height)) >= drag.y
  978. ) {
  979. for (var p = 0; p < this.drag[this.scantron.sort].answer.length; p++) {
  980. if (this.drag[this.scantron.sort].answer[p].op !== undefined && this.drag[this
  981. .scantron.sort].answer[p].op === index) {
  982. this.drag[this.scantron.sort].answer[p].op = undefined
  983. }
  984. }
  985. if (this.drag[this.scantron.sort].answer[i].op !== undefined) {
  986. this.tap(this.drag[this.scantron.sort].answer[i].op, this.drag[this.scantron.sort]
  987. .option[this.drag[this.scantron.sort].answer[i].op].old.ax, this.drag[this
  988. .scantron.sort]
  989. .option[this.drag[this.scantron.sort].answer[i].op].old.by);
  990. this.drag[this.scantron.sort].answer[i].op = index
  991. } else {
  992. this.drag[this.scantron.sort].answer[i].op = index
  993. }
  994. this.tap(index, x, y);
  995. dragOne = drag
  996. bxs = false
  997. break;
  998. }
  999. }
  1000. // console.log(this.drag[this.scantron.sort].option[index]);
  1001. if (bxs) {
  1002. this.tap(index, this.drag[this.scantron.sort].option[index].old.ax, this.drag[this.scantron
  1003. .sort].option[index].old.by);
  1004. }
  1005. setTimeout(() => {
  1006. if (dragOne !== undefined) {
  1007. this.radioAdd(this.dragItem, dragOne.id.replace("answer", ""), this.scantron)
  1008. }
  1009. this.disabledDrag = true
  1010. }, 700)
  1011. }
  1012. // if (this.drag[this.scantron.sort].option[index].b) {
  1013. // this.drag[this.scantron.sort].option[index].b = false
  1014. document.addEventListener('mouseup', asda);
  1015. // }
  1016. },
  1017. //缓存答案读取
  1018. answerDisplay(data) {
  1019. this.windowCheat = Number(data.leaveTime)
  1020. this.userExamAnswers = data.examAnswers
  1021. let examAnswers = data.examAnswers
  1022. for (var i = 0; i < examAnswers.length; i++) {
  1023. let scantron = examAnswers[i]
  1024. let index = Number(scantron.index)
  1025. if (scantron.index.includes('.')) {
  1026. let parentIndex = Number(scantron.index.split('.')[0])
  1027. let childIndex = scantron.index.split('.')[1]
  1028. let childSubject = this.examObject.userExamQuestionList[parentIndex - 1].subQuestionList[
  1029. childIndex]
  1030. console.log(childSubject);
  1031. } else if (scantron.questionType === 1 || scantron.questionType === 3) {
  1032. console.log(this.examObject.userExamQuestionList[index - 1]);
  1033. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1034. this.examObject.userExamQuestionList[index - 1].question.answerList[Number(scantron.answerIndex[
  1035. 0])]
  1036. .isRight = true
  1037. } else if (scantron.questionType === 2) {
  1038. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1039. for (var j = 0; j < scantron.answerIndex.length; j++) {
  1040. this.examObject.userExamQuestionList[index - 1].question.answerList[Number(scantron
  1041. .answerIndex[j])].isRight = true
  1042. }
  1043. } else if (scantron.questionType === 4) {
  1044. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1045. this.examObject.userExamQuestionList[index - 1].question.subjectiveAnswer = scantron
  1046. .subjectiveAnswer
  1047. } else if (scantron.questionType === 5) {
  1048. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1049. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1050. for (var k = 0; k < blankAnswer.length; k++) {
  1051. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1052. .length; j++) {
  1053. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1054. blankAnswer[k].tag) {
  1055. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1056. blankAnswer[k].content
  1057. }
  1058. }
  1059. }
  1060. } else if (scantron.questionType === 7) {
  1061. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1062. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1063. for (var k = 0; k < blankAnswer.length; k++) {
  1064. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1065. .length; j++) {
  1066. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1067. blankAnswer[k].tag) {
  1068. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1069. blankAnswer[k].content
  1070. }
  1071. }
  1072. }
  1073. this.drag[index] = JSON.parse(scantron.coordinates)
  1074. } else if (scantron.questionType === 8) {
  1075. console.log(scantron);
  1076. this.examObject.userExamQuestionList[index - 1].question.isAnswer = true
  1077. let blankAnswer = JSON.parse(scantron.blankAnswer)
  1078. for (var k = 0; k < blankAnswer.length; k++) {
  1079. for (var j = 0; j < this.examObject.userExamQuestionList[index - 1].question.answerList
  1080. .length; j++) {
  1081. if (this.examObject.userExamQuestionList[index - 1].question.answerList[j].tag ===
  1082. blankAnswer[k].tag) {
  1083. this.examObject.userExamQuestionList[index - 1].question.answerList[j].blankcontent =
  1084. blankAnswer[k].content
  1085. }
  1086. }
  1087. }
  1088. this.connectionContentALL[index] = JSON.parse(scantron.coordinates)
  1089. }
  1090. }
  1091. },
  1092. // 题目做答
  1093. radioAdd(value, index, scantron, combinationItem) {
  1094. index = index + ''
  1095. let qIndex = scantron.questionIndex + ""
  1096. let arr = []
  1097. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = true
  1098. if (scantron.questionType === 1 || scantron.questionType === 3) {
  1099. for (var i = 0; i < scantron.question.answerList.length; i++) {
  1100. scantron.question.answerList[i].isRight = false
  1101. }
  1102. scantron.question.answerList[index].isRight = true
  1103. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1104. if (this.userExamAnswers[i].index !== qIndex) {
  1105. arr.push(this.userExamAnswers[i])
  1106. }
  1107. }
  1108. arr.push({
  1109. answerIndex: [index],
  1110. answers: [value.id],
  1111. index: qIndex,
  1112. questionType: scantron.questionType
  1113. })
  1114. } else if (scantron.questionType === 2) {
  1115. let b = true
  1116. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1117. if (this.userExamAnswers[i].index !== qIndex) {
  1118. arr.push(this.userExamAnswers[i])
  1119. } else {
  1120. b = false
  1121. let bc = true
  1122. let arrAnswer = []
  1123. let arrAnswerId = []
  1124. let num = this.userExamAnswers[i].answers.length;
  1125. for (var j = 0; j < num; j++) {
  1126. if (this.userExamAnswers[i].answerIndex[j] !== index) {
  1127. arrAnswer.push(this.userExamAnswers[i].answerIndex[j])
  1128. arrAnswerId.push(this.userExamAnswers[i].answers[j])
  1129. } else {
  1130. if (!value.isRight) {
  1131. bc = false
  1132. }
  1133. }
  1134. }
  1135. if (bc) {
  1136. arrAnswer.push(index)
  1137. arrAnswerId.push(value.id)
  1138. }
  1139. if (arrAnswer.length !== 0) {
  1140. arr.push({
  1141. answerIndex: arrAnswer,
  1142. answers: arrAnswerId,
  1143. index: qIndex,
  1144. questionType: scantron.questionType
  1145. })
  1146. } else {
  1147. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1148. }
  1149. }
  1150. }
  1151. if (b) {
  1152. arr.push({
  1153. answerIndex: [index],
  1154. answers: [value.id],
  1155. index: qIndex,
  1156. questionType: scantron.questionType
  1157. })
  1158. }
  1159. } else if (scantron.questionType === 4) {
  1160. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1161. if (this.userExamAnswers[i].index !== qIndex) {
  1162. arr.push(this.userExamAnswers[i])
  1163. }
  1164. }
  1165. if (scantron.question.subjectiveAnswer === null || scantron.question.subjectiveAnswer === "") {
  1166. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1167. }
  1168. arr.push({
  1169. subjectiveAnswer: scantron.question.subjectiveAnswer,
  1170. index: qIndex,
  1171. questionType: scantron.questionType
  1172. })
  1173. } else if (scantron.questionType === 5) {
  1174. if (value === undefined) {
  1175. return
  1176. }
  1177. let b = true
  1178. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1179. if (this.userExamAnswers[i].index !== qIndex) {
  1180. arr.push(this.userExamAnswers[i])
  1181. } else {
  1182. b = false
  1183. let bc = true
  1184. let arrAnswer = []
  1185. let blankAnswer = JSON.parse(this.userExamAnswers[i].blankAnswer)
  1186. let num = blankAnswer.length;
  1187. for (var j = 0; j < num; j++) {
  1188. if (blankAnswer[j].tag !== index) {
  1189. arrAnswer.push({
  1190. tag: blankAnswer[j].tag,
  1191. content: blankAnswer[j].content
  1192. })
  1193. } else {
  1194. bc = false
  1195. }
  1196. }
  1197. if (bc) {
  1198. arrAnswer.push({
  1199. tag: index,
  1200. content: value
  1201. })
  1202. }
  1203. if (arrAnswer.length !== 0) {
  1204. arr.push({
  1205. blankAnswer: JSON.stringify(arrAnswer),
  1206. index: qIndex,
  1207. questionType: scantron.questionType
  1208. })
  1209. } else {
  1210. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1211. }
  1212. }
  1213. }
  1214. if (b) {
  1215. if (value === null || value === "") {
  1216. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1217. }
  1218. arr.push({
  1219. blankAnswer: JSON.stringify([{
  1220. tag: index,
  1221. content: value
  1222. }]),
  1223. index: qIndex,
  1224. questionType: scantron.questionType
  1225. })
  1226. }
  1227. } else if (scantron.questionType === 6) {
  1228. qIndex = qIndex + "." + combinationItem.sort
  1229. if (combinationItem.questionType === 1 || combinationItem.questionType ===
  1230. 3) {
  1231. for (var j = 0; j < combinationItem.question.answerList.length; j++) {
  1232. combinationItem.question.answerList[j].isRight = false
  1233. }
  1234. combinationItem.question.answerList[index].isRight = true
  1235. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1236. if (this.userExamAnswers[j].index !== qIndex) {
  1237. arr.push(this.userExamAnswers[j])
  1238. }
  1239. }
  1240. arr.push({
  1241. answerIndex: [index],
  1242. answers: [value.id],
  1243. index: qIndex,
  1244. questionType: combinationItem.questionType
  1245. })
  1246. } else if (combinationItem.questionType === 2) {
  1247. let b = true
  1248. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1249. if (this.userExamAnswers[j].index !== qIndex) {
  1250. arr.push(this.userExamAnswers[j])
  1251. } else {
  1252. b = false
  1253. let bca = true
  1254. let arrAnswer = []
  1255. let arrAnswerId = []
  1256. let num = this.userExamAnswers[j].answers.length;
  1257. for (var k = 0; k < num; k++) {
  1258. if (this.userExamAnswers[j].answerIndex[k] !== index) {
  1259. arrAnswer.push(this.userExamAnswers[j].answerIndex[k])
  1260. arrAnswerId.push(this.userExamAnswers[j].answers[k])
  1261. } else {
  1262. if (!value.isRight) {
  1263. bca = false
  1264. }
  1265. }
  1266. }
  1267. if (bca) {
  1268. arrAnswer.push(index)
  1269. arrAnswerId.push(value.id)
  1270. }
  1271. if (arrAnswer.length !== 0) {
  1272. arr.push({
  1273. answerIndex: arrAnswer,
  1274. answers: arrAnswerId,
  1275. index: qIndex,
  1276. questionType: combinationItem.questionType
  1277. })
  1278. } else {
  1279. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1280. .isAnswer =
  1281. false
  1282. }
  1283. }
  1284. }
  1285. if (b) {
  1286. arr.push({
  1287. answerIndex: [index],
  1288. answers: [value.id],
  1289. index: qIndex,
  1290. questionType: combinationItem.questionType
  1291. })
  1292. }
  1293. } else if (combinationItem.questionType === 4) {
  1294. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1295. if (this.userExamAnswers[j].index !== qIndex) {
  1296. arr.push(this.userExamAnswers[j])
  1297. }
  1298. }
  1299. if (combinationItem.question.subjectiveAnswer === null || scantron.subQuestionList[
  1300. i].question.subjectiveAnswer === "") {
  1301. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1302. }
  1303. arr.push({
  1304. subjectiveAnswer: combinationItem.question.subjectiveAnswer,
  1305. index: qIndex,
  1306. questionType: combinationItem.questionType
  1307. })
  1308. } else if (combinationItem.questionType === 5) {
  1309. if (value === undefined) {
  1310. return
  1311. }
  1312. let b = true
  1313. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1314. if (this.userExamAnswers[j].index !== qIndex) {
  1315. arr.push(this.userExamAnswers[j])
  1316. } else {
  1317. b = false
  1318. let bc = true
  1319. let arrAnswer = []
  1320. let blankAnswer = JSON.parse(this.userExamAnswers[j].blankAnswer)
  1321. let num = blankAnswer.length;
  1322. for (var q = 0; q < num; q++) {
  1323. if (blankAnswer[q].tag !== index) {
  1324. arrAnswer.push({
  1325. tag: blankAnswer[q].tag,
  1326. content: blankAnswer[q].content
  1327. })
  1328. } else {
  1329. bc = false
  1330. }
  1331. }
  1332. if (bc) {
  1333. arrAnswer.push({
  1334. tag: index,
  1335. content: value
  1336. })
  1337. }
  1338. if (arrAnswer.length !== 0) {
  1339. arr.push({
  1340. blankAnswer: JSON.stringify(arrAnswer),
  1341. index: qIndex,
  1342. questionType: scantron.subQuestionList[i].questionType
  1343. })
  1344. } else {
  1345. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1346. .isAnswer = false
  1347. }
  1348. }
  1349. }
  1350. if (b) {
  1351. if (value === null || value === "") {
  1352. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1353. }
  1354. console.log(qIndex);
  1355. console.log(scantron);
  1356. console.log(this.examObject.userExamQuestionList[scantron.questionIndex - 1].subQuestionList[
  1357. Number(combinationItem.sort)]);
  1358. arr.push({
  1359. blankAnswer: JSON.stringify([{
  1360. tag: index,
  1361. content: value
  1362. }]),
  1363. index: qIndex,
  1364. questionType: scantron.subQuestionList[i].questionType
  1365. })
  1366. }
  1367. }
  1368. } else if (scantron.questionType === 7) {
  1369. if (value === undefined) {
  1370. return
  1371. }
  1372. index = (Number(index) + 1) + ""
  1373. let b = true
  1374. for (var i = 0; i < this.userExamAnswers.length; i++) {
  1375. if (this.userExamAnswers[i].index !== qIndex) {
  1376. arr.push(this.userExamAnswers[i])
  1377. } else {
  1378. b = false
  1379. let bc = true
  1380. let arrAnswer = []
  1381. let blankAnswer = JSON.parse(this.userExamAnswers[i].blankAnswer)
  1382. let num = blankAnswer.length;
  1383. for (var j = 0; j < num; j++) {
  1384. if (blankAnswer[j].tag !== index) {
  1385. arrAnswer.push({
  1386. tag: blankAnswer[j].tag,
  1387. content: blankAnswer[j].content
  1388. })
  1389. } else {
  1390. arrAnswer.push({
  1391. tag: index,
  1392. content: value.id
  1393. })
  1394. bc = false
  1395. }
  1396. }
  1397. if (bc) {
  1398. arrAnswer.push({
  1399. tag: index,
  1400. content: value.id
  1401. })
  1402. }
  1403. if (arrAnswer.length !== 0) {
  1404. arr.push({
  1405. blankAnswer: JSON.stringify(arrAnswer),
  1406. coordinates: JSON.stringify(this.drag[qIndex]),
  1407. index: qIndex,
  1408. questionType: scantron.questionType
  1409. })
  1410. } else {
  1411. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1412. }
  1413. }
  1414. }
  1415. if (b) {
  1416. if (value === null || value === "") {
  1417. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer = false
  1418. }
  1419. arr.push({
  1420. blankAnswer: JSON.stringify([{
  1421. tag: index,
  1422. content: value.id
  1423. }]),
  1424. coordinates: JSON.stringify(this.drag[qIndex]),
  1425. index: qIndex,
  1426. questionType: scantron.questionType
  1427. })
  1428. }
  1429. } else if (scantron.questionType === 8) {
  1430. console.log(this.connectionContentALL[qIndex]);
  1431. let info = value
  1432. value = ""
  1433. for (var i = 0; i < info.length; i++) {
  1434. console.log(info);
  1435. value += info[i].id.replace('option', '').split('-')[1]
  1436. }
  1437. // connectingCoordinates
  1438. if (value === undefined) {
  1439. return
  1440. }
  1441. let b = true
  1442. for (var j = 0; j < this.userExamAnswers.length; j++) {
  1443. if (this.userExamAnswers[j].index !== qIndex) {
  1444. arr.push(this.userExamAnswers[j])
  1445. } else {
  1446. b = false
  1447. let bc = true
  1448. let arrAnswer = []
  1449. let blankAnswer = JSON.parse(this.userExamAnswers[j].blankAnswer)
  1450. let num = blankAnswer.length;
  1451. for (var q = 0; q < num; q++) {
  1452. if (blankAnswer[q].tag !== index) {
  1453. arrAnswer.push({
  1454. tag: blankAnswer[q].tag,
  1455. content: blankAnswer[q].content
  1456. })
  1457. } else {
  1458. bc = false
  1459. }
  1460. }
  1461. if (bc) {
  1462. arrAnswer.push({
  1463. tag: index,
  1464. content: value
  1465. })
  1466. }
  1467. if (arrAnswer.length !== 0) {
  1468. arr.push({
  1469. blankAnswer: JSON.stringify(arrAnswer),
  1470. index: qIndex,
  1471. coordinates: JSON.stringify(this.connectionContentALL[qIndex]),
  1472. questionType: scantron.questionType
  1473. })
  1474. } else {
  1475. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question
  1476. .isAnswer =
  1477. false
  1478. }
  1479. }
  1480. }
  1481. if (b) {
  1482. if (value === null || value === "") {
  1483. this.examObject.userExamQuestionList[scantron.questionIndex - 1].question.isAnswer =
  1484. false
  1485. }
  1486. arr.push({
  1487. blankAnswer: JSON.stringify([{
  1488. tag: index,
  1489. content: value
  1490. }]),
  1491. coordinates: JSON.stringify(this.connectionContentALL[qIndex]),
  1492. index: qIndex,
  1493. questionType: scantron.questionType
  1494. })
  1495. }
  1496. }
  1497. this.userExamAnswers = arr
  1498. },
  1499. // 失去焦点时的处理函数
  1500. handleBlur(v) {
  1501. if (this.examObject.leaveOn) {
  1502. if (this.windowCheat < 2 && v !== 0) {
  1503. this.$refs.cheat.open()
  1504. }
  1505. let leaveCount = this.examObject.totalLeaveTimes
  1506. let leaveTime = this.examObject.leaveTime
  1507. this.cheat = setInterval(() => {
  1508. this.windowCheat++
  1509. cacheExamAnswer({
  1510. 'examAnswers': this.userExamAnswers,
  1511. 'userExamId': sessionStorage.getItem('examId'),
  1512. 'leaveTime': this.windowCheat,
  1513. 'paperId': this.userExamPaper.paperId,
  1514. 'limitTime': this.userExamPaper.limitTime
  1515. })
  1516. clearInterval(this.cheat)
  1517. }, leaveTime * 1000)
  1518. }
  1519. },
  1520. // 获得焦点时的处理函数
  1521. handleFocus() {
  1522. if (this.examObject.leaveOn) {
  1523. clearInterval(this.cheat)
  1524. if (this.windowCheat >= leaveCount) {
  1525. this.submitExam('cheat')
  1526. }
  1527. }
  1528. },
  1529. // 时间
  1530. addExamPaperTime(systemTime, endTime) {
  1531. return (endTime.getTime() - systemTime.getTime()) / 1000
  1532. },
  1533. // 更新倒计时函数
  1534. updateCountDown() {
  1535. var distance = this.examPaperTime;
  1536. this.examPaperTime = this.examPaperTime - 1
  1537. if (distance < 0) {
  1538. clearInterval(this.intervalId);
  1539. console.log(0);
  1540. this.messageToggle('warn', "时间已到,2秒后为您自动交卷")
  1541. setTimeout(() => {
  1542. this.submitExam(0)
  1543. }, 2000)
  1544. return;
  1545. }
  1546. // 计算时分秒
  1547. var seconds = Math.floor((distance % (60)));
  1548. var minutes = Math.floor((distance % (60 * 60)) / (60));
  1549. var hours = Math.floor(distance / (60 * 60));
  1550. if (hours != 0) {
  1551. this.paperTime = hours + ":" + (minutes.toString().length == 2 ? minutes : '0' + minutes) + ":" + (
  1552. seconds.toString().length == 2 ? seconds : '0' + seconds)
  1553. } else {
  1554. this.paperTime = (minutes.toString().length == 2 ? minutes : '0' + minutes) + ":" + (seconds.toString()
  1555. .length == 2 ? seconds : '0' + seconds)
  1556. }
  1557. let examTime = this.papersTime + distance
  1558. // 计算考試时分秒
  1559. var examTimeseconds = Math.floor((examTime % (60)));
  1560. var examTimeminutes = Math.floor((examTime % (60 * 60)) / (60));
  1561. var examTimehours = Math.floor(examTime / (60 * 60));
  1562. if (examTimehours != 0) {
  1563. this.examTime = examTimehours + ":" + (examTimeminutes.toString().length == 2 ? examTimeminutes : '0' +
  1564. examTimeminutes) + ":" + (
  1565. seconds.toString().length == 2 ? examTimeseconds : '0' + examTimeseconds)
  1566. } else {
  1567. this.examTime = (examTimeminutes.toString().length == 2 ? examTimeminutes : '0' + examTimeminutes) +
  1568. ":" + (examTimeseconds.toString()
  1569. .length == 2 ? examTimeseconds : '0' + examTimeseconds)
  1570. }
  1571. },
  1572. examPapersTime() {
  1573. let list = this.examObject.examPapersList
  1574. let time = 0
  1575. for (var i = 0; i < list.length; i++) {
  1576. if (list[i].paperId !== this.userExamPaper.paperId) {
  1577. if (list[i].state === 9) {
  1578. time += list[i].paperTime * 60
  1579. }
  1580. }
  1581. }
  1582. return time
  1583. }
  1584. },
  1585. mounted() {
  1586. window.addEventListener("unload", (e) => {
  1587. e.preventDefault();
  1588. setTimeout(() => {
  1589. cacheExamAnswer({
  1590. 'examAnswers': this.userExamAnswers,
  1591. 'userExamId': sessionStorage.getItem('examId'),
  1592. 'leaveTime': this.windowCheat,
  1593. 'paperId': this.userExamPaper.paperId,
  1594. 'limitTime': this.userExamPaper.limitTime
  1595. }).then(data => {
  1596. console.log(data);
  1597. })
  1598. }, 100)
  1599. });
  1600. this.user = JSON.parse(sessionStorage.getItem("user"))
  1601. let examId = sessionStorage.getItem('examId')
  1602. getExamDetail({
  1603. 'userExamId': examId,
  1604. 't': new Date().toString()
  1605. }).then(data => {
  1606. if (data.data.code !== 200) {
  1607. sessionStorage.removeItem('examId')
  1608. toLogin()
  1609. }
  1610. this.examObject = data.data.result
  1611. this.scantron = this.examObject.userExamQuestionList[0]
  1612. this.userExamPaper = this.examObject.userExamPapersList[0]
  1613. this.examPaperTime = this.addExamPaperTime(new Date(this.userExamPaper.systemTime), new Date(this
  1614. .userExamPaper.limitTime))
  1615. // 试卷计时
  1616. this.papersTime = this.examPapersTime()
  1617. this.intervalId = setInterval(this.updateCountDown, 1000);
  1618. this.examTime = this.paperTime
  1619. // 添加切屏事件监听
  1620. if (windowState) {
  1621. window.addEventListener('blur', this.handleBlur);
  1622. window.addEventListener('focus', this.handleFocus);
  1623. }
  1624. // 获取缓存答案
  1625. getCacheAnswer({
  1626. 'userExamId': examId
  1627. }).then(answerData => {
  1628. if (answerData.data.result !== null) {
  1629. this.answerDisplay(answerData.data.result)
  1630. }
  1631. })
  1632. })
  1633. }
  1634. }
  1635. </script>
  1636. <style scoped>
  1637. .svg-container {
  1638. width: 100%;
  1639. height: 100%;
  1640. overflow: hidden;
  1641. position: runiative;
  1642. }
  1643. svg {
  1644. display: block;
  1645. width: 100%;
  1646. height: 100%;
  1647. }
  1648. .scroll-Y {
  1649. height: 80vh;
  1650. }
  1651. .allceter {
  1652. display: flex;
  1653. align-items: center;
  1654. height: 50px;
  1655. }
  1656. .scroll-view_H {
  1657. white-space: nowrap;
  1658. width: 100%;
  1659. }
  1660. .scroll-view-item {
  1661. height: 300rpx;
  1662. line-height: 300rpx;
  1663. text-align: center;
  1664. font-size: 36rpx;
  1665. }
  1666. .scroll-view-item_H {
  1667. display: inline-block;
  1668. width: 100%;
  1669. height: 300rpx;
  1670. line-height: 300rpx;
  1671. text-align: center;
  1672. font-size: 36rpx;
  1673. }
  1674. div {
  1675. margin: 0;
  1676. padding: 0;
  1677. }
  1678. /* CSS 预设*/
  1679. * {
  1680. margin: 0;
  1681. padding: 0;
  1682. }
  1683. a {
  1684. text-decoration: none;
  1685. outline: none;
  1686. }
  1687. body a {
  1688. outline: none;
  1689. blr: expression(this.onFocus=this.blur());
  1690. }
  1691. .uni-input {
  1692. padding-left: 20px;
  1693. border: 1rpx solid #5bb4ee;
  1694. height: 96rpx;
  1695. margin-left: 10px;
  1696. color: #000000;
  1697. width: 90%;
  1698. display: flex;
  1699. justify-content: center;
  1700. align-items: center;
  1701. }
  1702. img {
  1703. border: none;
  1704. }
  1705. .dialog-text {
  1706. font-size: 14px;
  1707. color: #333;
  1708. }
  1709. .paperCss {
  1710. width: 85%;
  1711. border-radius: 5px;
  1712. padding: 15px;
  1713. margin-top: 15px;
  1714. font-size: 15px;
  1715. text-align: left;
  1716. }
  1717. </style>