ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Test\Settings\MainSettings\SettingsFinishing Class Reference
+ Inheritance diagram for ILIAS\Test\Settings\MainSettings\SettingsFinishing:
+ Collaboration diagram for ILIAS\Test\Settings\MainSettings\SettingsFinishing:

Public Member Functions

 __construct (int $test_id, protected bool $show_answer_overview=false, protected bool $concluding_remarks_enabled=false, protected ?string $concluding_remarks_text='', protected ?int $concluding_remarks_page_id=null, protected int $redirection_mode=\ilObjTest::REDIRECT_NONE, protected ?string $redirection_url=null, protected int $mail_notification_content_type=0, protected bool $always_send_mail_notification=false)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 
 getShowAnswerOverview ()
 
 withShowAnswerOverview (bool $show_answer_overview)
 
 getConcludingRemarksEnabled ()
 
 withConcludingRemarksEnabled (bool $concluding_remarks_enabled)
 
 getConcludingRemarksText ()
 
 getConcludingRemarksPageId ()
 
 withConcludingRemarksPageId (?int $concluding_remarks_page_id)
 
 getRedirectionMode ()
 
 withRedirectionMode (int $redirection_mode)
 
 getRedirectionUrl ()
 
 withRedirectionUrl (?string $redirection_url)
 
 getMailNotificationContentType ()
 
 withMailNotificationContentType (int $mail_notification_content_type)
 
 getAlwaysSendMailNotification ()
 
 withAlwaysSendMailNotification (bool $always_send_mail_notification)
 
- Public Member Functions inherited from ILIAS\Test\Settings\TestSettings
 __construct (int $test_id)
 
 getTestId ()
 
 withTestId (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
 
 toStorage ()
 
 toLog (AdditionalInformationGenerator $additional_info)
 

Private Member Functions

 getRedirectionInputs (\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
 
 getMailNotificationInputs (\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Test\Settings\TestSettings
int $test_id
 

Detailed Description

Definition at line 31 of file SettingsFinishing.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::__construct ( int  $test_id,
protected bool  $show_answer_overview = false,
protected bool  $concluding_remarks_enabled = false,
protected ?string  $concluding_remarks_text = '',
protected ?int  $concluding_remarks_page_id = null,
protected int  $redirection_mode = \ilObjTest::REDIRECT_NONE,
protected ?string  $redirection_url = null,
protected int  $mail_notification_content_type = 0,
protected bool  $always_send_mail_notification = false 
)

Definition at line 33 of file SettingsFinishing.php.

References ILIAS\GlobalScreen\Provider\__construct().

43  {
45  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getAlwaysSendMailNotification()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getAlwaysSendMailNotification ( )

◆ getConcludingRemarksEnabled()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getConcludingRemarksEnabled ( )

Definition at line 253 of file SettingsFinishing.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsFinishing\toForm(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsFinishing\toStorage().

253  : bool
254  {
255  return $this->concluding_remarks_enabled;
256  }
+ Here is the caller graph for this function:

◆ getConcludingRemarksPageId()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getConcludingRemarksPageId ( )

Definition at line 270 of file SettingsFinishing.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsFinishing\toStorage().

270  : ?int
271  {
272  return $this->concluding_remarks_page_id;
273  }
+ Here is the caller graph for this function:

◆ getConcludingRemarksText()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getConcludingRemarksText ( )

Definition at line 265 of file SettingsFinishing.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsFinishing\toStorage().

265  : string
266  {
267  return $this->concluding_remarks_text ?? '';
268  }
+ Here is the caller graph for this function:

◆ getMailNotificationContentType()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getMailNotificationContentType ( )

◆ getMailNotificationInputs()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getMailNotificationInputs ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery 
)
private

Definition at line 124 of file SettingsFinishing.php.

References ILIAS\Test\Settings\MainSettings\SettingsFinishing\getAlwaysSendMailNotification(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getMailNotificationContentType(), null, ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsFinishing\toForm().

128  : OptionalGroup {
129  $notification_trafo = $refinery->custom()->transformation(
130  static function (?array $v): array {
131  if ($v === null) {
132  return [
133  'notification_content_type' => 0,
134  'always_notify' => false
135  ];
136  }
137 
138  return $v;
139  }
140  );
141 
142  $sub_inputs_finish_notification = [
143  'notification_content_type' => $f->radio(
144  $lng->txt('tst_finish_notification_content_type')
145  )->withOption(
146  '1',
147  $lng->txt('tst_finish_notification_simple')
148  )->withOption(
149  '2',
150  $lng->txt('tst_finish_notification_advanced')
151  )->withRequired(true)
152  ->withValue('1')
153  ->withAdditionalTransformation($refinery->kindlyTo()->int()),
154  'always_notify' => $f->checkbox(
155  $lng->txt('mailnottype'),
156  $lng->txt('mailnottype_desc')
157  )
158  ];
159 
160  $mail_notification_inputs = $f->optionalGroup(
161  $sub_inputs_finish_notification,
162  $lng->txt('tst_finish_notification'),
163  $lng->txt('tst_finish_notification_desc')
164  )->withValue(null)
165  ->withAdditionalTransformation($notification_trafo);
166 
167  if ($this->getMailNotificationContentType() === 0) {
168  return $mail_notification_inputs;
169  }
170 
171  return $mail_notification_inputs->withValue(
172  [
173  'notification_content_type' => (string) $this->getMailNotificationContentType(),
174  'always_notify' => (bool) $this->getAlwaysSendMailNotification()
175  ]
176  );
177  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectionInputs()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getRedirectionInputs ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery 
)
private

Definition at line 70 of file SettingsFinishing.php.

References ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionMode(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionUrl(), null, ilObjTest\REDIRECT_ALWAYS, ilObjTest\REDIRECT_KIOSK, ilObjTest\REDIRECT_NONE, ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\Test\Settings\MainSettings\SettingsFinishing\toForm().

74  : OptionalGroup {
75  $redirection_trafo = $refinery->custom()->transformation(
76  static function (?array $v): array {
77  if ($v === null) {
78  return [
79  'redirect_mode' => \ilObjTest::REDIRECT_NONE,
80  'redirect_url' => ''
81  ];
82  }
83 
84  return $v;
85  }
86  );
87 
88  $sub_inputs_redirect = [
89  'redirect_mode' => $f->radio(
90  $lng->txt('redirect_after_finishing_rule')
91  )->withOption(
93  $lng->txt('redirect_always')
94  )->withOption(
96  $lng->txt('redirect_in_kiosk_mode')
97  )->withRequired(true)
98  ->withAdditionalTransformation($refinery->kindlyTo()->int()),
99  'redirect_url' => $f->text(
100  $lng->txt('redirection_url')
101  )->withRequired(true)
102  ->withAdditionalTransformation($refinery->string()->hasMaxLength(4000))
103  ];
104 
105  $redirection_input = $f->optionalGroup(
106  $sub_inputs_redirect,
107  $lng->txt('redirect_after_finishing_tst'),
108  $lng->txt('redirect_after_finishing_tst_desc')
109  )->withValue(null)
110  ->withAdditionalTransformation($redirection_trafo);
111 
112  if ($this->getRedirectionMode() === \ilObjTest::REDIRECT_NONE) {
113  return $redirection_input;
114  }
115 
116  return $redirection_input->withValue(
117  [
118  'redirect_mode' => $this->getRedirectionMode(),
119  'redirect_url' => $this->getRedirectionUrl()
120  ]
121  );
122  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const REDIRECT_NONE
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
global $lng
Definition: privfeed.php:31
const REDIRECT_ALWAYS
const REDIRECT_KIOSK
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectionMode()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getRedirectionMode ( )

◆ getRedirectionUrl()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getRedirectionUrl ( )

◆ getShowAnswerOverview()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::getShowAnswerOverview ( )

Definition at line 241 of file SettingsFinishing.php.

Referenced by ilObjTest\addConcludingRemarksToSettingsFromImport(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\toForm(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\toLog(), and ILIAS\Test\Settings\MainSettings\SettingsFinishing\toStorage().

241  : bool
242  {
243  return $this->show_answer_overview;
244  }
+ Here is the caller graph for this function:

◆ toForm()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::toForm ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
?array  $environment = null 
)

Definition at line 47 of file SettingsFinishing.php.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Test\Settings\MainSettings\SettingsFinishing\getConcludingRemarksEnabled(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getMailNotificationInputs(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionInputs(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getShowAnswerOverview(), ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\withValue().

52  : FormInput {
53  $inputs['show_answer_overview'] = $f->checkbox(
54  $lng->txt('enable_examview'),
55  $lng->txt('enable_examview_desc')
56  )->withValue($this->getShowAnswerOverview());
57 
58  $inputs['show_concluding_remarks'] = $f->checkbox(
59  $lng->txt('final_statement'),
60  $lng->txt('final_statement_show_desc')
61  )->withValue((bool) $this->getConcludingRemarksEnabled());
62 
63  $inputs['redirect_after_finish'] = $this->getRedirectionInputs($lng, $f, $refinery);
64 
65  $inputs['finish_notification'] = $this->getMailNotificationInputs($lng, $f, $refinery);
66 
67  return $f->section($inputs, $lng->txt('tst_final_information'));
68  }
getRedirectionInputs(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
getMailNotificationInputs(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

◆ toLog()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::toLog ( AdditionalInformationGenerator  $additional_info)

Definition at line 193 of file SettingsFinishing.php.

References ILIAS\Test\Settings\MainSettings\SettingsFinishing\getAlwaysSendMailNotification(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getConcludingRemarksEnabled(), ILIAS\Test\Logging\AdditionalInformationGenerator\getEnabledDisabledTagForBool(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getMailNotificationContentType(), ILIAS\Test\Logging\AdditionalInformationGenerator\getNoneTag(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionMode(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionUrl(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getShowAnswerOverview(), ILIAS\Test\Logging\AdditionalInformationGenerator\getTagForLangVar(), ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_ALWAYS_SEND_NOTIFICATION, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_ANSWER_OVERVIEW_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_CONCLUDING_REMARKS_ENABLED, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_MAIL_NOTIFICATION_CONTENT_TYPE, ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_REDIRECT_MODE, and ILIAS\Test\Logging\AdditionalInformationGenerator\KEY_TEST_REDIRECT_URL.

193  : array
194  {
195  $log_array = [
197  ->getEnabledDisabledTagForBool($this->getShowAnswerOverview()),
199  ->getEnabledDisabledTagForBool($this->getConcludingRemarksEnabled()),
201 
202  ];
203 
204  switch ($this->getRedirectionMode()) {
205  case \ilObjTest::REDIRECT_NONE:
206  $log_array[AdditionalInformationGenerator::KEY_TEST_REDIRECT_MODE] = $additional_info
207  ->getNoneTag();
208  break;
209  case \ilObjTest::REDIRECT_ALWAYS:
210  $log_array[AdditionalInformationGenerator::KEY_TEST_REDIRECT_MODE] = $additional_info
211  ->getTagForLangVar('redirect_always');
212  break;
213  case \ilObjTest::REDIRECT_KIOSK:
214  $log_array[AdditionalInformationGenerator::KEY_TEST_REDIRECT_MODE] = $additional_info
215  ->getTagForLangVar('redirect_in_kiosk_mode');
216  break;
217  }
218 
219  switch ($this->getMailNotificationContentType()) {
220  case 0:
222  ->getNoneTag();
223  break;
224  case 1:
226  ->getTagForLangVar('tst_finish_notification_simple');
228  ->getEnabledDisabledTagForBool($this->getAlwaysSendMailNotification());
229  break;
230  case 2:
232  ->getTagForLangVar('tst_finish_notification_advanced');
234  ->getEnabledDisabledTagForBool($this->getAlwaysSendMailNotification());
235  break;
236  }
237 
238  return $log_array;
239  }
+ Here is the call graph for this function:

◆ toStorage()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::toStorage ( )

Definition at line 179 of file SettingsFinishing.php.

References ILIAS\Test\Settings\MainSettings\SettingsFinishing\getAlwaysSendMailNotification(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getConcludingRemarksEnabled(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getConcludingRemarksPageId(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getConcludingRemarksText(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getMailNotificationContentType(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionMode(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getRedirectionUrl(), ILIAS\Test\Settings\MainSettings\SettingsFinishing\getShowAnswerOverview(), and ILIAS\Repository\int().

179  : array
180  {
181  return [
182  'enable_examview' => ['integer', (int) $this->getShowAnswerOverview()],
183  'showfinalstatement' => ['integer', (int) $this->getConcludingRemarksEnabled()],
184  'finalstatement' => ['text', $this->getConcludingRemarksText()],
185  'concluding_remarks_page_id' => ['integer', $this->getConcludingRemarksPageId()],
186  'redirection_mode' => ['integer', $this->getRedirectionMode()],
187  'redirection_url' => ['text', $this->getRedirectionUrl()],
188  'mailnotification' => ['integer', $this->getMailNotificationContentType()],
189  'mailnottype' => ['integer', (int) $this->getAlwaysSendMailNotification()]
190  ];
191  }
+ Here is the call graph for this function:

◆ withAlwaysSendMailNotification()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withAlwaysSendMailNotification ( bool  $always_send_mail_notification)

Definition at line 323 of file SettingsFinishing.php.

323  : self
324  {
325  $clone = clone $this;
326  $clone->always_send_mail_notification = $always_send_mail_notification;
327  return $clone;
328  }

◆ withConcludingRemarksEnabled()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withConcludingRemarksEnabled ( bool  $concluding_remarks_enabled)

Definition at line 258 of file SettingsFinishing.php.

258  : self
259  {
260  $clone = clone $this;
261  $clone->concluding_remarks_enabled = $concluding_remarks_enabled;
262  return $clone;
263  }

◆ withConcludingRemarksPageId()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withConcludingRemarksPageId ( ?int  $concluding_remarks_page_id)

Definition at line 275 of file SettingsFinishing.php.

Referenced by ilObjTest\addConcludingRemarksToSettingsFromImport().

275  : self
276  {
277  $clone = clone $this;
278  $clone->concluding_remarks_page_id = $concluding_remarks_page_id;
279  return $clone;
280  }
+ Here is the caller graph for this function:

◆ withMailNotificationContentType()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withMailNotificationContentType ( int  $mail_notification_content_type)

Definition at line 311 of file SettingsFinishing.php.

311  : self
312  {
313  $clone = clone $this;
314  $clone->mail_notification_content_type = $mail_notification_content_type;
315  return $clone;
316  }

◆ withRedirectionMode()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withRedirectionMode ( int  $redirection_mode)

Definition at line 287 of file SettingsFinishing.php.

287  : self
288  {
289  $clone = clone $this;
290  $clone->redirection_mode = $redirection_mode;
291  return $clone;
292  }

◆ withRedirectionUrl()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withRedirectionUrl ( ?string  $redirection_url)

Definition at line 299 of file SettingsFinishing.php.

299  : self
300  {
301  $clone = clone $this;
302  $clone->redirection_url = $redirection_url;
303  return $clone;
304  }

◆ withShowAnswerOverview()

ILIAS\Test\Settings\MainSettings\SettingsFinishing::withShowAnswerOverview ( bool  $show_answer_overview)

Definition at line 246 of file SettingsFinishing.php.

Referenced by ILIAS\Test\Settings\MainSettings\SettingsMainGUI\getFinishingSettingsForStorage().

246  : self
247  {
248  $clone = clone $this;
249  $clone->show_answer_overview = $show_answer_overview;
250  return $clone;
251  }
+ Here is the caller graph for this function:

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