ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestRandomQuestionSetPoolDefinitionFormGUI Class Reference
+ Inheritance diagram for ilTestRandomQuestionSetPoolDefinitionFormGUI:
+ Collaboration diagram for ilTestRandomQuestionSetPoolDefinitionFormGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $lng, ilObjTest $testOBJ, ilTestRandomQuestionSetConfigGUI $questionSetConfigGUI, ilTestRandomQuestionSetConfig $questionSetConfig)
 
 setSaveCommand ($saveCommand)
 
 getSaveCommand ()
 
 setSaveAndNewCommand ($saveAndNewCommand)
 
 getSaveAndNewCommand ()
 
 build (ilTestRandomQuestionSetSourcePoolDefinition $sourcePool, $availableTaxonomyIds)
 
 applySubmit (ilTestRandomQuestionSetSourcePoolDefinition $sourcePoolDefinition, $availableTaxonomyIds)
 
- 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...
 
 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
 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 Attributes

 $saveCommand = null
 
 $saveAndNewCommand = null
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 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()

Member Function Documentation

◆ applySubmit()

ilTestRandomQuestionSetPoolDefinitionFormGUI::applySubmit ( ilTestRandomQuestionSetSourcePoolDefinition  $sourcePoolDefinition,
  $availableTaxonomyIds 
)

Definition at line 206 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

207 {
208 switch( true )
209 {
210 case $this->getItemByPostVar('source_pool_filter_tax') === null:
211
212 case !in_array($this->getItemByPostVar('filter_tax')->getValue(), $availableTaxonomyIds):
213
214 $sourcePoolDefinition->setOriginalFilterTaxId(null);
215 $sourcePoolDefinition->setOriginalFilterTaxNodeId(null);
216 break;
217
218 default:
219
220 $taxId = $this->getItemByPostVar('filter_tax')->getValue();
221
222 $sourcePoolDefinition->setOriginalFilterTaxId( $taxId );
223
224 $sourcePoolDefinition->setOriginalFilterTaxNodeId( $this->getItemByPostVar("filter_tax_$taxId")->getValue() );
225 }
226
227 if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
228 {
229 $sourcePoolDefinition->setQuestionAmount( $this->getItemByPostVar('question_amount_per_pool')->getValue() );
230 }
231 }
getItemByPostVar($a_post_var)
Get Item by POST variable.

References ilPropertyFormGUI\getItemByPostVar(), ilTestRandomQuestionSetSourcePoolDefinition\setOriginalFilterTaxId(), ilTestRandomQuestionSetSourcePoolDefinition\setOriginalFilterTaxNodeId(), and ilTestRandomQuestionSetSourcePoolDefinition\setQuestionAmount().

+ Here is the call graph for this function:

◆ build()

ilTestRandomQuestionSetPoolDefinitionFormGUI::build ( ilTestRandomQuestionSetSourcePoolDefinition  $sourcePool,
  $availableTaxonomyIds 
)

Definition at line 95 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

96 {
97 $this->setFormAction( $this->ctrl->getFormAction($this->questionSetConfigGUI) );
98
99 $this->setTitle( $this->lng->txt('tst_rnd_quest_set_cfg_pool_form') );
100 $this->setId('tstRndQuestSetCfgPoolForm');
101
102 $this->addCommandButton(
103 $this->getSaveCommand(), $this->lng->txt('save_and_back')
104 );
105
106 if(null !== $this->getSaveAndNewCommand())
107 {
108 $this->addCommandButton(
109 $this->getSaveAndNewCommand(), $this->lng->txt('tst_save_and_create_new_rule')
110 );
111 }
112
113 $this->addCommandButton(
115 );
116
117 $hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
118 $hiddenDefId->setValue( $sourcePool->getId() );
119 $this->addItem($hiddenDefId);
120
121 $hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
122 $hiddenPoolId->setValue( $sourcePool->getPoolId() );
123 $this->addItem($hiddenPoolId);
124
125 $nonEditablePoolLabel = new ilNonEditableValueGUI(
126 $this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label'
127 );
128 $nonEditablePoolLabel->setValue( $sourcePool->getPoolInfoLabel($this->lng) );
129
130 $this->addItem($nonEditablePoolLabel);
131
132
133 if( count($availableTaxonomyIds) )
134 {
135 $taxRadio = new ilRadioGroupInputGUI(
136 $this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax'
137 );
138
139 $taxRadio->setRequired(true);
140
141 $taxRadio->addOption(new ilRadioOption(
142 $this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0
143 ));
144
145 $taxRadio->setValue(0);
146
147 require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
148
149 foreach($availableTaxonomyIds as $taxId)
150 {
151 $taxonomy = new ilObjTaxonomy($taxId);
152 $label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
153
154 $taxRadioOption = new ilRadioOption($label, $taxId);
155
156 $taxRadio->addOption($taxRadioOption);
157
158 $taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_$taxId", false);
159 $taxSelect->setRequired(true);
160 $taxRadioOption->addSubItem($taxSelect);
161
162 if( $taxId == $sourcePool->getOriginalFilterTaxId() )
163 {
164 $taxRadio->setValue( $sourcePool->getOriginalFilterTaxId() );
165 $taxSelect->setValue( $sourcePool->getOriginalFilterTaxNodeId() );
166 }
167 }
168
169 $this->addItem($taxRadio);
170 }
171 else
172 {
173 $hiddenNoTax = new ilHiddenInputGUI('filter_tax');
174 $hiddenNoTax->setValue(0);
175 $this->addItem($hiddenNoTax);
176
177 $nonEditableNoTax = new ilNonEditableValueGUI(
178 $this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label'
179 );
180 $nonEditableNoTax->setValue( $this->lng->txt('tst_inp_no_available_tax_hint') );
181 $this->addItem($nonEditableNoTax);
182 }
183
184
185 if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
186 {
187 $questionAmountPerSourcePool = new ilNumberInputGUI(
188 $this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool'
189 );
190
191 $questionAmountPerSourcePool->setRequired(true);
192 $questionAmountPerSourcePool->allowDecimals(false);
193 $questionAmountPerSourcePool->setMinValue(0);
194 $questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
195 $questionAmountPerSourcePool->setSize(4);
196
197 if( $sourcePool->getQuestionAmount() )
198 {
199 $questionAmountPerSourcePool->setValue( $sourcePool->getQuestionAmount() );
200 }
201
202 $this->addItem($questionAmountPerSourcePool);
203 }
204 }
setFormAction($a_formaction)
Set FormAction.
setId($a_id)
Set Id.
This class represents a hidden form property in a property form.
This class represents a non editable value in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
addCommandButton($a_cmd, $a_text)
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.
Select taxonomy nodes input GUI.

References ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilTestRandomQuestionSetConfigGUI\CMD_SHOW_SRC_POOL_DEF_LIST, ilTestRandomQuestionSetSourcePoolDefinition\getId(), ilTestRandomQuestionSetSourcePoolDefinition\getOriginalFilterTaxId(), ilTestRandomQuestionSetSourcePoolDefinition\getOriginalFilterTaxNodeId(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolId(), ilTestRandomQuestionSetSourcePoolDefinition\getPoolInfoLabel(), ilTestRandomQuestionSetSourcePoolDefinition\getQuestionAmount(), getSaveAndNewCommand(), getSaveCommand(), ilFormGUI\setFormAction(), ilFormGUI\setId(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ getSaveAndNewCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::getSaveAndNewCommand ( )
Returns
null|string

Definition at line 90 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References $saveAndNewCommand.

Referenced by build().

+ Here is the caller graph for this function:

◆ getSaveCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::getSaveCommand ( )

Definition at line 74 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

References $saveCommand.

Referenced by build().

+ Here is the caller graph for this function:

◆ setSaveAndNewCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::setSaveAndNewCommand (   $saveAndNewCommand)
Parameters
null | string$saveAndNewCommand

Definition at line 82 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

83 {
84 $this->saveAndNewCommand = $saveAndNewCommand;
85 }

References $saveAndNewCommand.

◆ setSaveCommand()

ilTestRandomQuestionSetPoolDefinitionFormGUI::setSaveCommand (   $saveCommand)

Definition at line 69 of file class.ilTestRandomQuestionSetPoolDefinitionFormGUI.php.

70 {
71 $this->saveCommand = $saveCommand;
72 }

References $saveCommand.

Field Documentation

◆ $ctrl

ilTestRandomQuestionSetPoolDefinitionFormGUI::$ctrl = null

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

Referenced by __construct().

◆ $lng

ilTestRandomQuestionSetPoolDefinitionFormGUI::$lng = null

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

Referenced by __construct().

◆ $questionSetConfig

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfig = null

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

Referenced by __construct().

◆ $questionSetConfigGUI

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfigGUI = null

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

Referenced by __construct().

◆ $saveAndNewCommand

ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveAndNewCommand = null
private

◆ $saveCommand

ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveCommand = null
private

◆ $testOBJ

ilTestRandomQuestionSetPoolDefinitionFormGUI::$testOBJ = null

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

Referenced by __construct().


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