64 if( $this->testOBJ->isShowGradingStatusEnabled() )
69 if( $this->testOBJ->areObligationsEnabled() )
74 if( $this->testOBJ->isShowGradingMarkEnabled() )
79 if( $this->testOBJ->getECTSOutput() )
87 return $this->tpl->get();
92 $this->tpl =
new ilTemplate(
'tpl.tst_grading_message.html',
true,
true,
'Modules/Test');
97 $this->resultData = $this->testOBJ->getResultsForActiveId($this->
getActiveId());
99 if( $this->testOBJ->getECTSOutput() )
101 $ectsMark = $this->testOBJ->getECTSGrade(
102 $this->testOBJ->getTotalPointsPassedArray(),
103 $this->resultData[
'reached_points'],
104 $this->resultData[
'max_points']
107 $this->resultData[
'ects_grade'] = $this->lng->txt(
'ects_grade_'.strtolower($ectsMark));
113 $this->tpl->setCurrentBlock(
'status_css_class');
115 $this->tpl->parseCurrentBlock();
117 $this->tpl->setCurrentBlock(
'grading_status_msg');
119 $this->tpl->parseCurrentBlock();
136 return $this->lng->txt(
'grading_status_passed_msg');
139 return $this->lng->txt(
'grading_status_failed_msg');
144 return (
bool)$this->resultData[
'passed'];
149 $this->tpl->setCurrentBlock(
'grading_mark_msg');
151 $this->tpl->parseCurrentBlock();
156 $markMsg = $this->lng->txt(
'grading_mark_msg');
159 $markMsg = str_replace(
"[markshort]", $this->
getMarkShort(), $markMsg);
160 $markMsg = str_replace(
"[percentage]", $this->
getPercentage(), $markMsg);
162 $markMsg = str_replace(
"[max]", $this->
getMaxPoints(), $markMsg);
169 return $this->resultData[
'mark_official'];
174 return $this->resultData[
'mark_short'];
186 return sprintf(
"%.2f", $percentage);
191 return $this->resultData[
'reached_points'];
196 return $this->resultData[
'max_points'];
201 $this->tpl->setCurrentBlock(
'obligations_msg');
203 $this->tpl->parseCurrentBlock();
210 return $this->lng->txt(
'grading_obligations_answered_msg');
213 return $this->lng->txt(
'grading_obligations_missing_msg');
218 return (
bool)$this->resultData[
'obligations_answered'];
223 $this->tpl->setCurrentBlock(
'grading_mark_ects_msg');
225 $this->tpl->parseCurrentBlock();
230 return str_replace(
'[markects]', $this->
getEctsGrade(), $this->lng->txt(
'mark_tst_ects'));
235 return $this->resultData[
'ects_grade'];