19declare(strict_types=1);
46 protected readonly UIFactory $ui_factory,
47 protected readonly UIRenderer $ui_renderer,
48 protected readonly DataFactory $data_factory,
49 protected readonly GlobalHttpState $http_state,
59 if (!$this->test_obj->getHighscoreEnabled()) {
60 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
61 $this->
ctrl->redirectByClass(ilObjTestGUI::class);
64 $this->
ctrl->saveParameter($this,
'active_id');
66 $cmd = $this->
ctrl->getCmd();
76 $this->tpl->setContent($this->ui_renderer->render([
77 $this->buildMedianMarkPanel(),
78 ...$this->buildResultsToplists(TopListOrder::BY_SCORE),
79 ...$this->buildResultsToplists(TopListOrder::BY_TIME),
85 $title = $this->
lng->txt(
'tst_median_mark_panel');
88 $activeId = $this->test_obj->getActiveIdOfUser($this->
user->getId());
89 $data = $this->test_obj->getCompleteEvaluationData();
90 $median =
$data->getStatistics()->median();
91 $pct =
$data->getParticipant($activeId)->getMaxpoints() ? ($median /
$data->getParticipant($activeId)->getMaxpoints()) * 100.0 : 0;
92 $mark = $this->test_obj->getMarkSchema()->getMatchingMark($pct);
93 $content = $mark->getShortName();
95 return $this->ui_factory->panel()->standard(
97 $this->ui_factory->legacy()->content($content)
110 $this->
lng->txt(
'toplist_by_' . $order_by->getLabel()),
111 TopListType::GENERAL,
113 )->withId(
'tst_top_list' . $this->test_obj->getRefId());
118 count($tables) == 0 ? $this->
lng->txt(
'toplist_by_' . $order_by->getLabel()) :
'',
121 )->withId(
'tst_own_list' . $this->test_obj->getRefId());
139 $this->participant_repository
141 return $this->ui_factory->table()
142 ->data($table, $title, $table->getColumns())
143 ->withRequest($this->http_state->request());
148 return $this->test_obj->getHighscoreTopTable();
153 return $this->test_obj->getHighscoreOwnTable();
Builds a Color from either hex- or rgb values.
buildResultsToplists(TopListOrder $order_by)
buildTable(string $title, TopListType $list_type, TopListOrder $order_by)
isOwnRankingTableRequired()
isTopTenRankingTableRequired()
__construct(protected readonly ilObjTest $test_obj, protected readonly TestTopListRepository $repository, protected readonly ilCtrlInterface $ctrl, protected readonly ilGlobalTemplateInterface $tpl, protected readonly ilLanguage $lng, protected readonly ilObjUser $user, protected readonly UIFactory $ui_factory, protected readonly UIRenderer $ui_renderer, protected readonly DataFactory $data_factory, protected readonly GlobalHttpState $http_state, protected readonly ParticipantRepository $participant_repository)
Interface GlobalHttpState.
This describes how a panel could be modified during construction of UI.
This describes a Data Table.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...