ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestGradingMessageBuilder Class Reference
+ Collaboration diagram for ilTestGradingMessageBuilder:

Public Member Functions

 __construct (ilLanguage $lng, ilObjTest $testOBJ)
 setActiveId ($activeId)
 getActiveId ()
 build ()
 getMessage ()

Private Member Functions

 initTemplate ()
 loadResultData ()
 populateGradingStatus ()
 getGradingStatusCssClass ()
 buildGradingStatusMsg ()
 isPassed ()
 populateGradingMark ()
 buildGradingMarkMsg ()
 getMarkOfficial ()
 getMarkShort ()
 getPercentage ()
 getReachedPoints ()
 getMaxPoints ()
 populateObligationsStatus ()
 buildObligationsMsg ()
 areObligationsAnswered ()
 populateEctsGrade ()
 buildEctsGradeMsg ()
 getEctsGrade ()

Private Attributes

 $lng
 $testOBJ
 $tpl
 $resultData
 $activeId

Detailed Description

Definition at line 11 of file class.ilTestGradingMessageBuilder.php.

Constructor & Destructor Documentation

ilTestGradingMessageBuilder::__construct ( ilLanguage  $lng,
ilObjTest  $testOBJ 
)
Parameters
ilLanguage$lng
ilObjTest$testOBJ

Definition at line 42 of file class.ilTestGradingMessageBuilder.php.

References $lng, and $testOBJ.

{
$this->lng = $lng;
$this->testOBJ = $testOBJ;
}

Member Function Documentation

ilTestGradingMessageBuilder::areObligationsAnswered ( )
private

Definition at line 216 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildObligationsMsg().

{
return (bool)$this->resultData['obligations_answered'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::build ( )

Definition at line 58 of file class.ilTestGradingMessageBuilder.php.

References initTemplate(), loadResultData(), populateEctsGrade(), populateGradingMark(), populateGradingStatus(), and populateObligationsStatus().

{
$this->initTemplate();
$this->loadResultData();
if( $this->testOBJ->isShowGradingStatusEnabled() )
{
}
if( $this->testOBJ->areObligationsEnabled() )
{
}
if( $this->testOBJ->isShowGradingMarkEnabled() )
{
}
if( $this->testOBJ->getECTSOutput() )
{
}
}

+ Here is the call graph for this function:

ilTestGradingMessageBuilder::buildEctsGradeMsg ( )
private

Definition at line 228 of file class.ilTestGradingMessageBuilder.php.

References getEctsGrade().

Referenced by populateEctsGrade().

{
return str_replace('[markects]', $this->getEctsGrade(), $this->lng->txt('mark_tst_ects'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::buildGradingMarkMsg ( )
private

Definition at line 154 of file class.ilTestGradingMessageBuilder.php.

References getMarkOfficial(), getMarkShort(), getMaxPoints(), getPercentage(), and getReachedPoints().

Referenced by populateGradingMark().

{
$markMsg = $this->lng->txt('grading_mark_msg');
$markMsg = str_replace("[mark]", $this->getMarkOfficial(), $markMsg);
$markMsg = str_replace("[markshort]", $this->getMarkShort(), $markMsg);
$markMsg = str_replace("[percentage]", $this->getPercentage(), $markMsg);
$markMsg = str_replace("[reached]", $this->getReachedPoints(), $markMsg);
$markMsg = str_replace("[max]", $this->getMaxPoints(), $markMsg);
return $markMsg;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::buildGradingStatusMsg ( )
private

Definition at line 132 of file class.ilTestGradingMessageBuilder.php.

References isPassed().

Referenced by populateGradingStatus().

{
if( $this->isPassed() )
{
return $this->lng->txt('grading_status_passed_msg');
}
return $this->lng->txt('grading_status_failed_msg');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::buildObligationsMsg ( )
private

Definition at line 206 of file class.ilTestGradingMessageBuilder.php.

References areObligationsAnswered().

Referenced by populateObligationsStatus().

{
if( $this->areObligationsAnswered() )
{
return $this->lng->txt('grading_obligations_answered_msg');
}
return $this->lng->txt('grading_obligations_missing_msg');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getActiveId ( )

Definition at line 53 of file class.ilTestGradingMessageBuilder.php.

References $activeId.

Referenced by loadResultData().

{
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getEctsGrade ( )
private

Definition at line 233 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildEctsGradeMsg().

{
return $this->resultData['ects_grade'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getGradingStatusCssClass ( )
private

Definition at line 122 of file class.ilTestGradingMessageBuilder.php.

References isPassed().

Referenced by populateGradingStatus().

{
if( $this->isPassed() )
{
return 'passed';
}
return 'failed';
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getMarkOfficial ( )
private

Definition at line 167 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildGradingMarkMsg().

{
return $this->resultData['mark_official'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getMarkShort ( )
private

Definition at line 172 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildGradingMarkMsg().

{
return $this->resultData['mark_short'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getMaxPoints ( )
private

Definition at line 194 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildGradingMarkMsg(), and getPercentage().

{
return $this->resultData['max_points'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getMessage ( )

Definition at line 85 of file class.ilTestGradingMessageBuilder.php.

{
return $this->tpl->get();
}
ilTestGradingMessageBuilder::getPercentage ( )
private

Definition at line 177 of file class.ilTestGradingMessageBuilder.php.

References getMaxPoints(), and getReachedPoints().

Referenced by buildGradingMarkMsg().

{
$percentage = 0;
if( $this->getMaxPoints() > 0 )
{
$percentage = $this->getReachedPoints() / $this->getMaxPoints();
}
return sprintf("%.2f", $percentage);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::getReachedPoints ( )
private

Definition at line 189 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildGradingMarkMsg(), and getPercentage().

{
return $this->resultData['reached_points'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::initTemplate ( )
private

Definition at line 90 of file class.ilTestGradingMessageBuilder.php.

Referenced by build().

{
$this->tpl = new ilTemplate('tpl.tst_grading_message.html', true, true, 'Modules/Test');
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::isPassed ( )
private

Definition at line 142 of file class.ilTestGradingMessageBuilder.php.

Referenced by buildGradingStatusMsg(), and getGradingStatusCssClass().

{
return (bool)$this->resultData['passed'];
}

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::loadResultData ( )
private

Definition at line 95 of file class.ilTestGradingMessageBuilder.php.

References getActiveId().

Referenced by build().

{
$this->resultData = $this->testOBJ->getResultsForActiveId($this->getActiveId());
if( $this->testOBJ->getECTSOutput() )
{
$ectsMark = $this->testOBJ->getECTSGrade(
$this->testOBJ->getTotalPointsPassedArray(),
$this->resultData['reached_points'],
$this->resultData['max_points']
);
$this->resultData['ects_grade'] = $this->lng->txt('ects_grade_'.strtolower($ectsMark));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::populateEctsGrade ( )
private

Definition at line 221 of file class.ilTestGradingMessageBuilder.php.

References buildEctsGradeMsg().

Referenced by build().

{
$this->tpl->setCurrentBlock('grading_mark_ects_msg');
$this->tpl->setVariable('GRADING_MARK_ECTS_MSG', $this->buildEctsGradeMsg());
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::populateGradingMark ( )
private

Definition at line 147 of file class.ilTestGradingMessageBuilder.php.

References buildGradingMarkMsg().

Referenced by build().

{
$this->tpl->setCurrentBlock('grading_mark_msg');
$this->tpl->setVariable('GRADING_MARK_MSG', $this->buildGradingMarkMsg());
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::populateGradingStatus ( )
private

Definition at line 111 of file class.ilTestGradingMessageBuilder.php.

References buildGradingStatusMsg(), and getGradingStatusCssClass().

Referenced by build().

{
$this->tpl->setCurrentBlock('status_css_class');
$this->tpl->setVariable('STATUS_CSS_CLASS', $this->getGradingStatusCssClass());
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('grading_status_msg');
$this->tpl->setVariable('GRADING_STATUS_MSG', $this->buildGradingStatusMsg());
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::populateObligationsStatus ( )
private

Definition at line 199 of file class.ilTestGradingMessageBuilder.php.

References buildObligationsMsg().

Referenced by build().

{
$this->tpl->setCurrentBlock('obligations_msg');
$this->tpl->setVariable('OBLIGATIONS_MSG', $this->buildObligationsMsg());
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestGradingMessageBuilder::setActiveId (   $activeId)

Definition at line 48 of file class.ilTestGradingMessageBuilder.php.

References $activeId.

{
$this->activeId = $activeId;
}

Field Documentation

ilTestGradingMessageBuilder::$activeId
private

Definition at line 36 of file class.ilTestGradingMessageBuilder.php.

Referenced by getActiveId(), and setActiveId().

ilTestGradingMessageBuilder::$lng
private

Definition at line 16 of file class.ilTestGradingMessageBuilder.php.

Referenced by __construct().

ilTestGradingMessageBuilder::$resultData
private

Definition at line 31 of file class.ilTestGradingMessageBuilder.php.

ilTestGradingMessageBuilder::$testOBJ
private

Definition at line 21 of file class.ilTestGradingMessageBuilder.php.

Referenced by __construct().

ilTestGradingMessageBuilder::$tpl
private

Definition at line 26 of file class.ilTestGradingMessageBuilder.php.


The documentation for this class was generated from the following file: