Exemple #1
0
 /**
  * @return null|Quiz
  */
 public function getQuiz()
 {
     if (!empty($this->quiz)) {
         return $this->quiz;
     }
     return $this->quiz = Quiz::findOne($this->quizID);
 }
 public function actionAnswers($id)
 {
     $quiz = Quiz::findOne(['id' => $id]);
     if (!$quiz) {
         throw new NotFoundHttpException("Вопрос с идентификатором {$id} не найден!");
     }
     return $this->render('answers', ['quiz' => $quiz]);
 }