ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ScoreSettingsTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 use ILIAS\UI\Component as C;
26 use ILIAS\Data;
28 
30 {
31  public function testScoreSettingsBuild(): void
32  {
33  $id = -666;
34  $s = new ilObjTestScoreSettings(
35  $id,
40  );
41  $this->assertInstanceOf(ilObjTestScoreSettings::class, $s);
42  $this->assertEquals($id, $s->getTestId());
43  $this->assertInstanceOf(ilObjTestSettingsScoring::class, $s->getScoringSettings());
44  $this->assertInstanceOf(ilObjTestSettingsResultSummary::class, $s->getResultSummarySettings());
45  $this->assertInstanceOf(ilObjTestSettingsResultDetails::class, $s->getResultDetailsSettings());
46  $this->assertInstanceOf(ilObjTestSettingsGamification::class, $s->getGamificationSettings());
47  }
48 
49  public function testScoreSettingsScoring(): void
50  {
51  $s = new ilObjTestSettingsScoring(-666);
52  $this->assertEquals(-667, $s->withTestId(-667)->getTestId());
53  $this->assertEquals(2, $s->withCountSystem(2)->getCountSystem());
54  $this->assertEquals(4, $s->withScoreCutting(4)->getScoreCutting());
55  $this->assertEquals(5, $s->withPassScoring(5)->getPassScoring());
56  }
57 
58  public function testScoreSettingsSummary(): void
59  {
60  $dat = new \DateTimeImmutable();
61  $s = new ilObjTestSettingsResultSummary(-666);
62  $this->assertEquals(5, $s->withScoreReporting(5)->getScoreReporting());
63  $this->assertTrue($s->withScoreReporting(1)->getScoreReportingEnabled());
64  $this->assertFalse($s->withScoreReporting(0)->getScoreReportingEnabled());
65  $this->assertEquals($dat, $s->withReportingDate($dat)->getReportingDate());
66  $this->assertTrue($s->withShowGradingStatusEnabled(true)->getShowGradingStatusEnabled());
67  $this->assertFalse($s->withShowGradingStatusEnabled(false)->getShowGradingStatusEnabled());
68  $this->assertTrue($s->withShowGradingMarkEnabled(true)->getShowGradingMarkEnabled());
69  $this->assertFalse($s->withShowGradingMarkEnabled(false)->getShowGradingMarkEnabled());
70  $this->assertTrue($s->withPassDeletionAllowed(true)->getPassDeletionAllowed());
71  $this->assertFalse($s->withPassDeletionAllowed(false)->getPassDeletionAllowed());
72  $this->assertTrue($s->withShowPassDetails(true)->getShowPassDetails());
73  $this->assertFalse($s->withShowPassDetails(false)->getShowPassDetails());
74  }
75 
76  public function testScoreSettingsDetails(): void
77  {
78  $s = new ilObjTestSettingsResultDetails(-666);
79  $this->assertEquals(192, $s->withResultsPresentation(192)->getResultsPresentation(192));
80  $this->assertTrue($s->withShowExamIdInTestResults(true)->getShowExamIdInTestResults());
81  $this->assertTrue($s->withShowPassDetails(true)->getShowPassDetails());
82  $this->assertFalse($s->withShowPassDetails(false)->getShowPassDetails());
83  $this->assertTrue($s->withShowSolutionPrintview(true)->getShowSolutionPrintview());
84  $this->assertFalse($s->withShowSolutionPrintview(false)->getShowSolutionPrintview());
85  $this->assertTrue($s->withShowSolutionFeedback(true)->getShowSolutionFeedback());
86  $this->assertFalse($s->withShowSolutionFeedback(false)->getShowSolutionFeedback());
87  $this->assertTrue($s->withShowSolutionAnswersOnly(true)->getShowSolutionAnswersOnly());
88  $this->assertFalse($s->withShowSolutionAnswersOnly(false)->getShowSolutionAnswersOnly());
89  $this->assertTrue($s->withShowSolutionSignature(true)->getShowSolutionSignature());
90  $this->assertFalse($s->withShowSolutionSignature(false)->getShowSolutionSignature());
91  $this->assertTrue($s->withShowSolutionSuggested(true)->getShowSolutionSuggested());
92  $this->assertFalse($s->withShowSolutionSuggested(false)->getShowSolutionSuggested());
93  $this->assertTrue($s->withShowSolutionListComparison(true)->getShowSolutionListComparison());
94  $this->assertFalse($s->withShowSolutionListComparison(false)->getShowSolutionListComparison());
95  $this->assertTrue($s->withShowPassDetails(true)->getShowPassDetails());
96  }
97 
98  public function testScoreSettingsGamification(): void
99  {
100  $s = new ilObjTestSettingsGamification(-666);
101  $this->assertTrue($s->withHighscoreEnabled(true)->getHighscoreEnabled());
102  $this->assertFalse($s->withHighscoreEnabled(false)->getHighscoreEnabled());
103  $this->assertTrue($s->withHighscoreAnon(true)->getHighscoreAnon());
104  $this->assertFalse($s->withHighscoreAnon(false)->getHighscoreAnon());
105  $this->assertTrue($s->withHighscoreAchievedTS(true)->getHighscoreAchievedTS());
106  $this->assertFalse($s->withHighscoreAchievedTS(false)->getHighscoreAchievedTS());
107  $this->assertTrue($s->withHighscoreScore(true)->getHighscoreScore());
108  $this->assertFalse($s->withHighscoreScore(false)->getHighscoreScore());
109  $this->assertTrue($s->withHighscorePercentage(true)->getHighscorePercentage());
110  $this->assertFalse($s->withHighscorePercentage(false)->getHighscorePercentage());
111  $this->assertTrue($s->withHighscoreHints(true)->getHighscoreHints());
112  $this->assertFalse($s->withHighscoreHints(false)->getHighscoreHints());
113  $this->assertTrue($s->withHighscoreWTime(true)->getHighscoreWTime());
114  $this->assertFalse($s->withHighscoreWTime(false)->getHighscoreWTime());
115  $this->assertTrue($s->withHighscoreOwnTable(true)->getHighscoreOwnTable());
116  $this->assertFalse($s->withHighscoreOwnTable(false)->getHighscoreOwnTable());
117  $this->assertTrue($s->withHighscoreTopTable(true)->getHighscoreTopTable());
118  $this->assertFalse($s->withHighscoreTopTable(false)->getHighscoreTopTable());
119  $this->assertEquals(15, $s->withHighscoreTopNum(15)->getHighscoreTopNum());
120  }
121 
122 
123 
124  protected function getFieldFactory()
125  {
126  $factory = new I\Input\Field\Factory(
127  $this->createMock(I\Input\UploadLimitResolver::class),
129  new Data\Factory(),
130  $this->getRefinery(),
131  $this->getLanguage()
132  );
133  return $factory;
134  }
135 
136  protected function getUIPack()
137  {
138  return [
139  $this->getLanguage(),
140  $this->getFieldFactory(),
141  $this->getRefinery()
142  ];
143  }
144 
145  public function testScoreSettingsSectionScoring(): void
146  {
147  $s = new ilObjTestSettingsScoring(666);
148  $actual = $this->getDefaultRenderer()->render(
149  $s->toForm(...$this->getUIPack())
150  );
151 
152  $expected = <<<EOT
153 <div class="il-section-input">
154  <div class="il-section-input-header"><h2>test_scoring</h2></div>
155 
156  <div class="form-group row">
157  <label class="control-label col-sm-4 col-md-3 col-lg-2">tst_text_count_system</label>
158  <div class="col-sm-8 col-md-9 col-lg-10">
159  <div id="id_1" class="il-input-radio">
160 
161  <div class="form-control form-control-sm il-input-radiooption">
162  <input type="radio" id="id_1_0_opt" value="0" checked="checked" />
163  <label for="id_1_0_opt">tst_count_partial_solutions</label>
164  <div class="help-block">tst_count_partial_solutions_desc</div>
165  </div>
166  <div class="form-control form-control-sm il-input-radiooption">
167  <input type="radio" id="id_1_1_opt" value="1" />
168  <label for="id_1_1_opt">tst_count_correct_solutions</label>
169  <div class="help-block">tst_count_correct_solutions_desc</div>
170  </div>
171 
172  </div>
173  </div>
174  </div>
175 
176  <div class="form-group row">
177  <label class="control-label col-sm-4 col-md-3 col-lg-2">tst_score_cutting</label>
178  <div class="col-sm-8 col-md-9 col-lg-10">
179  <div id="id_2" class="il-input-radio">
180 
181  <div class="form-control form-control-sm il-input-radiooption">
182  <input type="radio" id="id_2_0_opt" value="0" checked="checked" />
183  <label for="id_2_0_opt">tst_score_cut_question</label>
184  <div class="help-block">tst_score_cut_question_desc</div>
185  </div>
186  <div class="form-control form-control-sm il-input-radiooption">
187  <input type="radio" id="id_2_1_opt" value="1" />
188  <label for="id_2_1_opt">tst_score_cut_test</label>
189  <div class="help-block">tst_score_cut_test_desc</div>
190  </div>
191 
192  </div>
193  </div>
194  </div>
195 
196  <div class="form-group row">
197  <label class="control-label col-sm-4 col-md-3 col-lg-2">tst_pass_scoring</label>
198  <div class="col-sm-8 col-md-9 col-lg-10">
199  <div id="id_3" class="il-input-radio">
200  <div class="form-control form-control-sm il-input-radiooption">
201  <input type="radio" id="id_3_0_opt" value="0" checked="checked" />
202  <label for="id_3_0_opt">tst_pass_last_pass</label>
203  <div class="help-block">tst_pass_last_pass_desc</div>
204  </div>
205  <div class="form-control form-control-sm il-input-radiooption">
206  <input type="radio" id="id_3_1_opt" value="1" />
207  <label for="id_3_1_opt">tst_pass_best_pass</label>
208  <div class="help-block">tst_pass_best_pass_desc</div>
209  </div>
210  </div>
211  </div>
212  </div>
213 </div>
214 EOT;
215 
216  $this->assertHTMLEquals(
217  $this->brutallyTrimHTML($expected),
218  $this->brutallyTrimHTML($this->brutallyTrimSignals($actual))
219  );
220  }
221 
222 
223  public function getUIFactory(): NoUIFactory
224  {
225  return new class () extends NoUIFactory {
226  public function symbol(): C\Symbol\Factory
227  {
228  return new S\Factory(
229  new S\Icon\Factory(),
230  new S\Glyph\Factory(),
231  new S\Avatar\Factory()
232  );
233  }
234  };
235  }
236 
237  public function testScoreSettingsSectionSummary(): void
238  {
239  $data_factory = new \ILIAS\Data\Factory();
240  $language = $this->getLanguage();
241  $refinery = new \ILIAS\Refinery\Factory($data_factory, $language);
242 
244  $this->createMock(\ILIAS\UI\Implementation\Component\Input\UploadLimitResolver::class),
246  $data_factory,
247  $refinery,
248  $language
249  );
250  $ui = [$language, $field_factory, $refinery];
251 
252  $s = new ilObjTestSettingsResultSummary(666);
253  $actual = $this->getDefaultRenderer()->render(
254  $s->toForm(...array_merge($ui, [[
255  'user_time_zone' => 'Europe/Berlin',
256  'user_date_format' => $data_factory->dateFormat()->withTime24(
257  $data_factory->dateFormat()->standard()
258  )
259  ]]))
260  );
261 
262  $expected = <<<EOT
263 <div class="il-section-input">
264  <div class="il-section-input-header"><h2>test_results</h2></div>
265  <div class="form-group row">
266  <label for="id_8" class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_access_enabled</label>
267  <div class="col-sm-8 col-md-9 col-lg-10">
268  <input type="checkbox" id="id_8" value="checked" class="form-control form-control-sm form-has-collapsible-form" />
269  <div class="help-block">tst_results_access_enabled_desc</div>
270  <div class="form-group row">
271  <label class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_access_setting<span class="asterisk">*</span></label>
272  <div class="col-sm-8 col-md-9 col-lg-10">
273  <div id="id_2" class="il-input-radio">
274  <div class="form-control form-control-sm il-input-radiooption form-has-collapsible-form">
275  <input type="radio" id="id_2_2_opt" value="2" />
276  <label for="id_2_2_opt">tst_results_access_always</label>
277  <div class="help-block">tst_results_access_always_desc</div>
278  </div>
279  <div class="form-control form-control-sm il-input-radiooption form-has-collapsible-form">
280  <input type="radio" id="id_2_1_opt" value="1" />
281  <label for="id_2_1_opt">tst_results_access_finished</label>
282  <div class="help-block">tst_results_access_finished_desc</div>
283  </div>
284  <div class="form-control form-control-sm il-input-radiooption form-has-collapsible-form">
285  <input type="radio" id="id_2_4_opt" value="4" />
286  <label for="id_2_4_opt">tst_results_access_passed</label>
287  <div class="help-block">tst_results_access_passed_desc</div>
288  </div>
289 
290  <div class="form-control form-control-sm il-input-radiooption form-has-collapsible-form">
291  <input type="radio" id="id_2_3_opt" value="3" />
292  <label for="id_2_3_opt">tst_results_access_date</label>
293  <div class="form-group row">
294  <label for="id_3" class="control-label col-sm-4 col-md-3 col-lg-2">tst_reporting_date<span class="asterisk">*</span></label>
295  <div class="col-sm-8 col-md-9 col-lg-10">
296  <div class="input-group date il-input-datetime">
297  <input id="id_3" type="datetime-local" class="form-control form-control-sm" />
298  </div>
299  </div>
300  </div>
301  <div class="help-block">tst_results_access_date_desc</div>
302  </div>
303  </div>
304  </div>
305  </div>
306 
307  <div class="form-group row">
308  <label for="id_4" class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_grading_opt_show_status</label>
309  <div class="col-sm-8 col-md-9 col-lg-10">
310  <input type="checkbox" id="id_4" value="checked" class="form-control form-control-sm" />
311  <div class="help-block">tst_results_grading_opt_show_status_desc</div>
312  </div>
313  </div>
314  <div class="form-group row">
315  <label for="id_5" class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_grading_opt_show_mark</label>
316  <div class="col-sm-8 col-md-9 col-lg-10">
317  <input type="checkbox" id="id_5" value="checked" class="form-control form-control-sm" />
318  <div class="help-block">tst_results_grading_opt_show_mark_desc</div>
319  </div>
320  </div>
321  <div class="form-group row">
322  <label for="id_6" class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_grading_opt_show_details</label>
323  <div class="col-sm-8 col-md-9 col-lg-10">
324  <input type="checkbox" id="id_6" value="checked" class="form-control form-control-sm" />
325  <div class="help-block">tst_results_grading_opt_show_details_desc</div>
326  </div>
327  </div>
328  <div class="form-group row">
329  <label for="id_7" class="control-label col-sm-4 col-md-3 col-lg-2">tst_pass_deletion</label>
330  <div class="col-sm-8 col-md-9 col-lg-10">
331  <input type="checkbox" id="id_7" value="checked" class="form-control form-control-sm" />
332  <div class="help-block">tst_pass_deletion_allowed</div>
333  </div>
334  </div>
335  </div>
336  </div>
337 </div>
338 EOT;
339 
340  $this->assertHTMLEquals(
341  $this->brutallyTrimHTML($expected),
342  $this->brutallyTrimHTML($this->brutallyTrimSignals($actual))
343  );
344  }
345 
346 
347 
348 
349  public function testScoreSettingsSectionDetails(): void
350  {
351  $s = new ilObjTestSettingsResultDetails(666);
352  $tax_ids = [1,2];
353  $actual = $this->getDefaultRenderer()->render(
354  $s->toForm(
355  ...array_merge(
356  $this->getUIPack(),
357  [['taxonomy_options' => $tax_ids]]
358  )
359  )
360  );
361 
362  $expected = <<<EOT
363 <div class="il-section-input">
364  <div class="il-section-input-header"><h2>tst_results_details_options</h2></div>
365 
366  <div class="form-group row">
367  <label for="id_1" class="control-label col-sm-4 col-md-3 col-lg-2">tst_results_print_best_solution</label>
368  <div class="col-sm-8 col-md-9 col-lg-10">
369  <input type="checkbox" id="id_1" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_results_print_best_solution_info</div>
370  </div>
371  </div>
372 
373  <div class="form-group row">
374  <label for="id_2" class="control-label col-sm-4 col-md-3 col-lg-2">tst_show_solution_feedback</label>
375  <div class="col-sm-8 col-md-9 col-lg-10">
376  <input type="checkbox" id="id_2" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_show_solution_feedback_desc</div>
377  </div>
378  </div>
379 
380  <div class="form-group row">
381  <label for="id_3" class="control-label col-sm-4 col-md-3 col-lg-2">tst_show_solution_suggested</label><div class="col-sm-8 col-md-9 col-lg-10">
382  <input type="checkbox" id="id_3" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_show_solution_suggested_desc</div>
383  </div>
384  </div>
385 
386  <div class="form-group row">
387  <label for="id_4" class="control-label col-sm-4 col-md-3 col-lg-2">tst_show_solution_printview</label><div class="col-sm-8 col-md-9 col-lg-10">
388  <input type="checkbox" id="id_4" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_show_solution_printview_desc</div>
389  </div>
390  </div>
391 
392  <div class="form-group row">
393  <label for="id_5" class="control-label col-sm-4 col-md-3 col-lg-2">tst_hide_pagecontents</label><div class="col-sm-8 col-md-9 col-lg-10">
394  <input type="checkbox" id="id_5" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_hide_pagecontents_desc</div>
395  </div>
396  </div>
397 
398  <div class="form-group row">
399  <label for="id_6" class="control-label col-sm-4 col-md-3 col-lg-2">tst_show_solution_signature</label><div class="col-sm-8 col-md-9 col-lg-10">
400  <input type="checkbox" id="id_6" value="checked" class="form-control form-control-sm" /><div class="help-block">tst_show_solution_signature_desc</div>
401  </div>
402  </div>
403 
404  <div class="form-group row">
405  <label for="id_7" class="control-label col-sm-4 col-md-3 col-lg-2">examid_in_test_res</label><div class="col-sm-8 col-md-9 col-lg-10">
406  <input type="checkbox" id="id_7" value="checked" checked="checked" class="form-control form-control-sm" /><div class="help-block">examid_in_test_res_desc</div>
407  </div>
408  </div>
409 
410 </div>
411 EOT;
412 
413  $this->assertHTMLEquals(
414  $this->brutallyTrimHTML($expected),
415  $this->brutallyTrimHTML($this->brutallyTrimSignals($actual))
416  );
417  }
418 
419 
420  public function testScoreSettingsSectionGamification(): void
421  {
422  $s = new ilObjTestSettingsGamification(666);
423  $actual = $this->getDefaultRenderer()->render(
424  $s->toForm(...$this->getUIPack())
425  );
426 
427  $expected = <<<EOT
428 <div class="il-section-input">
429 
430  <div class="il-section-input-header"><h2>tst_results_gamification</h2></div>
431 
432  <div class="form-group row">
433  <label for="id_10" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_enabled</label>
434  <div class="col-sm-8 col-md-9 col-lg-10">
435  <input type="checkbox" id="id_10" value="checked" class="form-control form-control-sm form-has-collapsible-form" />
436  <div class="help-block">tst_highscore_description</div>
437 
438  <div class="form-group row">
439  <label class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_mode<span class="asterisk">*</span></label>
440  <div class="col-sm-8 col-md-9 col-lg-10">
441  <div id="id_2" class="il-input-radio">
442  <div class="form-control form-control-sm il-input-radiooption">
443  <input type="radio" id="id_2_1_opt" value="1" />
444  <label for="id_2_1_opt">tst_highscore_own_table</label>
445  <div class="help-block">tst_highscore_own_table_description</div>
446  </div>
447 
448  <div class="form-control form-control-sm il-input-radiooption">
449  <input type="radio" id="id_2_2_opt" value="2" />
450  <label for="id_2_2_opt">tst_highscore_top_table</label>
451  <div class="help-block">tst_highscore_top_table_description</div>
452  </div>
453 
454  <div class="form-control form-control-sm il-input-radiooption">
455  <input type="radio" id="id_2_3_opt" value="3" checked="checked" />
456  <label for="id_2_3_opt">tst_highscore_all_tables</label>
457  <div class="help-block">tst_highscore_all_tables_description</div>
458  </div>
459  </div>
460  </div>
461  </div>
462 
463  <div class="form-group row">
464  <label for="id_3" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_top_num<span class="asterisk">*</span></label>
465  <div class="col-sm-8 col-md-9 col-lg-10">
466  <input id="id_3" type="number" value="10" class="form-control form-control-sm" />
467  <div class="help-block">tst_highscore_top_num_description</div>
468  </div>
469  </div>
470 
471  <div class="form-group row">
472  <label for="id_4" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_anon</label>
473  <div class="col-sm-8 col-md-9 col-lg-10">
474  <input type="checkbox" id="id_4" value="checked" checked="checked" class="form-control form-control-sm" />
475  <div class="help-block">tst_highscore_anon_description</div>
476  </div>
477  </div>
478  <div class="form-group row">
479  <label for="id_5" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_achieved_ts</label>
480  <div class="col-sm-8 col-md-9 col-lg-10">
481  <input type="checkbox" id="id_5" value="checked" checked="checked" class="form-control form-control-sm" />
482  <div class="help-block">tst_highscore_achieved_ts_description</div>
483  </div>
484  </div>
485  <div class="form-group row">
486  <label for="id_6" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_score</label>
487  <div class="col-sm-8 col-md-9 col-lg-10">
488  <input type="checkbox" id="id_6" value="checked" checked="checked" class="form-control form-control-sm" />
489  <div class="help-block">tst_highscore_score_description</div>
490  </div>
491  </div>
492  <div class="form-group row">
493  <label for="id_7" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_percentage</label>
494  <div class="col-sm-8 col-md-9 col-lg-10">
495  <input type="checkbox" id="id_7" value="checked" checked="checked" class="form-control form-control-sm" />
496  <div class="help-block">tst_highscore_percentage_description</div>
497  </div>
498  </div>
499  <div class="form-group row">
500  <label for="id_8" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_hints</label>
501  <div class="col-sm-8 col-md-9 col-lg-10">
502  <input type="checkbox" id="id_8" value="checked" checked="checked" class="form-control form-control-sm" />
503  <div class="help-block">tst_highscore_hints_description</div>
504  </div>
505  </div>
506  <div class="form-group row">
507  <label for="id_9" class="control-label col-sm-4 col-md-3 col-lg-2">tst_highscore_wtime</label>
508  <div class="col-sm-8 col-md-9 col-lg-10">
509  <input type="checkbox" id="id_9" value="checked" checked="checked" class="form-control form-control-sm" />
510  <div class="help-block">tst_highscore_wtime_description</div>
511  </div>
512  </div>
513 
514  </div>
515 
516  </div>
517 </div>
518 EOT;
519 
520  $this->assertHTMLEquals(
521  $this->brutallyTrimHTML($expected),
522  $this->brutallyTrimHTML($this->brutallyTrimSignals($actual))
523  );
524  }
525 
527  {
528  $id = -666;
529  $s = new ilObjTestScoreSettings(
530  $id,
535  );
536 
537  $t = new class ($s) extends ilObjTest {
538  public function __construct($s)
539  {
540  $this->score_settings = $s;
541  }
542  };
543 
544  $this->assertIsInt($t->getCountSystem());
545  $this->assertIsInt($t->getScoreCutting());
546  $this->assertIsInt($t->getPassScoring());
547  $this->assertNull($t->getReportingDate());
548  $this->assertIsBool($t->getShowPassDetails());
549  $this->assertIsBool($t->getShowSolutionAnswersOnly());
550  $this->assertIsBool($t->getShowSolutionSignature());
551  $this->assertIsBool($t->getShowSolutionSuggested());
552  $this->assertIsBool($t->getShowSolutionListComparison());
553  $this->assertIsBool($t->isPassDeletionAllowed());
554  $this->assertIsInt($t->getExportSettings());
555  $this->assertIsBool($t->getHighscoreEnabled());
556  $this->assertIsBool($t->getHighscoreAnon());
557  $this->assertIsBool($t->getHighscoreAchievedTS());
558  $this->assertIsBool($t->getHighscoreScore());
559  $this->assertIsBool($t->getHighscorePercentage());
560  $this->assertIsBool($t->getHighscoreHints());
561  $this->assertIsBool($t->getHighscoreWTime());
562  $this->assertIsBool($t->getHighscoreOwnTable());
563  $this->assertIsBool($t->getHighscoreTopTable());
564  $this->assertIsInt($t->getHighscoreTopNum());
565  $this->assertIsInt($t->getHighscoreMode());
566  }
567 
568  public function testScoreSettingsRelayingTestId(): void
569  {
570  $id = -666;
571  $s = new ilObjTestScoreSettings(
572  $id,
577  );
578 
579  $nu_id = 1234;
580  $s = $s->withTestId($nu_id);
581  $this->assertEquals($nu_id, $s->getTestId());
582  $this->assertEquals($nu_id, $s->getScoringSettings()->getTestId());
583  $this->assertEquals($nu_id, $s->getResultSummarySettings()->getTestId());
584  $this->assertEquals($nu_id, $s->getResultDetailsSettings()->getTestId());
585  $this->assertEquals($nu_id, $s->getGamificationSettings()->getTestId());
586  }
587 }
This is what a factory for input fields looks like.
Definition: Factory.php:28
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:458
__construct(VocabulariesInterface $vocabularies)
Provides common functionality for UI tests.
Definition: Base.php:310
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
brutallyTrimSignals(string $html)
A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output...
Definition: Base.php:490
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Refinery Factory $refinery