4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
38 $cmd = $ilCtrl->getCmd(self::CMD_SHOW_FORM);
39 $nextClass = $ilCtrl->getNextClass($this);
43 case 'ilasshintpagegui':
45 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
48 $forwarder->forward();
74 $form->setValuesByPost();
76 elseif( isset(
$_GET[
'hint_id']) && (
int)
$_GET[
'hint_id'] )
80 if( !$questionHint->load((
int)$_GET[
'hint_id']) )
93 $tpl->setContent( $form->getHTML() );
109 if( $form->checkInput() )
113 if( (
int)$form->getInput(
'hint_id') )
115 $questionHint->load( (
int)$form->getInput(
'hint_id') );
117 $hintJustCreated =
false;
121 $questionHint->setQuestionId( $this->questionOBJ->getId() );
123 $questionHint->setIndex(
127 $hintJustCreated =
true;
130 $questionHint->setText( $form->getInput(
'hint_text') );
131 $questionHint->setPoints( $form->getInput(
'hint_points') );
133 $questionHint->save();
136 $originalexists = $this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id);
137 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
144 if( $hintJustCreated && $this->questionOBJ->isAdditionalContentEditingModePageObject() )
146 $ilCtrl->setParameterByClass(
'ilasshintpagegui',
'hint_id', $questionHint->getId());
147 $ilCtrl->redirectByClass(
'ilasshintpagegui',
'edit');
169 $ilCtrl->redirectByClass(
'ilAssQuestionHintsGUI');
184 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
185 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
186 require_once
'Services/Form/classes/class.ilNumberInputGUI.php';
187 require_once
'Services/Form/classes/class.ilHiddenInputGUI.php';
190 $form->setTableWidth(
'100%');
192 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
196 $areaInp =
new ilTextAreaInputGUI($lng->txt(
'tst_question_hints_form_label_hint_text'),
'hint_text');
198 $areaInp->setRows(10);
199 $areaInp->setCols(80);
201 if( !$this->questionOBJ->getPreventRteUsage() ) $areaInp->setUseRte(
true);
203 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
206 $areaInp->setRTESupport($this->questionOBJ->getId(),
'qpl',
'assessment');
208 $areaInp->addPlugin(
"latex");
209 $areaInp->addButton(
"latex");
210 $areaInp->addButton(
"pastelatex");
212 $form->addItem($areaInp);
217 $numInp =
new ilNumberInputGUI($lng->txt(
'tst_question_hints_form_label_hint_points'),
'hint_points');
219 $numInp->setRequired(
true);
222 $form->addItem($numInp);
228 $form->setTitle(sprintf(
229 $lng->txt(
'tst_question_hints_form_header_edit'),
230 $questionHint->getIndex(),
231 $this->questionOBJ->getTitle()
237 $form->addItem($hiddenInp);
241 require_once
'Services/Utilities/classes/class.ilUtil.php';
243 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
248 $numInp->setValue($questionHint->getPoints());
250 $hiddenInp->setValue($questionHint->getId());
255 $form->setTitle(sprintf(
256 $lng->txt(
'tst_question_hints_form_header_create'),
257 $this->questionOBJ->getTitle()
261 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
263 if( $questionHint instanceof ilAssQuestionHint )
265 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save_points');
269 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save_points_and_edit_page');
274 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save');
277 $form->setFormAction($ilCtrl->getFormAction($this));
279 $form->addCommandButton(self::CMD_CANCEL_FORM, $lng->txt(
'cancel'));
280 $form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel);