Details

      Description

      Under certain circumstances a RS occurs when starting a QTI 1.2 test:

      message:null,java.lang.NullPointerException
      
      at 
      org.olat.course.nodes.iq.CourseIQSecurityCallback.attemptsLeft(CourseIQSecurityCallback.java:112)
      at 
      org.olat.modules.iq.IQDisplayController.init(IQDisplayController.java:291)
      at org.olat.modules.iq.IQDisplayController.(IQDisplayController.java:150)
      at 
      org.olat.modules.iq.IQManager.createIQDisplayController(IQManager.java:142)
      at org.olat.course.nodes.iq.IQRunController.event(IQRunController.java:401)
      

      In this case the course was a copy of an older one, the test also. I could not reproduce it with a new test in a new course. This patch prevents the RS:

      diff --git a/src/main/java/org/olat/course/nodes/iq/CourseIQSecurityCallback.java b/src/main/java/org/olat/course/nodes/iq/CourseIQSecurityCallback.java
      --- a/src/main/java/org/olat/course/nodes/iq/CourseIQSecurityCallback.java
      +++ b/src/main/java/org/olat/course/nodes/iq/CourseIQSecurityCallback.java
      @@ -109,7 +109,10 @@
       	 */
       	public int attemptsLeft(AssessmentInstance ai) {
       	    Integer userAttempts = assessmentManager.getNodeAttempts(courseNode, identity);
      -		return (attemptsConfig - userAttempts.intValue());
      +	    if (userAttempts != null)
      +	    	return (attemptsConfig - userAttempts.intValue());
      +	    else
      +	    	return attemptsConfig;
       	}
       
       	/**
      

        Attachments

          Activity

            People

            • Assignee:
              srosse Stéphane Rossé
              Reporter:
              stephan Stephan Clemenz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 35 minutes
                35m