4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
38 $cmd = $ilCtrl->getCmd(self::CMD_SHOW_FORM);
39 $nextClass = $ilCtrl->getNextClass($this);
42 case 'ilasshintpagegui':
44 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
47 $forwarder->forward();
72 $form->setValuesByPost();
73 } elseif (isset(
$_GET[
'hint_id']) && (
int)
$_GET[
'hint_id']) {
76 if (!$questionHint->load((
int) $_GET[
'hint_id'])) {
86 $tpl->setContent(
$form->getHTML());
102 if (
$form->checkInput()) {
105 if ((
int)
$form->getInput(
'hint_id')) {
106 $questionHint->load((
int)
$form->getInput(
'hint_id'));
108 $hintJustCreated =
false;
110 $questionHint->setQuestionId($this->questionOBJ->getId());
112 $questionHint->setIndex(
116 $hintJustCreated =
true;
119 $questionHint->setText(
$form->getInput(
'hint_text'));
120 $questionHint->setPoints(
$form->getInput(
'hint_points'));
122 $questionHint->save();
125 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
126 $this->questionOBJ->updateTimestamp();
129 $originalexists = $this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id);
130 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
136 if ($hintJustCreated && $this->questionOBJ->isAdditionalContentEditingModePageObject()) {
137 $ilCtrl->setParameterByClass(
'ilasshintpagegui',
'hint_id', $questionHint->getId());
138 $ilCtrl->redirectByClass(
'ilasshintpagegui',
'edit');
158 $ilCtrl->redirectByClass(
'ilAssQuestionHintsGUI');
173 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
174 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
175 require_once
'Services/Form/classes/class.ilNumberInputGUI.php';
176 require_once
'Services/Form/classes/class.ilHiddenInputGUI.php';
179 $form->setTableWidth(
'100%');
181 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
184 $areaInp =
new ilTextAreaInputGUI($lng->txt(
'tst_question_hints_form_label_hint_text'),
'hint_text');
186 $areaInp->setRows(10);
187 $areaInp->setCols(80);
189 if (!$this->questionOBJ->getPreventRteUsage()) {
190 $areaInp->setUseRte(
true);
193 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
196 $areaInp->setRTESupport($this->questionOBJ->getId(),
'qpl',
'assessment');
198 $areaInp->addPlugin(
"latex");
199 $areaInp->addButton(
"latex");
200 $areaInp->addButton(
"pastelatex");
202 $form->addItem($areaInp);
207 $numInp =
new ilNumberInputGUI($lng->txt(
'tst_question_hints_form_label_hint_points'),
'hint_points');
209 $numInp->setRequired(
true);
212 $form->addItem($numInp);
217 $form->setTitle(sprintf(
218 $lng->txt(
'tst_question_hints_form_header_edit'),
219 $questionHint->getIndex(),
220 $this->questionOBJ->getTitle()
226 $form->addItem($hiddenInp);
230 require_once
'Services/Utilities/classes/class.ilUtil.php';
232 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
233 $areaInp->setValue($questionHint->getText());
236 $numInp->setValue($questionHint->getPoints());
238 $hiddenInp->setValue($questionHint->getId());
241 $form->setTitle(sprintf(
242 $lng->txt(
'tst_question_hints_form_header_create'),
243 $this->questionOBJ->getTitle()
247 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
248 if ($questionHint instanceof ilAssQuestionHint) {
249 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save_points');
251 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save_points_and_edit_page');
254 $saveCmdLabel = $lng->txt(
'tst_question_hints_form_cmd_save');
257 $form->setFormAction($ilCtrl->getFormAction($this));
259 $form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel);
260 $form->addCommandButton(self::CMD_CANCEL_FORM, $lng->txt(
'cancel'));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
executeCommand()
Execute Command.
const PRESENTATION_MODE_AUTHOR
presentation mode for authoring
cancelFormCmd()
gateway command method to jump back to question hints overview
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
saveFormCmd()
saves the form on successfull validation and redirects to showForm command
const CMD_SHOW_LIST
command constants
static getNextIndexByQuestionId($questionId)
determines the next index to be used for a new hint that is to be added to the list of existing hints...
if(isset($_POST['submit'])) $form
buildForm(ilAssQuestionHint $questionHint=null)
builds the questions hints form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const CMD_SHOW_FORM
command constants
This class represents a text area property in a property form.
showFormCmd(ilPropertyFormGUI $form=null)
shows the form for managing a new/existing hint
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.