19declare(strict_types=1);
51 ?array $environment =
null
55 list($mode, $date) = $v;
56 if (count($date) < 1) {
59 $date = array_shift($date);
61 return [(
int) $mode, $date];
65 $results_time_group =
$f->switchableGroup(
67 ScoreReportingTypes::SCORE_REPORTING_IMMIDIATLY->value =>
$f->group([],
$lng->txt(
'tst_results_access_always'),
$lng->txt(
'tst_results_access_always_desc')),
68 ScoreReportingTypes::SCORE_REPORTING_FINISHED->value =>
$f->group([],
$lng->txt(
'tst_results_access_finished'),
$lng->txt(
'tst_results_access_finished_desc')),
69 ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED->value =>
$f->group([],
$lng->txt(
'tst_results_access_passed'),
$lng->txt(
'tst_results_access_passed_desc')),
70 ScoreReportingTypes::SCORE_REPORTING_DATE->value =>
$f->group(
72 $f->dateTime(
$lng->txt(
'tst_reporting_date'),
"")
73 ->withTimezone($environment[
'user_time_zone'])
74 ->withFormat($environment[
'user_date_format'])
78 new \DateTimeZone($environment[
'user_time_zone'])
83 $lng->txt(
'tst_results_access_date'),
84 $lng->txt(
'tst_results_access_date_desc')
87 $lng->txt(
'tst_results_access_setting'),
91 ->withAdditionalTransformation($trafo);
93 if ($this->
getScoreReporting() !== ScoreReportingTypes::SCORE_REPORTING_DISABLED) {
94 $results_time_group = $results_time_group->withValue($this->
getScoreReporting()->value);
98 $optional_group =
$f->optionalGroup(
100 'score_reporting_mode' => $results_time_group,
101 'show_grading_status' =>
$f->checkbox(
102 $lng->txt(
'tst_results_grading_opt_show_status'),
103 $lng->txt(
'tst_results_grading_opt_show_status_desc')
105 'show_grading_mark' =>
$f->checkbox(
106 $lng->txt(
'tst_results_grading_opt_show_mark'),
107 $lng->txt(
'tst_results_grading_opt_show_mark_desc')
109 'show_pass_details' =>
$f->checkbox(
110 $lng->txt(
'tst_results_grading_opt_show_details'),
111 $lng->txt(
'tst_results_grading_opt_show_details_desc')
113 'pass_deletion_allowed' =>
$f->checkbox(
114 $lng->txt(
'tst_pass_deletion'),
115 $lng->txt(
'tst_pass_deletion_allowed')
118 $lng->txt(
'tst_results_access_enabled'),
119 $lng->txt(
'tst_results_access_enabled_desc')
123 $optional_group = $optional_group->withValue(
133 $optional_group = $optional_group->withValue(
null);
136 $fields = [
'score_reporting' => $optional_group];
137 return $f->section($fields,
$lng->txt(
'test_results'))
141 $settings = clone $this;
144 if ($v[
'score_reporting']) {
145 list($mode, $date) = $v[
'score_reporting'][
'score_reporting_mode'];
146 $settings = $settings
147 ->withShowGradingStatusEnabled($v[
'score_reporting'][
'show_grading_status'])
148 ->withShowGradingMarkEnabled($v[
'score_reporting'][
'show_grading_mark'])
149 ->withShowPassDetails($v[
'score_reporting'][
'show_pass_details'])
150 ->withPassDeletionAllowed($v[
'score_reporting'][
'pass_deletion_allowed'])
155 ->withReportingDate($date);
163 $dat = $this->getReportingDate();
165 $dat = $dat->setTimezone(
new \DateTimeZone(
'UTC'))
169 'pass_deletion_allowed' => [
'integer', (
int) $this->getPassDeletionAllowed()],
170 'score_reporting' => [
'integer', $this->getScoreReporting()->value],
171 'reporting_date' => [
'text', (string) $dat],
172 'show_grading_status' => [
'integer', (
int) $this->getShowGradingStatusEnabled()],
173 'show_grading_mark' => [
'integer', (
int) $this->getShowGradingMarkEnabled()]
179 switch ($this->getScoreReporting()) {
180 case ScoreReportingTypes::SCORE_REPORTING_DISABLED:
184 case ScoreReportingTypes::SCORE_REPORTING_FINISHED:
187 $log_array += $this->getLogEntriesForScoreReportingEnabled($additional_info);
189 case ScoreReportingTypes::SCORE_REPORTING_IMMIDIATLY:
192 $log_array += $this->getLogEntriesForScoreReportingEnabled($additional_info);
194 case ScoreReportingTypes::SCORE_REPORTING_DATE:
197 $log_array += $this->getLogEntriesForScoreReportingEnabled($additional_info);
199 case ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED:
202 $log_array += $this->getLogEntriesForScoreReportingEnabled($additional_info);
213 ->getEnabledDisabledTagForBool($this->getShowGradingStatusEnabled()),
215 ->getEnabledDisabledTagForBool($this->getShowGradingMarkEnabled()),
217 ->getEnabledDisabledTagForBool($this->getShowPassDetails()),
219 ->getEnabledDisabledTagForBool($this->getPassDeletionAllowed())
225 return $this->score_reporting;
229 $clone = clone $this;
230 $clone->score_reporting = $score_reporting;
236 return $this->reporting_date;
240 $clone = clone $this;
241 $clone->reporting_date = $reporting_date;
247 return $this->show_grading_status;
251 $clone = clone $this;
252 $clone->show_grading_status = $show_grading_status;
258 return $this->show_grading_mark;
262 $clone = clone $this;
263 $clone->show_grading_mark = $show_grading_mark;
269 return $this->pass_deletion_allowed;
273 $clone = clone $this;
274 $clone->pass_deletion_allowed = $pass_deletion_allowed;
280 return $this->show_pass_details;
284 $clone = clone $this;
285 $clone->show_pass_details = $flag;
const STORAGE_DATE_FORMAT
bool $show_grading_status
bool $show_pass_details
this is derived from results_presentation with RESULTPRES_BIT_PASS_DETAILS; see ilObjTestSettingsResu...
withPassDeletionAllowed(bool $pass_deletion_allowed)
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, ?array $environment=null)
ScoreReportingTypes $score_reporting
bool $pass_deletion_allowed
withShowPassDetails(bool $flag)
toLog(AdditionalInformationGenerator $additional_info)
getShowGradingStatusEnabled()
DateTimeImmutable $reporting_date
__construct(int $test_id)
withReportingDate(?\DateTimeImmutable $reporting_date)
withScoreReporting(ScoreReportingTypes $score_reporting)
withShowGradingMarkEnabled(bool $show_grading_mark)
withShowGradingStatusEnabled(bool $show_grading_status)
getShowGradingMarkEnabled()
getLogEntriesForScoreReportingEnabled(AdditionalInformationGenerator $additional_info)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc