ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
executeCommand ()
 Execute command.
 setTableWidth ($a_width)
 Set table width.
 getTableWidth ()
 get table width
 setMode ($a_mode)
 Set Mode ('std', 'subform').
 getMode ()
 Get Mode ('std', 'subform').
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setTitleIcon ($a_titleicon)
 Set TitleIcon.
 getTitleIcon ()
 Get TitleIcon.
 setDescription ($a_val)
 Set description.
 getDescription ()
 Get description.
 setTopAnchor ($a_val)
 Set top anchor.
 getTopAnchor ()
 Get top anchor.
 setShowTopButtons ($a_val)
 Get show top buttons.
 getShowTopButtons ()
 Set show top buttons.
 addItem ($a_item)
 Add Item (Property, SectionHeader).
 removeItemByPostVar ($a_post_var)
 Remove Item.
 getItemByPostVar ($a_post_var)
 Get Item by POST variable.
 setItems ($a_items)
 Set Items.
 getItems ()
 Get Items.
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively
 setDisableStandardMessage ($a_val)
 Set disable standard message.
 getDisableStandardMessage ()
 Get disable standard message.
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not.
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not.
 setValuesByArray ($a_values)
 Set form values from an array.
 setValuesByPost ()
 Set form values from POST values.
 checkInput ()
 Check Post Input.
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id.
 addCustomProperty ($a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property.
 addCommandButton ($a_cmd, $a_text)
 Add Command button.
 clearCommandButtons ()
 Remove all command buttons.
 getContent ()
 Get Content.
 insertItem ($item, $a_sub_item=false)
 getHTML ()
 Get HTML.
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data.
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded?
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory.
- Public Member Functions inherited from ilFormGUI
 ilFormGUI ()
 Constructor.
 setFormAction ($a_formaction)
 Set FormAction.
 getFormAction ()
 Get FormAction.
 setTarget ($a_target)
 Set Target.
 getTarget ()
 Get Target.
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false.
 getMultipart ()
 Get Enctype Multipart/Formdata true/false.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setName ($a_name)
 Set Name.
 getName ()
 Get Name.
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open.
 getKeepOpen ()
 Get Keep Form Tag Open.
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag.
 getOpenTag ()
 Get Open Form Tag Enabled.
 setCloseTag ($a_val)
 Set close tag.
 getCloseTag ()
 Get close tag.

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
 keepFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Import upload into temp directory.
 rebuildUploadedFiles ()
 try to rebuild files
- 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

Detailed Description

Constructor & Destructor Documentation

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

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

References $ctrl, $lng, $questionSetConfig, $questionSetConfigGUI, and $testOBJ.

{
$this->ctrl = $ctrl;
$this->lng = $lng;
$this->testOBJ = $testOBJ;
$this->questionSetConfigGUI = $questionSetConfigGUI;
$this->questionSetConfig = $questionSetConfig;
}

Member Function Documentation

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

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

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

{
switch( true )
{
case $this->getItemByPostVar('source_pool_filter_tax') === null:
case !in_array($this->getItemByPostVar('filter_tax')->getValue(), $availableTaxonomyIds):
$sourcePoolDefinition->setOriginalFilterTaxId(null);
$sourcePoolDefinition->setOriginalFilterTaxNodeId(null);
break;
default:
$taxId = $this->getItemByPostVar('filter_tax')->getValue();
$sourcePoolDefinition->setOriginalFilterTaxId( $taxId );
$sourcePoolDefinition->setOriginalFilterTaxNodeId( $this->getItemByPostVar("filter_tax_$taxId")->getValue() );
}
if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
{
$sourcePoolDefinition->setQuestionAmount( $this->getItemByPostVar('question_amount_per_pool')->getValue() );
}
}

+ Here is the call graph for this function:

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

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

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

{
$this->setFormAction( $this->ctrl->getFormAction($this->questionSetConfigGUI) );
$this->setTitle( $this->lng->txt('tst_rnd_quest_set_cfg_pool_form') );
$this->setId('tstRndQuestSetCfgPoolForm');
$this->getSaveCommand(), $this->lng->txt('save_and_back')
);
if(null !== $this->getSaveAndNewCommand())
{
$this->getSaveAndNewCommand(), $this->lng->txt('tst_save_and_create_new_rule')
);
}
);
$hiddenDefId = new ilHiddenInputGUI('src_pool_def_id');
$hiddenDefId->setValue( $sourcePool->getId() );
$this->addItem($hiddenDefId);
$hiddenPoolId = new ilHiddenInputGUI('quest_pool_id');
$hiddenPoolId->setValue( $sourcePool->getPoolId() );
$this->addItem($hiddenPoolId);
$nonEditablePoolLabel = new ilNonEditableValueGUI(
$this->lng->txt('tst_inp_source_pool_label'), 'quest_pool_label'
);
$nonEditablePoolLabel->setValue( $sourcePool->getPoolInfoLabel($this->lng) );
$this->addItem($nonEditablePoolLabel);
if( count($availableTaxonomyIds) )
{
$taxRadio = new ilRadioGroupInputGUI(
$this->lng->txt('tst_inp_source_pool_filter_tax'), 'filter_tax'
);
$taxRadio->setRequired(true);
$taxRadio->addOption(new ilRadioOption(
$this->lng->txt('tst_inp_source_pool_no_tax_filter'), 0
));
$taxRadio->setValue(0);
require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
foreach($availableTaxonomyIds as $taxId)
{
$taxonomy = new ilObjTaxonomy($taxId);
$label = sprintf($this->lng->txt('tst_inp_source_pool_filter_tax_x'), $taxonomy->getTitle());
$taxRadioOption = new ilRadioOption($label, $taxId);
$taxRadio->addOption($taxRadioOption);
$taxSelect = new ilTaxSelectInputGUI($taxId, "filter_tax_$taxId", false);
$taxSelect->setRequired(true);
$taxRadioOption->addSubItem($taxSelect);
if( $taxId == $sourcePool->getOriginalFilterTaxId() )
{
$taxRadio->setValue( $sourcePool->getOriginalFilterTaxId() );
$taxSelect->setValue( $sourcePool->getOriginalFilterTaxNodeId() );
}
}
$this->addItem($taxRadio);
}
else
{
$hiddenNoTax = new ilHiddenInputGUI('filter_tax');
$hiddenNoTax->setValue(0);
$this->addItem($hiddenNoTax);
$nonEditableNoTax = new ilNonEditableValueGUI(
$this->lng->txt('tst_inp_source_pool_filter_tax'), 'no_tax_label'
);
$nonEditableNoTax->setValue( $this->lng->txt('tst_inp_no_available_tax_hint') );
$this->addItem($nonEditableNoTax);
}
if( $this->questionSetConfig->isQuestionAmountConfigurationModePerPool() )
{
$questionAmountPerSourcePool = new ilNumberInputGUI(
$this->lng->txt('tst_inp_quest_amount_per_source_pool'), 'question_amount_per_pool'
);
$questionAmountPerSourcePool->setRequired(true);
$questionAmountPerSourcePool->allowDecimals(false);
$questionAmountPerSourcePool->setMinValue(0);
$questionAmountPerSourcePool->setMinvalueShouldBeGreater(true);
$questionAmountPerSourcePool->setSize(4);
if( $sourcePool->getQuestionAmount() )
{
$questionAmountPerSourcePool->setValue( $sourcePool->getQuestionAmount() );
}
$this->addItem($questionAmountPerSourcePool);
}
}

+ Here is the call graph for this function:

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:

ilTestRandomQuestionSetPoolDefinitionFormGUI::getSaveCommand ( )

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

References $saveCommand.

Referenced by build().

{
}

+ Here is the caller graph for this function:

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

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

References $saveAndNewCommand.

{
$this->saveAndNewCommand = $saveAndNewCommand;
}
ilTestRandomQuestionSetPoolDefinitionFormGUI::setSaveCommand (   $saveCommand)

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

References $saveCommand.

{
$this->saveCommand = $saveCommand;
}

Field Documentation

ilTestRandomQuestionSetPoolDefinitionFormGUI::$ctrl = null

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

Referenced by __construct().

ilTestRandomQuestionSetPoolDefinitionFormGUI::$lng = null

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

Referenced by __construct().

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfig = null

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

Referenced by __construct().

ilTestRandomQuestionSetPoolDefinitionFormGUI::$questionSetConfigGUI = null

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

Referenced by __construct().

ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveAndNewCommand = null
private
ilTestRandomQuestionSetPoolDefinitionFormGUI::$saveCommand = null
private
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: