examStart.vue 59 KB

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