ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
 build ()
 
 save ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 ilPropertyFormGUI ()
 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)
 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)
 Add Command button. 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
 ilFormGUI ()
 Constructor. More...
 
 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...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Data Fields

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

Private Member Functions

 fetchValidQuestionAmountConfigModeWithFallbackModePerTest (ilTestRandomQuestionSetConfig $config)
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 keepFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Import upload into temp directory. More...
 
 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
 
 $reloaded_files
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ build()

ilTestRandomQuestionSetGeneralConfigFormGUI::build ( )

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

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilTestRandomQuestionSetConfigGUI\CMD_SAVE_GENERAL_CONFIG_FORM, fetchValidQuestionAmountConfigModeWithFallbackModePerTest(), 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().

63  {
64  $this->setFormAction( $this->ctrl->getFormAction($this->questionSetConfigGUI) );
65 
66  $this->setTitle( $this->lng->txt('tst_rnd_quest_set_cfg_general_form') );
67  $this->setId('tstRndQuestSetCfgGeneralForm');
68 
69  $this->addCommandButton(
71  );
72 
73  // Require Pools with Homogeneous Scored Questions
74 
75  $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI(
76  $this->lng->txt('tst_inp_all_quest_points_equal_per_pool'), 'quest_points_equal_per_pool'
77  );
78 
79  $requirePoolsQuestionsHomoScored->setInfo(
80  $this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')
81  );
82 
83  $requirePoolsQuestionsHomoScored->setChecked(
84  $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()
85  );
86 
87  $this->addItem($requirePoolsQuestionsHomoScored);
88 
89  // question amount config mode (per test / per pool)
90 
91  $questionAmountConfigMode = new ilRadioGroupInputGUI(
92  $this->lng->txt('tst_inp_quest_amount_cfg_mode'), 'quest_amount_cfg_mode'
93  );
94 
96  $this->questionSetConfig
97  ));
98 
99  $questionAmountConfigModePerTest = new ilRadioOption(
100  $this->lng->txt('tst_inp_quest_amount_cfg_mode_test'),
102  );
103 
104  $questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
105 
106  $questionAmountConfigModePerPool = new ilRadioOption(
107  $this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'),
109  );
110 
111  $questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
112 
113  $questionAmountConfigMode->setRequired(true);
114 
115  $this->addItem($questionAmountConfigMode);
116 
117  // question amount per test
118 
119  $questionAmountPerTest = new ilNumberInputGUI(
120  $this->lng->txt('tst_inp_quest_amount_per_test'), 'quest_amount_per_test'
121  );
122 
123  $questionAmountPerTest->setRequired(true);
124  $questionAmountPerTest->setMinValue(1);
125  $questionAmountPerTest->allowDecimals(false);
126  $questionAmountPerTest->setMinvalueShouldBeGreater(false);
127  $questionAmountPerTest->setSize(4);
128 
129  $questionAmountPerTest->setValue(
130  $this->questionSetConfig->getQuestionAmountPerTest()
131  );
132 
133  $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
134 
135  if( $this->testOBJ->participantDataExist() )
136  {
137  $requirePoolsQuestionsHomoScored->setDisabled(true);
138  $questionAmountConfigMode->setDisabled(true);
139  $questionAmountPerTest->setDisabled(true);
140 
141  }
142  }
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)
Add Command button.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ fetchValidQuestionAmountConfigModeWithFallbackModePerTest()

◆ save()

ilTestRandomQuestionSetGeneralConfigFormGUI::save ( )

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

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

158  {
159  $this->questionSetConfig->setPoolsWithHomogeneousScoredQuestionsRequired(
160  $this->getItemByPostVar('quest_points_equal_per_pool')->getChecked()
161  );
162 
163  switch( $this->getItemByPostVar('quest_amount_cfg_mode')->getValue() )
164  {
166 
167  $this->questionSetConfig->setQuestionAmountConfigurationMode(
168  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
169  );
170 
171  $this->questionSetConfig->setQuestionAmountPerTest(
172  $this->getItemByPostVar('quest_amount_per_test')->getValue()
173  );
174 
175  break;
176 
178 
179  $this->questionSetConfig->setQuestionAmountConfigurationMode(
180  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
181  );
182 
183  $this->questionSetConfig->setQuestionAmountPerTest(null);
184 
185  break;
186  }
187 
188  return $this->questionSetConfig->saveToDb( $this->testOBJ->getTestId() );
189  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilTestRandomQuestionSetGeneralConfigFormGUI::$ctrl = null

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

Referenced by __construct().

◆ $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: