org.olat.course.assessment
Interface AssessmentManager

All Known Implementing Classes:
NewCachePersistingAssessmentManager

public interface AssessmentManager

Description:
The assessment manager is used by the assessable course nodes to store and retrieve user assessment data from the database. The assessment Manager should not be used directly from the controllers but only via the assessable course nodes interface.
Exception are nodes that want to save or get node attempts variables for nodes that are not assessable nodes (e.g. questionnaire)

Initial Date: Nov 24, 2004

Author:
gnaegi

Field Summary
static java.lang.String ASSESSMENT_ID
           
static java.lang.String ATTEMPTS
           
static java.lang.String COACH_COMMENT
           
static java.lang.String COMMENT
           
static java.lang.String PASSED
           
static java.lang.String SCORE
           
 
Method Summary
 OLATResourceable createOLATResourceableForLocking(Identity assessedIdentity)
          Provides an OLATResourceable for locking (of score/passed etc.) purposes (if doInSync is called on score/passed data) Or provides a lock token for assessment data of the assessedIdentity.
 void deregisterFromAssessmentChangeEvents(GenericEventListener gel)
          Deregister the given event listener from all assessment changed events of this course
 java.lang.Long getAssessmentID(CourseNode courseNode, Identity identity)
          If this returns null, try get the assessmentID via the IQManager.getLastAssessmentID().
 java.lang.Integer getNodeAttempts(CourseNode courseNode, Identity identity)
           
 java.lang.String getNodeCoachComment(CourseNode courseNode, Identity identity)
           
 java.lang.String getNodeComment(CourseNode courseNode, Identity identity)
           
 java.lang.Boolean getNodePassed(CourseNode courseNode, Identity identity)
           
 java.lang.Float getNodeScore(CourseNode courseNode, Identity identity)
           
 void incrementNodeAttempts(CourseNode courseNode, Identity identity, UserCourseEnvironment userCourseEnvironment)
          Increment the users attempts for this course node.
 void preloadCache()
          Load all persisted assessment data of a course into a local cache if such a cache is available
 void preloadCache(Identity identity)
          Load all persisted assessment data into a local cache if such a cache is available
 void registerForAssessmentChangeEvents(GenericEventListener gel, Identity identity)
          Register the given event listener for all assessment changed events of this course
 void saveNodeAttempts(CourseNode courseNode, Identity identity, Identity assessedIdentity, java.lang.Integer attempts)
          Save the users attempts for this node.
 void saveNodeCoachComment(CourseNode courseNode, Identity assessedIdentity, java.lang.String comment)
          Save an coach comment for this node for a user.
 void saveNodeComment(CourseNode courseNode, Identity identity, Identity assessedIdentity, java.lang.String comment)
          Save an assessment comment for this node for a user.
 void saveScoreEvaluation(CourseNode courseNode, Identity identity, Identity assessedIdentity, ScoreEvaluation scoreEvaluation, UserCourseEnvironment userCourseEnvironment, boolean incrementUserAttempts)
          Save the users achieved ScoreEvaluation for this node.
 

Field Detail

SCORE

static final java.lang.String SCORE
See Also:
Constant Field Values

PASSED

static final java.lang.String PASSED
See Also:
Constant Field Values

ATTEMPTS

static final java.lang.String ATTEMPTS
See Also:
Constant Field Values

COMMENT

static final java.lang.String COMMENT
See Also:
Constant Field Values

COACH_COMMENT

static final java.lang.String COACH_COMMENT
See Also:
Constant Field Values

ASSESSMENT_ID

static final java.lang.String ASSESSMENT_ID
See Also:
Constant Field Values
Method Detail

preloadCache

void preloadCache()
Load all persisted assessment data of a course into a local cache if such a cache is available


preloadCache

void preloadCache(Identity identity)
Load all persisted assessment data into a local cache if such a cache is available

Parameters:
identity - Restrict preloading to a certain identity or null to preload assessment data from all users

saveNodeAttempts

void saveNodeAttempts(CourseNode courseNode,
                      Identity identity,
                      Identity assessedIdentity,
                      java.lang.Integer attempts)
Save the users attempts for this node. If there is already an attempts property available, it will be overwritten with the new value

Parameters:
courseNode -
identity - The user who changes this score
assessedIdentity - The user whose score is changed
attempts - The new attempts

saveNodeComment

void saveNodeComment(CourseNode courseNode,
                     Identity identity,
                     Identity assessedIdentity,
                     java.lang.String comment)
Save an assessment comment for this node for a user. If there is already a comment property available, it will be overwritten with the new value

Parameters:
courseNode -
identity - The user who changes this comment
assessedIdentity - The user whose comment is changed
comment -

saveNodeCoachComment

void saveNodeCoachComment(CourseNode courseNode,
                          Identity assessedIdentity,
                          java.lang.String comment)
Save an coach comment for this node for a user. If there is already a coach comment property available, it will be overwritten with the new value.

Parameters:
courseNode -
assessedIdentity - The user whose coach comment is changed
comment -

incrementNodeAttempts

void incrementNodeAttempts(CourseNode courseNode,
                           Identity identity,
                           UserCourseEnvironment userCourseEnvironment)
Increment the users attempts for this course node.

Parameters:
courseNode -
identity -

getNodeScore

java.lang.Float getNodeScore(CourseNode courseNode,
                             Identity identity)
Parameters:
courseNode - The course node
identity - The identity
Returns:
The achieved score or null if no score available

getNodeComment

java.lang.String getNodeComment(CourseNode courseNode,
                                Identity identity)
Parameters:
courseNode - The course node
identity - The identity
Returns:
The achieved passed or null if no passed available

getNodeCoachComment

java.lang.String getNodeCoachComment(CourseNode courseNode,
                                     Identity identity)
Parameters:
courseNode - The course node
identity - The identity
Returns:
The coach comment or null if no coach comment available

getNodePassed

java.lang.Boolean getNodePassed(CourseNode courseNode,
                                Identity identity)
Parameters:
courseNode - The course node
identity - The identity
Returns:
whether passed or not, or null if there is no info yet

getNodeAttempts

java.lang.Integer getNodeAttempts(CourseNode courseNode,
                                  Identity identity)
Parameters:
courseNode - The course node
identity - The identity
Returns:
The number of attempts. If no Property is set, the method will return 0

registerForAssessmentChangeEvents

void registerForAssessmentChangeEvents(GenericEventListener gel,
                                       Identity identity)
Register the given event listener for all assessment changed events of this course

Parameters:
gel -
identity -

deregisterFromAssessmentChangeEvents

void deregisterFromAssessmentChangeEvents(GenericEventListener gel)
Deregister the given event listener from all assessment changed events of this course

Parameters:
gel -

getAssessmentID

java.lang.Long getAssessmentID(CourseNode courseNode,
                               Identity identity)
If this returns null, try get the assessmentID via the IQManager.getLastAssessmentID().

Parameters:
courseNode -
identity -
Returns:
null if none found

saveScoreEvaluation

void saveScoreEvaluation(CourseNode courseNode,
                         Identity identity,
                         Identity assessedIdentity,
                         ScoreEvaluation scoreEvaluation,
                         UserCourseEnvironment userCourseEnvironment,
                         boolean incrementUserAttempts)
Save the users achieved ScoreEvaluation for this node. If there is already a score property available, it will be overwritten with the new value

Parameters:
courseNode -
identity -
assessedIdentity -
scoreEvaluation -

createOLATResourceableForLocking

OLATResourceable createOLATResourceableForLocking(Identity assessedIdentity)
Provides an OLATResourceable for locking (of score/passed etc.) purposes (if doInSync is called on score/passed data) Or provides a lock token for assessment data of the assessedIdentity.

Parameters:
assessedIdentity -
Returns: