use of uk.ac.ed.ph.jqtiplus.value.FloatValue in project openolat by klemens.
the class AssessmentTestComponentRenderer method renderMaxScoreItem.
protected void renderMaxScoreItem(StringOutput sb, AssessmentTestComponent component, ItemSessionState itemSessionState, Translator translator) {
if (component.isMaxScoreAssessmentItem()) {
Value val = itemSessionState.getOutcomeValue(QTI21Constants.MAXSCORE_IDENTIFIER);
if (val != null && val instanceof FloatValue) {
double dVal = ((FloatValue) val).doubleValue();
if (dVal > 0.0d) {
String sVal;
if (dVal < 2.0) {
sVal = translator.translate("assessment.item.point", new String[] { AssessmentHelper.getRoundedScore(dVal) });
} else {
sVal = translator.translate("assessment.item.points", new String[] { AssessmentHelper.getRoundedScore(dVal) });
}
sb.append("<span class='o_qti_item_max_score'>").append(sVal).append("</span>");
}
}
}
}
Aggregations