*/
public void event(UserRequest urequest, Controller source, Event event) {
if (source == displayController) {
if (event instanceof IQSubmittedEvent) {
IQSubmittedEvent se = (IQSubmittedEvent) event;
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
// Save results in case of test
if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) {
// update scoring overview for the user in the current course
Float score = new Float(se.getScore());
Boolean passed = new Boolean(se.isPassed());
ScoreEvaluation sceval = new ScoreEvaluation(score, passed, new Long(se.getAssessmentID()));
AssessableCourseNode acn = (AssessableCourseNode)courseNode; // assessment nodes are assesable
boolean incrementUserAttempts = true;
acn.updateUserScoreEvaluation(sceval, userCourseEnv, urequest.getIdentity(), incrementUserAttempts);
//userCourseEnv.getScoreAccounting().scoreInfoChanged(acn, sceval);
exposeUserTestDataToVC(urequest);
// Mark publisher for notifications
AssessmentNotificationsHandler anh = AssessmentNotificationsHandler.getInstance();
Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
anh.markPublisherNews(urequest.getIdentity(), courseId);
if(!assessmentStopped) {
assessmentStopped = true;
AssessmentEvent assessmentStoppedEvent = new AssessmentEvent(AssessmentEvent.TYPE.STOPPED, userSession);
singleUserEventCenter.fireEventToListenersOf(assessmentStoppedEvent, assessmentEventOres);
}
}
// Save results in case of questionnaire
else if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
// save number of attempts
// although this is not an assessable node we still use the assessment
// manager since this one uses caching
am.incrementNodeAttempts(courseNode, urequest.getIdentity(), userCourseEnv);
exposeUserQuestionnaireDataToVC();
getWindowControl().pop();
}
// Don't save results in case of self-test