ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
35  include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
36  $this->settingsTemplate = new ilSettingsTemplate($templateId, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
37  }
38  }
Settings template application class.
+ Here is the call graph for this function:

Member Function Documentation

◆ formPropertyExists()

◆ getTemplateSettingValue()

ilTestSettingsGUI::getTemplateSettingValue (   $settingName)
protected

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

Referenced by ilObjTestSettingsGeneralGUI\addTestRunProperties().

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

◆ isHiddenFormItem()

ilTestSettingsGUI::isHiddenFormItem (   $formFieldId)
protected

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

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

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

◆ isSectionHeaderRequired()

ilTestSettingsGUI::isSectionHeaderRequired (   $fields)
protected

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

References isHiddenFormItem().

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

80  {
81  foreach($fields as $field)
82  {
83  if( !$this->isHiddenFormItem($field) )
84  {
85  return true;
86  }
87  }
88 
89  return false;
90  }
+ 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 97 of file class.ilTestSettingsGUI.php.

References ilPropertyFormGUI\removeItemByPostVar().

Referenced by ilObjTestSettingsGeneralGUI\buildForm().

98  {
99  if( $this->settingsTemplate )
100  {
101  foreach ($this->settingsTemplate->getSettings() as $id => $item)
102  {
103  if ($item["hide"])
104  {
105  $form->removeItemByPostVar($id);
106  }
107  }
108  }
109  }
removeItemByPostVar($a_post_var)
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: