19 declare(strict_types=1);
47 if (!$this->test_obj->getHighscoreEnabled()) {
48 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
49 $this->
ctrl->redirectByClass(ilObjTestGUI::class);
52 $this->
ctrl->saveParameter($this,
'active_id');
54 $cmd = $this->
ctrl->getCmd();
64 $this->tpl->setContent(implode(
'', [
76 $title = $this->
lng->txt(
'tst_median_mark_panel');
79 $activeId = $this->test_obj->getActiveIdOfUser($this->
user->getId());
80 $data = $this->test_obj->getCompleteEvaluationData();
81 $median =
$data->getStatistics()->getStatistics()->median();
82 $pct =
$data->getParticipant($activeId)->getMaxpoints() ? ($median /
$data->getParticipant($activeId)->getMaxpoints()) * 100.0 : 0;
83 $mark = $this->test_obj->getMarkSchema()->getMatchingMark($pct);
84 $content = $mark->getShortName();
86 $panel = $this->ui_factory->panel()->standard(
88 $this->ui_factory->legacy($content)
91 return $this->ui_renderer->render($panel);
99 $title = $this->
lng->txt(
'toplist_by_score');
103 $topData = $this->toplist->getGeneralToplistByPercentage(
104 $this->test_obj->getRefId(),
109 $table->setData($topData);
110 $table->setTitle($title);
112 $html .= $table->getHTML();
116 $ownData = $this->toplist->getUserToplistByPercentage(
117 $this->test_obj->getRefId(),
122 $table->setData($ownData);
124 $table->setTitle($title);
127 $html .= $table->getHTML();
138 $title = $this->
lng->txt(
'toplist_by_time');
142 $topData = $this->toplist->getGeneralToplistByWorkingtime(
143 $this->test_obj->getRefId(),
148 $table->setData($topData);
149 $table->setTitle($title);
151 $html .= $table->getHTML();
155 $ownData = $this->toplist->getUserToplistByWorkingtime(
156 $this->test_obj->getRefId(),
161 $table->setData($ownData);
164 $table->setTitle($title);
167 $html .= $table->getHTML();
188 return $this->test_obj->getHighscoreTopTable();
196 return $this->test_obj->getHighscoreOwnTable();
isOwnRankingTableRequired()
renderResultsToplistByScore()
__construct(private ilObjTest $test_obj, private ilTestTopList $toplist, private ilCtrl $ctrl, private ilGlobalTemplateInterface $tpl, private ilLanguage $lng, private ilObjUser $user, private UIFactory $ui_factory, private UIRenderer $ui_renderer)
renderResultsToplistByTime()
Class ilTestTopListTableGUI.
isTopTenRankingTableRequired()