4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
38 $ilTabs = $DIC[
'ilTabs'];
42 $cmd =
$ilCtrl->getCmd(self::CMD_SHOW_FORM);
43 $nextClass =
$ilCtrl->getNextClass($this);
46 case 'ilasshintpagegui':
48 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
51 $forwarder->forward();
76 $ilToolbar = $DIC[
'ilToolbar'];
81 $form->setValuesByPost();
82 } elseif (isset(
$_GET[
'hint_id']) && (
int)
$_GET[
'hint_id']) {
85 if (!$questionHint->load((
int) $_GET[
'hint_id'])) {
114 if (
$form->checkInput()) {
117 if ((
int)
$form->getInput(
'hint_id')) {
118 $questionHint->load((
int)
$form->getInput(
'hint_id'));
120 $hintJustCreated =
false;
122 $questionHint->setQuestionId($this->questionOBJ->getId());
124 $questionHint->setIndex(
128 $hintJustCreated =
true;
131 $questionHint->setText(
$form->getInput(
'hint_text'));
132 $questionHint->setPoints(
$form->getInput(
'hint_points'));
134 $questionHint->save();
135 ilUtil::sendSuccess(
$lng->txt(
'tst_question_hints_form_saved_msg'),
true);
137 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
138 $this->questionOBJ->updateTimestamp();
141 $originalexists = $this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id);
142 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
148 if ($hintJustCreated && $this->questionOBJ->isAdditionalContentEditingModePageObject()) {
149 $ilCtrl->setParameterByClass(
'ilasshintpagegui',
'hint_id', $questionHint->getId());
150 $ilCtrl->redirectByClass(
'ilasshintpagegui',
'edit');
171 $ilCtrl->redirectByClass(
'ilAssQuestionHintsGUI');
188 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
189 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
190 require_once
'Services/Form/classes/class.ilNumberInputGUI.php';
191 require_once
'Services/Form/classes/class.ilHiddenInputGUI.php';
194 $form->setTableWidth(
'100%');
196 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
201 $areaInp->setRows(10);
202 $areaInp->setCols(80);
204 if (!$this->questionOBJ->getPreventRteUsage()) {
205 $areaInp->setUseRte(
true);
208 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
211 $areaInp->setRTESupport($this->questionOBJ->getId(),
'qpl',
'assessment');
213 $areaInp->addPlugin(
"latex");
214 $areaInp->addButton(
"latex");
215 $areaInp->addButton(
"pastelatex");
217 $form->addItem($areaInp);
222 $numInp =
new ilNumberInputGUI(
$lng->txt(
'tst_question_hints_form_label_hint_points'),
'hint_points');
224 $numInp->setRequired(
true);
227 $form->addItem($numInp);
232 $form->setTitle(sprintf(
233 $lng->txt(
'tst_question_hints_form_header_edit'),
234 $questionHint->getIndex(),
235 $this->questionOBJ->getTitle()
241 $form->addItem($hiddenInp);
245 require_once
'Services/Utilities/classes/class.ilUtil.php';
247 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
248 $areaInp->setValue($questionHint->getText());
251 $numInp->setValue($questionHint->getPoints());
253 $hiddenInp->setValue($questionHint->getId());
256 $form->setTitle(sprintf(
257 $lng->txt(
'tst_question_hints_form_header_create'),
258 $this->questionOBJ->getTitle()
262 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
263 if ($questionHint instanceof ilAssQuestionHint) {
264 $saveCmdLabel =
$lng->txt(
'tst_question_hints_form_cmd_save_points');
266 $saveCmdLabel =
$lng->txt(
'tst_question_hints_form_cmd_save_points_and_edit_page');
269 $saveCmdLabel =
$lng->txt(
'tst_question_hints_form_cmd_save');
274 $form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel);
275 $form->addCommandButton(self::CMD_CANCEL_FORM,
$lng->txt(
'cancel'));
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.