Bladeren bron

fixed #305

ali 2 jaren geleden
bovenliggende
commit
9a23d5c719
1 gewijzigde bestanden met toevoegingen van 47 en 38 verwijderingen
  1. 47 38
      src/components/Widgets/Test/ShowTestGradeForGrader/ShowTestGradeForGrader.vue

+ 47 - 38
src/components/Widgets/Test/ShowTestGradeForGrader/ShowTestGradeForGrader.vue

@@ -32,13 +32,21 @@
         <q-item v-for="(answerSheet, answerSheetIndex) in answerBook.answer_sheet_info.list"
                 :key="answerSheetIndex"
                 clickable>
-          <q-item-section>
-            <q-item-label v-html="'<span>' + (answerSheetIndex + 1) + ' - </span>' + answerSheet.test_question_info.question_info.text" />
-            <q-item-label>
+          <div class="row full-width q-col-gutter-md">
+            <div class="col-md-10 col-12">
+              <div v-html="'<span>' + (answerSheetIndex + 1) + ' - </span>' + answerSheet.test_question_info.question_info.text" />
               <q-card class="q-mt-sm">
                 <q-card-section>
                   <div>
-                    متن پاسخ:
+                    پاسخ صحیح:
+                  </div>
+                  <div v-html="answerSheet.test_question_info.question_info.correct_answer" />
+                </q-card-section>
+              </q-card>
+              <q-card class="q-mt-sm">
+                <q-card-section>
+                  <div>
+                    متن پاسخ کاربر:
                   </div>
                   <div>
                     {{ answerSheet.answer_text }}
@@ -48,40 +56,42 @@
                     <q-btn outline
                            color="primary"
                            icon="attachment"
-                           label="فایل پیوست"
+                           label="فایل پیوست کاربر"
                            :href="answerSheet.answer_attachment"
                            target="_blank" />
                   </div>
                 </q-card-section>
               </q-card>
-            </q-item-label>
-            <q-item-label v-if="currentUserIsGrader">
-              <q-input v-model="scores[answerSheetIndex].score"
-                       :loading="scores[answerSheetIndex].loading"
-                       label="نمره">
-                <template v-slot:append>
-                  <q-btn color="primary"
-                         flat
-                         label="ثبت نمره"
+            </div>
+            <div class="col-md-2 col-12">
+              <div>
+                <q-badge v-if="answerSheet.score !== null">
+                  {{ answerSheet.score }}
+                  از
+                  {{ answerSheet.test_question_info.question_info.mark }}
+                  نمره
+                </q-badge>
+                <q-badge v-else>
+                  {{ answerSheet.test_question_info.question_info.mark }}
+                  نمره
+                </q-badge>
+              </div>
+              <div v-if="currentUserIsGrader"
+                   class="q-mt-md input-grate-question">
+                <q-input v-model="scores[answerSheetIndex].score"
                          :loading="scores[answerSheetIndex].loading"
-                         @click="submitScore(answerSheetIndex)" />
-                </template>
-              </q-input>
-            </q-item-label>
-          </q-item-section>
-
-          <q-item-section side>
-            <q-badge v-if="answerSheet.score !== null">
-              {{ answerSheet.score }}
-              از
-              {{ answerSheet.test_question_info.question_info.mark }}
-              نمره
-            </q-badge>
-            <q-badge v-else>
-              {{ answerSheet.test_question_info.question_info.mark }}
-              نمره
-            </q-badge>
-          </q-item-section>
+                         dense>
+                  <template v-slot:append>
+                    <q-btn color="primary"
+                           label="ثبت نمره"
+                           outline
+                           :loading="scores[answerSheetIndex].loading"
+                           @click="submitScore(answerSheetIndex)" />
+                  </template>
+                </q-input>
+              </div>
+            </div>
+          </div>
         </q-item>
       </q-list>
       <q-separator class="q-my-lg" />
@@ -290,12 +300,11 @@ export default {
   }
   :deep(.q-list) {
     .q-item {
-      .q-item__section {
-        display: inline-block;
-        .entity-crud-formBuilder {
-          margin-top: 8px;
-          .outsideLabel {
-            margin-bottom: 8px;
+      .input-grate-question {
+        .q-input {
+          .q-field__inner .q-field__control {
+            height: 40px;
+            min-height: 40px;
           }
         }
       }