Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java,v diff -u -r1.11 -r1.12 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 10 May 2006 21:23:21 -0000 1.11 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 12 May 2006 12:02:16 -0000 1.12 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v diff -u -r1.13 -r1.14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 27 Apr 2006 16:48:37 -0000 1.13 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 12 May 2006 12:02:16 -0000 1.14 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java,v diff -u -r1.14 -r1.15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 10 May 2006 18:38:54 -0000 1.14 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 12 May 2006 12:02:16 -0000 1.15 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java,v diff -u -r1.11 -r1.12 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 10 May 2006 21:23:21 -0000 1.11 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java 12 May 2006 12:02:16 -0000 1.12 @@ -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);