ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjTestSettingsResultSummary Class Reference
+ Inheritance diagram for ilObjTestSettingsResultSummary:
+ Collaboration diagram for ilObjTestSettingsResultSummary:

Public Member Functions

 __construct (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 
 getScoreReporting ()
 
 withScoreReporting (int $score_reporting)
 
 getScoreReportingEnabled ()
 
 getReportingDate ()
 
 withReportingDate (?\DateTimeImmutable $reporting_date)
 
 getShowGradingStatusEnabled ()
 
 withShowGradingStatusEnabled (bool $show_grading_status)
 
 getShowGradingMarkEnabled ()
 
 withShowGradingMarkEnabled (bool $show_grading_mark)
 
 getPassDeletionAllowed ()
 
 withPassDeletionAllowed (bool $pass_deletion_allowed)
 
 getShowPassDetails ()
 
 withShowPassDetails (bool $flag)
 
- Public Member Functions inherited from TestSettings
 __construct (int $test_id)
 
 getTestId ()
 
 withTestId (int $test_id)
 
 toForm (\ilLanguage $lng, FieldFactory $f, Refinery $refinery, array $environment=null)
 
 toStorage ()
 

Data Fields

const SCORE_REPORTING_DISABLED = 0
 
const SCORE_REPORTING_FINISHED = 1
 
const SCORE_REPORTING_IMMIDIATLY = 2
 
const SCORE_REPORTING_DATE = 3
 
const SCORE_REPORTING_AFTER_PASSED = 4
 

Protected Attributes

int $score_reporting = 0
 
DateTimeImmutable $reporting_date = null
 
bool $pass_deletion_allowed = false
 
bool $show_pass_details = false
 this is derived from results_presentation with RESULTPRES_BIT_PASS_DETAILS; see ilObjTestSettingsResultDetails More...
 
- Protected Attributes inherited from TestSettings
int $test_id
 

Detailed Description

Definition at line 25 of file ilObjTestSettingsResultSummary.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTestSettingsResultSummary::__construct ( int  $test_id)

Definition at line 42 of file ilObjTestSettingsResultSummary.php.

References ILIAS\GlobalScreen\Provider\__construct().

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

Member Function Documentation

◆ getPassDeletionAllowed()

ilObjTestSettingsResultSummary::getPassDeletionAllowed ( )

Definition at line 232 of file ilObjTestSettingsResultSummary.php.

References $pass_deletion_allowed.

Referenced by toForm(), and toStorage().

232  : bool
233  {
235  }
+ Here is the caller graph for this function:

◆ getReportingDate()

ilObjTestSettingsResultSummary::getReportingDate ( )

Definition at line 199 of file ilObjTestSettingsResultSummary.php.

References $reporting_date.

Referenced by toForm(), and toStorage().

199  : ?\DateTimeImmutable
200  {
201  return $this->reporting_date;
202  }
+ Here is the caller graph for this function:

◆ getScoreReporting()

ilObjTestSettingsResultSummary::getScoreReporting ( )

Definition at line 183 of file ilObjTestSettingsResultSummary.php.

References $score_reporting.

Referenced by toForm(), and toStorage().

183  : int
184  {
185  return $this->score_reporting;
186  }
+ Here is the caller graph for this function:

◆ getScoreReportingEnabled()

ilObjTestSettingsResultSummary::getScoreReportingEnabled ( )

Definition at line 194 of file ilObjTestSettingsResultSummary.php.

Referenced by toForm().

194  : bool
195  {
196  return $this->score_reporting !== self::SCORE_REPORTING_DISABLED;
197  }
+ Here is the caller graph for this function:

◆ getShowGradingMarkEnabled()

ilObjTestSettingsResultSummary::getShowGradingMarkEnabled ( )

Definition at line 221 of file ilObjTestSettingsResultSummary.php.

Referenced by toForm(), and toStorage().

221  : bool
222  {
223  return $this->show_grading_mark;
224  }
+ Here is the caller graph for this function:

◆ getShowGradingStatusEnabled()

ilObjTestSettingsResultSummary::getShowGradingStatusEnabled ( )

Definition at line 210 of file ilObjTestSettingsResultSummary.php.

Referenced by toForm(), and toStorage().

210  : bool
211  {
212  return $this->show_grading_status;
213  }
+ Here is the caller graph for this function:

◆ getShowPassDetails()

ilObjTestSettingsResultSummary::getShowPassDetails ( )

Definition at line 243 of file ilObjTestSettingsResultSummary.php.

References $show_pass_details.

Referenced by toForm().

243  : bool
244  {
246  }
bool $show_pass_details
this is derived from results_presentation with RESULTPRES_BIT_PASS_DETAILS; see ilObjTestSettingsResu...
+ Here is the caller graph for this function:

◆ toForm()

ilObjTestSettingsResultSummary::toForm ( \ilLanguage  $lng,
FieldFactory  $f,
Refinery  $refinery,
array  $environment = null 
)

Definition at line 47 of file ilObjTestSettingsResultSummary.php.

References ILIAS\LTI\ToolProvider\$settings, getPassDeletionAllowed(), getReportingDate(), getScoreReporting(), getScoreReportingEnabled(), getShowGradingMarkEnabled(), getShowGradingStatusEnabled(), getShowPassDetails(), ILIAS\Repository\int(), ilLanguage\txt(), and ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation().

52  : FormInput {
53  $trafo = $refinery->custom()->transformation(
54  function ($v) {
55  list($mode, $date) = $v;
56  if (count($date) < 1) {
57  $date = null;
58  } else {
59  $date = array_shift($date);
60  }
61  return [(int) $mode, $date];
62  }
63  );
64 
66  if ($reporting_date !== null) {
67  $reporting_date = $reporting_date->setTimezone(
68  new DateTimeZone($environment['user_time_zone'])
69  )->format($environment['user_date_format']->toString() . ' H:i');
70  }
71 
72  $results_time_group = $f->switchableGroup(
73  [
74  self::SCORE_REPORTING_IMMIDIATLY => $f->group([], $lng->txt('tst_results_access_always'), $lng->txt('tst_results_access_always_desc')),
75  self::SCORE_REPORTING_FINISHED => $f->group([], $lng->txt('tst_results_access_finished'), $lng->txt('tst_results_access_finished_desc')),
76  self::SCORE_REPORTING_AFTER_PASSED => $f->group([], $lng->txt('tst_results_access_passed'), $lng->txt('tst_results_access_passed_desc')),
77  self::SCORE_REPORTING_DATE => $f->group(
78  [
79  $f->dateTime($lng->txt('tst_reporting_date'), "")
80  ->withTimezone($environment['user_time_zone'])
81  ->withUseTime(true)
82  ->withFormat($environment['user_date_format'])
83  ->withValue(
85  )
86  ->withRequired(true)
87  ],
88  $lng->txt('tst_results_access_date'),
89  $lng->txt('tst_results_access_date_desc')
90  )
91  ],
92  $lng->txt('tst_results_access_setting'),
93  ""
94  )
95  ->withRequired(true)
96  ->withAdditionalTransformation($trafo);
97 
98  if ($this->getScoreReporting() > 0) {
99  $results_time_group = $results_time_group->withValue($this->getScoreReporting());
100  }
101 
102  $optional_group = $f->optionalGroup(
103  [
104  'score_reporting_mode' => $results_time_group,
105  'show_grading_status' => $f->checkbox(
106  $lng->txt('tst_results_grading_opt_show_status'),
107  $lng->txt('tst_results_grading_opt_show_status_desc')
108  ),
109  'show_grading_mark' => $f->checkbox(
110  $lng->txt('tst_results_grading_opt_show_mark'),
111  $lng->txt('tst_results_grading_opt_show_mark_desc')
112  ),
113  'show_pass_details' => $f->checkbox(
114  $lng->txt('tst_results_grading_opt_show_details'),
115  $lng->txt('tst_results_grading_opt_show_details_desc')
116  ),
117  'pass_deletion_allowed' => $f->checkbox(
118  $lng->txt('tst_pass_deletion'),
119  $lng->txt('tst_pass_deletion_allowed')
120  )
121  ],
122  $lng->txt('tst_results_access_enabled'),
123  $lng->txt('tst_results_access_enabled_desc')
124  );
125 
126  if ($this->getScoreReportingEnabled()) {
127  $optional_group = $optional_group->withValue(
128  [
129  "score_reporting_mode" => $this->getScoreReporting(),
130  "show_grading_status" => $this->getShowGradingStatusEnabled(),
131  "show_grading_mark" => $this->getShowGradingMarkEnabled(),
132  "show_pass_details" => $this->getShowPassDetails(),
133  "pass_deletion_allowed" => $this->getPassDeletionAllowed()
134  ]
135  );
136  } else {
137  $optional_group = $optional_group->withValue(null);
138  }
139 
140  $fields = ['score_reporting' => $optional_group];
141  return $f->section($fields, $lng->txt('test_results'))
143  $refinery->custom()->transformation(
144  function ($v) {
145  $settings = clone $this;
146  $mode = 0;
147  $date = null;
148  if ($v['score_reporting']) {
149  list($mode, $date) = $v['score_reporting']['score_reporting_mode'];
151  ->withShowGradingStatusEnabled($v['score_reporting']['show_grading_status'])
152  ->withShowGradingMarkEnabled($v['score_reporting']['show_grading_mark'])
153  ->withShowPassDetails($v['score_reporting']['show_pass_details'])
154  ->withPassDeletionAllowed($v['score_reporting']['pass_deletion_allowed'])
155  ;
156  }
157  return $settings
158  ->withScoreReporting((int) $mode)
159  ->withReportingDate($date);
160  }
161  )
162  );
163  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
$lng
This describes inputs that can be used in forms.
Definition: FormInput.php:31
Refinery Factory $refinery
+ Here is the call graph for this function:

◆ toStorage()

ilObjTestSettingsResultSummary::toStorage ( )

Definition at line 165 of file ilObjTestSettingsResultSummary.php.

References getPassDeletionAllowed(), getReportingDate(), getScoreReporting(), getShowGradingMarkEnabled(), getShowGradingStatusEnabled(), ILIAS\Repository\int(), and ilObjTestScoreSettingsDatabaseRepository\STORAGE_DATE_FORMAT.

165  : array
166  {
167  $dat = $this->getReportingDate();
168  if ($dat) {
169  $dat = $dat->setTimezone(new DateTimeZone('UTC'))
171  }
172  return [
173  'pass_deletion_allowed' => ['integer', (int) $this->getPassDeletionAllowed()],
174  'score_reporting' => ['integer', $this->getScoreReporting()],
175  'reporting_date' => ['text', (string) $dat],
176  'show_grading_status' => ['integer', (int) $this->getShowGradingStatusEnabled()],
177  'show_grading_mark' => ['integer', (int) $this->getShowGradingMarkEnabled()]
178  //show_pass_details
179  ];
180  }
+ Here is the call graph for this function:

◆ withPassDeletionAllowed()

ilObjTestSettingsResultSummary::withPassDeletionAllowed ( bool  $pass_deletion_allowed)

Definition at line 236 of file ilObjTestSettingsResultSummary.php.

References $pass_deletion_allowed.

236  : self
237  {
238  $clone = clone $this;
239  $clone->pass_deletion_allowed = $pass_deletion_allowed;
240  return $clone;
241  }

◆ withReportingDate()

ilObjTestSettingsResultSummary::withReportingDate ( ?\DateTimeImmutable  $reporting_date)

Definition at line 203 of file ilObjTestSettingsResultSummary.php.

References $reporting_date.

203  : self
204  {
205  $clone = clone $this;
206  $clone->reporting_date = $reporting_date;
207  return $clone;
208  }

◆ withScoreReporting()

ilObjTestSettingsResultSummary::withScoreReporting ( int  $score_reporting)

Definition at line 187 of file ilObjTestSettingsResultSummary.php.

References $score_reporting.

187  : self
188  {
189  $clone = clone $this;
190  $clone->score_reporting = $score_reporting;
191  return $clone;
192  }

◆ withShowGradingMarkEnabled()

ilObjTestSettingsResultSummary::withShowGradingMarkEnabled ( bool  $show_grading_mark)

Definition at line 225 of file ilObjTestSettingsResultSummary.php.

225  : self
226  {
227  $clone = clone $this;
228  $clone->show_grading_mark = $show_grading_mark;
229  return $clone;
230  }

◆ withShowGradingStatusEnabled()

ilObjTestSettingsResultSummary::withShowGradingStatusEnabled ( bool  $show_grading_status)

Definition at line 214 of file ilObjTestSettingsResultSummary.php.

214  : self
215  {
216  $clone = clone $this;
217  $clone->show_grading_status = $show_grading_status;
218  return $clone;
219  }

◆ withShowPassDetails()

ilObjTestSettingsResultSummary::withShowPassDetails ( bool  $flag)

Definition at line 247 of file ilObjTestSettingsResultSummary.php.

Referenced by ilObjTestScoreSettings\__construct().

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

Field Documentation

◆ $pass_deletion_allowed

bool ilObjTestSettingsResultSummary::$pass_deletion_allowed = false
protected

◆ $reporting_date

DateTimeImmutable ilObjTestSettingsResultSummary::$reporting_date = null
protected

Definition at line 34 of file ilObjTestSettingsResultSummary.php.

Referenced by getReportingDate(), and withReportingDate().

◆ $score_reporting

int ilObjTestSettingsResultSummary::$score_reporting = 0
protected

Definition at line 33 of file ilObjTestSettingsResultSummary.php.

Referenced by getScoreReporting(), and withScoreReporting().

◆ $show_pass_details

bool ilObjTestSettingsResultSummary::$show_pass_details = false
protected

this is derived from results_presentation with RESULTPRES_BIT_PASS_DETAILS; see ilObjTestSettingsResultDetails

Definition at line 40 of file ilObjTestSettingsResultSummary.php.

Referenced by getShowPassDetails().

◆ SCORE_REPORTING_AFTER_PASSED

const ilObjTestSettingsResultSummary::SCORE_REPORTING_AFTER_PASSED = 4

Definition at line 31 of file ilObjTestSettingsResultSummary.php.

◆ SCORE_REPORTING_DATE

const ilObjTestSettingsResultSummary::SCORE_REPORTING_DATE = 3

Definition at line 30 of file ilObjTestSettingsResultSummary.php.

◆ SCORE_REPORTING_DISABLED

const ilObjTestSettingsResultSummary::SCORE_REPORTING_DISABLED = 0

Definition at line 27 of file ilObjTestSettingsResultSummary.php.

◆ SCORE_REPORTING_FINISHED

const ilObjTestSettingsResultSummary::SCORE_REPORTING_FINISHED = 1

Definition at line 28 of file ilObjTestSettingsResultSummary.php.

◆ SCORE_REPORTING_IMMIDIATLY

const ilObjTestSettingsResultSummary::SCORE_REPORTING_IMMIDIATLY = 2

Definition at line 29 of file ilObjTestSettingsResultSummary.php.


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