Explorar el Código

fix: test show style

ali hace 2 años
padre
commit
c9a160208a

+ 35 - 37
src/components/Widgets/Test/AdminAnswerBookShow/AdminAnswerBookShow.vue

@@ -27,7 +27,7 @@
             سوال
           </div>
           <div class="col-md-4 col-12">
-            {{ answerBook.duration }}
+            {{ answerBook.test_info.duration_deadline }}
             دقیقه
           </div>
         </div>
@@ -36,9 +36,9 @@
         <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>
@@ -58,34 +58,33 @@
                   </div>
                 </q-card-section>
               </q-card>
-            </q-item-label>
-            <q-item-label>
-              <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">
+              <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 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" />
@@ -255,12 +254,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;
           }
         }
       }

+ 9 - 7
src/components/Widgets/Test/TestParticipation/components/AllQuestions.vue

@@ -4,13 +4,15 @@
       <q-item v-for="(answerSheet, answerSheetIndex) in answerBook.answer_sheet_info.list"
               :key="answerSheetIndex"
               clickable>
-        <q-item-section v-html="'<span>' + (answerSheetIndex + 1) + ' - </span>' + answerSheet.test_question_info.question_info.text" />
-        <q-item-section side>
-          <q-badge>
-            {{ answerSheet.test_question_info.question_info.mark }}
-            نمره
-          </q-badge>
-        </q-item-section>
+        <div class="full-width">
+          <div class="flex justify-end">
+            <q-badge>
+              {{ answerSheet.test_question_info.question_info.mark }}
+              نمره
+            </q-badge>
+          </div>
+          <div v-html="'<span>' + (answerSheetIndex + 1) + ' - </span>' + answerSheet.test_question_info.question_info.text" />
+        </div>
       </q-item>
     </q-list>
     <q-separator class="q-my-lg" />

+ 31 - 30
src/components/Widgets/Test/TestShow/TestShow.vue

@@ -16,7 +16,7 @@
             سوال
           </div>
           <div class="col-md-4 col-12">
-            {{ answerBook.duration }}
+            {{ answerBook.test_info.duration_deadline }}
             دقیقه
           </div>
         </div>
@@ -25,35 +25,36 @@
         <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>
-              <entity-show v-if="mounted"
-                           ref="entityShow"
-                           v-model:value="questionInputs[answerSheetIndex]"
-                           :loaded-data="answerSheet"
-                           :show-close-button="false"
-                           :show-edit-button="false"
-                           :show-expand-button="false"
-                           :show-save-button="false"
-                           :show-index-button="false"
-                           :show-reload-button="false"
-                           :default-layout="false" />
-            </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>
+          <div class="full-width">
+            <div class="flex justify-end">
+              <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>
+              <div v-html="'<span>' + (answerSheetIndex + 1) + ' - </span>' + answerSheet.test_question_info.question_info.text" />
+              <div>
+                <entity-show v-if="mounted"
+                             ref="entityShow"
+                             v-model:value="questionInputs[answerSheetIndex]"
+                             :loaded-data="answerSheet"
+                             :show-close-button="false"
+                             :show-edit-button="false"
+                             :show-expand-button="false"
+                             :show-save-button="false"
+                             :show-index-button="false"
+                             :show-reload-button="false"
+                             :default-layout="false" />
+              </div>
+            </div>
+          </div>
         </q-item>
       </q-list>
       <q-separator class="q-my-lg" />