diff --git a/src/main/java/org/olat/course/run/scoring/ScoreAccounting.java b/src/main/java/org/olat/course/run/scoring/ScoreAccounting.java index e9958fdb3fc5126d980b7b8c1a45e38b6857dcdc..1d093697ef1e38a3e02c01ddf9c71d7a6087bb87 100644 --- a/src/main/java/org/olat/course/run/scoring/ScoreAccounting.java +++ b/src/main/java/org/olat/course/run/scoring/ScoreAccounting.java @@ -126,30 +126,23 @@ public class ScoreAccounting implements Visitor { */ public Float evalScoreOfCourseNode(String childId) { CourseNode foundNode = findChildByID(childId); - if (foundNode == null) { + + Float score = null; + if (foundNode instanceof AssessableCourseNode) { + AssessableCourseNode acn = (AssessableCourseNode) foundNode; + ScoreEvaluation se = evalCourseNode(acn); + if(se != null) { // the node could not provide any sensible information on scoring. e.g. a STNode with no calculating rules + score = se.getScore(); + } + if (score == null) { // a child has no score yet + score = new Float(0.0f); // default to 0.0, so that the condition can be evaluated (zero points makes also the most sense for "no results yet", if to be expressed in a number) + } + } else { error = true; wrongChildID = childId; - return new Float(-9999999.0f); - } - if (!(foundNode instanceof AssessableCourseNode)) { - error = true; - wrongChildID = childId; - return new Float(-1111111.0f); - } - AssessableCourseNode acn = (AssessableCourseNode) foundNode; - ScoreEvaluation se = evalCourseNode(acn); - if (se == null) { // the node could not provide any sensible information on scoring. e.g. a STNode with no calculating rules - String msg = "could not evaluate node " + acn.getShortTitle() + " (" + acn.getIdent() + ")" + "; called by node " - + (evaluatingCourseNode == null ? "n/a" : evaluatingCourseNode.getShortTitle() + " (" + evaluatingCourseNode.getIdent() + ")"); - new OLATRuntimeException(ScoreAccounting.class, "scoreaccounting.evaluationerror.score", - new String[]{acn.getIdent(), acn.getShortTitle()}, - Util.getPackageName(ScoreAccounting.class), - msg, null); - } - Float score = se.getScore(); - if (score == null) { // a child has no score yet - score = new Float(0.0f); // default to 0.0, so that the condition can be evaluated (zero points makes also the most sense for "no results yet", if to be expressed in a number) + score = new Float(0.0f); } + return score; }