You are here

protected function QuizSession::setCurrentQuizzes in Quiz 6.x

Gets the current quizzes the user is taking

Return value

array The quizzes

5 calls to QuizSession::setCurrentQuizzes()
QuizSession::removeQuiz in src/Services/QuizSession.php
Remove quiz from session
QuizSession::setCurrentQuestion in src/Services/QuizSession.php
Set the user's current question.
QuizSession::setResult in src/Services/QuizSession.php
Set a quiz result for the current user.
QuizSession::setTemporaryResult in src/Services/QuizSession.php
Set the user's temporary result ID (for feedback/review).
QuizSession::startQuiz in src/Services/QuizSession.php
Put a quiz result into the current user's session.

File

src/Services/QuizSession.php, line 140

Class

QuizSession
Default implementation of the quiz session.

Namespace

Drupal\quiz\Services

Code

protected function setCurrentQuizzes(array $current_quizzes) {
  $key = $this
    ->getSessionKey();
  if (sizeOf($current_quizzes) == 0) {
    $this->session
      ->remove($key);
  }
  else {
    $this->session
      ->set($key, $current_quizzes);
  }
}