19 declare(strict_types=1);
57 if (!$this->test_obj->getHighscoreEnabled()) {
58 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
59 $this->
ctrl->redirectByClass(ilObjTestGUI::class);
62 $this->
ctrl->saveParameter($this,
'active_id');
64 $cmd = $this->
ctrl->getCmd();
74 $this->tpl->setContent($this->ui_renderer->render([
75 $this->buildMedianMarkPanel(),
76 ...$this->buildResultsToplists(TopListOrder::BY_SCORE),
77 ...$this->buildResultsToplists(TopListOrder::BY_TIME),
83 $title = $this->
lng->txt(
'tst_median_mark_panel');
86 $activeId = $this->test_obj->getActiveIdOfUser($this->
user->getId());
87 $data = $this->test_obj->getCompleteEvaluationData();
88 $median =
$data->getStatistics()->median();
89 $pct =
$data->getParticipant($activeId)->getMaxpoints() ? ($median /
$data->getParticipant($activeId)->getMaxpoints()) * 100.0 : 0;
90 $mark = $this->test_obj->getMarkSchema()->getMatchingMark($pct);
91 $content = $mark->getShortName();
93 return $this->ui_factory->panel()->standard(
95 $this->ui_factory->legacy()->content($content)
108 $this->
lng->txt(
'toplist_by_' . $order_by->getLabel()),
109 TopListType::GENERAL,
111 )->withId(
'tst_top_list' . $this->test_obj->getRefId());
116 count($tables) == 0 ? $this->
lng->txt(
'toplist_by_score' . $order_by->getLabel()) :
'',
119 )->withId(
'tst_own_list' . $this->test_obj->getRefId());
138 return $this->ui_factory->table()
139 ->data($table, $title, $table->getColumns())
140 ->withRequest($this->http_state->request());
145 return $this->test_obj->getHighscoreTopTable();
150 return $this->test_obj->getHighscoreOwnTable();
This describes how a panel could be modified during construction of UI.
isOwnRankingTableRequired()
repository()
description: > Example for rendering a repository card
__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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildResultsToplists(TopListOrder $order_by)
isTopTenRankingTableRequired()
buildTable(string $title, TopListType $list_type, TopListOrder $order_by)