From: Vincent Vanwaelscappel Date: Mon, 2 Nov 2020 15:36:00 +0000 (+0100) Subject: wait #3393 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b31f0653e2008261d3ddc4d044368acd03fd4460;p=fluidbook-toolbox.git wait #3393 @0:20 --- diff --git a/app/Http/Controllers/Admin/Operations/ReportOperation.php b/app/Http/Controllers/Admin/Operations/ReportOperation.php index c00859a7d..8a48ebf82 100644 --- a/app/Http/Controllers/Admin/Operations/ReportOperation.php +++ b/app/Http/Controllers/Admin/Operations/ReportOperation.php @@ -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) {