|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.course.assessment.NewCachePersistingAssessmentManager
public class NewCachePersistingAssessmentManager
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)
This implementation will store its values using the property manager and has
a cache built in for frequently used assessment data like score, passed and
attempts variables.
the underlying cache is segmented as follows: 1.) by this class (=owner in singlevm, coowner in cluster mode) 2.) by course (so that e.g. deletion of a course removes all caches) 3.) by identity, for preloading and invalidating (e.g. a user entering a course will cause the identity's cache to be loaded) each cache only has -one- key, which is a hashmap with all the information (score,passed, etc) for the given user/course. the reason for this is that it must be possible to see a difference between a null value (key expired) and a value which corresponds to e.g. "this user has never attempted this test in this course". since only the concrete set, but not the possible set is known. (at least not in the database). so all keys of a given user/course will therefore expire together which also makes sense from a use point of view. Cache usage with e.g. the wiki: wikipages should be saved as separate keys, since no batch updates are needed for perf. reasons. reason for 3: preloading all data of all users of a course lasts up to 5 seconds and will waste memory. a user in a course only needs its own data. only when a tutor enters the assessment functionality, all data of all users is needed -> do a full load only then. TODO: e.g. IQTEST.onDelete(..) cleans all data without going over the assessmentmanager here. meaning that the cache has stale data in it. since coursenode.getIdent (partial key of this cache) is forever unique, then this doesn't really matter. - but it is rather unintended... point is that a node can save lots of data that have nothing to do with assessments
| Field Summary |
|---|
| Fields inherited from interface org.olat.course.assessment.AssessmentManager |
|---|
ASSESSMENT_ID, ATTEMPTS, COACH_COMMENT, COMMENT, PASSED, SCORE |
| Method Summary | |
|---|---|
OLATResourceable |
createOLATResourceableForLocking(Identity assessedIdentity)
Always use this to get a OLATResourceable for doInSync locking! Uses the assessIdentity. |
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)
No caching for the assessmentID. |
static AssessmentManager |
getInstance(ICourse course)
Get an instance of the persisting assessment manager. |
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 userCourseEnv)
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 userCourseEnv,
boolean incrementUserAttempts)
Save the users achieved ScoreEvaluation for this node. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static AssessmentManager getInstance(ICourse course)
course -
public void preloadCache(Identity identity)
AssessmentManager
preloadCache in interface AssessmentManageridentity - Restrict preloading to a certain identity or null to preload assessment data from all usersAssessmentManager.preloadCache(org.olat.core.id.Identity)public void preloadCache()
AssessmentManager
preloadCache in interface AssessmentManager
public void saveNodeAttempts(CourseNode courseNode,
Identity identity,
Identity assessedIdentity,
java.lang.Integer attempts)
AssessmentManager
saveNodeAttempts in interface AssessmentManageridentity - The user who changes this scoreassessedIdentity - The user whose score is changedattempts - The new attemptsAssessmentManager.saveNodeAttempts(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity, org.olat.core.id.Identity,
java.lang.Integer)
public void saveNodeComment(CourseNode courseNode,
Identity identity,
Identity assessedIdentity,
java.lang.String comment)
AssessmentManager
saveNodeComment in interface AssessmentManageridentity - The user who changes this commentassessedIdentity - The user whose comment is changedAssessmentManager.saveNodeComment(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity, org.olat.core.id.Identity,
java.lang.String)
public void saveNodeCoachComment(CourseNode courseNode,
Identity assessedIdentity,
java.lang.String comment)
AssessmentManager
saveNodeCoachComment in interface AssessmentManagerassessedIdentity - The user whose coach comment is changedAssessmentManager.saveNodeCoachComment(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity, java.lang.String)
public void incrementNodeAttempts(CourseNode courseNode,
Identity identity,
UserCourseEnvironment userCourseEnv)
AssessmentManager
incrementNodeAttempts in interface AssessmentManagerorg.olat.course.assessment.AssessmentManager#incrementNodeAttempts(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public java.lang.Float getNodeScore(CourseNode courseNode,
Identity identity)
getNodeScore in interface AssessmentManagercourseNode - The course nodeidentity - The identity
AssessmentManager.getNodeScore(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public java.lang.Boolean getNodePassed(CourseNode courseNode,
Identity identity)
getNodePassed in interface AssessmentManagercourseNode - The course nodeidentity - The identity
AssessmentManager.getNodePassed(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public java.lang.Integer getNodeAttempts(CourseNode courseNode,
Identity identity)
getNodeAttempts in interface AssessmentManagercourseNode - The course nodeidentity - The identity
AssessmentManager.getNodeAttempts(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public java.lang.String getNodeComment(CourseNode courseNode,
Identity identity)
getNodeComment in interface AssessmentManagercourseNode - The course nodeidentity - The identity
AssessmentManager.getNodeComment(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public java.lang.String getNodeCoachComment(CourseNode courseNode,
Identity identity)
getNodeCoachComment in interface AssessmentManagercourseNode - The course nodeidentity - The identity
AssessmentManager.getNodeCoachComment(org.olat.course.nodes.CourseNode,
org.olat.core.id.Identity)
public void registerForAssessmentChangeEvents(GenericEventListener gel,
Identity identity)
AssessmentManager
registerForAssessmentChangeEvents in interface AssessmentManagerAssessmentManager.registerForAssessmentChangeEvents(org.olat.core.util.event.GenericEventListener,
org.olat.core.id.Identity)public void deregisterFromAssessmentChangeEvents(GenericEventListener gel)
AssessmentManager
deregisterFromAssessmentChangeEvents in interface AssessmentManagerAssessmentManager.deregisterFromAssessmentChangeEvents(org.olat.core.util.event.GenericEventListener)
public java.lang.Long getAssessmentID(CourseNode courseNode,
Identity identity)
getAssessmentID in interface AssessmentManagerAssessmentManager.getAssessmentID(org.olat.course.nodes.CourseNode, org.olat.core.id.Identity)
public void saveScoreEvaluation(CourseNode courseNode,
Identity identity,
Identity assessedIdentity,
ScoreEvaluation scoreEvaluation,
UserCourseEnvironment userCourseEnv,
boolean incrementUserAttempts)
AssessmentManager
saveScoreEvaluation in interface AssessmentManagerorg.olat.course.assessment.AssessmentManager#saveScoreEvaluation(org.olat.course.nodes.CourseNode, org.olat.core.id.Identity, org.olat.core.id.Identity, org.olat.course.run.scoring.ScoreEvaluation)public OLATResourceable createOLATResourceableForLocking(Identity assessedIdentity)
createOLATResourceableForLocking in interface AssessmentManagercourse - assessedIdentity - courseNode -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||