Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java =================================================================== diff -u -r81e4b129f71e63322c81c9016ec1ffa93f3c5944 -rc3b793637eab6ae0c12968c3c07f9993c1ef6f16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision 81e4b129f71e63322c81c9016ec1ffa93f3c5944) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McUtils.java (.../McUtils.java) (revision c3b793637eab6ae0c12968c3c07f9993c1ef6f16) @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.Random; -import java.util.TimeZone; import java.util.TreeMap; import javax.servlet.http.HttpServletRequest; @@ -125,20 +124,7 @@ return (DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); } - public static void saveTimeZone(HttpServletRequest request) - { - TimeZone timeZone=TimeZone.getDefault(); - logger.debug("current timezone: " + timeZone.getDisplayName()); - request.getSession().setAttribute(TIMEZONE, timeZone.getDisplayName()); - logger.debug("current timezone id: " + timeZone.getID()); - } - public static String getCurrentTimeZone() - { - TimeZone timeZone=TimeZone.getDefault(); - logger.debug("current timezone: " + timeZone.getDisplayName()); - return timeZone.getDisplayName(); - } /** @@ -167,85 +153,6 @@ return mapOptionsContent; } - - - /** - * void saveInSessionRichText(HttpServletRequest request, boolean requestByStarter) - * - * @param request - * @param requestByStarter - */ - public static void saveInSessionRichText(HttpServletRequest request, boolean requestByStarter) - { - logger.debug("saveInSessionRichText, requestByStarter: " + requestByStarter); - - String richTextOfflineInstructions=request.getParameter(RICHTEXT_OFFLINEINSTRUCTIONS); - logger.debug("read parameter richTextOfflineInstructions: " + richTextOfflineInstructions); - String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); - logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions); - - if ((richTextOfflineInstructions != null) && (richTextOfflineInstructions.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,richTextOfflineInstructions); - } - - if ((richTextOnlineInstructions != null) && (richTextOnlineInstructions.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,richTextOnlineInstructions); - } - - - String richTextTitle=request.getParameter(RICHTEXT_TITLE); - logger.debug("read parameter richTextTitle: " + richTextTitle); - String richTextInstructions=request.getParameter(RICHTEXT_INSTRUCTIONS); - logger.debug("read parameter richTextInstructions: " + richTextInstructions); - - - if (!requestByStarter) - { - request.getSession().setAttribute(RICHTEXT_TITLE,richTextTitle); - request.getSession().setAttribute(RICHTEXT_INSTRUCTIONS,richTextInstructions); - } - - - String richTextIncorrectFeedback=request.getParameter(RICHTEXT_INCORRECT_FEEDBACK); - logger.debug("read parameter richTextIncorrectFeedback: " + richTextIncorrectFeedback); - - if ((richTextIncorrectFeedback != null) && (richTextIncorrectFeedback.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_INCORRECT_FEEDBACK,richTextIncorrectFeedback); - } - else - { - request.getSession().setAttribute(RICHTEXT_INCORRECT_FEEDBACK,DEFAULT_FEEDBACK_INCORRECT); - } - - - String richTextCorrectFeedback=request.getParameter(RICHTEXT_CORRECT_FEEDBACK); - logger.debug("read parameter richTextCorrectFeedback: " + richTextCorrectFeedback); - - if ((richTextCorrectFeedback != null) && (richTextCorrectFeedback.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,richTextCorrectFeedback); - } - else - { - request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,DEFAULT_FEEDBACK_CORRECT); - } - - - String richTextReportTitle=request.getParameter(RICHTEXT_REPORT_TITLE); - logger.debug("read parameter richTextReportTitle: " + richTextReportTitle); - - if ((richTextReportTitle != null) && (richTextReportTitle.length() > 0)) - { - request.getSession().setAttribute(RICHTEXT_REPORT_TITLE,richTextReportTitle); - } - - Map mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK); - } - - public static void configureContentRepository(HttpServletRequest request, IMcService mcService) { logger.debug("attempt configureContentRepository"); @@ -449,36 +356,8 @@ } } - - public static void debugMaps(HttpServletRequest request) - { - Map mapQuestionsContent=(Map)request.getSession().getAttribute(MAP_QUESTIONS_CONTENT); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); - Map mapGeneralSelectedOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_SELECTED_OPTIONS_CONTENT); - Map mapStartupGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_STARTUP_GENERAL_OPTIONS_CONTENT); - Map mapStartupGeneralSelectedOptionsContent=(Map)request.getSession().getAttribute(MAP_STARTUP_GENERAL_SELECTED_OPTIONS_CONTENT); - Map mapDisabledQuestions=(Map)request.getSession().getAttribute(MAP_DISABLED_QUESTIONS); - Map mapWeights=(Map)request.getSession().getAttribute(MAP_WEIGHTS); - Map mapCheckBoxStates=(Map)request.getSession().getAttribute(MAP_CHECKBOX_STATES); - Map mapSelectedOptions=(Map)request.getSession().getAttribute(MAP_SELECTED_OPTIONS); - - logger.debug("START DEBUGGING MAPS:"); - logger.debug("mapQuestionsContent:" + mapQuestionsContent); - logger.debug("mapOptionsContent:" + mapOptionsContent); - logger.debug("mapGeneralOptionsContent:" + mapGeneralOptionsContent); - logger.debug("mapGeneralSelectedOptionsContent:" + mapGeneralSelectedOptionsContent); - logger.debug("mapStartupGeneralOptionsContent:" + mapStartupGeneralOptionsContent); - logger.debug("mapStartupGeneralSelectedOptionsContent:" + mapStartupGeneralSelectedOptionsContent); - logger.debug("mapDisabledQuestions:" + mapDisabledQuestions); - logger.debug("mapWeights:" + mapWeights); - logger.debug("mapCheckBoxStates:" + mapCheckBoxStates); - logger.debug("mapSelectedOptions:" + mapSelectedOptions); - logger.debug("STOP DEBUGGING MAPS"); - } - /** * the only attributes kept are TOOL_SESSION and TOOL_CONTENT_ID and CURRENT_MONITORED_TOOL_SESSION * cleanUpSessionAbsolute(HttpServletRequest request) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java =================================================================== diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -rc3b793637eab6ae0c12968c3c07f9993c1ef6f16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/LearningUtil.java (.../LearningUtil.java) (revision c3b793637eab6ae0c12968c3c07f9993c1ef6f16) @@ -104,63 +104,7 @@ } - /** - * continueOptions(HttpServletRequest request) - * - * @param request - * @return boolean - */ - public static boolean continueOptions(HttpServletRequest request, IMcService mcService) - { - logger.debug("continue options requested."); - String currentQuestionIndex=(String)request.getSession().getAttribute(CURRENT_QUESTION_INDEX); - logger.debug("currentQuestionIndex:" + currentQuestionIndex); - - int newQuestionIndex=new Integer(currentQuestionIndex).intValue() + 1; - request.getSession().setAttribute(CURRENT_QUESTION_INDEX, new Integer(newQuestionIndex).toString()); - logger.debug("updated questionIndex:" + request.getSession().getAttribute(CURRENT_QUESTION_INDEX)); - - Long toolContentID= (Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("TOOL_CONTENT_ID: " + toolContentID); - - McContent mcContent=mcService.retrieveMc(toolContentID); - logger.debug("mcContent: " + mcContent); - - /* - * fetch question content from content - */ - logger.debug("newQuestionIndex: " + newQuestionIndex); - Iterator contentIterator=mcContent.getMcQueContents().iterator(); - boolean questionFound=false; - while (contentIterator.hasNext()) - { - McQueContent mcQueContent=(McQueContent)contentIterator.next(); - if (mcQueContent != null) - { - int displayOrder=mcQueContent.getDisplayOrder().intValue(); - logger.debug("displayOrder: " + displayOrder); - - /* prepare the next question's candidate answers for presentation*/ - if (newQuestionIndex == displayOrder) - { - logger.debug("get the next question... "); - Long uid=mcQueContent.getUid(); - logger.debug("uid : " + uid); - /* get the options for this question */ - List listMcOptions=mcService.findMcOptionsContentByQueId(uid); - logger.debug("listMcOptions : " + listMcOptions); - Map mapOptionsContent=McUtils.generateOptionsMap(listMcOptions); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); - questionFound=true; - } - } - } - logger.debug("questionFound: " + questionFound); - return questionFound; - } - /** * calculateWeights(Map mapLeanerAssessmentResults, Map mapQuestionWeights) * @@ -613,7 +557,8 @@ { logger.debug("starting createLearnerAttempt: "); Date attempTime=McUtils.getGMTDateTime(); - String timeZone= McUtils.getCurrentTimeZone(); + //String timeZone= McUtils.getCurrentTimeZone(); + String timeZone= ""; logger.debug("timeZone: " + timeZone); @@ -758,49 +703,6 @@ } - /** - * - * Map buildQuestionContentMap(HttpServletRequest request, McContent mcContent, IMcService mcService) - * - * @param request - * @param mcContent - * @param mcService - * @return - */ - public static Map buildQuestionContentMap(HttpServletRequest request, McContent mcContent, IMcService mcService) - { - Map mapQuestionsContent= new TreeMap(new McComparator()); - - Iterator contentIterator=mcContent.getMcQueContents().iterator(); - while (contentIterator.hasNext()) - { - McQueContent mcQueContent=(McQueContent)contentIterator.next(); - if (mcQueContent != null) - { - int displayOrder=mcQueContent.getDisplayOrder().intValue(); - if (displayOrder != 0) - { - /* add the question to the questions Map in the displayOrder*/ - mapQuestionsContent.put(new Integer(displayOrder).toString(),mcQueContent.getQuestion() + " of weight: " + mcQueContent.getWeight().toString() + "%"); - } - - /* prepare the first question's candidate answers for presentation*/ - if (displayOrder == 1) - { - logger.debug("first question... "); - Long uid=mcQueContent.getUid(); - logger.debug("uid : " + uid); - List listMcOptions=mcService.findMcOptionsContentByQueId(uid); - logger.debug("listMcOptions : " + listMcOptions); - Map mapOptionsContent=McUtils.generateOptionsMap(listMcOptions); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); - } - } - } - return mapQuestionsContent; - } - /** * McGeneralLearnerFlowDTO buildMcGeneralLearnerFlowDTO(McContent mcContent) Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -rc3b793637eab6ae0c12968c3c07f9993c1ef6f16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision c3b793637eab6ae0c12968c3c07f9993c1ef6f16) @@ -228,7 +228,7 @@ mcGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); mcGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - McUtils.saveTimeZone(request); + //McUtils.saveTimeZone(request); /* we have made sure TOOL_CONTENT_ID is passed */ String toolContentID=mcMonitoringForm.getToolContentID(); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java =================================================================== diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -rc3b793637eab6ae0c12968c3c07f9993c1ef6f16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision c3b793637eab6ae0c12968c3c07f9993c1ef6f16) @@ -1151,31 +1151,7 @@ } - /** - * void setAttributeNoToolSessions(HttpServletRequest request, IMcService mcService, McContent mcContent) - * - * @param request - * @param mcService - * @param mcContent - */ - public static void setAttributeNoToolSessions(HttpServletRequest request, IMcService mcService, McContent mcContent) - { - logger.debug("using mcContent: " + mcContent); - /*true means there is at least 1 response*/ - if ((mcContent != null) && (mcService.studentActivityOccurredGlobal(mcContent))) - { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); - } - else - { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); - } - } - - /** * cleans up the monitoring session * cleanupMonitoringSession(HttpServletRequest request)