4require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
 
   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                        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";
 
  149                        if( $hintJustCreated && $this->questionOBJ->isAdditionalContentEditingModePageObject() )
 
  151                                $ilCtrl->setParameterByClass(
'ilasshintpagegui', 
'hint_id', $questionHint->getId());
 
  152                                $ilCtrl->redirectByClass(
'ilasshintpagegui', 
'edit');
 
  174                $ilCtrl->redirectByClass(
'ilAssQuestionHintsGUI');
 
  189                require_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  190                require_once 
'Services/Form/classes/class.ilTextAreaInputGUI.php';
 
  191                require_once 
'Services/Form/classes/class.ilNumberInputGUI.php';
 
  192                require_once 
'Services/Form/classes/class.ilHiddenInputGUI.php';
 
  195                $form->setTableWidth(
'100%');
 
  197                if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
 
  202                        $areaInp->setRequired(
true);
 
  203                        $areaInp->setRows(10);
 
  204                        $areaInp->setCols(80);
 
  206                        if( !$this->questionOBJ->getPreventRteUsage() ) $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');
 
  223                $numInp->allowDecimals(
true);
 
  224                $numInp->setRequired(
true);
 
  227                $form->addItem($numInp);
 
  234                                        $lng->txt(
'tst_question_hints_form_header_edit'),
 
  235                                        $questionHint->getIndex(),
 
  236                                        $this->questionOBJ->getTitle()
 
  242                        $form->addItem($hiddenInp);
 
  246                        require_once 
'Services/Utilities/classes/class.ilUtil.php';
 
  248                        if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
 
  253                        $numInp->setValue($questionHint->getPoints());
 
  255                        $hiddenInp->setValue($questionHint->getId());
 
  261                                        $lng->txt(
'tst_question_hints_form_header_create'),
 
  262                                        $this->questionOBJ->getTitle()
 
  266                if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
 
  270                                $saveCmdLabel = 
$lng->txt(
'tst_question_hints_form_cmd_save_points');
 
  274                                $saveCmdLabel = 
$lng->txt(
'tst_question_hints_form_cmd_save_points_and_edit_page');
 
  279                        $saveCmdLabel = 
$lng->txt(
'tst_question_hints_form_cmd_save');
 
  282                $form->setFormAction(
$ilCtrl->getFormAction($this));
 
  284                $form->addCommandButton(self::CMD_SAVE_FORM, $saveCmdLabel);
 
  285                $form->addCommandButton(self::CMD_CANCEL_FORM, 
$lng->txt(
'cancel'));
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
const CMD_SHOW_FORM
command constants
executeCommand()
Execute Command.
buildForm(ilAssQuestionHint $questionHint=null)
builds the questions hints form
showFormCmd(ilPropertyFormGUI $form=null)
shows the form for managing a new/existing hint
saveFormCmd()
saves the form on successfull validation and redirects to showForm command
cancelFormCmd()
gateway command method to jump back to question hints overview
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...
const PRESENTATION_MODE_AUTHOR
presentation mode for authoring
const CMD_SHOW_LIST
command constants
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
This class represents a text area property in a property form.
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,...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.