Browse Source

fix: test participation

ali 2 years ago
parent
commit
b74ae9b665

+ 1 - 1
src/components/Widgets/Test/TestConfirmation/TestConfirmation.vue

@@ -67,7 +67,7 @@ export default {
       answerBook: new AnswerBook()
     }
   },
-  mounted() {
+  mounted () {
     this.$store.commit('Test/updateAnswerBook', null)
     this.getAnswerBook()
   },

+ 3 - 0
src/components/Widgets/Test/TestParticipation/TestParticipation.vue

@@ -119,6 +119,9 @@ export default {
     this.getTestQuestions()
     this.mounted = true
   },
+  beforeUnmount() {
+    this.stopTimer()
+  },
   methods: {
     loadAnswerBookFromStore () {
       this.storeAnswerBook = this.$store.getters['Test/answerBook']

+ 18 - 2
src/pages/User/Profile/classroomInfo.vue

@@ -178,10 +178,26 @@
                   {{ inputData.rowNumber }}
                 </template>
                 <template v-else-if="col.name === 'action'">
-                  <q-btn size="md"
+                  <q-btn v-if="row.is_enabled_attending"
+                         size="md"
                          color="primary"
-                         label="جزییات"
+                         label="شرکت در آزمون"
                          :to="{name: 'UserPanel.Test.AnswerBook.Confirmation', params: {test_id: row.test, answer_book_id: row.id}}" />
+                  <q-btn v-if="row.is_enabled_continuing"
+                         size="md"
+                         color="primary"
+                         label="ادامه آزمون"
+                         @click="showParticipateTypeDialog(row.test, row.id)" />
+                  <q-btn v-if="row.is_enabled_objecting"
+                         size="md"
+                         color="primary"
+                         label="ثبت اعتراض"
+                         :to="{name: 'UserPanel.Test.AnswerBook.Show', params: {test_id: row.test, answer_book_id: row.id}, query: { send_objection: 1}}" />
+                  <q-btn v-if="row.is_enabled_viewing"
+                         size="md"
+                         color="primary"
+                         label="مشاهده"
+                         :to="{name: 'UserPanel.Test.AnswerBook.Show', params: {test_id: row.test, answer_book_id: row.id}}" />
                 </template>
               </template>
             </entity-index-grid-item>