4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
53 parent::__construct($questionGUI);
67 $ilTabs = $DIC[
'ilTabs'];
70 $cmd =
$ilCtrl->getCmd(self::CMD_SHOW_LIST);
71 $nextClass =
$ilCtrl->getNextClass($this);
74 case 'ilasshintpagegui':
76 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
79 $forwarder->forward();
101 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsTableGUI.php';
103 $questionHintList = $this->questionHintTracking->getRequestedHintsList();
130 if (!isset(
$_GET[
'hintId']) || !(
int)
$_GET[
'hintId']) {
134 $isRequested = $this->questionHintTracking->isRequested((
int) $_GET[
'hintId']);
137 throw new ilTestException(
'hint with given id is not yet requested for given testactive and testpass');
142 require_once
'Services/Utilities/classes/class.ilUtil.php';
143 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
144 require_once
'Services/Form/classes/class.ilNonEditableValueGUI.php';
152 $form->setTableWidth(
'100%');
154 $form->setTitle(sprintf(
155 $lng->txt(
'tst_question_hints_form_header_edit'),
156 $questionHint->getIndex(),
157 $this->questionOBJ->getTitle()
160 $form->addCommandButton(self::CMD_BACK_TO_QUESTION,
$lng->txt(
'tst_question_hints_back_to_question'));
162 $numExistingRequests = $this->questionHintTracking->getNumExistingRequests();
164 if ($numExistingRequests > 1) {
165 $form->addCommandButton(self::CMD_SHOW_LIST,
$lng->txt(
'button_show_requested_question_hints'));
170 $nonEditableHintText =
new ilNonEditableValueGUI(
$lng->txt(
'tst_question_hints_form_label_hint_text'),
'hint_text',
true);
172 $form->addItem($nonEditableHintText);
176 $nonEditableHintPoints =
new ilNonEditableValueGUI(
$lng->txt(
'tst_question_hints_form_label_hint_points'),
'hint_points');
177 $nonEditableHintPoints->
setValue($questionHint->getPoints());
178 $form->addItem($nonEditableHintPoints);
199 $nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
201 $ilCtrl->redirect($this, self::CMD_BACK_TO_QUESTION);
204 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
210 "hintId={$nextRequestableHint->getId()}" 213 $confirmation->setFormAction($formAction);
215 $confirmation->setConfirm(
$lng->txt(
'tst_question_hints_confirm_request'), self::CMD_PERFORM_REQUEST);
216 $confirmation->setCancel(
$lng->txt(
'tst_question_hints_cancel_request'), self::CMD_BACK_TO_QUESTION);
218 $confirmation->setHeaderText(sprintf(
219 $lng->txt(
'tst_question_hints_request_confirmation'),
220 $nextRequestableHint->getIndex(),
221 $nextRequestableHint->getPoints()
239 if (!isset(
$_GET[
'hintId']) || !(
int)
$_GET[
'hintId']) {
244 $nextRequestableHint = $this->questionHintTracking->getNextRequestableHint();
246 $ilCtrl->redirect($this, self::CMD_BACK_TO_QUESTION);
249 if ($nextRequestableHint->getId() != (int) $_GET[
'hintId']) {
250 throw new ilTestException(
'given hint id does not relate to the next requestable hint');
253 $this->questionHintTracking->storeRequest($nextRequestableHint);
271 $ilCtrl->redirect($this->parentGUI, $this->parentCMD);
287 $tpl->setBodyClass(
'kiosk');
288 $tpl->setAddFooter(
false);
293 'tpl.il_tst_question_hints_kiosk_page.html',
294 'Modules/TestQuestionPool' 297 $tpl->setVariable(
'KIOSK_HEAD', $this->parentGUI->getKioskHead());
299 $tpl->setVariable(
'KIOSK_CONTENT', $content);
301 $tpl->setContent($content);
327 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
328 $ilCtrl->setParameterByClass(
'ilasshintpagegui',
'hint_id', $hintId);
329 $linkTarget =
$ilCtrl->getLinkTargetByClass(
'ilAssHintPageGUI',
'',
'',
false, $xmlStyle);
331 $ilCtrl->setParameter($this,
'hintId', $hintId);
332 $linkTarget =
$ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT,
'',
false, $xmlStyle);
showListCmd()
shows the list of allready requested hints
const CMD_CONFIRM_REQUEST
__construct($parentGUI, $parentCMD, assQuestionGUI $questionGUI, $questionHintTracking)
Constructor.
getHintPresentationLinkTarget($hintId, $xmlStyle=true)
returns the link target for hint request presentation
setValue($a_value)
Set Value.
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
static prepareTextareaOutput($txt_output, $prepare_for_latex_output=false, $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
backToQuestionCmd()
gateway command method to jump back to test session output
populateContent($content)
populates the rendered questin hint relating output content to global template depending on possibly ...
Base Exception for all Exceptions relating to Modules/Test.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
showHintCmd()
shows an allready requested hint
if(isset($_POST['submit'])) $form
const CMD_PERFORM_REQUEST
confirmRequestCmd()
shows a confirmation screen for a hint request
Basic GUI class for assessment questions.
const PRESENTATION_MODE_REQUEST
presentation mode for requesting
executeCommand()
Execute Command.
const CMD_SHOW_LIST
command constants
This class represents a non editable value in a property form.
if(empty($password)) $table
static redirect($a_script)
performRequestCmd()
Performs a hint request and invokes the (re-)saving the question solution.
Confirmation screen class.
const CMD_BACK_TO_QUESTION