19 declare(strict_types=1);
48 if ($this->testOBJ->isShowGradingStatusEnabled()) {
52 if ($this->testOBJ->isShowGradingMarkEnabled()) {
59 $this->messageText[] = $msgPart;
64 return implode(
' ', $this->messageText);
69 if (!$this->testOBJ->isShowGradingStatusEnabled()) {
70 $this->main_tpl->setOnScreenMessage(
'info', $this->
getFullMessage());
71 } elseif ($this->result->isPassed()) {
72 $this->main_tpl->setOnScreenMessage(
'success', $this->
getFullMessage());
74 $this->main_tpl->setOnScreenMessage(
'info', $this->
getFullMessage());
80 if ($this->result->isPassed()) {
81 return $this->
lng->txt(
'grading_status_passed_msg');
84 return $this->
lng->txt(
'grading_status_failed_msg');
89 $mark_msg = $this->
lng->txt(
'grading_mark_msg');
91 $mark_msg = str_replace(
'[mark]', $this->result->getMarkOfficial(), $mark_msg);
92 $mark_msg = str_replace(
'[markshort]', $this->result->getMarkShort(), $mark_msg);
93 $mark_msg = str_replace(
'[percentage]', sprintf(
'%.2f', $this->result->getPercentage()), $mark_msg);
94 $mark_msg = str_replace(
'[reached]', (
string) $this->result->getReachedPoints(), $mark_msg);
95 $mark_msg = str_replace(
'[max]', (
string) $this->result->getMaxPoints(), $mark_msg);
104 if ($this->testOBJ->isShowGradingStatusEnabled()) {
105 $passedStatusLangVar = $this->result->isPassed() ?
'passed_official' :
'failed_official';
108 $this->
lng->txt(
'passed_status'),
109 $this->
lng->txt($passedStatusLangVar)
113 if ($this->testOBJ->isShowGradingMarkEnabled()) {
122 $this->tpl =
new ilTemplate(
'tpl.tst_grading_msg_list.html',
true,
true,
'components/ILIAS/Test');
127 $this->tpl->setCurrentBlock(
'grading_msg_entry');
128 $this->tpl->setVariable(
'LABEL', $label);
129 $this->tpl->setVariable(
'VALUE', $value);
130 $this->tpl->parseCurrentBlock();
135 $this->tpl->setCurrentBlock(
'grading_msg_list');
136 $this->tpl->parseCurrentBlock();
141 return $this->tpl->get();
populateListEntry($label, $value)
__construct(private ilLanguage $lng, private ilGlobalTemplateInterface $main_tpl, private ilObjTest $testOBJ, private readonly ParticipantResult $result)
Class ParticipantResult is a model representation of an entry in the test_result_cache table...