protected function initInternal() { parent::initInternal(); $this->initCredits(); $this->initFrontMatter(); $this->initProgress(); $this->initEvaluation(); $this->initResponse(); if ($this->isComplete()) { // If earned credits were accidentally deleted but evaluation // is already complete, recreate them before relocating away from // page. $this->saveEarnedCredits(); $this->relocateForCompletedEvaluation(); } $count = 0; $question_bindings = $this->evaluation->visible_question_bindings; foreach ($question_bindings as $question_binding) { $this->addQuestionToUi($question_binding, ++$count); } }
protected function initInternal() { parent::initInternal(); $this->initCredits(); $this->initFrontMatter(); $this->initProgress(); $this->initQuiz(); $this->initResponse(); // if there is no quiz, go to evaluation page if (!$this->quiz instanceof CMEQuiz) { if (!$this->response->complete_date instanceof SwatDate) { $this->relocateToEvaluation(); } } if ($this->isComplete()) { // If earned credit was accidentally deleted but quiz is already // complete, recreate earned credit before displaying quiz results. $this->saveEarnedCredit(); } else { foreach ($this->quiz->question_bindings as $question_binding) { $this->addQuestionToUi($question_binding); } } }