You are here

function QuizQuestionFeedbackForm::submitEnd in Quiz 8.5

Same name and namespace in other branches
  1. 8.6 src/Form/QuizQuestionFeedbackForm.php \Drupal\quiz\Form\QuizQuestionFeedbackForm::submitEnd()
  2. 6.x src/Form/QuizQuestionFeedbackForm.php \Drupal\quiz\Form\QuizQuestionFeedbackForm::submitEnd()

Submit handler to go to the quiz results from the last question's feedback.

File

src/Form/QuizQuestionFeedbackForm.php, line 95

Class

QuizQuestionFeedbackForm

Namespace

Drupal\quiz\Form

Code

function submitEnd($form, &$form_state) {
  $result_id = $_SESSION['quiz']['temp']['result_id'];
  $quiz = $form_state
    ->getBuildInfo()['args'][0];
  $form_state
    ->setRedirect('entity.quiz_result.canonical', [
    'quiz' => $quiz
      ->id(),
    'quiz_result' => $result_id,
  ]);
}