Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -r3a984c9bc1a3a01f8cd91635fb437dd44d07f950 -rdd298335db00afcb64815700a40f32b78c6b8998 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 3a984c9bc1a3a01f8cd91635fb437dd44d07f950) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision dd298335db00afcb64815700a40f32b78c6b8998) @@ -627,9 +627,6 @@ logger.debug("question: " + voteQueContent.getQuestion()); mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); - //int votesCount=voteService.getAttemptsForQuestionContent(voteQueContent.getUid()); - //logger.debug("votesCount for questionContent uid: " + votesCount + " for" + voteQueContent.getUid()); - int votesCount=0; if (sessionLevelCharting == true) { @@ -687,7 +684,6 @@ if ((userEntry != null) && (userEntry.length() > 0)) { - //int userEntryRate=voteService.getUserRecordsEntryCount(userEntry); int userEntryRate=0; if (sessionLevelCharting == true) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -rb981d563ace42f1c943a2e847aa2f725249b82a8 -rdd298335db00afcb64815700a40f32b78c6b8998 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision b981d563ace42f1c943a2e847aa2f725249b82a8) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision dd298335db00afcb64815700a40f32b78c6b8998) @@ -235,7 +235,12 @@ AuthoringUtil authoringUtil= new AuthoringUtil(); Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); logger.debug("mapOptionsContent :" +mapOptionsContent); - + + if (mapOptionsContent == null) + mapOptionsContent= new TreeMap(new VoteComparator()); + + logger.debug("mapOptionsContent :" +mapOptionsContent); + int maxIndex=mapOptionsContent.size(); request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); @@ -245,10 +250,6 @@ request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); - if (mapOptionsContent == null) - mapOptionsContent= new TreeMap(new VoteComparator()); - logger.debug("mapOptionsContent :" +mapOptionsContent); - ActionMessages errors= new ActionMessages(); /* full form validation should be performed only in standard authoring mode, but not in monitoring EditActivity */ errors=validateSubmit(request, errors, voteAuthoringForm); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r714df94653eb0195275d4086ece5b856c3a632c3 -rdd298335db00afcb64815700a40f32b78c6b8998 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 714df94653eb0195275d4086ece5b856c3a632c3) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision dd298335db00afcb64815700a40f32b78c6b8998) @@ -211,8 +211,8 @@ { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("error: The tool expects voteSession."); - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); - persistError(request,"error.toolSession.notAvailable"); + //request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + //persistError(request,"error.toolSession.notAvailable"); return (mapping.findForward(ERROR_LIST)); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r3a984c9bc1a3a01f8cd91635fb437dd44d07f950 -rdd298335db00afcb64815700a40f32b78c6b8998 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 3a984c9bc1a3a01f8cd91635fb437dd44d07f950) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision dd298335db00afcb64815700a40f32b78c6b8998) @@ -23,6 +23,9 @@ package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; +import java.util.Iterator; +import java.util.Map; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -38,8 +41,10 @@ import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; +import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; +import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -109,11 +114,13 @@ request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } + /* else if (allUserEntriesCount > 0) { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); logger.debug("allUserEntriesCount is:" + allUserEntriesCount + " USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } + */ else { request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); @@ -196,9 +203,41 @@ logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); logger.debug("error.noLearnerActivity must be displayed"); } + + /* + * get the nominations + * section is needed for the Edit tab's View Only mode, starts here + */ + Map mapOptionsContent= new TreeMap(new VoteComparator()); + logger.debug("setting existing content data from the db"); + mapOptionsContent.clear(); + Iterator queIterator=voteContent.getVoteQueContents().iterator(); + Long mapIndex=new Long(1); + logger.debug("mapOptionsContent: " + mapOptionsContent); + while (queIterator.hasNext()) + { + VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); + if (voteQueContent != null) + { + logger.debug("question: " + voteQueContent.getQuestion()); + mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); + /** + * make the first entry the default(first) one for jsp + */ + if (mapIndex.longValue() == 1) + { + request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, voteQueContent.getQuestion()); + } + + mapIndex=new Long(mapIndex.longValue()+1); + } + } + logger.debug("Map initialized with existing contentid to: " + mapOptionsContent); + request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); + logger.debug("starter initialized the Comparable Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT) ); + /* ends here*/ - VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); logger.debug("refreshing summary data..."); voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, null, null, false);