19 declare(strict_types=1);
53 array $environment = null
55 $trafo = $refinery->custom()->transformation(
57 list($mode, $date) = $v;
58 if (count($date) < 1) {
61 $date = array_shift($date);
63 return [(
int) $mode, $date];
67 $results_time_group = $f->switchableGroup(
69 self::SCORE_REPORTING_IMMIDIATLY => $f->group([], $lng->
txt(
'tst_results_access_always'), $lng->
txt(
'tst_results_access_always_desc')),
70 self::SCORE_REPORTING_FINISHED => $f->group([], $lng->
txt(
'tst_results_access_finished'), $lng->
txt(
'tst_results_access_finished_desc')),
71 self::SCORE_REPORTING_AFTER_PASSED => $f->group([], $lng->
txt(
'tst_results_access_passed'), $lng->
txt(
'tst_results_access_passed_desc')),
72 self::SCORE_REPORTING_DATE => $f->group(
74 $f->dateTime($lng->
txt(
'tst_reporting_date'),
"")
75 ->withTimezone($environment[
'user_time_zone'])
76 ->withFormat($environment[
'user_date_format'])
85 $lng->
txt(
'tst_results_access_date'),
86 $lng->
txt(
'tst_results_access_date_desc')
89 $lng->
txt(
'tst_results_access_setting'),
100 $optional_group = $f->optionalGroup(
102 'score_reporting_mode' => $results_time_group,
103 'show_grading_status' => $f->checkbox(
104 $lng->
txt(
'tst_results_grading_opt_show_status'),
105 $lng->
txt(
'tst_results_grading_opt_show_status_desc')
107 'show_grading_mark' => $f->checkbox(
108 $lng->
txt(
'tst_results_grading_opt_show_mark'),
109 $lng->
txt(
'tst_results_grading_opt_show_mark_desc')
111 'show_pass_details' => $f->checkbox(
112 $lng->
txt(
'tst_results_grading_opt_show_details'),
113 $lng->
txt(
'tst_results_grading_opt_show_details_desc')
115 'pass_deletion_allowed' => $f->checkbox(
116 $lng->
txt(
'tst_pass_deletion'),
117 $lng->
txt(
'tst_pass_deletion_allowed')
120 $lng->
txt(
'tst_results_access_enabled'),
121 $lng->
txt(
'tst_results_access_enabled_desc')
125 $optional_group = $optional_group->withValue(
135 $optional_group = $optional_group->withValue(null);
138 $fields = [
'score_reporting' => $optional_group];
139 return $f->section($fields, $lng->
txt(
'test_results'))
141 $refinery->custom()->transformation(
146 if ($v[
'score_reporting']) {
147 list($mode, $date) = $v[
'score_reporting'][
'score_reporting_mode'];
149 ->withShowGradingStatusEnabled($v[
'score_reporting'][
'show_grading_status'])
150 ->withShowGradingMarkEnabled($v[
'score_reporting'][
'show_grading_mark'])
151 ->withShowPassDetails($v[
'score_reporting'][
'show_pass_details'])
152 ->withPassDeletionAllowed($v[
'score_reporting'][
'pass_deletion_allowed'])
156 ->withScoreReporting((
int) $mode)
157 ->withReportingDate($date);
173 'reporting_date' => [
'text', (string) $dat],
187 $clone = clone $this;
194 return $this->score_reporting !== self::SCORE_REPORTING_DISABLED;
203 $clone = clone $this;
214 $clone = clone $this;
225 $clone = clone $this;
236 $clone = clone $this;
247 $clone = clone $this;
248 $clone->show_pass_details = $flag;
bool $show_pass_details
this is derived from results_presentation with RESULTPRES_BIT_PASS_DETAILS; see ilObjTestSettingsResu...
getShowGradingMarkEnabled()
__construct(int $test_id)
bool $show_grading_status
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...
const SCORE_REPORTING_AFTER_PASSED
withPassDeletionAllowed(bool $pass_deletion_allowed)
withReportingDate(?\DateTimeImmutable $reporting_date)
withShowPassDetails(bool $flag)
const SCORE_REPORTING_FINISHED
DateTimeImmutable $reporting_date
withShowGradingStatusEnabled(bool $show_grading_status)
const SCORE_REPORTING_DISABLED
const SCORE_REPORTING_DATE
withScoreReporting(int $score_reporting)
const STORAGE_DATE_FORMAT
getShowGradingStatusEnabled()
bool $pass_deletion_allowed
const SCORE_REPORTING_IMMIDIATLY
withShowGradingMarkEnabled(bool $show_grading_mark)
toForm(\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
getScoreReportingEnabled()
Refinery Factory $refinery