ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestSettingsGUI Class Reference
+ Inheritance diagram for ilTestSettingsGUI:
+ Collaboration diagram for ilTestSettingsGUI:

Public Member Functions

 __construct (ilObjTest $testOBJ)
 

Protected Member Functions

 getTemplateSettingValue ($settingName)
 
 isHiddenFormItem ($formFieldId)
 
 isSectionHeaderRequired ($fields)
 
 formPropertyExists (ilPropertyFormGUI $form, $propertyId)
 
 removeHiddenItems (ilPropertyFormGUI $form)
 

Protected Attributes

 $testOBJ = null
 
 $settingsTemplate = null
 

Detailed Description

Definition at line 13 of file class.ilTestSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSettingsGUI::__construct ( ilObjTest  $testOBJ)

Definition at line 27 of file class.ilTestSettingsGUI.php.

References $testOBJ, and ilObjAssessmentFolderGUI\getSettingsTemplateConfig().

28  {
29  $this->testOBJ = $testOBJ;
30 
31  $templateId = $this->testOBJ->getTemplate();
32 
33  if ($templateId) {
34  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
35  $this->settingsTemplate = new ilSettingsTemplate($templateId, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
36  }
37  }
Settings template application class.
+ Here is the call graph for this function:

Member Function Documentation

◆ formPropertyExists()

◆ getTemplateSettingValue()

ilTestSettingsGUI::getTemplateSettingValue (   $settingName)
protected

Definition at line 39 of file class.ilTestSettingsGUI.php.

Referenced by ilObjTestSettingsGeneralGUI\addTestRunProperties().

40  {
41  if (!$this->settingsTemplate) {
42  return null;
43  }
44 
45  $templateSettings = $this->settingsTemplate->getSettings();
46 
47  if (!isset($templateSettings[$settingName])) {
48  return false;
49  }
50 
51  return $templateSettings[$settingName]['value'];
52  }
+ Here is the caller graph for this function:

◆ isHiddenFormItem()

ilTestSettingsGUI::isHiddenFormItem (   $formFieldId)
protected

Definition at line 54 of file class.ilTestSettingsGUI.php.

Referenced by isSectionHeaderRequired(), and ilObjTestSettingsScoringResultsGUI\saveResultMiscOptionsSettings().

55  {
56  if (!$this->settingsTemplate) {
57  return false;
58  }
59 
60  $settings = $this->settingsTemplate->getSettings();
61 
62  if (!isset($settings[$formFieldId])) {
63  return false;
64  }
65 
66  if (!$settings[$formFieldId]['hide']) {
67  return false;
68  }
69 
70  return true;
71  }
+ Here is the caller graph for this function:

◆ isSectionHeaderRequired()

ilTestSettingsGUI::isSectionHeaderRequired (   $fields)
protected

Definition at line 73 of file class.ilTestSettingsGUI.php.

References isHiddenFormItem().

Referenced by ilObjTestSettingsGeneralGUI\addQuestionBehaviourProperties(), and ilObjTestSettingsScoringResultsGUI\addScoringSettingsFormSection().

74  {
75  foreach ($fields as $field) {
76  if (!$this->isHiddenFormItem($field)) {
77  return true;
78  }
79  }
80 
81  return false;
82  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeHiddenItems()

ilTestSettingsGUI::removeHiddenItems ( ilPropertyFormGUI  $form)
protected

Definition at line 89 of file class.ilTestSettingsGUI.php.

References $id, and ilPropertyFormGUI\removeItemByPostVar().

Referenced by ilObjTestSettingsGeneralGUI\buildForm().

90  {
91  if ($this->settingsTemplate) {
92  foreach ($this->settingsTemplate->getSettings() as $id => $item) {
93  if ($item["hide"]) {
94  $form->removeItemByPostVar($id);
95  }
96  }
97  }
98  }
if(!array_key_exists('StateId', $_REQUEST)) $id
removeItemByPostVar($a_post_var, $a_remove_unused_headers=false)
Remove Item.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $settingsTemplate

ilTestSettingsGUI::$settingsTemplate = null
protected

Definition at line 25 of file class.ilTestSettingsGUI.php.

◆ $testOBJ

ilObjTest ilTestSettingsGUI::$testOBJ = null
protected

Definition at line 18 of file class.ilTestSettingsGUI.php.

Referenced by __construct().


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