ExamPaperResult.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. <template>
  2. <el-container v-if="showPaper">
  3. <el-header>
  4. <el-row>
  5. <el-col style="border-bottom: 1px solid #f5f5f5">
  6. <el-row>
  7. <span class="examTitle">试卷名字: </span>
  8. <span style="color: red;font-size: 18px;">{{ examInfo.examName }}</span>
  9. <span class="examTitle">试卷总分: </span>
  10. <span style="color: red;font-size: 18px;">{{ examInfo.paperScore }} 分</span>
  11. <span class="examTitle">考试时间: </span>
  12. <span style="color: red;font-size: 18px;">{{ examInfo.examTime }}</span>
  13. </el-row>
  14. <el-row>
  15. <span class="examTitle">总分: </span>
  16. <span style="color: red;font-size: 18px;">{{ examInfo.userScore }} 分</span>
  17. <span class="examTitle">客观题得分: </span>
  18. <span style="color: red;font-size: 18px;">{{ examInfo.objectiveScore }} 分</span>
  19. <span class="examTitle">主观题得分: </span>
  20. <span style="color: red;font-size: 18px;">{{ examInfo.subjectiveScore }} 分</span>
  21. </el-row>
  22. <el-row>
  23. <div v-if="paperStatus === 3">
  24. <el-button
  25. type="warning"
  26. round
  27. style="background-color: #ffd550;float: right;color: black;font-weight: 800"
  28. @click="uploadExamToAdmin"
  29. >提交阅卷
  30. </el-button>
  31. </div>
  32. </el-row>
  33. </el-col>
  34. </el-row>
  35. </el-header>
  36. <el-main>
  37. <el-row>
  38. <el-col :span="16">
  39. <el-row v-for="(item, index) in questionResults" :key="index">
  40. <el-row class="card-style">
  41. <el-card>
  42. <!-- 题目信息 -->
  43. <div>
  44. <span v-if="item.questionInfo.questionType === 1">【单选题】</span>
  45. <span v-else-if="item.questionInfo.questionType === 2">【多选题】</span>
  46. <span v-else-if="item.questionInfo.questionType === 3">【不定项选择题】</span>
  47. <span v-else-if="item.questionInfo.questionType === 4">【判断题】</span>
  48. <span v-else-if="item.questionInfo.questionType === 5">【填空题】</span>
  49. <span v-else-if="item.questionInfo.questionType === 6">【问答题】</span>
  50. <span v-else-if="item.questionInfo.questionType === 7">【理解题】</span>
  51. <span v-else>【综合题】</span>
  52. <br>
  53. <br>
  54. <i class="num">{{ item.questionInfo.pos }}</i>
  55. <span style="color: red">
  56. ({{ item.questionInfo.score }} 分)
  57. </span>
  58. <span v-html="item.questionInfo.questionContent" />
  59. <span style="color: green">
  60. (得分: {{ item.userScore }} 分)
  61. </span>
  62. <div v-if="item.questionInfo.questionType !== 8">
  63. <el-button
  64. type="warning"
  65. size="mini"
  66. icon="el-icon-info"
  67. @click="questionAnalysisDialog = true"
  68. >试题解析</el-button>
  69. </div>
  70. <div v-if="item.questionInfo.questionType === 8">
  71. <div v-for="(child, childIndex) in item.children" :key="childIndex">
  72. <div
  73. style="margin-top: 40px"
  74. >
  75. <span style="color: red">
  76. ({{ child.questionInfo.score }} 分)
  77. </span>
  78. <span v-html="child.questionInfo.questionContent" />
  79. <span style="color: green">
  80. (得分: {{ child.userScore }} 分)
  81. </span>
  82. <el-button
  83. type="warning"
  84. size="mini"
  85. icon="el-icon-info"
  86. @click="questionAnalysisDialog = true"
  87. >试题解析</el-button>
  88. </div>
  89. <!-- 单选和判断题候选答案列表 -->
  90. <div
  91. v-show="child.questionInfo.questionType === 1 || child.questionInfo.questionType === 4"
  92. style="margin-top: 25px"
  93. >
  94. <el-radio-group
  95. v-for="(ans,ans_index) in child.questionInfo.answer"
  96. :key="ans_index"
  97. v-model="child.userAnswer"
  98. text-color="green"
  99. >
  100. <el-radio-button
  101. :label="ans.pos"
  102. disabled
  103. >
  104. <span
  105. :class="ans.correct ? 'el-icon-check' : ''"
  106. >
  107. {{ optionName[ans_index] + '、' + ans.answer }}
  108. </span>
  109. </el-radio-button>
  110. </el-radio-group>
  111. <div style="margin-top: 25px">
  112. <el-divider />
  113. <span>答案解析</span>
  114. </div>
  115. </div>
  116. <!-- 多选和不定项选择题的候选答案列表 -->
  117. <div
  118. v-show="child.questionType === 2 || child.questionType === 3"
  119. style="margin-top: 25px"
  120. >
  121. <el-checkbox-group
  122. v-for="(ans,ans_index) in child.answer"
  123. :key="ans_index"
  124. v-model="child.userAnswer"
  125. text-color="green"
  126. >
  127. <el-checkbox :label="ans_index">
  128. <span
  129. :class="ans.correct ? 'el-icon-check' : ''"
  130. >
  131. {{ optionName[ans_index] + '、' + ans.answer }}
  132. </span>
  133. </el-checkbox>
  134. </el-checkbox-group>
  135. <div style="margin-top: 25px">
  136. <span>答案解析</span>
  137. </div>
  138. </div>
  139. <!-- 填空题和问答题的回答区 -->
  140. <div
  141. v-show="child.questionType === 5 || child.questionType === 6"
  142. style="margin-top: 25px"
  143. >
  144. <el-input
  145. v-model="userAnswer[curIndex]"
  146. type="textarea"
  147. :rows="8"
  148. placeholder="请输入答案"
  149. />
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <!-- 单选和判断题候选答案列表 -->
  155. <div
  156. v-show="item.questionInfo.questionType === 1 || item.questionInfo.questionType === 4"
  157. style="margin-top: 25px"
  158. >
  159. <el-radio-group
  160. v-for="(ans,ans_index) in item.questionInfo.answer"
  161. :key="ans_index"
  162. v-model="item.userAnswer"
  163. text-color="green"
  164. >
  165. <el-radio-button
  166. :label="ans.pos"
  167. disabled
  168. >
  169. <span
  170. :class="ans.correct ? 'el-icon-check' : ''"
  171. >
  172. {{ optionName[ans_index] + '、' + ans.answer }}
  173. </span>
  174. </el-radio-button>
  175. </el-radio-group>
  176. <div style="margin-top: 25px">
  177. <span>答案解析</span>
  178. </div>
  179. </div>
  180. <!-- 多选和不定项选择题的候选答案列表 -->
  181. <div
  182. v-show="item.questionInfo.questionType === 2 || item.questionInfo.questionType === 3"
  183. style="margin-top: 25px"
  184. >
  185. <el-checkbox-group
  186. v-for="(ans,ans_index) in item.questionInfo.answer"
  187. :key="ans_index"
  188. v-model="item.userAnswer"
  189. text-color="green"
  190. >
  191. <el-checkbox-button
  192. :label="ans.pos"
  193. border
  194. style="margin-top: 20px;"
  195. disabled
  196. >
  197. <span
  198. :class="ans.correct ? 'el-icon-check' : ''"
  199. >
  200. {{ optionName[ans_index] + '、' + ans.answer }}
  201. </span>
  202. </el-checkbox-button>
  203. </el-checkbox-group>
  204. <div style="margin-top: 25px">
  205. <el-divider />
  206. <span>答案解析</span>
  207. </div>
  208. </div>
  209. <!-- 填空题的回答区 -->
  210. <div
  211. v-show="item.questionInfo.questionType === 5"
  212. style="margin-top: 25px"
  213. >
  214. <div style="margin-top: 25px">
  215. <el-row>
  216. <span>用户答案:</span>
  217. </el-row>
  218. <el-row>
  219. <span style="color: green" v-html="item.userAnswer" />
  220. </el-row>
  221. </div>
  222. <div style="margin-top: 25px">
  223. <el-row>
  224. <span>正确答案:</span>
  225. </el-row>
  226. <el-row>
  227. <span style="color: orangered" v-html="item.correctAnswer" />
  228. </el-row>
  229. </div>
  230. <div v-if="paperStatus === 3" style="margin-top: 25px">
  231. <span>评分:</span>
  232. <el-input-number
  233. v-model="questionMarks[item.questionInfo.pos].score"
  234. :min="0"
  235. :max="50"
  236. @change="onInputNumber(item.questionInfo)"
  237. />
  238. <el-input
  239. v-model="questionMarks[item.questionInfo.pos].review"
  240. type="textarea"
  241. :rows="3"
  242. placeholder="请输入评语"
  243. @blur="onInputBlur(item.questionInfo)"
  244. />
  245. </div>
  246. <div v-if="paperStatus === 4" style="margin-top: 25px">
  247. <span>
  248. 得分: <span style="color: green">{{ questionMarks[item.questionInfo.pos].score }}</span>
  249. </span>
  250. <br/>
  251. <br/>
  252. <span>
  253. 评语: <span style="color: green">{{ questionMarks[item.questionInfo.pos].review }}</span>
  254. </span>
  255. </div>
  256. <div style="margin-top: 25px">
  257. <el-divider />
  258. <span>答案解析</span>
  259. </div>
  260. </div>
  261. <!-- 问答题的回答区 -->
  262. <div
  263. v-show="item.questionInfo.questionType === 6"
  264. style="margin-top: 25px"
  265. >
  266. <div style="margin-top: 25px">
  267. <el-row>
  268. <span>用户答案:</span>
  269. </el-row>
  270. <el-row>
  271. <span style="color: green" v-html="item.userAnswer" />
  272. </el-row>
  273. </div>
  274. <div style="margin-top: 25px">
  275. <el-row>
  276. <span>正确答案:</span>
  277. </el-row>
  278. <el-row>
  279. <span style="color: orangered" v-html="item.correctAnswer" />
  280. </el-row>
  281. </div>
  282. <div v-if="paperStatus === 3" style="margin-top: 25px">
  283. <span>评分:</span>
  284. <el-input-number
  285. v-model="questionMarks[item.questionInfo.pos].score"
  286. :min="0"
  287. :max="50"
  288. @change="onInputNumber(item.questionInfo)"
  289. />
  290. <el-input
  291. v-model="questionMarks[item.questionInfo.pos].review"
  292. type="textarea"
  293. :rows="3"
  294. placeholder="请输入评语"
  295. @blur="onInputBlur(item.questionInfo)"
  296. />
  297. </div>
  298. <div v-if="paperStatus === 4" style="margin-top: 25px">
  299. <span>
  300. 得分: <span style="color: green">{{ questionMarks[item.questionInfo.pos].score }}</span>
  301. </span>
  302. <br/>
  303. <br/>
  304. <span>
  305. 评语: <span style="color: green">{{ questionMarks[item.questionInfo.pos].review }}</span>
  306. </span>
  307. </div>
  308. <div style="margin-top: 25px">
  309. <el-divider />
  310. <span>答案解析</span>
  311. </div>
  312. </div>
  313. </el-card>
  314. </el-row>
  315. </el-row>
  316. </el-col>
  317. <!-- 答题卡 -->
  318. <el-col :span="8">
  319. <el-row class="card-style">
  320. <el-card>
  321. <div slot="header" class="clearfix">
  322. <h1>阅卷须知</h1>
  323. </div>
  324. <div class="text item">
  325. <el-row>
  326. <h3>客观题部分</h3>
  327. <span>
  328. 系统已自动对客观题进行了阅卷<br>
  329. </span>
  330. <span>
  331. 用户答案使用<span style="color: green">绿色</span>文字标记<br>
  332. </span>
  333. <span>
  334. 参考答案前面会使用 <span class="el-icon-check" /> 来标记<br>
  335. </span>
  336. </el-row>
  337. <el-row>
  338. <h3>主观题部分</h3>
  339. <span>
  340. 用户答案使用<span style="color: green">绿色</span>文字标记<br>
  341. </span>
  342. <span>
  343. 参考答案使用<span style="color: orangered">红色</span>文字标记<br>
  344. </span>
  345. </el-row>
  346. </div>
  347. </el-card>
  348. </el-row>
  349. <el-row class="card-style">
  350. <el-card>
  351. <div>
  352. <p style="font-size: 18px;">答题卡</p>
  353. </div>
  354. <!-- 单选的答题卡 -->
  355. <div style="margin-top: 25px">
  356. <p style="font-size: 18px;">单选题</p>
  357. <el-button
  358. v-for="item in questionList.length"
  359. v-show="questionList[item-1].questionType === 1"
  360. :key="item"
  361. style="margin-top: 10px;margin-left: 15px"
  362. size="mini"
  363. :class="questionList[item-1].questionType === 1 && userAnswer[item-1] !== undefined ?
  364. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  365. >{{ item }}
  366. </el-button>
  367. </div>
  368. <!-- 多选的答题卡 -->
  369. <div style="margin-top: 25px">
  370. <p style="font-size: 18px;">多选题</p>
  371. <el-button
  372. v-for="item in questionList.length"
  373. v-show="questionList[item-1].questionType === 2"
  374. :key="item"
  375. style="margin-top: 10px;margin-left: 15px"
  376. size="mini"
  377. >{{ item }}
  378. </el-button>
  379. </div>
  380. <!-- 不定项选择题的答题卡 -->
  381. <div style="margin-top: 25px">
  382. <p style="font-size: 18px;">不定项选择题</p>
  383. <el-button
  384. v-for="item in questionList.length"
  385. v-show="questionList[item-1].questionType === 3"
  386. :key="item"
  387. style="margin-top: 10px;margin-left: 15px"
  388. size="mini"
  389. :class="questionList[item-1].questionType === 3 && userAnswer[item-1] !== undefined ?
  390. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  391. >{{ item }}
  392. </el-button>
  393. </div>
  394. <!-- 判断题的答题卡 -->
  395. <div style="margin-top: 25px">
  396. <p style="font-size: 18px;">判断题</p>
  397. <el-button
  398. v-for="item in questionList.length"
  399. v-show="questionList[item-1].questionType === 4"
  400. :key="item"
  401. style="margin-top: 10px;margin-left: 15px"
  402. size="mini"
  403. :class="questionList[item-1].questionType === 4 && userAnswer[item-1] !== undefined ?
  404. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  405. >{{ item }}
  406. </el-button>
  407. </div>
  408. <!-- 填空题的答题卡 -->
  409. <div style="margin-top: 25px">
  410. <p style="font-size: 18px;">填空题</p>
  411. <el-button
  412. v-for="item in questionList.length"
  413. v-show="questionList[item-1].questionType === 5"
  414. :key="item"
  415. style="margin-top: 10px;margin-left: 15px"
  416. size="mini"
  417. :class="questionList[item-1].questionType === 5 && userAnswer[item-1] !== undefined ?
  418. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  419. >{{ item }}
  420. </el-button>
  421. </div>
  422. <!-- 问答题的答题卡 -->
  423. <div style="margin-top: 25px">
  424. <p style="font-size: 18px;">问答题</p>
  425. <el-button
  426. v-for="item in questionList.length"
  427. v-show="questionList[item-1].questionType === 6"
  428. :key="item"
  429. style="margin-top: 10px;margin-left: 15px"
  430. size="mini"
  431. :class="questionList[item-1].questionType === 6 && userAnswer[item-1] !== undefined ?
  432. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  433. >{{ item }}
  434. </el-button>
  435. </div>
  436. <!-- 综合题的答题卡 -->
  437. <div style="margin-top: 25px">
  438. <p style="font-size: 18px;">综合题</p>
  439. <el-button
  440. v-for="item in questionList.length"
  441. v-show="questionList[item-1].questionType === 8"
  442. :key="item"
  443. style="margin-top: 10px;margin-left: 15px"
  444. size="mini"
  445. :class="questionList[item-1].questionType === 8 && userAnswer[item-1] !== undefined ?
  446. 'done' : userAnswer[item-1] === undefined ? curIndex === (item-1) ? 'orange' : 'noAnswer' : 'noAnswer'"
  447. @click="curIndex = item-1"
  448. >{{ item }}
  449. </el-button>
  450. </div>
  451. </el-card>
  452. </el-row>
  453. </el-col>
  454. </el-row>
  455. </el-main>
  456. <el-dialog :visible.sync="questionAnalysisDialog" @close="questionAnalysisDialog = false">
  457. <span>试题解析</span>
  458. </el-dialog>
  459. </el-container>
  460. </template>
  461. <script>
  462. import { getExamResult, getPaperQuestions, submitExamMark } from '@/api/exam'
  463. export default {
  464. name: 'ExamPaperResult',
  465. data() {
  466. return {
  467. paperStatus: 1,
  468. questionAnalysisDialog: false,
  469. // 当前考试的信息
  470. examInfo: {},
  471. // 当前的考试题目
  472. questionList: [
  473. {
  474. questionType: ''
  475. }
  476. ],
  477. // 当前题目的索引值
  478. curIndex: 0,
  479. // 控制大图的对话框
  480. bigImgDialog: false,
  481. // 当前要展示的大图的url
  482. bigImgUrl: '',
  483. // 用户选择的答案
  484. userAnswer: [],
  485. // 页面数据加载
  486. loading: {},
  487. // 页面绘制是否开始
  488. showPaper: false,
  489. // 答案的选项名abcd数据
  490. optionName: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
  491. // 考试总时长
  492. duration: 0,
  493. answer: {
  494. pos: null,
  495. questionId: null,
  496. questionType: null,
  497. questionAnswer: null,
  498. children: []
  499. },
  500. questionMap: new Map(),
  501. childMap: new Map(),
  502. questionResults: [],
  503. questionMarks: [
  504. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  505. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  506. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  507. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  508. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  509. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  510. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  511. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  512. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  513. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' },
  514. { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }, { score: 0, review: '' }
  515. ]
  516. }
  517. },
  518. created() {
  519. const path = this.$route.path
  520. if (path.startsWith('/exam/mark')) {
  521. document.title = '试卷评判'
  522. this.paperStatus = 3
  523. const resultId = this.$route.params.resultId
  524. this.getExamResult(resultId)
  525. } else if (path.startsWith('/exam/score')) {
  526. document.title = '试卷成绩'
  527. this.paperStatus = 4
  528. const resultId = this.$route.params.resultId
  529. this.getExamResult(resultId)
  530. }
  531. const paperId = this.$route.params.paperId
  532. },
  533. methods: {
  534. renderByMathjax() {
  535. // tinymce 的 mathjax 插件生成的 latex 格式公式放在 className 为 math-tex 的 span 标签内
  536. const className = 'math-tex'
  537. this.$nextTick(function() {
  538. if (this.MathJax.isMathjaxConfig) {
  539. this.MathJax.initMathjaxConfig()
  540. }
  541. this.MathJax.MathQueue1(className)
  542. })
  543. },
  544. getExamResult(resultId) {
  545. getExamResult(resultId).then((resp) => {
  546. if (resp.code === 0) {
  547. const respData = resp.data
  548. this.examInfo = {
  549. examId: respData.examId,
  550. resultId: respData.resultId,
  551. examName: respData.examName,
  552. paperScore: respData.paperScore,
  553. examTime: respData.examTime,
  554. userScore: respData.userScore,
  555. objectiveScore: respData.objectiveScore,
  556. subjectiveScore: respData.subjectiveScore
  557. }
  558. this.questionResults = resp.data.questionResults
  559. const paperId = resp.data.examId
  560. this.getQuestionInfo1(paperId)
  561. }
  562. })
  563. },
  564. // 查询考试的题目信息
  565. getQuestionInfo1(paperId) {
  566. getPaperQuestions(paperId).then(resp => {
  567. if (resp.code === 0) {
  568. this.questionList = resp.data || []
  569. // 重置问题的顺序 单选 -> -> 判断 -> 简答
  570. this.questionList = this.questionList.sort(function(a, b) {
  571. return a.questionType - b.questionType
  572. })
  573. for (const item of this.questionList) {
  574. if (item.questionType === 5 || item.questionType === 6) {
  575. this.questionMap.set(item.questionId, item)
  576. }
  577. if (item.children !== undefined && item.children !== null) {
  578. for (const child of item.children) {
  579. if (child.questionType === 5 || child.questionType === 6) {
  580. this.childMap.set(child.questionId, item.questionId)
  581. this.questionMap.set(item.questionId, item)
  582. }
  583. }
  584. }
  585. }
  586. this.showPaper = true
  587. this.renderByMathjax()
  588. }
  589. })
  590. },
  591. // ****************************************************************************************************************
  592. // 填空和问答题
  593. onInputNumber(val) {
  594. console.log(this.questionMarks[val.pos])
  595. },
  596. onInputBlur(val) {
  597. console.log(this.questionMarks[val.pos])
  598. },
  599. async uploadExamToAdmin() {
  600. var submitMarks = []
  601. for (const item of this.questionMap) {
  602. const question = item[1]
  603. const pos = question.pos
  604. const markForm = this.questionMarks[pos]
  605. submitMarks.push({
  606. questionId: question.questionId,
  607. pos: pos,
  608. score: markForm.score,
  609. review: markForm.review
  610. })
  611. }
  612. const markResult = {}
  613. markResult.paperId = this.examInfo.examId
  614. markResult.resultId = this.examInfo.resultId
  615. markResult.paperMarks = submitMarks
  616. submitExamMark(markResult).then((resp) => {
  617. if (resp.code === 0) {
  618. this.$notify({
  619. title: 'Tips',
  620. message: '阅卷结果已提交',
  621. type: 'success',
  622. duration: 2000
  623. })
  624. this.$router.push('/exam/mark')
  625. }
  626. }).catch(error => {
  627. this.$notify({
  628. title: '提示',
  629. message: error.message,
  630. type: 'error',
  631. duration: 3000
  632. })
  633. })
  634. },
  635. showCorrectAnswer(correctAnswer) {
  636. this.$message.info(correctAnswer)
  637. }
  638. }
  639. }
  640. </script>
  641. <style lang="scss" scoped>
  642. * {
  643. font-weight: 800;
  644. }
  645. .el-container {
  646. width: 100%;
  647. height: 100%;
  648. }
  649. .startExam {
  650. color: #160f58;
  651. border-bottom: 4px solid #ffd550;
  652. font-size: 18px;
  653. font-weight: 700;
  654. padding-bottom: 10px
  655. }
  656. .examTitle {
  657. font-size: 18px;
  658. color: #cbcacf;
  659. margin-left: 20px;
  660. font-weight: 700;
  661. }
  662. .el-radio-group label {
  663. display: block;
  664. width: 400px;
  665. padding: 48px 20px 10px 20px;
  666. border-radius: 4px;
  667. border: 1px solid #dcdfe6;
  668. margin-bottom: 10px;
  669. cursor: pointer;
  670. position: relative;
  671. span {
  672. position: absolute;
  673. top: 50%;
  674. transform: translateY(-50%);
  675. font-size: 16px;
  676. }
  677. }
  678. .el-radio-group label:hover {
  679. background-color: rgb(245, 247, 250);
  680. }
  681. /*当前选中的答案*/
  682. .active {
  683. border: 1px solid #1f90ff !important;
  684. opacity: .5;
  685. }
  686. /*做过的题目的高亮颜色*/
  687. .done {
  688. background-color: rgb(87, 148, 247);
  689. }
  690. /*未做题目的高亮颜色*/
  691. .noAnswer {
  692. background-color: rgb(238, 238, 238);
  693. }
  694. /*当前在做的题目高亮的颜色*/
  695. .orange {
  696. background-color: rgb(255, 213, 80);
  697. }
  698. .num {
  699. display: inline-block;
  700. background: url('../../assets/img/examTitle.png') no-repeat 95%;
  701. background-size: contain;
  702. height: 37px;
  703. width: 37px;
  704. line-height: 30px;
  705. color: #fff;
  706. font-size: 20px;
  707. text-align: center;
  708. margin-right: 15px;
  709. }
  710. .card-style {
  711. padding-top: 5px;
  712. padding-bottom: 5px;
  713. padding-left: 5px;
  714. padding-right: 5px;
  715. }
  716. </style>