Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java =================================================================== diff -u --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java (revision 0) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -0,0 +1,161 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.vote; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + +/** + *
DTO that holds export portfolio properties + *
+ * + * @author Ozgur Demirtas + */ +public class ExportPortfolioDTO implements Comparable +{ + protected String portfolioExportMode; + protected String userExceptionNoToolSessions; + + protected Map mapStandardNominationsHTMLedContent; + protected Map mapStandardUserCount; + protected Map mapStandardRatesContent; + + protected List listUserEntries; + protected List listMonitoredAnswersContainerDto; + + + + public int compareTo(Object o) + { + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = (VoteGeneralAuthoringDTO) o; + + if (voteGeneralAuthoringDTO == null) + return 1; + else + return 0; + } + + public String toString() { + return new ToStringBuilder(this) + .append("portfolioExportMode: ", portfolioExportMode) + .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) + .append("mapStandardNominationsHTMLedContent: ", mapStandardNominationsHTMLedContent) + .append("mapStandardUserCount: ", mapStandardUserCount) + .append("mapStandardRatesContent: ", mapStandardRatesContent) + .append("listUserEntries: ", listUserEntries) + .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .toString(); + } + + /** + * @return Returns the listMonitoredAnswersContainerDto. + */ + public List getListMonitoredAnswersContainerDto() { + return listMonitoredAnswersContainerDto; + } + /** + * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + */ + public void setListMonitoredAnswersContainerDto( + List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + } + /** + * @return Returns the listUserEntries. + */ + public List getListUserEntries() { + return listUserEntries; + } + /** + * @param listUserEntries The listUserEntries to set. + */ + public void setListUserEntries(List listUserEntries) { + this.listUserEntries = listUserEntries; + } + /** + * @return Returns the mapStandardNominationsHTMLedContent. + */ + public Map getMapStandardNominationsHTMLedContent() { + return mapStandardNominationsHTMLedContent; + } + /** + * @param mapStandardNominationsHTMLedContent The mapStandardNominationsHTMLedContent to set. + */ + public void setMapStandardNominationsHTMLedContent( + Map mapStandardNominationsHTMLedContent) { + this.mapStandardNominationsHTMLedContent = mapStandardNominationsHTMLedContent; + } + /** + * @return Returns the mapStandardRatesContent. + */ + public Map getMapStandardRatesContent() { + return mapStandardRatesContent; + } + /** + * @param mapStandardRatesContent The mapStandardRatesContent to set. + */ + public void setMapStandardRatesContent(Map mapStandardRatesContent) { + this.mapStandardRatesContent = mapStandardRatesContent; + } + /** + * @return Returns the mapStandardUserCount. + */ + public Map getMapStandardUserCount() { + return mapStandardUserCount; + } + /** + * @param mapStandardUserCount The mapStandardUserCount to set. + */ + public void setMapStandardUserCount(Map mapStandardUserCount) { + this.mapStandardUserCount = mapStandardUserCount; + } + /** + * @return Returns the portfolioExportMode. + */ + public String getPortfolioExportMode() { + return portfolioExportMode; + } + /** + * @param portfolioExportMode The portfolioExportMode to set. + */ + public void setPortfolioExportMode(String portfolioExportMode) { + this.portfolioExportMode = portfolioExportMode; + } + /** + * @return Returns the userExceptionNoToolSessions. + */ + public String getUserExceptionNoToolSessions() { + return userExceptionNoToolSessions; + } + /** + * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + */ + public void setUserExceptionNoToolSessions( + String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; + } +} Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -48,8 +48,8 @@ public static final String LOAD_LEARNER ="loadLearner"; public static final String GENERATE_CHART ="generateChart"; public static final String ALL_NOMINATIONS ="allNominations"; - public static final String LOAD_MONITORING_CONTENT ="loadMonitoring"; - public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; + public static final String LOAD_MONITORING_CONTENT ="loadMonitoring"; + public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; public static final String EXPORT_PORTFOLIO = "exportPortfolio"; public static final String INDIVIDUAL_REPORT ="individualReport"; public static final String EXIT_PAGE ="exitPage"; @@ -100,6 +100,7 @@ public static final String ONLINE_INSTRUCTIONS_KEY = "onlineInstructionsKey"; public static final String OFFLINE_INSTRUCTIONS_KEY = "offlineInstructionsKey"; + public static final String EXPORT_PORTFOLIO_DTO = "exportPortfolioDto"; /* * authoring mode controllers Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -470,7 +470,7 @@ /** - * the only attributes kept are TOOL_SESSION and TOOL_CONTENT_ID and CURRENT_MONITORED_TOOL_SESSION + * * cleanUpSessionAbsolute(HttpServletRequest request) * @param request */ Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -39,6 +39,7 @@ import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; @@ -82,8 +83,10 @@ public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { + ExportPortfolioDTO exportPortfolioDTO= new ExportPortfolioDTO(); + logger.debug("starting learner mode..."); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); + exportPortfolioDTO.setPortfolioExportMode("learner"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); logger.debug("voteService:" + voteService); @@ -125,20 +128,27 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID ); + VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); voteMonitoringAction.refreshSummaryData(request, content, voteService, true, true, - toolSessionID.toString(), userID.toString() , true, null, voteGeneralMonitoringDTO); + toolSessionID.toString(), userID.toString() , true, null, voteGeneralMonitoringDTO, exportPortfolioDTO); + logger.debug("post refreshSummaryData, exportPortfolioDTO now: " + exportPortfolioDTO); - MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), voteSession.getUid()); - logger.debug("post prepareChartDataForExport"); + MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), + voteSession.getUid(), exportPortfolioDTO); + + logger.debug("final exportPortfolioDTO: " + exportPortfolioDTO); + logger.debug("final exportPortfolioDTO userExceptionNoToolSessions: " + exportPortfolioDTO.getUserExceptionNoToolSessions() ); + request.getSession().setAttribute(EXPORT_PORTFOLIO_DTO, exportPortfolioDTO); logger.debug("ending learner mode: "); } public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { logger.debug("starting teacher mode..."); - request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); + ExportPortfolioDTO exportPortfolioDTO= new ExportPortfolioDTO(); + exportPortfolioDTO.setPortfolioExportMode("teacher"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); logger.debug("voteService:" + voteService); @@ -163,13 +173,18 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); + logger.debug("starting refreshSummaryData."); - voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO); + voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO, exportPortfolioDTO); + logger.debug("post refreshSummaryData, exportPortfolioDTO now: " + exportPortfolioDTO); logger.debug("teacher uses content id: " + content.getVoteContentId()); - MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null); + MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null, exportPortfolioDTO); logger.debug("post prepareChartDataForExportTeacher"); - + + logger.debug("final exportPortfolioDTO: " + exportPortfolioDTO); + logger.debug("final exportPortfolioDTO userExceptionNoToolSessions: " + exportPortfolioDTO.getUserExceptionNoToolSessions() ); + request.getSession().setAttribute(EXPORT_PORTFOLIO_DTO, exportPortfolioDTO); logger.debug("ending teacher mode: "); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -33,10 +33,12 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.VoteAllSessionsDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; +import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; import org.lamsfoundation.lams.tool.vote.VoteMonitoredAnswersDTO; import org.lamsfoundation.lams.tool.vote.VoteMonitoredUserDTO; import org.lamsfoundation.lams.tool.vote.VoteStringComparator; @@ -47,11 +49,10 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; -import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; /** * - *Keeps all operations needed for Monitoring mode.
+ *More generic monitoring mode functions live here
* * @author Ozgur Demirtas * @@ -1077,19 +1078,6 @@ request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent); logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); - //request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT, mapStandardNominationsHTMLedContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT)); - - //request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount); - logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT)); - - //request.getSession().setAttribute("mapStandardQuestionUid", mapStandardQuestionUid); - logger.debug("test2: mapStandardQuestionUid: " + request.getSession().getAttribute("mapStandardQuestionUid")); - - //request.getSession().setAttribute("mapStandardToolSessionUid", mapStandardToolSessionUid); - logger.debug("test2: mapStandardToolSessionUid: " + request.getSession().getAttribute("mapStandardToolSessionUid")); - - if (voteGeneralLearnerFlowDTO !=null) { logger.debug("placing maps within voteGeneralLearnerFlowDTO"); @@ -1118,234 +1106,7 @@ request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } - /** - * generates JFreeChart for the learner export portfolio - * - * @param request - * @param voteService - * @param voteMonitoringForm - * @param toolContentID - * @param toolSessionUid - */ - public static void prepareChartDataForExportLearner(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid) - { - logger.debug("starting prepareChartDataForExportLearner, toolContentID: " + toolContentID); - logger.debug("starting prepareChartDataForExportLearner, toolSessionUid: " + toolSessionUid); - VoteContent voteContent=voteService.retrieveVote(toolContentID); - logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); - - logger.debug("starting prepareChartDataForExport, voteMonitoringForm: " + voteMonitoringForm); - - logger.debug("existing voteContent:" + voteContent); - Map mapOptionsContent= new TreeMap(new VoteComparator()); - logger.debug("mapOptionsContent: " + mapOptionsContent); - - Map mapVoteRatesContent= new TreeMap(new VoteComparator()); - logger.debug("mapVoteRatesContent: " + mapVoteRatesContent); - - List distinctSessionUsers=new ArrayList(); - boolean sessionLevelCharting=true; - int entriesCount=0; - Set userEntries=null; - - if (toolSessionUid != null) - { - logger.debug("process for session: " + toolSessionUid); - entriesCount=voteService.getSessionEntriesCount(toolSessionUid); - logger.debug("entriesCount: " + entriesCount); - userEntries=voteService.getSessionUserEntriesSet(toolSessionUid); - logger.debug("sessionUserCount: " + userEntries.size()); - - int completedSessionUserCount=voteService.getCompletedVoteUserBySessionUid(toolSessionUid); - logger.debug("completedSessionUserCount: " + completedSessionUserCount); - - int completedEntriesCount=voteService.getCompletedSessionEntriesCount(toolSessionUid); - logger.debug("completedEntriesCount: " + completedEntriesCount); - int potentialUserCount=voteService.getVoteSessionPotentialLearnersCount(toolSessionUid); - logger.debug("potentialUserCount: " + potentialUserCount); - - if (potentialUserCount != 0) - { - double completedPercent=(completedSessionUserCount * 100) / potentialUserCount; - logger.debug("completed percent: " + completedPercent); - - } - } - - logger.debug("entriesCount: " + entriesCount); - logger.debug("userEntries: " + userEntries); - logger.debug("sessionLevelCharting: " + sessionLevelCharting); - - - Map mapStandardUserCount= new TreeMap(new VoteComparator()); - Map mapStandardNominationsVisibility= 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); - int totalStandardVotesCount=0; - - logger.debug("using entriesCount: " + entriesCount); - Map mapStandardNominationsHTMLedContent= new TreeMap(new VoteComparator()); - while (queIterator.hasNext()) - { - VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); - if (voteQueContent != null) - { - logger.debug("question: " + voteQueContent.getQuestion()); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(),voteQueContent.getQuestion()); - String noHTMLNomination = VoteUtils.stripHTML(voteQueContent.getQuestion()); - logger.debug("noHTMLNomination: " + noHTMLNomination); - mapOptionsContent.put(mapIndex.toString(),noHTMLNomination); - - - int votesCount=0; - if (sessionLevelCharting == true) - { - logger.debug("getting votesCount based on session: " + toolSessionUid); - votesCount=voteService.getStandardAttemptsForQuestionContentAndSessionUid(voteQueContent.getUid(), toolSessionUid); - - logger.debug("votesCount for questionContent uid: " + votesCount + " for" + voteQueContent.getUid()); - mapStandardUserCount.put(mapIndex.toString(),new Integer(votesCount).toString()); - totalStandardVotesCount=totalStandardVotesCount + votesCount; - } - else - { - logger.debug("getting votesCount based on content: " + voteQueContent.getUid()); - votesCount=voteService.getAttemptsForQuestionContent(voteQueContent.getUid()); - logger.debug("votesCount for questionContent uid: " + votesCount + " for" + voteQueContent.getUid()); - } - - double voteRate=0d; - double doubleVotesCount=votesCount * 1d; - logger.debug("doubleVotesCount: " + doubleVotesCount); - double doubleEntriesCount=entriesCount * 1d; - logger.debug("doubleEntriesCount: " + doubleEntriesCount); - if (entriesCount != 0) - { - voteRate=((doubleVotesCount * 100)/ doubleEntriesCount); - } - - logger.debug("voteRate" + voteRate); - - String stringVoteRate=new Double(voteRate).toString(); - int lengthVoteRate=stringVoteRate.length(); - logger.debug("lengthVoteRate" + lengthVoteRate); - if (lengthVoteRate > 5) - stringVoteRate=stringVoteRate.substring(0,6); - - mapVoteRatesContent.put(mapIndex.toString(), stringVoteRate); - mapStandardNominationsVisibility.put(mapIndex.toString(), new Boolean(true).toString()); - mapIndex=new Long(mapIndex.longValue()+1); - } - } - logger.debug("test1: Map initialized with existing contentid to: " + mapOptionsContent); - Map mapStandardNominationsContent= new TreeMap(new VoteComparator()); - mapStandardNominationsContent=mapOptionsContent; - logger.debug("mapStandardNominationsContent: " + mapStandardNominationsContent); - logger.debug("mapStandardNominationsHTMLedContent: " + mapStandardNominationsHTMLedContent); - - Map mapStandardRatesContent= new TreeMap(new VoteComparator()); - mapStandardRatesContent=mapVoteRatesContent; - logger.debug("test1: mapStandardRatesContent: " + mapStandardRatesContent); - logger.debug("test1: mapStandardUserCount: " + mapStandardUserCount); - logger.debug("test1: mapStandardNominationsVisibility: " + mapStandardNominationsVisibility); - - Iterator itListQuestions = userEntries.iterator(); - int mapVoteRatesSize=mapVoteRatesContent.size(); - logger.debug("mapVoteRatesSize: " + mapVoteRatesSize); - mapIndex=new Long(mapVoteRatesSize+1); - logger.debug("updated mapIndex: " + mapIndex); - - double total=MonitoringUtil.calculateTotal(mapVoteRatesContent); - logger.debug("updated mapIndex: " + mapIndex); - double share=100d-total ; - logger.debug("share: " + share); - - logger.debug("totalStandardVotesCount: " + totalStandardVotesCount); - int userEnteredVotesCount=entriesCount - totalStandardVotesCount; - logger.debug("userEnteredVotesCount for this session: " + userEnteredVotesCount); - - if (userEnteredVotesCount != 0) - { - share=((userEnteredVotesCount * 100)/ entriesCount); - logger.debug("calculated share normally, userEnteredVotesCount: " + userEnteredVotesCount); - logger.debug("calculated share normally, entriesCount: " + entriesCount); - } - else - { - share=0; - logger.debug("reset share"); - } - logger.debug("final share: " + share); - - - logger.debug("start processing userEntries: " + userEntries); - itListQuestions = userEntries.iterator(); - while (itListQuestions.hasNext()) - { - String userEntry =(String)itListQuestions.next(); - logger.debug("userEntry:..." + userEntry); - logger.debug("mapIndex: " + mapIndex); - - if ((userEntry != null) && (userEntry.length() > 0)) - { - int userEntryRate=0; - if (sessionLevelCharting == true) - { - logger.debug("getting userEntryRate based on session: " + toolSessionUid); - List voteEntries=voteService.getUserEnteredVotesForSession(userEntry, toolSessionUid); - boolean isVoteVisible=voteService.isVoteVisibleForSession(userEntry, toolSessionUid); - logger.debug("isVoteVisible: " + isVoteVisible); - - logger.debug("voteEntries: " + voteEntries); - int individualUserEnteredVoteCount=voteEntries.size(); - logger.debug("individualUserEnteredVoteCount: " + individualUserEnteredVoteCount); - - double votesShare=(individualUserEnteredVoteCount * share) / userEnteredVotesCount; - logger.debug("votesShare: " + votesShare); - - if (isVoteVisible == true) - { - mapStandardNominationsContent.put(mapIndex.toString(), userEntry); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), userEntry); - } - else - { - String nominationName="Nomination" + mapIndex + " Hidden"; - logger.debug("nominationName: " + nominationName); - mapStandardNominationsContent.put(mapIndex.toString(), nominationName); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), nominationName); - } - - mapStandardRatesContent.put(mapIndex.toString(), new Double(votesShare).toString()); - mapStandardUserCount.put(mapIndex.toString(), new Integer(individualUserEnteredVoteCount).toString()); - mapStandardNominationsVisibility.put(mapIndex.toString(), new Boolean(isVoteVisible).toString()); - mapIndex=new Long(mapIndex.longValue()+1); - } - } - } - - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, mapStandardNominationsContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT, mapStandardNominationsHTMLedContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent); - logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount); - logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT)); - - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_VISIBILITY, mapStandardNominationsVisibility); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_VISIBILITY: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_VISIBILITY)); - } - - /** * generates JFreeChart for the teacher export portfolio * @@ -1355,10 +1116,13 @@ * @param toolContentID * @param toolSessionUid */ - public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid) + public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, + VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid, ExportPortfolioDTO exportPortfolioDTO) { logger.debug("starting prepareChartDataForExportTeacher, toolContentID: " + toolContentID); logger.debug("starting prepareChartDataForExportTeacher, toolSessionUid: " + toolSessionUid); + logger.debug("pased exportPortfolioDTO: " + exportPortfolioDTO); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); logger.debug("starting prepareChartDataForExport, voteMonitoringForm: " + voteMonitoringForm); @@ -1465,17 +1229,13 @@ mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString()); - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, mapStandardNominationsContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT, mapStandardNominationsHTMLedContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_HTMLED_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent); - logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); - - request.getSession().setAttribute(MAP_STANDARD_USER_COUNT, mapStandardUserCount); - logger.debug("test2: MAP_STANDARD_USER_COUNT: " + request.getSession().getAttribute(MAP_STANDARD_USER_COUNT)); + if (exportPortfolioDTO != null) + { + exportPortfolioDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); + exportPortfolioDTO.setMapStandardRatesContent(mapStandardRatesContent); + exportPortfolioDTO.setMapStandardUserCount(mapStandardUserCount); + } + logger.debug("ending prepareChartDataForExportTeacher, exportPortfolioDTO: " + exportPortfolioDTO); } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -336,7 +336,7 @@ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, true, currentToolSessionId.toString(), - learnerProgressUserId, true, voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + learnerProgressUserId, true, voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, null); voteGeneralLearnerFlowDTO.setRequestLearningReport(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setRequestLearningReportProgress(new Boolean(true).toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -39,6 +39,7 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; @@ -176,7 +177,9 @@ logger.debug("post prepareChartData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, - voteGeneralMonitoringDTO); + voteGeneralMonitoringDTO, null); + logger.debug("session_name: " + voteSession.getSession_name()); + voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } @@ -279,10 +282,11 @@ public void refreshSummaryData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, ExportPortfolioDTO exportPortfolioDTO) { logger.debug("doing refreshSummaryData." + voteGeneralLearnerFlowDTO); logger.debug("voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); + logger.debug("exportPortfolioDTO:" + exportPortfolioDTO); if (voteService == null) { @@ -312,6 +316,13 @@ logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } + String userExceptionNoToolSessions=voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); + logger.debug("userExceptionNoToolSessions: " + userExceptionNoToolSessions); + if (exportPortfolioDTO != null) + { + exportPortfolioDTO.setUserExceptionNoToolSessions(userExceptionNoToolSessions); + } + Map summaryToolSessionsId=MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); logger.debug("currentSessionId: " + currentSessionId); @@ -323,6 +334,10 @@ if (voteGeneralMonitoringDTO != null) voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); } + else + { + voteGeneralMonitoringDTO.setGroupName("All Groups"); + } logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible); List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, voteContent, @@ -335,13 +350,22 @@ List listUserEntries=processUserEnteredNominations(voteService, voteContent, currentSessionId, showUserEntriesBySession, userId, isLearnerRequest); logger.debug("listUserEntries: " + listUserEntries); - if (voteGeneralLearnerFlowDTO !=null) + if (voteGeneralLearnerFlowDTO != null) { logger.debug("placing dtos within the voteGeneralLearnerFlowDTO: "); voteGeneralLearnerFlowDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); voteGeneralLearnerFlowDTO.setListUserEntries(listUserEntries);; } + + if (exportPortfolioDTO != null) + { + logger.debug("placing dtos within the exportPortfolioDTO: "); + exportPortfolioDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); + exportPortfolioDTO.setListUserEntries(listUserEntries);; + } + + if (voteGeneralMonitoringDTO != null) { voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); @@ -372,7 +396,6 @@ logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" + voteGeneralMonitoringDTO); request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - } @@ -1187,7 +1210,7 @@ logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, - null, true, null,voteGeneralMonitoringDTO); + null, true, null,voteGeneralMonitoringDTO, null); initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); @@ -1325,7 +1348,8 @@ String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO); + refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, + voteGeneralMonitoringDTO, null); if (currentMonitoredToolSession.equals("All")) { @@ -1399,7 +1423,7 @@ logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, - true, null, voteGeneralMonitoringDTO); + true, null, voteGeneralMonitoringDTO, null); if (currentMonitoredToolSession.equals("All")) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -296,7 +296,7 @@ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); logger.debug("refreshing summary data..."); voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, - null, null, false, null, voteGeneralMonitoringDTO); + null, null, false, null, voteGeneralMonitoringDTO, null); logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); logger.debug("refreshing stats data..."); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -248,23 +248,13 @@ /* this will be fixed when making changes to Monitoring module */ if (strToolContentId == null) { - /*it is possible that the original request for authoring module is coming from monitoring url which keeps the - TOOL_CONTENT_ID in the session*/ - Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentID: " + toolContentID); - if (toolContentID != null) - { - strToolContentId= toolContentID.toString(); - logger.debug("cached strToolContentId from the session: " + strToolContentId); - } - else - { - logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session."); - /*use default content instead of giving a warning*/ - String defaultContentId=voteAuthoringForm.getDefaultContentId(); - logger.debug("using Voting defaultContentId: " + defaultContentId); - strToolContentId=defaultContentId; - } + /*watch out for a possibility that the original request for authoring module is coming + * from monitoring url */ + logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available."); + /*use default content instead of giving a warning*/ + String defaultContentId=voteAuthoringForm.getDefaultContentId(); + logger.debug("using Voting defaultContentId: " + defaultContentId); + strToolContentId=defaultContentId; } logger.debug("final strToolContentId: " + strToolContentId); Index: lams_tool_vote/web/authoring/InstructionsContent.jsp =================================================================== diff -u -r1447dc2ae2077d18831a17b7c2f309390adb0687 -r5c9c47d5e75fb6d0229862af0f08c84229b6056c --- lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 1447dc2ae2077d18831a17b7c2f309390adb0687) +++ lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) @@ -76,7 +76,7 @@ |
|
- |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
- | |||||||||||||||||||||||||
|
- |
+
+ |
||||||||||||||||||||||||
|
|
- |||||||||||||||||||||||||
|
- |
|