/** * Performs a hint request and invokes the (re-)saving the question solution. * Redirects to local showHint command * * @access private * @global ilCtrl $ilCtrl */ private function performRequestCmd() { global $ilCtrl; if (!isset($_GET['hintId']) || !(int) $_GET['hintId']) { throw new ilTestException('no hint id given'); } $nextRequestableHint = ilAssQuestionHintTracking::getNextRequestableHint($this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()); if ($nextRequestableHint->getId() != (int) $_GET['hintId']) { throw new ilTestException('given hint id does not relate to the next requestable hint'); } ilAssQuestionHintTracking::storeRequest($nextRequestableHint, $this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()); $this->testOutputGUI->saveQuestionSolution(); $redirectTarget = $this->getHintPresentationLinkTarget($nextRequestableHint->getId(), false); ilUtil::redirect($redirectTarget); }
/** * Performs a hint request and invokes the (re-)saving the question solution. * Redirects to local showHint command * * @access private * @global ilCtrl $ilCtrl */ private function performRequestCmd() { global $ilCtrl; if (!isset($_GET['hintId']) || !(int) $_GET['hintId']) { throw new ilTestException('no hint id given'); } $nextRequestableHint = ilAssQuestionHintTracking::getNextRequestableHint($this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()); if ($nextRequestableHint->getId() != (int) $_GET['hintId']) { throw new ilTestException('given hint id does not relate to the next requestable hint'); } ilAssQuestionHintTracking::storeRequest($nextRequestableHint, $this->questionOBJ->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()); $this->testOutputGUI->saveQuestionSolution(); $redirectTarget = ilUtil::appendUrlParameterString($ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT, '', false, false), "hintId={$nextRequestableHint->getId()}"); ilUtil::redirect($redirectTarget); }