Index: lams_tool_vote/conf/language/ApplicationResources.properties
===================================================================
diff -u -r0ab582175b03ab93a172f7ee84c105a3b8d267b7 -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 0ab582175b03ab93a172f7ee84c105a3b8d267b7)
+++ lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -99,13 +99,13 @@
error.defaultContent.notAvailable =Tool Activity Error! Can't continue
The the default content for the Tool Activity has not been set up.
error.defaultQuestionContent.notAvailable =Tool Activity Error! Can't continue
The the default question content for the Tool Activity has not been set up.
error.defaultOptionsContent.notAvailable =Tool Activity Error! Can't continue
The the default options content for the Tool Activity has not been set up.
-error.noLearnerActivity =Summary report is not available since no users attempted the activity yet.
+error.noLearnerActivity =The report is not available since no users attempted the activity yet.
#Learning mode resources
label.progressiveResults =Progressive Voting Results
button.endLearning =Finish
label.user =User
-label.attemptTime =Attempt Date/Time
+label.attemptTime =Voting Time
label.timezone =Time-Zone
label.response =Response
sbmt.learner.nominations.successful =Your votes have been submitted.
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java
===================================================================
diff -u -r2be43d0e5d701ff9c00b32c85e0d35f3367d52cb -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 2be43d0e5d701ff9c00b32c85e0d35f3367d52cb)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -124,6 +124,8 @@
public static final String MAP_VIEWONLY_QUESTION_CONTENT_LEARNER ="mapViewOnlyQuestionContentLearner";
public static final String MAP_QUE_ATTEMPTS ="mapQueAttempts";
public static final String LIST_USER_ENTRIES ="listUserEntries";
+ public static final String IS_PORTFOLIO_EXPORT ="isPortfolioExport";
+ public static final String PORTFOLIO_EXPORT_MODE ="portfolioExportMode";
public static final String SELECTED_QUESTION ="selectedQuestion";
public static final String SELECTED_QUESTION_INDEX ="selectedQuestionIndex";
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java
===================================================================
diff -u -rb523c049772bec9396882cecd81fdb23a91b5c19 -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision b523c049772bec9396882cecd81fdb23a91b5c19)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -24,16 +24,14 @@
package org.lamsfoundation.lams.tool.vote.web;
-import java.util.List;
-import java.util.Map;
-
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.tool.ToolAccessMode;
+import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
import org.lamsfoundation.lams.tool.vote.pojos.VoteContent;
import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr;
@@ -42,7 +40,7 @@
import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy;
import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet;
-public class ExportServlet extends AbstractExportPortfolioServlet {
+public class ExportServlet extends AbstractExportPortfolioServlet implements VoteAppConstants{
static Logger logger = Logger.getLogger(ExportServlet.class.getName());
private static final long serialVersionUID = -4529093489007108143L;
private final String FILENAME = "vote_main.html";
@@ -51,13 +49,15 @@
public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
logger.debug("dispathcing doExport");
+ request.getSession().setAttribute(IS_PORTFOLIO_EXPORT, new Boolean(true).toString());
+ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
+
if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){
- learner(request,response,directoryName,cookies);
+ learner(request,response,directoryName,cookies);
}else if (StringUtils.equals(mode,ToolAccessMode.TEACHER.toString())){
teacher(request,response,directoryName,cookies);
}
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
logger.debug("basePath: " + basePath);
writeResponseToFile(basePath+"/export/exportportfolio.jsp",directoryName,FILENAME,cookies);
@@ -66,7 +66,8 @@
public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
- logger.debug("starting learner...");
+ logger.debug("starting learner mode...");
+ request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner");
IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext());
logger.debug("voteService:" + voteService);
@@ -105,15 +106,17 @@
throw new VoteApplicationException(error);
}
-
- Map topicsByUser = null;
+ 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);
+
logger.debug("ending learner mode: ");
- request.getSession().setAttribute("report",topicsByUser);
}
public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
- logger.debug("starting teacher...");
+ logger.debug("starting teacher mode...");
+ request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher");
IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext());
logger.debug("voteService:" + voteService);
@@ -136,7 +139,10 @@
throw new VoteApplicationException(error);
}
+ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction();
+ logger.debug("starting refreshSummaryData.");
+ voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false);
+
logger.debug("ending teacher mode: ");
- request.getSession().setAttribute("report",null);
}
}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java
===================================================================
diff -u -r2be43d0e5d701ff9c00b32c85e0d35f3367d52cb -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 2be43d0e5d701ff9c00b32c85e0d35f3367d52cb)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -78,13 +78,13 @@
}
public static List buildGroupsQuestionData(HttpServletRequest request, VoteContent voteContent,
- boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId)
+ boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService)
{
logger.debug("isUserNamesVisible: " + isUserNamesVisible);
logger.debug("isLearnerRequest: " + isLearnerRequest);
logger.debug("userId: " + userId);
- IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
+ //IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
logger.debug("voteService: " + voteService);
logger.debug("will be building groups question data for content:..." + voteContent);
@@ -107,7 +107,7 @@
logger.debug("using allUsersData to retrieve users data: " + isUserNamesVisible);
Map questionAttemptData= buildGroupsAttemptData(request, voteContent, voteQueContent, voteQueContent.getUid().toString(),
- isUserNamesVisible,isLearnerRequest, currentSessionId, userId);
+ isUserNamesVisible,isLearnerRequest, currentSessionId, userId, voteService);
logger.debug("questionAttemptData:..." + questionAttemptData);
voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData);
listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO);
@@ -120,16 +120,15 @@
public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, VoteQueContent voteQueContent, String questionUid,
- boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId)
+ boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService)
{
logger.debug("isUserNamesVisible: " + isUserNamesVisible);
logger.debug("isLearnerRequest: " + isLearnerRequest);
logger.debug("currentSessionId: " + currentSessionId);
logger.debug("userId: " + userId);
logger.debug("doing buildGroupsAttemptData...");
- IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
- logger.debug("voteService: " + voteService);
+ logger.debug("voteService: " + voteService);
Map mapMonitoredAttemptsContainerDTO= new TreeMap(new VoteComparator());
List listMonitoredAttemptsContainerDTO= new LinkedList();
@@ -158,7 +157,7 @@
List listUsers=voteService.getUserBySessionOnly(voteSession);
logger.debug("listMcUsers for session id:" + voteSession.getVoteSessionId() + " = " + listUsers);
Map sessionUsersAttempts=populateSessionUsersAttempts(request,voteSession.getVoteSessionId(), listUsers, questionUid,
- isUserNamesVisible, isLearnerRequest, userId);
+ isUserNamesVisible, isLearnerRequest, userId, voteService);
listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts);
}
}
@@ -187,7 +186,7 @@
List listUsers=voteService.getUserBySessionOnly(voteSession);
logger.debug("listMcUsers for session id:" + voteSession.getVoteSessionId() + " = " + listUsers);
Map sessionUsersAttempts=populateSessionUsersAttempts(request,voteSession.getVoteSessionId(), listUsers, questionUid,
- isUserNamesVisible, isLearnerRequest, userId);
+ isUserNamesVisible, isLearnerRequest, userId, voteService);
listMonitoredAttemptsContainerDTO.add(sessionUsersAttempts);
}
}
@@ -203,16 +202,15 @@
public static Map populateSessionUsersAttempts(HttpServletRequest request,Long sessionId, List listUsers, String questionUid,
- boolean isUserNamesVisible, boolean isLearnerRequest, String userId)
+ boolean isUserNamesVisible, boolean isLearnerRequest, String userId, IVoteService voteService)
{
logger.debug("doing populateSessionUsersAttempts for: " +questionUid);
logger.debug("isUserNamesVisible: " + isUserNamesVisible);
logger.debug("isLearnerRequest: " + isLearnerRequest);
logger.debug("userId: " + userId);
logger.debug("doing populateSessionUsersAttempts...");
- IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
- logger.debug("voteService: " + voteService);
+ logger.debug("voteService: " + voteService);
Map mapMonitoredUserContainerDTO= new TreeMap(new VoteStringComparator());
List listMonitoredUserContainerDTO= new LinkedList();
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java
===================================================================
diff -u -r83ebb6f565f6d5ce638160e37fc6793c074c6356 -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 83ebb6f565f6d5ce638160e37fc6793c074c6356)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -136,25 +136,26 @@
VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form;
- String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId();
+
+ String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId();
logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession);
-
- VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentMonitoredToolSession));
- logger.debug("retrieving voteSession: " + voteSession);
-
- VoteContent voteContent=voteSession.getVoteContent();
- logger.debug("using voteContent: " + voteContent);
- refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true);
-
- if (currentMonitoredToolSession.equals("All"))
+ /* SELECTION_CASE == 1 indicates a selected group other than "All" */
+ if (currentMonitoredToolSession.equals("All"))
{
request.getSession().setAttribute(SELECTION_CASE, new Long(2));
}
else
{
- /* SELECTION_CASE == 1 indicates a selected group other than "All" */
+ VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentMonitoredToolSession));
+ logger.debug("retrieving voteSession: " + voteSession);
+
+ VoteContent voteContent=voteSession.getVoteContent();
+ logger.debug("using voteContent: " + voteContent);
+
+ refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true);
request.getSession().setAttribute(SELECTION_CASE, new Long(1));
+
}
logger.debug("SELECTION_CASE: " + request.getSession().getAttribute(SELECTION_CASE));
@@ -181,6 +182,7 @@
logger.debug("voteService: " + voteService);
}
+ logger.debug("voteService: " + voteService);
logger.debug("isUserNamesVisible: " + isUserNamesVisible);
logger.debug("isLearnerRequest: " + isLearnerRequest);
@@ -219,21 +221,25 @@
logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible);
List listMonitoredAnswersContainerDTO=MonitoringUtil.buildGroupsQuestionData(request, voteContent,
- isUserNamesVisible, isLearnerRequest, currentSessionId, userId);
+ isUserNamesVisible, isLearnerRequest, currentSessionId, userId, voteService);
request.getSession().setAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO, listMonitoredAnswersContainerDTO);
logger.debug("LIST_MONITORED_ANSWERS_CONTAINER_DTO: " + request.getSession().getAttribute(LIST_MONITORED_ANSWERS_CONTAINER_DTO));
/* ends here. */
- List listUserEntries=processUserEnteredNominations(voteService, currentSessionId, showUserEntriesBySession);
+ logger.debug("decide processing user entered values based on isLearnerRequest: " + isLearnerRequest);
+
+ List listUserEntries=processUserEnteredNominations(voteService, currentSessionId, showUserEntriesBySession, userId, isLearnerRequest);
logger.debug("listUserEntries: " + listUserEntries);
- request.getSession().setAttribute(LIST_USER_ENTRIES, listUserEntries);
+ request.getSession().setAttribute(LIST_USER_ENTRIES, listUserEntries);
}
- public List processUserEnteredNominations(IVoteService voteService, String currentSessionId, boolean showUserEntriesBySession)
+ public List processUserEnteredNominations(IVoteService voteService, String currentSessionId, boolean showUserEntriesBySession, String userId, boolean showUserEntriesByUserId)
{
logger.debug("start getting user entries, showUserEntriesBySession: " + showUserEntriesBySession);
logger.debug("start getting user entries, currentSessionId: " + currentSessionId);
+ logger.debug("start getting user entries, showUserEntriesByUserId: " + showUserEntriesByUserId);
+ logger.debug("start getting user entries, userId: " + userId);
List userEntries=voteService.getUserEntries();
logger.debug("userEntries: " + userEntries);
@@ -280,15 +286,38 @@
logger.debug("showUserEntriesBySession is true");
String userSessionId=voteUsrAttempt.getVoteQueUsr().getVoteSession().getVoteSessionId().toString() ;
logger.debug("userSessionId versus currentSessionId: " + userSessionId + " versus " + currentSessionId);
- if (userSessionId.equals(currentSessionId))
+
+ if (showUserEntriesByUserId == true)
{
- logger.debug("this is a requested session id: " + currentSessionId);
- voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime().toString());
- voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone());
- voteMonitoredUserDTO.setUserName(voteUsrAttempt.getVoteQueUsr().getUsername());
- voteMonitoredUserDTO.setQueUsrId(voteUsrAttempt.getVoteQueUsr().getUid().toString());
- voteMonitoredUserDTO.setUserEntry(voteUsrAttempt.getUserEntry());
+ logger.debug("showUserEntriesByUserId is true");
+ if (userSessionId.equals(currentSessionId))
+ {
+ String localUserId=voteUsrAttempt.getVoteQueUsr().getQueUsrId().toString();
+ if (userId.equals(localUserId))
+ {
+ logger.debug("this is requested by user id: " + userId);
+ voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime().toString());
+ voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone());
+ voteMonitoredUserDTO.setUserName(voteUsrAttempt.getVoteQueUsr().getUsername());
+ voteMonitoredUserDTO.setQueUsrId(voteUsrAttempt.getVoteQueUsr().getUid().toString());
+ voteMonitoredUserDTO.setUserEntry(voteUsrAttempt.getUserEntry());
+
+ }
+ }
}
+ else
+ {
+ logger.debug("showUserEntriesByUserId is false");
+ if (userSessionId.equals(currentSessionId))
+ {
+ logger.debug("this is requested by session id: " + currentSessionId);
+ voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime().toString());
+ voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone());
+ voteMonitoredUserDTO.setUserName(voteUsrAttempt.getVoteQueUsr().getUsername());
+ voteMonitoredUserDTO.setQueUsrId(voteUsrAttempt.getVoteQueUsr().getUid().toString());
+ voteMonitoredUserDTO.setUserEntry(voteUsrAttempt.getUserEntry());
+ }
+ }
}
listMonitoredUserContainerDTO.add(voteMonitoredUserDTO);
}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java
===================================================================
diff -u -r2be43d0e5d701ff9c00b32c85e0d35f3367d52cb -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 2be43d0e5d701ff9c00b32c85e0d35f3367d52cb)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -186,8 +186,19 @@
VoteUtils.cleanUpSessionAbsolute(request);
logger.debug("student activity occurred on this content:" + voteContent);
request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString());
+
+ 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");
+ logger.debug("error.noLearnerActivity must be displayed");
+ }
+
+
VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction();
logger.debug("refreshing summary data...");
voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, null, null, false);
Index: lams_tool_vote/web/export/exportportfolio.jsp
===================================================================
diff -u -r0ab582175b03ab93a172f7ee84c105a3b8d267b7 -r55e015221d64f87ca024dd967925bd763dceafd0
--- lams_tool_vote/web/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 0ab582175b03ab93a172f7ee84c105a3b8d267b7)
+++ lams_tool_vote/web/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 55e015221d64f87ca024dd967925bd763dceafd0)
@@ -1,16 +1,37 @@
+<%--
+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 version 2 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
+--%>
+
+
<%@ taglib uri="tags-bean" prefix="bean"%>
<%@ taglib uri="tags-html" prefix="html"%>
<%@ taglib uri="tags-logic" prefix="logic" %>
-<%@ taglib uri="tags-logic-el" prefix="logic-el" %>
<%@ taglib uri="tags-core" prefix="c"%>
<%@ taglib uri="tags-fmt" prefix="fmt" %>
<%@ taglib uri="fck-editor" prefix="FCK" %>
<%@ taglib uri="tags-lams" prefix="lams" %>
+
- |
- |
-     - | -|
+ |
+ |
| |
|
- |
    | |
| |