protected function displayResults(Set $set, OutputInterface $output)
{
$results = array();
$questionCount = 1;
foreach ($set->getQuestions() as $key => $question) {
$isCorrect = $set->isCorrect($key);
$label = wordwrap($question->getQuestion(), self::WORDWRAP_NUMBER, "\n");
$results[] = array(sprintf('<comment>#%d</comment> %s', $questionCount++, $label), wordwrap(implode(', ', $question->getCorrectAnswersValues()), self::WORDWRAP_NUMBER, "\n"), $isCorrect ? '<info>✔</info>' : '<error>✗</error>');
}
if ($results) {
$tableHelper = $this->getHelper('table');
$tableHelper->setHeaders(array('Question', 'Correct answer', 'Result'))->setRows($results);
$tableHelper->render($output);
$output->writeln(sprintf('<comment>Results</comment>: <error>errors: %s</error> - <info>correct: %s</info>', $set->getErrorsNumber(), $set->getValidNumber()));
}
}