ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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

ilObjTest $testOBJ
 
ilSettingsTemplate $settingsTemplate = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSettingsGUI::__construct ( ilObjTest  $testOBJ)

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

References $testOBJ, ilObjAssessmentFolderGUI\getSettingsTemplateConfig(), and ilObjTest\getTemplate().

31  {
32  $this->testOBJ = $testOBJ;
33 
34  $templateId = $this->testOBJ->getTemplate();
35 
36  if ($templateId) {
37  $this->settingsTemplate = new ilSettingsTemplate($templateId, ilObjAssessmentFolderGUI::getSettingsTemplateConfig());
38  }
39  }
Settings template application class.
+ Here is the call graph for this function:

Member Function Documentation

◆ formPropertyExists()

ilTestSettingsGUI::formPropertyExists ( ilPropertyFormGUI  $form,
  $propertyId 
)
protected

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

References ilPropertyFormGUI\getItemByPostVar().

Referenced by ilObjTestSettingsGeneralGUI\saveGeneralProperties(), ilObjTestSettingsGeneralGUI\saveQuestionBehaviourProperties(), ilObjTestSettingsGeneralGUI\saveTestAccessProperties(), ilObjTestSettingsGeneralGUI\saveTestFinishProperties(), and ilObjTestSettingsGeneralGUI\saveTestSequenceSettings().

86  : bool
87  {
88  return $form->getItemByPostVar($propertyId) instanceof ilFormPropertyGUI;
89  }
getItemByPostVar(string $a_post_var)
This class represents a property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplateSettingValue()

ilTestSettingsGUI::getTemplateSettingValue (   $settingName)
protected

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

Referenced by ilObjTestSettingsGeneralGUI\addTestRunProperties().

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

◆ isHiddenFormItem()

ilTestSettingsGUI::isHiddenFormItem (   $formFieldId)
protected

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

References ILIAS\LTI\ToolProvider\$settings.

Referenced by isSectionHeaderRequired().

56  : bool
57  {
58  if (!$this->settingsTemplate) {
59  return false;
60  }
61 
62  $settings = $this->settingsTemplate->getSettings();
63 
64  if (!isset($settings[$formFieldId])) {
65  return false;
66  }
67 
68  if (!$settings[$formFieldId]['hide']) {
69  return false;
70  }
71 
72  return true;
73  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
+ Here is the caller graph for this function:

◆ isSectionHeaderRequired()

ilTestSettingsGUI::isSectionHeaderRequired (   $fields)
protected

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

References isHiddenFormItem().

Referenced by ilObjTestSettingsGeneralGUI\addQuestionBehaviourProperties().

75  : bool
76  {
77  foreach ($fields as $field) {
78  if (!$this->isHiddenFormItem($field)) {
79  return true;
80  }
81  }
82 
83  return false;
84  }
+ 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 91 of file class.ilTestSettingsGUI.php.

References $id, and ilPropertyFormGUI\removeItemByPostVar().

Referenced by ilObjTestSettingsGeneralGUI\buildForm().

92  {
93  if ($this->settingsTemplate) {
94  foreach ($this->settingsTemplate->getSettings() as $id => $item) {
95  if ($item["hide"]) {
96  $form->removeItemByPostVar($id);
97  }
98  }
99  }
100  }
removeItemByPostVar(string $a_post_var, bool $a_remove_unused_headers=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $settingsTemplate

ilSettingsTemplate ilTestSettingsGUI::$settingsTemplate = null
protected

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

◆ $testOBJ

ilObjTest ilTestSettingsGUI::$testOBJ
protected

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

Referenced by __construct().


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