19 declare(strict_types=1);
35 protected bool $show_answer_overview =
false,
36 protected bool $concluding_remarks_enabled =
false,
37 protected ?
string $concluding_remarks_text =
'',
38 protected ?
int $concluding_remarks_page_id =
null,
40 protected ?
string $redirection_url =
null,
41 protected int $mail_notification_content_type = 0,
42 protected bool $always_send_mail_notification =
false 51 ?array $environment =
null 53 $inputs[
'show_answer_overview'] = $f->checkbox(
54 $lng->
txt(
'enable_examview'),
55 $lng->
txt(
'enable_examview_desc')
58 $inputs[
'show_concluding_remarks'] = $f->checkbox(
59 $lng->
txt(
'final_statement'),
60 $lng->
txt(
'final_statement_show_desc')
67 return $f->section(
$inputs, $lng->
txt(
'tst_final_information'));
75 $redirection_trafo = $refinery->custom()->transformation(
76 static function (?array $v): array {
88 $sub_inputs_redirect = [
89 'redirect_mode' => $f->radio(
90 $lng->
txt(
'redirect_after_finishing_rule')
93 $lng->
txt(
'redirect_always')
96 $lng->
txt(
'redirect_in_kiosk_mode')
98 ->withAdditionalTransformation($refinery->kindlyTo()->int()),
99 'redirect_url' => $f->text(
100 $lng->
txt(
'redirection_url')
101 )->withRequired(
true)
102 ->withAdditionalTransformation($refinery->string()->hasMaxLength(4000))
105 $redirection_input = $f->optionalGroup(
106 $sub_inputs_redirect,
107 $lng->
txt(
'redirect_after_finishing_tst'),
108 $lng->
txt(
'redirect_after_finishing_tst_desc')
110 ->withAdditionalTransformation($redirection_trafo);
113 return $redirection_input;
116 return $redirection_input->withValue(
129 $notification_trafo = $refinery->custom()->transformation(
130 static function (?array $v): array {
133 'notification_content_type' => 0,
134 'always_notify' => false
142 $sub_inputs_finish_notification = [
143 'notification_content_type' => $f->radio(
144 $lng->
txt(
'tst_finish_notification_content_type')
147 $lng->
txt(
'tst_finish_notification_simple')
150 $lng->
txt(
'tst_finish_notification_advanced')
151 )->withRequired(
true)
153 ->withAdditionalTransformation($refinery->kindlyTo()->int()),
154 'always_notify' => $f->checkbox(
155 $lng->
txt(
'mailnottype'),
156 $lng->
txt(
'mailnottype_desc')
160 $mail_notification_inputs = $f->optionalGroup(
161 $sub_inputs_finish_notification,
162 $lng->
txt(
'tst_finish_notification'),
163 $lng->
txt(
'tst_finish_notification_desc')
165 ->withAdditionalTransformation($notification_trafo);
168 return $mail_notification_inputs;
171 return $mail_notification_inputs->withValue(
205 case \ilObjTest::REDIRECT_NONE:
209 case \ilObjTest::REDIRECT_ALWAYS:
213 case \ilObjTest::REDIRECT_KIOSK:
243 return $this->show_answer_overview;
248 $clone = clone $this;
249 $clone->show_answer_overview = $show_answer_overview;
255 return $this->concluding_remarks_enabled;
260 $clone = clone $this;
261 $clone->concluding_remarks_enabled = $concluding_remarks_enabled;
267 return $this->concluding_remarks_text ??
'';
272 return $this->concluding_remarks_page_id;
277 $clone = clone $this;
278 $clone->concluding_remarks_page_id = $concluding_remarks_page_id;
284 return $this->redirection_mode;
289 $clone = clone $this;
290 $clone->redirection_mode = $redirection_mode;
296 return $this->redirection_url;
301 $clone = clone $this;
302 $clone->redirection_url = $redirection_url;
308 return $this->mail_notification_content_type;
313 $clone = clone $this;
314 $clone->mail_notification_content_type = $mail_notification_content_type;
320 return $this->always_send_mail_notification;
325 $clone = clone $this;
326 $clone->always_send_mail_notification = $always_send_mail_notification;
withShowAnswerOverview(bool $show_answer_overview)
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
toLog(AdditionalInformationGenerator $additional_info)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getConcludingRemarksEnabled()
withRedirectionUrl(?string $redirection_url)
getAlwaysSendMailNotification()
withMailNotificationContentType(int $mail_notification_content_type)
getRedirectionInputs(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withConcludingRemarksEnabled(bool $concluding_remarks_enabled)
__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)
getConcludingRemarksPageId()
withAlwaysSendMailNotification(bool $always_send_mail_notification)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMailNotificationInputs(\ilLanguage $lng, FieldFactory $f, Refinery $refinery)
withConcludingRemarksPageId(?int $concluding_remarks_page_id)
__construct(Container $dic, ilPlugin $plugin)
getMailNotificationContentType()
withRedirectionMode(int $redirection_mode)
getConcludingRemarksText()