ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTestRandomQuestionSetPoolDefinitionFormGUI Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetPoolDefinitionFormGUI:
+ Collaboration diagram for ilTestRandomQuestionSetPoolDefinitionFormGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $lng, ilObjTest $testOBJ, ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI, ilTestRandomQuestionSetConfig $questionSetConfig)
 
 setSaveCommand ($saveCommand)
 
 getSaveCommand ()
 
 setSaveAndNewCommand ($saveAndNewCommand)
 
 getSaveAndNewCommand ()
 
 build (ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
 
 applySubmit (ilTestRandomQuestionSetSourcePoolDefinition $sourcePoolDefinition, $availableTaxonomyIds)
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ($a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Data Fields

 $ctrl = null
 
 $lng = null
 
 $testOBJ = null
 
 $questionSetConfigGUI = null
 
 $questionSetConfig = null
 

Private Attributes

 $saveCommand = null
 
 $saveAndNewCommand = null
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 
- Protected Attributes inherited from ilPropertyFormGUI
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ applySubmit()

ilTestRandomQuestionSetPoolDefinitionFormGUI::applySubmit ( ilTestRandomQuestionSetSourcePoolDefinition  $sourcePoolDefinition,
  $availableTaxonomyIds 
)

Definition at line 208 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), ilTestRandomQuestionSetSourcePoolDefinition\setOriginalFilterTaxId(), ilTestRandomQuestionSetSourcePoolDefinition\setOriginalFilterTaxNodeId(), and ilTestRandomQuestionSetSourcePoolDefinition\setQuestionAmount().

209  {
210  switch( true )
211  {
212  case $this->getItemByPostVar('source_pool_filter_tax') === null:
213 
214  case !in_array($this->getItemByPostVar('filter_tax')->getValue(), $availableTaxonomyIds):
215 
216  $sourcePoolDefinition->setOriginalFilterTaxId(null);
217  $sourcePoolDefinition->setOriginalFilterTaxNodeId(null);
218  break;
219 
220  default:
221 
222  $taxId = $this->getItemByPostVar('filter_tax')->getValue();
223 
224  $sourcePoolDefinition->setOriginalFilterTaxId( $taxId );
225 
226  $sourcePoolDefinition->setOriginalFilterTaxNodeId( $this->getItemByPostVar("filter_tax_$taxId")->getValue() );
227  }
228 
229  if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
230  {
231  $sourcePoolDefinition->setQuestionAmount( $this->getItemByPostVar('question_amount_per_pool')->getValue() );
232  }
233  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:

◆ build()

ilTestRandomQuestionSetPoolDefinitionFormGUI::build ( ilTestRandomQuestionSetSourcePoolDefinition  $sourcePool,
  $availableTaxonomyIds 
)

Definition at line 95 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilTestRandomQuestionSetConfigGUI\CMD_SHOW_SRC_POOL_DEF_LIST, ilTestRandomQuestionSetSourcePoolDefinition\getId(), ilTestRandomQuestionSetSourcePoolDefinition\getOriginalFilterTaxId(), ilTestRandomQuestionSetSourcePoolDefinition\getOriginalFilterTaxNodeId(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolId(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolInfoLabel(), ilTestRandomQuestionSetSourcePoolDefinition\getQuestionAmount(), getSaveAndNewCommand(), getSaveCommand(), ilFormGUI\setFormAction(), ilFormGUI\setId(), ilFormPropertyGUI\setRequired(), ilPropertyFormGUI\setTitle(), and ilNonEditableValueGUI\setValue().

96  {
97  $this->setFormAction( $this->ctrl->getFormAction($this->questionSetConfigGUI) );
98 
99  $this->setTitle( $this->lng->txt('tst_rnd_quest_set_cfg_pool_form') );
100  $this->setId('tstRndQuestSetCfgPoolForm');
101 
102  $this->addCommandButton(
103  $this->getSaveCommand(), $this->lng->txt('save_and_back')
104  );
105 
106  if(null !== $this->getSaveAndNewCommand())
107  {
108  $this->addCommandButton(
109  $this->getSaveAndNewCommand(), $this->lng->txt('tst_save_and_create_new_rule')
110  );
111  }
112 
113  $this->addCommandButton(
115  );
116 
117  $hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
118  $hiddenDefId->setValue( $sourcePool->getId() );
119  $this->addItem($hiddenDefId);
120 
121  $hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
122  $hiddenPoolId->setValue( $sourcePool->getPoolId() );
123  $this->addItem($hiddenPoolId);
124 
125  $nonEditablePoolLabel = new ilNonEditableValueGUI(
126  $this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label'
127  );
128  $nonEditablePoolLabel->setValue( $sourcePool->getPoolInfoLabel($this->lng) );
129 
130  $this->addItem($nonEditablePoolLabel);
131 
132 
133  if( count($availableTaxonomyIds) )
134  {
135  $taxRadio = new ilRadioGroupInputGUI(
136  $this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax'
137  );
138 
139  $taxRadio->setRequired(true);
140 
141  $taxRadio->addOption(new ilRadioOption(
142  $this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0
143  ));
144 
145  $taxRadio->setValue(0);
146 
147  require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
148 
149  foreach($availableTaxonomyIds as $taxId)
150  {
151  $taxonomy = new ilObjTaxonomy($taxId);
152  $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
153 
154  $taxRadioOption = new ilRadioOption($label, $taxId);
155 
156  $taxRadio->addOption($taxRadioOption);
157 
158  $this->ctrl->setParameterByClass('iltaxselectinputgui', 'src_pool_def_id', $sourcePool->getId());
159  $this->ctrl->setParameterByClass('iltaxselectinputgui', 'quest_pool_id', $sourcePool->getPoolId());
160  $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_$taxId", false);
161  $taxSelect->setRequired(true);
162  $taxRadioOption->addSubItem($taxSelect);
163 
164  if( $taxId == $sourcePool->getOriginalFilterTaxId() )
165  {
166  $taxRadio->setValue( $sourcePool->getOriginalFilterTaxId() );
167  $taxSelect->setValue( $sourcePool->getOriginalFilterTaxNodeId() );
168  }
169  }
170 
171  $this->addItem($taxRadio);
172  }
173  else
174  {
175  $hiddenNoTax = new ilHiddenInputGUI('filter_tax');
176  $hiddenNoTax->setValue(0);
177  $this->addItem($hiddenNoTax);
178 
179  $nonEditableNoTax = new ilNonEditableValueGUI(
180  $this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label'
181  );
182  $nonEditableNoTax->setValue( $this->lng->txt('tst_inp_no_available_tax_hint') );
183  $this->addItem($nonEditableNoTax);
184  }
185 
186 
187  if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
188  {
189  $questionAmountPerSourcePool = new ilNumberInputGUI(
190  $this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool'
191  );
192 
193  $questionAmountPerSourcePool->setRequired(true);
194  $questionAmountPerSourcePool->allowDecimals(false);
195  $questionAmountPerSourcePool->setMinValue(0);
196  $questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
197  $questionAmountPerSourcePool->setSize(4);
198 
199  if( $sourcePool->getQuestionAmount() )
200  {
201  $questionAmountPerSourcePool->setValue( $sourcePool->getQuestionAmount() );
202  }
203 
204  $this->addItem($questionAmountPerSourcePool);
205  }
206  }
This class represents an option in a radio group.
Select taxonomy nodes input GUI.
setId($a_id)
Set Id.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setTitle($a_title)
Set Title.
This class represents a number property in a property form.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
This class represents a non editable value in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ getSaveAndNewCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::getSaveAndNewCommand ( )
Returns
null|string

Definition at line 90 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References $saveAndNewCommand.

Referenced by build().

+ Here is the caller graph for this function:

◆ getSaveCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::getSaveCommand ( )

Definition at line 74 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References $saveCommand.

Referenced by build().

+ Here is the caller graph for this function:

◆ setSaveAndNewCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::setSaveAndNewCommand (   $saveAndNewCommand)
Parameters
null | string$saveAndNewCommand

Definition at line 82 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References $saveAndNewCommand.

◆ setSaveCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::setSaveCommand (   $saveCommand)

Field Documentation

◆ $ctrl

ilTestRandomQuestionSetPoolDefinitionFormGUI::$ctrl = null

Definition at line 23 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

Referenced by __construct().

◆ $lng

ilTestRandomQuestionSetPoolDefinitionFormGUI::$lng = null

Definition at line 30 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

Referenced by __construct().

◆ $questionSetConfig

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfig = null

Definition at line 51 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

Referenced by __construct().

◆ $questionSetConfigGUI

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfigGUI = null

Definition at line 44 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

Referenced by __construct().

◆ $saveAndNewCommand

ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveAndNewCommand = null
private

◆ $saveCommand

ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveCommand = null
private

◆ $testOBJ

ilTestRandomQuestionSetPoolDefinitionFormGUI::$testOBJ = null

Definition at line 37 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: