ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestSettingsChangeConfirmationGUI Class Reference
+ Inheritance diagram for ilTestSettingsChangeConfirmationGUI:
+ Collaboration diagram for ilTestSettingsChangeConfirmationGUI:

Public Member Functions

 __construct (ilObjTest $testOBJ)
 
 setOldQuestionSetType (string $oldQuestionSetType)
 
 getOldQuestionSetType ()
 
 setNewQuestionSetType (string $newQuestionSetType)
 
 getNewQuestionSetType ()
 
 setQuestionLossInfoEnabled (bool $questionLossInfoEnabled)
 
 isQuestionLossInfoEnabled ()
 
 build ()
 
 populateParametersFromPost ()
 
 populateParametersFromPropertyForm (ilPropertyFormGUI $form, $timezone)
 
- Public Member Functions inherited from ilConfirmationGUI
 setFormAction (string $a_form_action)
 
 getFormAction ()
 
 setHeaderText (string $a_headertext)
 
 getHeaderText ()
 
 setFormName (string $a_name)
 
 addButton (string $a_txt, string $a_cmd)
 
 setCancel (string $a_txt, string $a_cmd, string $a_id='')
 
 setConfirm (string $a_txt, string $a_cmd, string $a_id='')
 
 addItem (string $a_post_var, string $a_id, string $a_text, string $a_img='', string $a_alt='')
 
 addHiddenItem (string $a_post_var, string $a_value)
 
 getHTML ()
 

Protected Attributes

ilObjTest $testOBJ
 
- Protected Attributes inherited from ilConfirmationGUI
ilLanguage $lng
 
string $form_action = ''
 
string $headertext = ''
 
string $cancel_txt = ''
 
string $cancel_cmd = ''
 
string $cancel_id = ''
 
string $confirm_txt = ''
 
string $confirm_cmd = ''
 
string $confirm_id = ''
 

Private Member Functions

 buildHeaderText ()
 

Private Attributes

string $oldQuestionSetType
 
string $newQuestionSetType
 
bool $questionLossInfoEnabled
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestSettingsChangeConfirmationGUI::__construct ( ilObjTest  $testOBJ)

Definition at line 34 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $testOBJ, and ILIAS\MetaData\Repository\Validation\Data\__construct().

35  {
36  $this->testOBJ = $testOBJ;
37 
39  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestSettingsChangeConfirmationGUI::build ( )

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

References buildHeaderText(), and ilConfirmationGUI\setHeaderText().

89  : void
90  {
91  $this->setHeaderText($this->buildHeaderText());
92  }
setHeaderText(string $a_headertext)
+ Here is the call graph for this function:

◆ buildHeaderText()

ilTestSettingsChangeConfirmationGUI::buildHeaderText ( )
private

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

References getNewQuestionSetType(), getOldQuestionSetType(), isQuestionLossInfoEnabled(), and ILIAS\Repository\lng().

Referenced by build().

74  : string
75  {
76  $headerText = sprintf(
77  $this->lng->txt('tst_change_quest_set_type_from_old_to_new_with_conflict'),
78  $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getOldQuestionSetType()),
79  $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getNewQuestionSetType())
80  );
81 
82  if ($this->isQuestionLossInfoEnabled()) {
83  $headerText .= '<br /><br />' . $this->lng->txt('tst_nonpool_questions_get_lost_warning');
84  }
85 
86  return $headerText;
87  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getNewQuestionSetType ( )

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

References $newQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ getOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getOldQuestionSetType ( )

Definition at line 46 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $oldQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ isQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::isQuestionLossInfoEnabled ( )

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

References $questionLossInfoEnabled.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ populateParametersFromPost()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPost ( )

Definition at line 94 of file class.ilTestSettingsChangeConfirmationGUI.php.

References ILIAS\LTI\ToolProvider\$key, and ilConfirmationGUI\addHiddenItem().

94  : void
95  {
96  foreach ($_POST as $key => $value) {
97  if (strcmp($key, "cmd") != 0) {
98  if (is_array($value)) {
99  foreach ($value as $k => $v) {
100  $this->addHiddenItem("{$key}[{$k}]", $v);
101  }
102  } else {
103  $this->addHiddenItem($key, $value);
104  }
105  }
106  }
107  }
addHiddenItem(string $a_post_var, string $a_value)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ populateParametersFromPropertyForm()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPropertyForm ( ilPropertyFormGUI  $form,
  $timezone 
)

Definition at line 109 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $datetime, ilConfirmationGUI\$item, ILIAS\LTI\ToolProvider\$key, $parts, ilConfirmationGUI\addHiddenItem(), ilPropertyFormGUI\getInputItemsRecursive(), and IL_CAL_DATETIME.

109  : void
110  {
111  foreach ($form->getInputItemsRecursive() as $key => $item) {
112  switch ($item->getType()) {
113  case 'section_header':
114 
115  continue 2;
116 
117  case 'datetime':
118 
119  $datetime = $item->getDate();
120  if ($datetime instanceof ilDateTime && !$datetime->isNull()) {
121  $parts = explode(' ', $datetime->get(IL_CAL_DATETIME));
122  if ($datetime instanceof ilDate) {
123  $this->addHiddenItem($item->getPostVar(), $parts[0]);
124  } else {
125  $this->addHiddenItem($item->getPostVar(), $parts[0] . ' ' . $parts[1]);
126  }
127  } else {
128  $this->addHiddenItem($item->getPostVar(), '');
129  }
130 
131  break;
132 
133  case 'duration':
134 
135  $this->addHiddenItem("{$item->getPostVar()}[MM]", (string) $item->getMonths());
136  $this->addHiddenItem("{$item->getPostVar()}[dd]", (string) $item->getDays());
137  $this->addHiddenItem("{$item->getPostVar()}[hh]", (string) $item->getHours());
138  $this->addHiddenItem("{$item->getPostVar()}[mm]", (string) $item->getMinutes());
139  $this->addHiddenItem("{$item->getPostVar()}[ss]", (string) $item->getSeconds());
140 
141  break;
142 
143  case 'dateduration':
144 
145  foreach (["start", "end"] as $type) {
146  $postVar = $item->getPostVar() . '[' . $type . ']';
147  $datetime = $item->{'get' . ucfirst($type)}();
148 
149  if ($datetime instanceof ilDateTime && !$datetime->isNull()) {
150  $parts = explode(' ', $datetime->get(IL_CAL_DATETIME));
151  if ($datetime instanceof ilDate) {
152  $this->addHiddenItem($postVar, $parts[0]);
153  } else {
154  $this->addHiddenItem($postVar, $parts[0] . ' ' . $parts[1]);
155  }
156  } else {
157  $this->addHiddenItem($postVar, '');
158  }
159  }
160 
161  break;
162 
163  case 'checkboxgroup':
164 
165  if (is_array($item->getValue())) {
166  foreach ($item->getValue() as $option) {
167  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
168  }
169  }
170 
171  break;
172 
173  case 'select':
174 
175  $value = $item->getValue();
176  if (!is_array($value)) {
177  $value = array($value);
178  }
179  foreach ($value as $option) {
180  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
181  }
182 
183  break;
184 
185  case 'checkbox':
186 
187  if ($item->getChecked()) {
188  $this->addHiddenItem($item->getPostVar(), '1');
189  }
190 
191  break;
192 
193  default:
194 
195  $this->addHiddenItem($item->getPostVar(), (string) $item->getValue());
196  }
197  }
198  }
const IL_CAL_DATETIME
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
$datetime
addHiddenItem(string $a_post_var, string $a_value)
string $key
Consumer key/client ID value.
Definition: System.php:193
getInputItemsRecursive()
returns a flat array of all input items including the possibly existing subitems recursively ...
+ Here is the call graph for this function:

◆ setNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setNewQuestionSetType ( string  $newQuestionSetType)

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

References $newQuestionSetType.

51  : void
52  {
53  $this->newQuestionSetType = $newQuestionSetType;
54  }

◆ setOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setOldQuestionSetType ( string  $oldQuestionSetType)

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

References $oldQuestionSetType.

41  : void
42  {
43  $this->oldQuestionSetType = $oldQuestionSetType;
44  }

◆ setQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::setQuestionLossInfoEnabled ( bool  $questionLossInfoEnabled)
Parameters
bool$questionLossInfoEnabled

Definition at line 64 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $questionLossInfoEnabled.

64  : void
65  {
66  $this->questionLossInfoEnabled = $questionLossInfoEnabled;
67  }

Field Documentation

◆ $newQuestionSetType

string ilTestSettingsChangeConfirmationGUI::$newQuestionSetType
private

◆ $oldQuestionSetType

string ilTestSettingsChangeConfirmationGUI::$oldQuestionSetType
private

◆ $questionLossInfoEnabled

bool ilTestSettingsChangeConfirmationGUI::$questionLossInfoEnabled
private

◆ $testOBJ

ilObjTest ilTestSettingsChangeConfirmationGUI::$testOBJ
protected

Definition at line 29 of file class.ilTestSettingsChangeConfirmationGUI.php.

Referenced by __construct().


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