]> _ Git - fluidbook-toolbox.git/commitdiff
wait #3393 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Nov 2020 15:36:00 +0000 (16:36 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Nov 2020 15:36:00 +0000 (16:36 +0100)
app/Http/Controllers/Admin/Operations/ReportOperation.php

index c00859a7d8fe951f4dd5244d5d97ec3a8fb0b85a..8a48ebf82ba8841619c07c4ecfd3edf9856c36e6 100644 (file)
@@ -27,9 +27,15 @@ trait ReportOperation
         $first = ['#', 'Date', 'Score', 'Passed'];
 
         $emailQuestion = 0;
+        $countForScore = [];
 
         foreach ($quiz->questions as $q => $question) {
-            $first[] = $question['report_label'] ?: $question['question'];
+            $label = $question['report_label'] ?: $question['question'];
+            $first[] = $label;
+            if ($question['count_for_score']) {
+                $first[] = $label . ' status';
+                $countForScore[] = $q;
+            }
             if ($question['type'] === 'email') {
                 $emailQuestion = $q;
             }
@@ -52,6 +58,9 @@ trait ReportOperation
                     $email = trim(mb_strtolower($aa));
                 }
                 $a[] = is_array($aa) ? implode(', ', $aa) : $aa;
+                if (in_array($aid - 1, $countForScore, true)) {
+                    $a[] = $answer['score'];
+                }
             }
 
             if (null !== $email) {