ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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, $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)
 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...
 
 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 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
 
 $prevent_double_submission = false
 

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 64 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().

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

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

160  {
161  $this->questionSetConfig->setPoolsWithHomogeneousScoredQuestionsRequired(
162  $this->getItemByPostVar('quest_points_equal_per_pool')->getChecked()
163  );
164 
165  switch( $this->getItemByPostVar('quest_amount_cfg_mode')->getValue() )
166  {
168 
169  $this->questionSetConfig->setQuestionAmountConfigurationMode(
170  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
171  );
172 
173  $this->questionSetConfig->setQuestionAmountPerTest(
174  $this->getItemByPostVar('quest_amount_per_test')->getValue()
175  );
176 
177  break;
178 
180 
181  $this->questionSetConfig->setQuestionAmountConfigurationMode(
182  $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
183  );
184 
185  $this->questionSetConfig->setQuestionAmountPerTest(null);
186 
187  break;
188  }
189 
190  return $this->questionSetConfig->saveToDb( $this->testOBJ->getTestId() );
191  }
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: