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

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

33  {
34  $this->testOBJ = $testOBJ;
35 
37  }
__construct(Container $dic, ilPlugin $plugin)
+ 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().

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

◆ buildHeaderText()

ilTestSettingsChangeConfirmationGUI::buildHeaderText ( )
private

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

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

Referenced by build().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getNewQuestionSetType ( )

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

References $newQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ getOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getOldQuestionSetType ( )

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

References $oldQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ 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.

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

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
+ Here is the call graph for this function:

◆ populateParametersFromPropertyForm()

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

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

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

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
$type
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
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 49 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $newQuestionSetType.

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

◆ setOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setOldQuestionSetType ( string  $oldQuestionSetType)

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

References $oldQuestionSetType.

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

◆ setQuestionLossInfoEnabled()

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

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

References $questionLossInfoEnabled.

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

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: