71 $ilCtrl =
$DIC[
'ilCtrl'];
72 $ilTabs =
$DIC[
'ilTabs'];
75 $cmd = $ilCtrl->getCmd(self::CMD_SHOW_LIST);
76 $nextClass = $ilCtrl->getNextClass($this);
79 case 'ilasshintpagegui':
81 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
84 $forwarder->forward();
104 $ilCtrl =
$DIC[
'ilCtrl'];
108 if (
$DIC->globalScreen()->tool()->context()->current()->getAdditionalData()
110 $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
112 $this->parentGUI->getObject()->getTitle() .
' - ' .
$lng->txt(
'show_requested_question_hints')
116 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsTableGUI.php';
118 $questionHintList = $this->questionHintTracking->getRequestedHintsList();
141 $ilCtrl =
$DIC[
'ilCtrl'];
145 if (!$this->request->isset(
'hintId') || !(
int) $this->request->raw(
'hintId')) {
149 $isRequested = $this->questionHintTracking->isRequested((
int) $this->request->raw(
'hintId'));
152 throw new ilTestException(
'hint with given id is not yet requested for given testactive and testpass');
157 require_once
'Services/Utilities/classes/class.ilUtil.php';
158 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
159 require_once
'Services/Form/classes/class.ilNonEditableValueGUI.php';
161 if (
$DIC->globalScreen()->tool()->context()->current()->getAdditionalData()
163 $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
165 $this->parentGUI->getObject()->getTitle() .
' - ' . sprintf(
166 $lng->txt(
'tst_question_hints_form_header_edit'),
167 $questionHint->getIndex(),
168 $this->request->int(
'sequence') ?? 0
175 $form->setFormAction($ilCtrl->getFormAction($this));
177 $form->setTableWidth(
'100%');
179 $form->setTitle(sprintf(
180 $lng->txt(
'tst_question_hints_form_header_edit'),
181 $questionHint->getIndex(),
182 $this->questionOBJ->getTitleForHTMLOutput()
185 $form->addCommandButton(self::CMD_BACK_TO_QUESTION,
$lng->txt(
'tst_question_hints_back_to_question'));
187 $numExistingRequests = $this->questionHintTracking->getNumExistingRequests();
189 if ($numExistingRequests > 1) {
190 $form->addCommandButton(self::CMD_SHOW_LIST,
$lng->txt(
'show_requested_question_hints'));
195 $nonEditableHintText =
new ilNonEditableValueGUI(
$lng->txt(
'tst_question_hints_form_label_hint_text'),
'hint_text',
true);
197 $form->addItem($nonEditableHintText);
201 $nonEditableHintPoints =
new ilNonEditableValueGUI(
$lng->txt(
'tst_question_hints_form_label_hint_points'),
'hint_points');
202 $nonEditableHintPoints->setValue($questionHint->getPoints());
203 $form->addItem($nonEditableHintPoints);
216 private function confirmRequestCmd(): void
220 $ilCtrl =
$DIC[
'ilCtrl'];
225 if (
$DIC->globalScreen()->tool()->context()->current()->getAdditionalData()
227 $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
229 $this->parentGUI->getObject()->getTitle() .
' - ' .
$lng->txt(
'tst_question_hints_confirm_request')
234 $nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
236 $ilCtrl->redirect($this, self::CMD_BACK_TO_QUESTION);
243 $ilCtrl->getFormAction($this),
244 "hintId={$nextRequestableHint->getId()}"
247 $confirmation->setFormAction($formAction);
249 $confirmation->setConfirm(
$lng->txt(
'tst_question_hints_confirm_request'), self::CMD_PERFORM_REQUEST);
250 $confirmation->setCancel(
$lng->txt(
'tst_question_hints_cancel_request'), self::CMD_BACK_TO_QUESTION);
252 if ($nextRequestableHint->getPoints() == 0.0) {
253 $confirmation->setHeaderText(
$lng->txt(
'tst_question_hints_request_confirmation_no_deduction'));
255 $confirmation->setHeaderText(sprintf(
256 $lng->txt(
'tst_question_hints_request_confirmation'),
257 $nextRequestableHint->getIndex(),
258 $nextRequestableHint->getPoints()
275 $ilCtrl =
$DIC[
'ilCtrl'];
277 if (!$this->request->isset(
'hintId') || !(
int) $this->request->raw(
'hintId')) {
282 $nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
284 $ilCtrl->redirect($this, self::CMD_BACK_TO_QUESTION);
287 if ($nextRequestableHint->getId() != (
int) $this->request->raw(
'hintId')) {
288 throw new ilTestException(
'given hint id does not relate to the next requestable hint');
291 $this->questionHintTracking->storeRequest($nextRequestableHint);
307 $ilCtrl =
$DIC[
'ilCtrl'];
309 $ilCtrl->redirect($this->parentGUI, $this->parentCMD);
330 'tpl.il_tst_question_hints_kiosk_page.html',
331 'Modules/TestQuestionPool'
334 $tpl->setVariable(
'KIOSK_HEAD', $this->parentGUI->getKioskHead());
336 $tpl->setVariable(
'KIOSK_CONTENT', $content);
338 $tpl->setContent($content);
362 $ilCtrl =
$DIC[
'ilCtrl'];
364 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
365 $ilCtrl->setParameterByClass(
'ilasshintpagegui',
'hint_id', $hintId);
366 $linkTarget = $ilCtrl->getLinkTargetByClass(
'ilAssHintPageGUI',
'',
'',
false, $xmlStyle);
368 $ilCtrl->setParameter($this,
'hintId', $hintId);
369 $linkTarget = $ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT,
'',
false, $xmlStyle);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assQuestionGUI $questionGUI
const PRESENTATION_MODE_REQUEST
presentation mode for requesting
populateContent($content, $tpl)
populates the rendered questin hint relating output content to global template depending on possibly ...
const CMD_CONFIRM_REQUEST
__construct($parentGUI, $parentCMD, assQuestionGUI $questionGUI, $questionHintTracking)
Constructor.
getHintPresentationLinkTarget($hintId, $xmlStyle=true)
returns the link target for hint request presentation
performRequestCmd()
Performs a hint request and invokes the (re-)saving the question solution.
const CMD_PERFORM_REQUEST
showListCmd()
shows the list of allready requested hints
const CMD_SHOW_LIST
command constants
backToQuestionCmd()
gateway command method to jump back to test session output
const CMD_BACK_TO_QUESTION
showHintCmd()
shows an allready requested hint
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static redirect(string $a_script)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc