Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd -r66bdcbf0aa30e2806a09754ffb940f2b53126a01 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 66bdcbf0aa30e2806a09754ffb940f2b53126a01) @@ -462,28 +462,32 @@ String shiftableWeightEntry = getRequiredWeightEntry(mapWeights, new Integer(shiftableIndex).toString()); logger.debug("shiftableWeightEntry: " + shiftableWeightEntry); - if (movableWeightEntry != null) - { - mapTempWeights.put(new Integer(shiftableIndex).toString(), movableWeightEntry); - logger.debug("mapTempWeights has been updated with movableWeightEntry"); - } - else - { - mapTempWeights.put(new Integer(shiftableIndex).toString(), ""); - logger.debug("mapTempWeights has been updated with a empty string"); - } - - if (shiftableWeightEntry != null) + if ((movableWeightEntry != null) && (shiftableWeightEntry != null)) { - mapTempWeights.put(questionIndex,shiftableWeightEntry); - logger.debug("mapTempWeights has been updated with shiftableWeightEntry"); + if (movableWeightEntry != null) + { + mapTempWeights.put(new Integer(shiftableIndex).toString(), movableWeightEntry); + logger.debug("mapTempWeights has been updated with movableWeightEntry"); + } + else + { + mapTempWeights.put(new Integer(shiftableIndex).toString(), ""); + logger.debug("mapTempWeights has been updated with a empty string"); + } + + + if (shiftableWeightEntry != null) + { + mapTempWeights.put(questionIndex,shiftableWeightEntry); + logger.debug("mapTempWeights has been updated with shiftableWeightEntry"); + } + else + { + mapTempWeights.put(questionIndex, ""); + logger.debug("mapTempWeights has been updated with empty string"); + } } - else - { - mapTempWeights.put(questionIndex, ""); - logger.debug("mapTempWeights has been updated with empty string"); - } logger.debug("final shifted mapTempWeights: " + mapTempWeights); return mapTempWeights; @@ -500,6 +504,7 @@ */ public static Map shiftFeedbackMap(Map map, String questionIndex , String direction) { + logger.debug("doing shiftFeedbackMap: "); /* map to be returned */ Map mapTemp= new TreeMap(new McComparator()); mapTemp= map; @@ -522,24 +527,27 @@ String shiftableEntry = getRequiredFeedbackEntry(map, new Integer(shiftableIndex).toString()); logger.debug("shiftableEntry: " + shiftableEntry); - if (movableEntry != null) + if ((movableEntry != null) && (shiftableEntry != null)) { - mapTemp.put(new Integer(shiftableIndex).toString(), movableEntry); + if (movableEntry != null) + { + mapTemp.put(new Integer(shiftableIndex).toString(), movableEntry); + } + else + { + mapTemp.put(new Integer(shiftableIndex).toString(), ""); + } + + + if (shiftableEntry != null) + { + mapTemp.put(questionIndex,shiftableEntry); + } + else + { + mapTemp.put(questionIndex, ""); + } } - else - { - mapTemp.put(new Integer(shiftableIndex).toString(), ""); - } - - - if (shiftableEntry != null) - { - mapTemp.put(questionIndex,shiftableEntry); - } - else - { - mapTemp.put(questionIndex, ""); - } logger.debug("final shifted mapTemp: " + mapTemp); return mapTemp; @@ -581,6 +589,7 @@ Map mapShiftableOptionsEntry = getRequiredOptionsEntry(mapGlobalOptionsContent, new Integer(shiftableIndex).toString()); logger.debug("mapShiftableOptionsEntry: " + mapShiftableOptionsEntry); + if (mapMovableOptionsEntry != null) { mapTempGeneralOptionsContent.put(new Integer(shiftableIndex).toString(), mapMovableOptionsEntry); @@ -1085,30 +1094,33 @@ McContent mcContent=mcService.retrieveMc(toolContentId); logger.debug("mcContent:" + mcContent); - List list=mcService.refreshQuestionContent(mcContent.getUid()); - logger.debug("refreshed list:" + list); - - Iterator listIterator=list.iterator(); - Long mapIndex=new Long(1); - while (listIterator.hasNext()) - { - McQueContent mcQueContent=(McQueContent)listIterator.next(); - logger.debug("mcQueContent:" + mcQueContent); + if (mcContent != null) + { + List list=mcService.refreshQuestionContent(mcContent.getUid()); + logger.debug("refreshed list:" + list); + + Iterator listIterator=list.iterator(); + Long mapIndex=new Long(1); + while (listIterator.hasNext()) + { + McQueContent mcQueContent=(McQueContent)listIterator.next(); + logger.debug("mcQueContent:" + mcQueContent); - if (mcQueContent != null) - { - String incorrectFeedback=mcQueContent.getFeedbackIncorrect(); - if (incorrectFeedback != null) - { - map.put(mapIndex.toString(),incorrectFeedback.toString()); - } - else - { - map.put(mapIndex.toString(),""); - } - mapIndex=new Long(mapIndex.longValue()+1); - } - } + if (mcQueContent != null) + { + String incorrectFeedback=mcQueContent.getFeedbackIncorrect(); + if (incorrectFeedback != null) + { + map.put(mapIndex.toString(),incorrectFeedback.toString()); + } + else + { + map.put(mapIndex.toString(),""); + } + mapIndex=new Long(mapIndex.longValue()+1); + } + } + } logger.debug("refreshed Map:" + map); return map; @@ -1125,32 +1137,35 @@ McContent mcContent=mcService.retrieveMc(toolContentId); logger.debug("mcContent:" + mcContent); - List list=mcService.refreshQuestionContent(mcContent.getUid()); - logger.debug("refreshed list:" + list); - - Iterator listIterator=list.iterator(); - Long mapIndex=new Long(1); - while (listIterator.hasNext()) - { - McQueContent mcQueContent=(McQueContent)listIterator.next(); - logger.debug("mcQueContent:" + mcQueContent); - - if (mcQueContent != null) - { - String correctFeedback=mcQueContent.getFeedbackCorrect(); - logger.debug("correctFeedback:" + correctFeedback); - - if (correctFeedback != null) - { - map.put(mapIndex.toString(),correctFeedback.toString()); - } - else - { - map.put(mapIndex.toString(),""); - } - } - mapIndex=new Long(mapIndex.longValue()+1); - } + if (mcContent != null) + { + List list=mcService.refreshQuestionContent(mcContent.getUid()); + logger.debug("refreshed list:" + list); + + Iterator listIterator=list.iterator(); + Long mapIndex=new Long(1); + while (listIterator.hasNext()) + { + McQueContent mcQueContent=(McQueContent)listIterator.next(); + logger.debug("mcQueContent:" + mcQueContent); + + if (mcQueContent != null) + { + String correctFeedback=mcQueContent.getFeedbackCorrect(); + logger.debug("correctFeedback:" + correctFeedback); + + if (correctFeedback != null) + { + map.put(mapIndex.toString(),correctFeedback.toString()); + } + else + { + map.put(mapIndex.toString(),""); + } + } + mapIndex=new Long(mapIndex.longValue()+1); + } + } logger.debug("refreshed Map:" + map); return map; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r391557c1cca07365383bedeb438f9306c74938c9 -r66bdcbf0aa30e2806a09754ffb940f2b53126a01 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 391557c1cca07365383bedeb438f9306c74938c9) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 66bdcbf0aa30e2806a09754ffb940f2b53126a01) @@ -510,31 +510,68 @@ logger.debug("set SELECTED_QUESTION_INDEX to:" + questionIndex); /*presenting incorrect feedback data*/ - Map mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK); - logger.debug("mapIncorrectFeedback:" + mapIncorrectFeedback); - String incorrectFeedback=""; - if (mapIncorrectFeedback.size() > 0) - { - logger.debug("mapIncorrectFeedback size > 0"); - incorrectFeedback=(String)mapIncorrectFeedback.get(questionIndex); - } - logger.debug("incorrectFeedback:" + incorrectFeedback); - request.getSession().setAttribute(RICHTEXT_INCORRECT_FEEDBACK,incorrectFeedback); - + //Map mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK); + //logger.debug("mapIncorrectFeedback:" + mapIncorrectFeedback); + + /*get existing feedback maps*/ + + Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId:" + toolContentId); + + McContent mcContent=mcService.retrieveMc(toolContentId); + logger.debug("mcContent:" + mcContent); - /*presenting correct feedback data*/ - Map mapCorrectFeedback=(Map)request.getSession().getAttribute(MAP_CORRECT_FEEDBACK); - logger.debug("mapCorrectFeedback:" + mapCorrectFeedback); - String correctFeedback=""; - if (mapCorrectFeedback.size() > 0) - { - logger.debug("mapCorrectFeedback size > 0"); - correctFeedback=(String)mapCorrectFeedback.get(questionIndex); - } - logger.debug("correctFeedback:" + correctFeedback); - request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,correctFeedback); + Map mapIncorrectFeedback=new TreeMap(new McComparator()); + Map mapCorrectFeedback=new TreeMap(new McComparator()); + + //if (mcContent == null) + //{ + logger.debug("getting feedback maps from cache:"); + mapIncorrectFeedback=(Map)request.getSession().getAttribute(MAP_INCORRECT_FEEDBACK); + logger.debug("mapIncorrectFeedback:" + mapIncorrectFeedback); + mapCorrectFeedback=(Map)request.getSession().getAttribute(MAP_CORRECT_FEEDBACK); + logger.debug("mapCorrectFeedback:" + mapCorrectFeedback); + //} + /* + else + { + logger.debug("getting feedback maps from db:"); + mapIncorrectFeedback = AuthoringUtil.rebuildIncorrectFeedbackMapfromDB(request, toolContentId); + logger.debug("existing mapIncorrectFeedback:" + mapIncorrectFeedback); + request.getSession().setAttribute(MAP_INCORRECT_FEEDBACK, mapIncorrectFeedback); - + mapCorrectFeedback = AuthoringUtil.rebuildCorrectFeedbackMapfromDB(request, toolContentId); + logger.debug("existing mapCorrectFeedback:" + mapCorrectFeedback); + request.getSession().setAttribute(MAP_CORRECT_FEEDBACK, mapCorrectFeedback); + } + */ + + + if (mapIncorrectFeedback != null) + { + String incorrectFeedback=""; + if (mapIncorrectFeedback.size() > 0) + { + logger.debug("mapIncorrectFeedback size > 0"); + incorrectFeedback=(String)mapIncorrectFeedback.get(questionIndex); + logger.debug("incorrectFeedback:" + incorrectFeedback); + request.getSession().setAttribute(RICHTEXT_INCORRECT_FEEDBACK,incorrectFeedback); + } + } + + if (mapCorrectFeedback != null) + { + String correctFeedback=""; + if (mapCorrectFeedback.size() > 0) + { + logger.debug("mapCorrectFeedback size > 0"); + correctFeedback=(String)mapCorrectFeedback.get(questionIndex); + logger.debug("correctFeedback:" + correctFeedback); + request.getSession().setAttribute(RICHTEXT_CORRECT_FEEDBACK,correctFeedback); + } + } + + String editableQuestionEntry=(String)mapQuestionsContent.get(questionIndex); logger.debug("editableQuestionEntry:" + editableQuestionEntry); request.getSession().setAttribute(SELECTED_QUESTION, editableQuestionEntry); @@ -582,9 +619,6 @@ request.getSession().setAttribute(MAP_QUESTIONS_CONTENT, mapQuestionsContent); request.getSession().setAttribute(MAP_WEIGHTS, mapWeights); - Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId:" + toolContentId); - String selectedQuestionIndex=(String) request.getSession().getAttribute(SELECTED_QUESTION_INDEX); logger.debug("SELECTED_QUESTION_INDEX to:" + selectedQuestionIndex); @@ -650,7 +684,7 @@ } else { - McContent mcContent=mcService.retrieveMc(toolContentId); + mcContent=mcService.retrieveMc(toolContentId); logger.debug("mcContent:" + mcContent); McQueContent mcQueContent=null; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java =================================================================== diff -u -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd -r66bdcbf0aa30e2806a09754ffb940f2b53126a01 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringAction.java (.../McMonitoringAction.java) (revision 66bdcbf0aa30e2806a09754ffb940f2b53126a01) @@ -343,6 +343,8 @@ logger.debug("Title is: " + mcContent.getTitle()); logger.debug("Instructions is: " + mcContent.getInstructions()); + logger.debug("setting passmark to: " + mcContent.getPassMark()); + mcMonitoringForm.setPassmark(mcContent.getPassMark().toString()); logger.debug("fwd ing to : " + LOAD_MONITORING_CONTENT); return (mapping.findForward(LOAD_MONITORING_CONTENT)); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java =================================================================== diff -u -r2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd -r66bdcbf0aa30e2806a09754ffb940f2b53126a01 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 2e1913a4770c9bc154693d8c35f6e7a6b6e0e3fd) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McMonitoringStarterAction.java (.../McMonitoringStarterAction.java) (revision 66bdcbf0aa30e2806a09754ffb940f2b53126a01) @@ -261,6 +261,15 @@ } logger.debug("final IS_MONITORED_CONTENT_IN_USE: " + request.getSession().getAttribute(IS_MONITORED_CONTENT_IN_USE)); + /*get existing feedback maps*/ + mapIncorrectFeedback = AuthoringUtil.rebuildIncorrectFeedbackMapfromDB(request,toolContentId); + logger.debug("existing mapIncorrectFeedback:" + mapIncorrectFeedback); + request.getSession().setAttribute(MAP_INCORRECT_FEEDBACK, mapIncorrectFeedback); + + mapCorrectFeedback = AuthoringUtil.rebuildCorrectFeedbackMapfromDB(request, toolContentId); + logger.debug("existing mapCorrectFeedback:" + mapCorrectFeedback); + request.getSession().setAttribute(MAP_CORRECT_FEEDBACK, mapCorrectFeedback); + return (mapping.findForward(LOAD_MONITORING_CONTENT)); } Index: lams_tool_lamc/web/authoring/BasicContent.jsp =================================================================== diff -u -r391557c1cca07365383bedeb438f9306c74938c9 -r66bdcbf0aa30e2806a09754ffb940f2b53126a01 --- lams_tool_lamc/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 391557c1cca07365383bedeb438f9306c74938c9) +++ lams_tool_lamc/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 66bdcbf0aa30e2806a09754ffb940f2b53126a01) @@ -31,7 +31,6 @@ -

@@ -121,21 +120,22 @@ - - images/down.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionDown');"> - - - - - images/up.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionUp');"> - - - - - images/down.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionDown');"> - images/up.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionUp');"> - - + + + images/down.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionDown');"> + + + + images/up.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionUp');"> + + + + + images/down.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionDown');"> + images/up.gif" align=left onclick="javascript:submitModifyQuestion('','moveQuestionUp');"> + + + @@ -176,7 +176,7 @@ images/down.gif" align=left onclick="javascript:alert('This button is disabled in this [view-only] mode.');" > - + images/up.gif" align=left onclick="javascript:alert('This button is disabled in this [view-only] mode.');" >