ILIAS  release_8 Revision v8.24
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 32 of file class.ilTestSettingsChangeConfirmationGUI.php.

33 {
34 $this->testOBJ = $testOBJ;
35
37 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $testOBJ, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestSettingsChangeConfirmationGUI::build ( )

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

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

+ Here is the call graph for this function:

◆ buildHeaderText()

ilTestSettingsChangeConfirmationGUI::buildHeaderText ( )
private

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

72 : string
73 {
74 $headerText = sprintf(
75 $this->lng->txt('tst_change_quest_set_type_from_old_to_new_with_conflict'),
76 $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getOldQuestionSetType()),
77 $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getNewQuestionSetType())
78 );
79
80 if ($this->isQuestionLossInfoEnabled()) {
81 $headerText .= '<br /><br />' . $this->lng->txt('tst_nonpool_questions_get_lost_warning');
82 }
83
84 return $headerText;
85 }

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

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getNewQuestionSetType ( )

◆ getOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getOldQuestionSetType ( )

◆ isQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::isQuestionLossInfoEnabled ( )

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

References $questionLossInfoEnabled.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ populateParametersFromPost()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPost ( )

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

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

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

+ Here is the call graph for this function:

◆ populateParametersFromPropertyForm()

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

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

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

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

+ Here is the call graph for this function:

◆ setNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setNewQuestionSetType ( string  $newQuestionSetType)

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

49 : void
50 {
51 $this->newQuestionSetType = $newQuestionSetType;
52 }

References $newQuestionSetType.

◆ setOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setOldQuestionSetType ( string  $oldQuestionSetType)

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

39 : void
40 {
41 $this->oldQuestionSetType = $oldQuestionSetType;
42 }

References $oldQuestionSetType.

◆ setQuestionLossInfoEnabled()

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

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

62 : void
63 {
64 $this->questionLossInfoEnabled = $questionLossInfoEnabled;
65 }

References $questionLossInfoEnabled.

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 27 of file class.ilTestSettingsChangeConfirmationGUI.php.

Referenced by __construct().


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