ExamingEnd.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="container" id="exam-end" v-if="afterExamRemark !== null">
  3. <div class="instructions">
  4. <h1 class="">考试已结束</h1>
  5. <div><img class="user-avatar" :src="user.photoPath" alt="无底照" /></div>
  6. <div class="qm-big-text score-text" v-if="!examResult">答案获取中...</div>
  7. <div class="qm-big-text score-text" v-if="!examResult && getResultTimes > 30">后台繁忙,请稍后在待考列表中查看客观题得分。</div>
  8. <div class="qm-big-text score-text" v-if="showObjectScore && !examResult.isWarn">客观题得分: <span style="color: red">{{examResult.objectiveScore}}</span></div>
  9. <div class="qm-big-text score-text" v-if="exam.examType !== 'ONLINE' && showObjectScore && !examResult.isWarn">客观题正确率: <span style="color: red">{{examResult.objectiveAccuracy}}%</span></div>
  10. <div class="qm-big-text score-text" v-if="examResult.isWarn">客观题得分: 成绩待审核</div>
  11. <h1 v-if="examResult.isWarn" class="" style="text-align: left;">违纪提示: </h1>
  12. <div v-if="examResult.isWarn" class="" style="text-align: left; padding-bottom: 20px">
  13. <p v-html="cheatingRemark"></p>
  14. </div>
  15. <h1 class="" style="text-align: left;">考后说明: </h1>
  16. <div class="" style="text-align: left; padding-bottom: 20px">
  17. <p v-html="afterExamRemark"></p>
  18. </div>
  19. <router-link class="qm-primary-button" to="/online-exam" style="display: inline-block; width: 100%;">
  20. 返回主页</router-link>
  21. </div>
  22. </div>
  23. <div v-else>
  24. 正在等待数据返回...
  25. </div>
  26. </template>
  27. <script>
  28. import { mapState as globalMapState } from "vuex";
  29. import { createNamespacedHelpers } from "vuex";
  30. const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
  31. export default {
  32. data() {
  33. return {
  34. afterExamRemark: null,
  35. showObjectScore: null,
  36. paperTotalScore: null,
  37. cheatingRemark: null,
  38. examResult: null,
  39. getResultTimes: 0
  40. };
  41. },
  42. async mounted() {
  43. const examRecordDataId = this.$route.params.examRecordDataId;
  44. const f = async () => {
  45. try {
  46. this.getResultTimes = this.getResultTimes + 1;
  47. const examResult = (await this.$http.get(
  48. "/api/ecs_oe_student/examControl/getEndExamInfo?examRecordDataId=" +
  49. examRecordDataId
  50. )).data;
  51. if (examResult === undefined || examResult === null) {
  52. setTimeout(() => f(), 3000);
  53. return;
  54. }
  55. this.examResult = examResult;
  56. } catch (error) {
  57. setTimeout(() => f(), 3000);
  58. }
  59. };
  60. await f();
  61. const afterExamRemark = await this.$http.get(
  62. "/api/ecs_exam_work/exam/examOrgProperty/" +
  63. this.$route.params.examId +
  64. `/AFTER_EXAM_REMARK`
  65. );
  66. this.afterExamRemark = afterExamRemark.data || "";
  67. const showObjectScore = await this.$http.get(
  68. "/api/ecs_exam_work/exam/examOrgProperty/" +
  69. this.$route.params.examId +
  70. `/IS_OBJ_SCORE_VIEW`
  71. );
  72. this.showObjectScore = showObjectScore.data || false;
  73. if (this.examResult.isWarn) {
  74. const cheatingRemark = await this.$http.get(
  75. "/api/ecs_exam_work/exam/examOrgProperty/" +
  76. this.$route.params.examId +
  77. `/CHEATING_REMARK`
  78. );
  79. this.cheatingRemark = cheatingRemark.data || "";
  80. }
  81. document.body.style = "";
  82. // this.paperTotalScore = this.paperStruct.defaultPaper.questionGroupList
  83. // .map(q => q.groupScore)
  84. // .reduce((p, c) => p + c);
  85. },
  86. beforeDestroy() {
  87. this.updateExamState({
  88. exam: null,
  89. paperStruct: null,
  90. examQuestionList: null
  91. });
  92. // this.updateExamResult({
  93. // examResult: null
  94. // });
  95. },
  96. computed: {
  97. ...globalMapState(["user"]),
  98. ...mapState(["exam", "paperStruct"])
  99. },
  100. methods: {
  101. ...mapMutations(["updateExamState", "updateExamResult"])
  102. }
  103. };
  104. </script>
  105. <style scoped>
  106. .container {
  107. margin: 0 auto;
  108. width: 80vw;
  109. overflow: auto;
  110. }
  111. .instructions {
  112. /* display: grid; */
  113. /* grid-template-rows: 40px 300px min(100px) 30px minmax(200px, auto) min(100px) min(
  114. 100px
  115. ) min(100px); */
  116. padding: 40px 20px;
  117. }
  118. .instructions > h1,
  119. .instructions > div {
  120. padding-bottom: 30px;
  121. }
  122. .user-avatar {
  123. display: inline-block;
  124. width: 140px;
  125. height: 140px;
  126. object-fit: contain;
  127. }
  128. .score-text {
  129. font-size: 40px;
  130. }
  131. /* .exam-detail {
  132. padding: 40px 20px;
  133. background-color: #f5f5f5;
  134. text-align: left;
  135. } */
  136. </style>
  137. <style>
  138. #exam-end img {
  139. max-width: 100%;
  140. height: auto !important;
  141. }
  142. </style>