ILIAS  release_8 Revision v8.24
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 (bool $editModeEnabled)
 
 build ()
 
 save ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Data Fields

ilObjTest $testOBJ
 
ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI
 
ilTestRandomQuestionSetConfig $questionSetConfig
 

Protected Attributes

bool $editModeEnabled = true
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Private Member Functions

 fetchValidQuestionAmountConfigModeWithFallbackModePerTest (ilTestRandomQuestionSetConfig $config)
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

47 {
48 $this->ctrl = $ctrl;
49 $this->lng = $lng;
50 // Bugfix for mantis: 0015081
51 $this->lng->loadLanguageModule('form');
52 $this->testOBJ = $testOBJ;
53 $this->questionSetConfigGUI = $questionSetConfigGUI;
54 $this->questionSetConfig = $questionSetConfig;
56 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilPropertyFormGUI\$ctrl, ilPropertyFormGUI\$lng, $questionSetConfig, $questionSetConfigGUI, $testOBJ, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestRandomQuestionSetGeneralConfigFormGUI::build ( )

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

68 : void
69 {
70 $this->setFormAction($this->ctrl->getFormAction($this->questionSetConfigGUI));
71
72 $this->setTitle($this->lng->txt('tst_rnd_quest_set_cfg_general_form'));
73 $this->setId('tstRndQuestSetCfgGeneralForm');
74
75 $this->addCommandButton(
77 $this->lng->txt('save')
78 );
79
80 // Require Pools with Homogeneous Scored Questions
81
82 $requirePoolsQuestionsHomoScored = new ilCheckboxInputGUI(
83 $this->lng->txt('tst_inp_all_quest_points_equal_per_pool'),
84 'quest_points_equal_per_pool'
85 );
86
87 $requirePoolsQuestionsHomoScored->setInfo(
88 $this->lng->txt('tst_inp_all_quest_points_equal_per_pool_desc')
89 );
90
91 $requirePoolsQuestionsHomoScored->setChecked(
92 (bool)
93 $this->questionSetConfig->arePoolsWithHomogeneousScoredQuestionsRequired()
94 );
95
96 $this->addItem($requirePoolsQuestionsHomoScored);
97
98 // question amount config mode (per test / per pool)
99
100 $questionAmountConfigMode = new ilRadioGroupInputGUI(
101 $this->lng->txt('tst_inp_quest_amount_cfg_mode'),
102 'quest_amount_cfg_mode'
103 );
104
105 $questionAmountConfigMode->setValue($this->fetchValidQuestionAmountConfigModeWithFallbackModePerTest(
106 $this->questionSetConfig
107 ));
108
109 $questionAmountConfigModePerTest = new ilRadioOption(
110 $this->lng->txt('tst_inp_quest_amount_cfg_mode_test'),
112 );
113
114 $questionAmountConfigMode->addOption($questionAmountConfigModePerTest);
115
116 $questionAmountConfigModePerPool = new ilRadioOption(
117 $this->lng->txt('tst_inp_quest_amount_cfg_mode_pool'),
119 );
120
121 $questionAmountConfigMode->addOption($questionAmountConfigModePerPool);
122
123 $questionAmountConfigMode->setRequired(true);
124
125 $this->addItem($questionAmountConfigMode);
126
127 // question amount per test
128
129 $questionAmountPerTest = new ilNumberInputGUI(
130 $this->lng->txt('tst_inp_quest_amount_per_test'),
131 'quest_amount_per_test'
132 );
133
134 $questionAmountPerTest->setRequired(true);
135 $questionAmountPerTest->setMinValue(1);
136 $questionAmountPerTest->allowDecimals(false);
137 $questionAmountPerTest->setMinvalueShouldBeGreater(false);
138 $questionAmountPerTest->setSize(4);
139
140 $questionAmountPerTest->setValue(
141 $this->questionSetConfig->getQuestionAmountPerTest()
142 );
143
144 $questionAmountConfigModePerTest->addSubItem($questionAmountPerTest);
145
146 if (!$this->isEditModeEnabled()) {
147 $requirePoolsQuestionsHomoScored->setDisabled(true);
148 $questionAmountConfigMode->setDisabled(true);
149 $questionAmountPerTest->setDisabled(true);
150 }
151 }
This class represents a checkbox property in a property form.
setFormAction(string $a_formaction)
setId(string $a_id)
This class represents a number property in a property form.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fetchValidQuestionAmountConfigModeWithFallbackModePerTest(ilTestRandomQuestionSetConfig $config)

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilTestRandomQuestionSetConfigGUI\CMD_SAVE_GENERAL_CONFIG_FORM, ILIAS\Repository\ctrl(), fetchValidQuestionAmountConfigModeWithFallbackModePerTest(), isEditModeEnabled(), ILIAS\Repository\lng(), 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 153 of file class.ilTestRandomQuestionSetGeneralConfigFormGUI.php.

153 : ?string
154 {
155 switch ($config->getQuestionAmountConfigurationMode()) {
158
159 return $config->getQuestionAmountConfigurationMode();
160 }
161
163 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

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

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

References $editModeEnabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ save()

ilTestRandomQuestionSetGeneralConfigFormGUI::save ( )

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

165 : void
166 {
167 $this->questionSetConfig->setPoolsWithHomogeneousScoredQuestionsRequired(
168 $this->getItemByPostVar('quest_points_equal_per_pool')->getChecked()
169 );
170
171 switch ($this->getItemByPostVar('quest_amount_cfg_mode')->getValue()) {
173
174 $this->questionSetConfig->setQuestionAmountConfigurationMode(
175 $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
176 );
177
178 $this->questionSetConfig->setQuestionAmountPerTest(
179 $this->getItemByPostVar('quest_amount_per_test')->getValue()
180 );
181
182 break;
183
185
186 $this->questionSetConfig->setQuestionAmountConfigurationMode(
187 $this->getItemByPostVar('quest_amount_cfg_mode')->getValue()
188 );
189
190 $this->questionSetConfig->setQuestionAmountPerTest(null);
191
192 break;
193 }
194
195 $this->questionSetConfig->saveToDb();
196 }
getItemByPostVar(string $a_post_var)
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:47

References ilPropertyFormGUI\getItemByPostVar(), ILIAS\UI\Implementation\Component\Input\getValue(), 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 ( bool  $editModeEnabled)

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

63 : void
64 {
65 $this->editModeEnabled = $editModeEnabled;
66 }

References $editModeEnabled.

Field Documentation

◆ $editModeEnabled

bool ilTestRandomQuestionSetGeneralConfigFormGUI::$editModeEnabled = true
protected

◆ $questionSetConfig

ilTestRandomQuestionSetConfig ilTestRandomQuestionSetGeneralConfigFormGUI::$questionSetConfig

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

Referenced by __construct().

◆ $questionSetConfigGUI

ilTestRandomQuestionSetConfigGUI ilTestRandomQuestionSetGeneralConfigFormGUI::$questionSetConfigGUI

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

Referenced by __construct().

◆ $testOBJ

ilObjTest ilTestRandomQuestionSetGeneralConfigFormGUI::$testOBJ

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

Referenced by __construct().


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