ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Factory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
33 
34 class Factory
35 {
36  public function __construct(
37  protected UIFactory $ui_factory,
38  protected UIRenderer $ui_renderer,
39  protected Refinery $refinery,
40  protected DataFactory $data_factory,
41  protected HTTPService $http,
42  protected Language $lng
43  ) {
44  }
45 
47  AttemptResult $attempt_result,
48  Settings $settings,
49  string $title,
50  bool $for_print
52  return new AttemptResultsTable(
53  $this->ui_factory,
54  $this->ui_renderer,
55  $this->refinery,
56  $this->http,
57  $this->data_factory,
58  $this->lng,
59  $attempt_result,
60  $settings,
61  $title,
62  $for_print
63  );
64  }
65 
66  public function getAttemptResultsSettings(
67  \ilObjTest $test_obj,
68  bool $is_user_output
69  ): Settings {
70  $settings_result = $test_obj->getScoreSettings()->getResultDetailsSettings();
71 
72  $show_hidden_questions = false;
73  $show_optional_questions = true;
74  $show_best_solution = $is_user_output ?
75  $settings_result->getShowSolutionListComparison() :
76  (bool) \ilSession::get('tst_results_show_best_solutions');
77 
78  return new Settings(
79  $test_obj->getId(),
80  $show_hidden_questions,
81  $show_optional_questions,
82  $test_obj->getMainSettings()->getQuestionBehaviourSettings()->getQuestionHintsEnabled(),
83  $show_best_solution,
84  $settings_result->getShowSolutionFeedback(),
85  $settings_result->getShowSolutionAnswersOnly(),
86  $settings_result->getShowSolutionSuggested()
87  );
88  }
89 }
static get(string $a_var)
__construct(protected UIFactory $ui_factory, protected UIRenderer $ui_renderer, protected Refinery $refinery, protected DataFactory $data_factory, protected HTTPService $http, protected Language $lng)
Definition: Factory.php:36
$http
Definition: deliver.php:30
static http()
Fetches the global http state from ILIAS.
getAttemptResultsSettings(\ilObjTest $test_obj, bool $is_user_output)
Definition: Factory.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAttemptResultsPresentationTable(AttemptResult $attempt_result, Settings $settings, string $title, bool $for_print)
Definition: Factory.php:46
global $lng
Definition: privfeed.php:31