ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestRandomQuestionSetGeneralConfigFormGUI Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetGeneralConfigFormGUI:
+ Collaboration diagram for ilTestRandomQuestionSetGeneralConfigFormGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $lng, ilObjTest $testOBJ, ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI, ilTestRandomQuestionSetConfig $questionSetConfig)
 
 isEditModeEnabled ()
 
 setEditModeEnabled ($editModeEnabled)
 
 build ()
 
 save ()
 
- 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, $a_remove_unused_headers=false)
 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
 

Protected Attributes

 $editModeEnabled = true
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $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
 

Private Member Functions

 fetchValidQuestionAmountConfigModeWithFallbackModePerTest (ilTestRandomQuestionSetConfig $config)
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestRandomQuestionSetGeneralConfigFormGUI::__construct ( ilCtrl  $ctrl,
ilLanguage  $lng,
ilObjTest  $testOBJ,
ilTestRandomQuestionSetConfigGUI  $questionSetConfigGUI,
ilTestRandomQuestionSetConfig  $questionSetConfig 
)

Member Function Documentation

◆ build()

ilTestRandomQuestionSetGeneralConfigFormGUI::build ( )

Definition at line 92 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilTestRandomQuestionSetConfigGUI\CMD_SAVE_GENERAL_CONFIG_FORM, fetchValidQuestionAmountConfigModeWithFallbackModePerTest(), isEditModeEnabled(), ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST, ilFormGUI\setFormAction(), ilFormGUI\setId(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilPropertyFormGUI\setTitle(), and ilRadioGroupInputGUI\setValue().

93  {
94  $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
95 
96  $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
97  $this->setId('tstRndQuestSetCfgGeneralForm');
98 
99  $this->addCommandButton(
101  $this->lng->txt('save')
102  );
103 
104  // Require Pools with Homogeneous Scored Questions
105 
106  $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI(
107  $this->lng->txt('tst_inp_all_quest_points_equal_per_pool'),
108  'quest_points_equal_per_pool'
109  );
110 
111  $requirePoolsQuestionsHomoScored->setInfo(
112  $this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')
113  );
114 
115  $requirePoolsQuestionsHomoScored->setChecked(
116  $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()
117  );
118 
119  $this->addItem($requirePoolsQuestionsHomoScored);
120 
121  // question amount config mode (per test / per pool)
122 
123  $questionAmountConfigMode = new ilRadioGroupInputGUI(
124  $this->lng->txt('tst_inp_quest_amount_cfg_mode'),
125  'quest_amount_cfg_mode'
126  );
127 
129  $this->questionSetConfig
130  ));
131 
132  $questionAmountConfigModePerTest = new ilRadioOption(
133  $this->lng->txt('tst_inp_quest_amount_cfg_mode_test'),
135  );
136 
137  $questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
138 
139  $questionAmountConfigModePerPool = new ilRadioOption(
140  $this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'),
142  );
143 
144  $questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
145 
146  $questionAmountConfigMode->setRequired(true);
147 
148  $this->addItem($questionAmountConfigMode);
149 
150  // question amount per test
151 
152  $questionAmountPerTest = new ilNumberInputGUI(
153  $this->lng->txt('tst_inp_quest_amount_per_test'),
154  'quest_amount_per_test'
155  );
156 
157  $questionAmountPerTest->setRequired(true);
158  $questionAmountPerTest->setMinValue(1);
159  $questionAmountPerTest->allowDecimals(false);
160  $questionAmountPerTest->setMinvalueShouldBeGreater(false);
161  $questionAmountPerTest->setSize(4);
162 
163  $questionAmountPerTest->setValue(
164  $this->questionSetConfig->getQuestionAmountPerTest()
165  );
166 
167  $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
168 
169  if (!$this->isEditModeEnabled()) {
170  $requirePoolsQuestionsHomoScored->setDisabled(true);
171  $questionAmountConfigMode->setDisabled(true);
172  $questionAmountPerTest->setDisabled(true);
173  }
174  }
This class represents an option in a radio group.
setId($a_id)
Set Id.
This class represents a checkbox property in a property form.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
setTitle($a_title)
Set Title.
fetchValidQuestionAmountConfigModeWithFallbackModePerTest(ilTestRandomQuestionSetConfig $config)
This class represents a number property in a property form.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ fetchValidQuestionAmountConfigModeWithFallbackModePerTest()

◆ isEditModeEnabled()

ilTestRandomQuestionSetGeneralConfigFormGUI::isEditModeEnabled ( )
Returns
boolean

Definition at line 79 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

References $editModeEnabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ save()

ilTestRandomQuestionSetGeneralConfigFormGUI::save ( )

Definition at line 188 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

189  {
190  $this->questionSetConfig->setPoolsWithHomogeneousScoredQuestionsRequired(
191  $this->getItemByPostVar('quest_points_equal_per_pool')->getChecked()
192  );
193 
194  switch ($this->getItemByPostVar('quest_amount_cfg_mode')->getValue()) {
196 
197  $this->questionSetConfig->setQuestionAmountConfigurationMode(
198  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
199  );
200 
201  $this->questionSetConfig->setQuestionAmountPerTest(
202  $this->getItemByPostVar('quest_amount_per_test')->getValue()
203  );
204 
205  break;
206 
208 
209  $this->questionSetConfig->setQuestionAmountConfigurationMode(
210  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
211  );
212 
213  $this->questionSetConfig->setQuestionAmountPerTest(null);
214 
215  break;
216  }
217 
218  return $this->questionSetConfig->saveToDb($this->testOBJ->getTestId());
219  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:

◆ setEditModeEnabled()

ilTestRandomQuestionSetGeneralConfigFormGUI::setEditModeEnabled (   $editModeEnabled)
Parameters
boolean$editModeEnabled

Definition at line 87 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

References $editModeEnabled.

Field Documentation

◆ $ctrl

ilTestRandomQuestionSetGeneralConfigFormGUI::$ctrl = null

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

Referenced by __construct().

◆ $editModeEnabled

ilTestRandomQuestionSetGeneralConfigFormGUI::$editModeEnabled = true
protected

◆ $lng

ilTestRandomQuestionSetGeneralConfigFormGUI::$lng = null

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

Referenced by __construct().

◆ $questionSetConfig

ilTestRandomQuestionSetGeneralConfigFormGUI::$questionSetConfig = null

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

Referenced by __construct().

◆ $questionSetConfigGUI

ilTestRandomQuestionSetGeneralConfigFormGUI::$questionSetConfigGUI = null

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

Referenced by __construct().

◆ $testOBJ

ilTestRandomQuestionSetGeneralConfigFormGUI::$testOBJ = null

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

Referenced by __construct().


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