You are here

public function QuizSession::setTemporaryResult in Quiz 6.x

Set the user's temporary result ID (for feedback/review).

Parameters

QuizResult $quiz_result: The quiz result.

Overrides QuizSessionInterface::setTemporaryResult

File

src/Services/QuizSession.php, line 95

Class

QuizSession
Default implementation of the quiz session.

Namespace

Drupal\quiz\Services

Code

public function setTemporaryResult(QuizResult $quiz_result) {
  $current_quizzes = $this
    ->getCurrentQuizzes();
  $current_quizzes[self::TEMP_ID] = $quiz_result
    ->id();
  $this
    ->setCurrentQuizzes($current_quizzes);
}