Skip to content
Snippets Groups Projects
Commit f1e7a18b authored by srosse's avatar srosse
Browse files

OO-2480: node attempts must return a value, default is zero

parent 639afb70
No related branches found
No related tags found
No related merge requests found
......@@ -388,7 +388,7 @@ public class CourseAssessmentManagerImpl implements AssessmentManager {
AssessmentEntry nodeAssessment = assessmentService
.loadAssessmentEntry(identity, cgm.getCourseEntry(), courseNode.getIdent());
return nodeAssessment == null ? INTEGER_ZERO : nodeAssessment.getAttempts();
return nodeAssessment == null || nodeAssessment.getAttempts() == null ? INTEGER_ZERO : nodeAssessment.getAttempts();
}
@Override
......
......@@ -610,7 +610,7 @@ public class IQRunController extends BasicController implements GenericEventList
myContent.contextPut("passed", assessmentEntry.getPassed());
StringBuilder comment = Formatter.stripTabsAndReturns(assessmentEntry.getComment());
myContent.contextPut("comment", StringHelper.xssScan(comment));
myContent.contextPut("attempts", assessmentEntry.getAttempts());
myContent.contextPut("attempts", assessmentEntry.getAttempts() == null ? 0 : assessmentEntry.getAttempts());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment