ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 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 ()
 Get HTML. More...
 
 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
 $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.

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

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(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ fetchValidQuestionAmountConfigModeWithFallbackModePerTest()

ilTestRandomQuestionSetGeneralConfigFormGUI::fetchValidQuestionAmountConfigModeWithFallbackModePerTest ( ilTestRandomQuestionSetConfig  $config)
private

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

175 {
176 switch( $config->getQuestionAmountConfigurationMode() )
177 {
180
181 return $config->getQuestionAmountConfigurationMode();
182 }
183
185 }

References $config, ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_POOL, and ilTestRandomQuestionSetConfig\QUESTION_AMOUNT_CONFIG_MODE_PER_TEST.

Referenced by build().

+ Here is the caller graph for this function:

◆ 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 187 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

188 {
189 $this->questionSetConfig->setPoolsWithHomogeneousScoredQuestionsRequired(
190 $this->getItemByPostVar('quest_points_equal_per_pool')->getChecked()
191 );
192
193 switch( $this->getItemByPostVar('quest_amount_cfg_mode')->getValue() )
194 {
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.

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

+ Here is the call graph for this function:

◆ setEditModeEnabled()

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

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

88 {
89 $this->editModeEnabled = $editModeEnabled;
90 }

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: