Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== diff -u -r1158d541cead46e6f0c26f71fdd99e46f031acd1 -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java (.../QaAppConstants.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -137,6 +137,10 @@ public static final String USER_EXCEPTION_NO_TOOL_SESSIONS ="userExceptionNoToolSessions"; public static final String USER_EXCEPTION_NO_STUDENT_ACTIVITY ="userExceptionNoStudentActivity"; public static final String USER_EXCEPTION_CONTENT_IN_USE ="userExceptionContentInUse"; + public static final String USER_EXCEPTION_CONTENT_DEFINE_LATER ="userExceptionContentDefineLater"; + public static final String USER_EXCEPTION_RUN_OFFLINE ="userExceptionRunOffline"; + public static final String USER_EXCEPTION_MODE_REQUIRED ="userExceptionModeRequired"; + public static final String USER_EXCEPTION_MODE_INVALID ="userExceptionModeInvalid"; public static final String COUNT_SESSION_COMPLETE ="countSessionComplete"; public static final String CURRENT_MONITORED_TOOL_SESSION ="currentMonitoredToolSession"; @@ -159,7 +163,7 @@ public static final String MODE ="mode"; public static final String LEARNER ="learner"; public static final String TEACHER ="teacher"; - public static final String USER_EXCEPTION_MODE_REQUIRED ="userExceptionModeRequired"; + public static final String PORTFOLIO_REPORT ="portfolioReport"; public static final String PORTFOLIO_REQUEST ="portfolioRequest"; public static final int MAX_GROUPS_COUNT =250; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== diff -u -r1158d541cead46e6f0c26f71fdd99e46f031acd1 -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java (.../QaUtils.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -486,24 +486,6 @@ request.getSession().removeAttribute(MAP_TOOL_SESSIONS); request.getSession().removeAttribute(MAX_TOOL_SESSION_COUNT.toString()); request.getSession().removeAttribute(IS_TOOL_SESSION_CHANGED); - request.getSession().removeAttribute(USER_EXCEPTION_WRONG_FORMAT); - request.getSession().removeAttribute(USER_EXCEPTION_UNCOMPATIBLE_IDS); - request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENTID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTNUMERIC); - request.getSession().removeAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS); - request.getSession().removeAttribute(USER_EXCEPTION_USERID_EXISTING); - request.getSession().removeAttribute(USER_EXCEPTION_USER_DOESNOTEXIST); - request.getSession().removeAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP); - request.getSession().removeAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS); - request.getSession().removeAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY); request.getSession().removeAttribute(COUNT_SESSION_COMPLETE); request.getSession().removeAttribute(CURRENT_MONITORED_TOOL_SESSION); request.getSession().removeAttribute(COUNT_ALL_USERS); @@ -514,7 +496,6 @@ request.getSession().removeAttribute(MODE); request.getSession().removeAttribute(LEARNER); request.getSession().removeAttribute(TEACHER); - request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED); request.getSession().removeAttribute(PORTFOLIO_REPORT); request.getSession().removeAttribute(PORTFOLIO_REQUEST); request.getSession().removeAttribute(ADD_NEW_QUESTION); @@ -567,7 +548,29 @@ request.getSession().removeAttribute(IS_MONITORED_CONTENT_IN_USE); request.getSession().removeAttribute(LOAD_MONITORING_CONTENT_EDITACTIVITY); request.getSession().removeAttribute(MONITORING_ORIGINATED_DEFINELATER); - request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE); + request.getSession().removeAttribute(USER_EXCEPTION_WRONG_FORMAT); + request.getSession().removeAttribute(USER_EXCEPTION_UNCOMPATIBLE_IDS); + request.getSession().removeAttribute(USER_EXCEPTION_NUMBERFORMAT); + request.getSession().removeAttribute(USER_EXCEPTION_USER_DOESNOTEXIST); + request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST); + request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSION_DOESNOTEXIST); + request.getSession().removeAttribute(USER_EXCEPTION_CONTENTID_REQUIRED); + request.getSession().removeAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED); + request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOT_AVAILABLE); + request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTQUESTIONCONTENT_NOT_AVAILABLE); + request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE); + request.getSession().removeAttribute(USER_EXCEPTION_USERID_NOTNUMERIC); + request.getSession().removeAttribute(USER_EXCEPTION_ONLYCONTENT_ANDNOSESSIONS); + request.getSession().removeAttribute(USER_EXCEPTION_USERID_EXISTING); + request.getSession().removeAttribute(USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED); + request.getSession().removeAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP); + request.getSession().removeAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS); + request.getSession().removeAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY); + request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE); + request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_DEFINE_LATER); + request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED); + request.getSession().removeAttribute(USER_EXCEPTION_RUN_OFFLINE); + request.getSession().removeAttribute(USER_EXCEPTION_MODE_INVALID); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java =================================================================== diff -u -r35717bc4f7da978b2c0a0f9a85a77d7b77f5670b -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java (.../QAction.java) (revision 35717bc4f7da978b2c0a0f9a85a77d7b77f5670b) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java (.../QAction.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -479,8 +479,11 @@ logger.debug("learning-defineLater: " + defineLater); if (defineLater.booleanValue() == true) { - persistError(request,"error.defineLater"); - return (mapping.findForward(ERROR_LIST_LEARNER)); + QaUtils.cleanUpSessionAbsolute(request); + logger.debug("default content id has not been setup"); + persistError(request,"error.defineLater"); + request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DEFINE_LATER, new Boolean(true).toString()); + return (mapping.findForward(ERROR_LIST_LEARNER)); } LearningUtil learningUtil= new LearningUtil(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -rbe3dd87b1e0a6417681d6ba8e9c7cc432cedd2f7 -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision be3dd87b1e0a6417681d6ba8e9c7cc432cedd2f7) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -216,6 +216,8 @@ if (!QaUtils.existsSession(toolSessionId.longValue(), qaService)) { + QaUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); logger.debug("error: The tool expects mcSession."); persistError(request,"error.toolSession.notAvailable"); return (mapping.findForward(ERROR_LIST_LEARNER)); @@ -242,9 +244,10 @@ logger.debug("using qaContent: " + qaContent); if (qaContent == null) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects qaContent."); + request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); persistError(request,"error.toolContent.notAvailable"); - QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } @@ -370,15 +373,14 @@ logger.debug("isRunOffline: " + isRunOffline); if (isRunOffline == true) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("warning to learner: the activity is offline."); + request.getSession().setAttribute(USER_EXCEPTION_RUN_OFFLINE, new Boolean(true).toString()); persistError(request,"label.learning.runOffline"); - QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } - - /* * Verify that userId does not already exist in the db. * If it does exist, that means, that user already responded to the content and @@ -432,8 +434,9 @@ if ((user == null) || (user.getUserID() == null)) { logger.debug("error: The tool expects userId"); + request.setAttribute(USER_EXCEPTION_USER_DOESNOTEXIST, new Boolean(true).toString()); persistError(request,"error.learningUser.notAvailable"); - //McUtils.cleanUpSessionAbsolute(request); + QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); }else userID = user.getUserID().toString(); @@ -449,8 +452,9 @@ long toolSessionId=0; if ((strToolSessionId == null) || (strToolSessionId.length() == 0)) { + request.setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true).toString()); persistError(request, "error.toolSessionId.required"); - //McUtils.cleanUpSessionAbsolute(request); + QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } else @@ -463,9 +467,10 @@ } catch(NumberFormatException e) { + request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString()); persistError(request, "error.sessionId.numberFormatException"); logger.debug("add error.sessionId.numberFormatException to ActionMessages."); - //McUtils.cleanUpSessionAbsolute(request); + QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } } @@ -476,15 +481,17 @@ if ((mode == null) || (mode.length() == 0)) { + request.setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true).toString()); persistError(request, "error.mode.required"); - //McUtils.cleanUpSessionAbsolute(request); + QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } if ((!mode.equals("learner")) && (!mode.equals("teacher")) && (!mode.equals("author"))) { + request.setAttribute(USER_EXCEPTION_MODE_INVALID, new Boolean(true).toString()); persistError(request, "error.mode.invalid"); - //McUtils.cleanUpSessionAbsolute(request); + QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST_LEARNER)); } logger.debug("session LEARNING_MODE set to:" + mode); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== diff -u -r1158d541cead46e6f0c26f71fdd99e46f031acd1 -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java (.../QaMonitoringStarterAction.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -93,13 +93,15 @@ if (qaContent == null) { - persistError(request, "error.content.doesNotExist"); QaUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true).toString()); + persistError(request, "error.content.doesNotExist"); return false; } if (qaService.studentActivityOccurred(qaContent)) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + qaContent); request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); } @@ -110,6 +112,7 @@ logger.debug("summaryToolSessions: " + summaryToolSessions); if (summaryToolSessions.isEmpty()) { + QaUtils.cleanUpSessionAbsolute(request); /* inform in the Summary tab that the tool has no active sessions */ request.setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== diff -u -r1158d541cead46e6f0c26f71fdd99e46f031acd1 -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision 1158d541cead46e6f0c26f71fdd99e46f031acd1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java (.../QaStarterAction.java) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -194,14 +194,14 @@ UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); if ((user == null) || (user.getUserID() == null)) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects userId"); + request.getSession().setAttribute(USER_EXCEPTION_USER_DOESNOTEXIST, new Boolean(true).toString()); persistError(request,"error.authoringUser.notAvailable"); - request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true)); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } - ActionForward validateSignature=readSignature(request,mapping); logger.debug("validateSignature: " + validateSignature); if (validateSignature != null) @@ -248,8 +248,9 @@ if ((strToolContentId == null) || (strToolContentId.equals(""))) { - persistError(request,"error.contentId.required"); QaUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true).toString()); + persistError(request,"error.contentId.required"); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -303,10 +304,11 @@ logger.debug("qaContent: " + qaContent); if (qaService.studentActivityOccurred(qaContent)) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + qaContent); + request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); persistError(request, "error.content.inUse"); logger.debug("add error.content.inUse to ActionMessages."); - QaUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, new Long(strToolContentId).longValue()); @@ -424,17 +426,19 @@ logger.debug("retrieved tool default contentId: " + defaultContentID); if (defaultContentID == 0) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("default content id has not been setup"); persistError(request,"error.defaultContent.notSetup"); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); - return (mapping.findForward(LOAD_QUESTIONS)); //TODO: forward to error page + request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + return (mapping.findForward(ERROR_LIST)); } } catch(Exception e) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("error getting the default content id: " + e.getMessage()); persistError(request,"error.defaultContent.notSetup"); - request.setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true)); + request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -448,10 +452,11 @@ QaContent qaContent=qaService.loadQa(defaultContentID); if (qaContent == null) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default content"); persistError(request,"error.defaultContent.notSetup"); - QaUtils.cleanUpSessionAbsolute(request); - return (mapping.findForward(LOAD_QUESTIONS)); + request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + return (mapping.findForward(ERROR_LIST)); } logger.debug("using qaContent: " + qaContent); logger.debug("using mcContent uid: " + qaContent.getUid()); @@ -460,9 +465,10 @@ } catch(Exception e) { + QaUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default question content"); persistError(request,"error.defaultContent.notSetup"); - QaUtils.cleanUpSessionAbsolute(request); + request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } Index: lams_tool_laqa/web/QaErrorBox.jsp =================================================================== diff -u -rf2b7c28c53bfee9c676b5a836e42b71e0e1bf20f -raeb8e36ba2c9ddfef56bbe29f70de78b8162ff66 --- lams_tool_laqa/web/QaErrorBox.jsp (.../QaErrorBox.jsp) (revision f2b7c28c53bfee9c676b5a836e42b71e0e1bf20f) +++ lams_tool_laqa/web/QaErrorBox.jsp (.../QaErrorBox.jsp) (revision aeb8e36ba2c9ddfef56bbe29f70de78b8162ff66) @@ -25,8 +25,85 @@ <%@ taglib uri="tags-fmt" prefix="fmt" %> <%@ taglib uri="fck-editor" prefix="FCK" %> <%@ taglib uri="tags-lams" prefix="lams" %> - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +