$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;
}
$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) {