move question count calculation
This commit is contained in:
parent
c5999fb6e7
commit
4676ec9b55
@ -49,7 +49,7 @@ class SafetyController extends AbstractController
|
||||
}
|
||||
}
|
||||
$log->Debug($testerName . ' quiz answers correct: ' . $correctAnswers);
|
||||
$this->sendQuizResults($correctAnswers, count($data), $form, $mailer, $log);
|
||||
$this->sendQuizResults($correctAnswers, $form, $mailer, $log);
|
||||
return $this->render('Training/Safety/quizResults.html.twig', ['testerName'=>$testerName,
|
||||
'correctAnswers'=>$correctAnswers, 'totalAnswers'=>count($data)]);
|
||||
}
|
||||
@ -115,7 +115,7 @@ class SafetyController extends AbstractController
|
||||
return new Response($header . $navButtons . $contents);
|
||||
}
|
||||
//Send an email with the quiz results
|
||||
public function sendQuizResults(int $answersCorrect, int $totalQuestions, FormInterface $submittedQuiz, MailerInterface $mailer, LoggerInterface $log)
|
||||
public function sendQuizResults(int $answersCorrect, FormInterface $submittedQuiz, MailerInterface $mailer, LoggerInterface $log)
|
||||
{
|
||||
//Fetch array of mail inboxes to send messages to.
|
||||
//If env var doesn't exist then fail gracefully
|
||||
@ -170,7 +170,7 @@ class SafetyController extends AbstractController
|
||||
->context([
|
||||
'submission' => $quiz,
|
||||
'answersCorrect' => $answersCorrect,
|
||||
'totalQuestions' => $totalQuestions,
|
||||
'totalQuestions' => count($questionKeys),
|
||||
'submitterName' => $submittedData['Name']])
|
||||
;
|
||||
try
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user