Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java,v diff -u -r1.31 -r1.32 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 14 Jul 2006 04:50:06 -0000 1.31 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java 11 Aug 2006 12:34:07 -0000 1.32 @@ -62,6 +62,10 @@ public static final String LEARNER_PROGRESS ="learnerProgress"; public static final String VOTE_NOMINATION_VIEWER ="voteNominationViewer"; public static final String LEARNER_PROGRESS_USERID ="learnerProgressUserId"; + public static final String MAX_NOMINATION_COUNT ="maxNominationCount"; + public static final String ALLOW_TEXT_ENTRY ="allowTextEntry"; + public static final String VOTE_CHANGABLE ="voteChangable"; + public static final String LOCK_ON_FINISH ="lockOnFinish"; public static final String AUTHORING ="authoring"; public static final String SOURCE_VOTE_STARTER ="sourceVoteStarter"; @@ -81,6 +85,7 @@ public static final String IS_REMOVE_QUESTION ="isRemoveQuestion"; public static final String IS_REMOVE_CONTENT ="isRemoveContent"; public static final String IS_REVISITING_USER ="isRevisitingUser"; + public static final String REVISITING_USER ="revisitingUser"; public static final String USER = "user"; public static final String TOOL_CONTENT_ID = "toolContentID"; @@ -128,6 +133,7 @@ public static final String MAP_STUDENTS_VOTED ="mapStudentsVoted"; public static final String QUESTIONS_WITHNO_OPTIONS ="questionsWithNoOptions"; + public static final String VOTE_GENERAL_LEARNER_FLOW_DTO ="voteGeneralLearnerFlowDTO"; public static final String MAP_GENERAL_CHECKED_OPTIONS_CONTENT ="mapGeneralCheckedOptionsContent"; public static final String MAP_LEARNER_QUESTIONS_CONTENT ="mapLearnerQuestionsContent"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralLearnerFlowDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteGeneralLearnerFlowDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralLearnerFlowDTO.java 11 Aug 2006 12:34:07 -0000 1.1 @@ -0,0 +1,501 @@ +/*************************************************************************** + * 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: VoteGeneralLearnerFlowDTO.java,v 1.1 2006/08/11 12:34:07 ozgurd Exp $$ */ +package org.lamsfoundation.lams.tool.vote; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + +/** + *
DTO that holds learner flow decision properties and some other view-only properties + *
+ * + * @author Ozgur Demirtas + */ +public class VoteGeneralLearnerFlowDTO implements Comparable +{ + protected String activityTitle; + + protected String activityInstructions; + + protected String revisitingUser; + + protected String userEntry; + + protected String castVoteCount; + + protected String maxNominationCountReached; + + protected String activityRunOffline; + + protected String toolSessionID; + + protected String toolContentID; + + protected String toolContentUID; + + protected String learningMode; + + protected String maxNominationCount; + + protected String allowTextEntry; + + protected String lockOnFinish; + + protected String voteChangable; + + protected String totalQuestionCount; + + protected String previewOnly; + + protected String requestLearningReport; + + protected String requestLearningReportProgress; + + protected String nominationsSubmited; + + protected Map mapGeneralCheckedOptionsContent; + + protected Map mapStandardNominationsContent; + + protected Map mapStandardNominationsHTMLedContent; + + protected Map mapStandardRatesContent; + + protected Map mapStandardUserCount; + + protected Map mapStandardQuestionUid; + + protected Map mapStandardToolSessionUid; + + protected List listMonitoredAnswersContainerDto; + + protected List listUserEntries; + + /** + * @return Returns the activityRunOffline. + */ + public String getActivityRunOffline() { + return activityRunOffline; + } + /** + * @param activityRunOffline The activityRunOffline to set. + */ + public void setActivityRunOffline(String activityRunOffline) { + this.activityRunOffline = activityRunOffline; + } + /** + * @return Returns the castVoteCount. + */ + public String getCastVoteCount() { + return castVoteCount; + } + /** + * @param castVoteCount The castVoteCount to set. + */ + public void setCastVoteCount(String castVoteCount) { + this.castVoteCount = castVoteCount; + } + /** + * @return Returns the maxNominationCountReached. + */ + public String getMaxNominationCountReached() { + return maxNominationCountReached; + } + /** + * @param maxNominationCountReached The maxNominationCountReached to set. + */ + public void setMaxNominationCountReached(String maxNominationCountReached) { + this.maxNominationCountReached = maxNominationCountReached; + } + /** + * @return Returns the revisitingUser. + */ + public String getRevisitingUser() { + return revisitingUser; + } + /** + * @param revisitingUser The revisitingUser to set. + */ + public void setRevisitingUser(String revisitingUser) { + this.revisitingUser = revisitingUser; + } + /** + * @return Returns the userEntry. + */ + public String getUserEntry() { + return userEntry; + } + /** + * @param userEntry The userEntry to set. + */ + public void setUserEntry(String userEntry) { + this.userEntry = userEntry; + } + + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the learningMode. + */ + public String getLearningMode() { + return learningMode; + } + /** + * @param learningMode The learningMode to set. + */ + public void setLearningMode(String learningMode) { + this.learningMode = learningMode; + } + /** + * @return Returns the toolSessionID. + */ + public String getToolSessionID() { + return toolSessionID; + } + /** + * @param toolSessionID The toolSessionID to set. + */ + public void setToolSessionID(String toolSessionID) { + this.toolSessionID = toolSessionID; + } + + /** + * @return Returns the allowTextEntry. + */ + public String getAllowTextEntry() { + return allowTextEntry; + } + /** + * @param allowTextEntry The allowTextEntry to set. + */ + public void setAllowTextEntry(String allowTextEntry) { + this.allowTextEntry = allowTextEntry; + } + /** + * @return Returns the lockOnFinish. + */ + public String getLockOnFinish() { + return lockOnFinish; + } + /** + * @param lockOnFinish The lockOnFinish to set. + */ + public void setLockOnFinish(String lockOnFinish) { + this.lockOnFinish = lockOnFinish; + } + /** + * @return Returns the maxNominationCount. + */ + public String getMaxNominationCount() { + return maxNominationCount; + } + /** + * @param maxNominationCount The maxNominationCount to set. + */ + public void setMaxNominationCount(String maxNominationCount) { + this.maxNominationCount = maxNominationCount; + } + /** + * @return Returns the voteChangable. + */ + public String getVoteChangable() { + return voteChangable; + } + /** + * @param voteChangable The voteChangable to set. + */ + public void setVoteChangable(String voteChangable) { + this.voteChangable = voteChangable; + } + + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + /** + * @return Returns the toolContentUID. + */ + public String getToolContentUID() { + return toolContentUID; + } + /** + * @param toolContentUID The toolContentUID to set. + */ + public void setToolContentUID(String toolContentUID) { + this.toolContentUID = toolContentUID; + } + + /** + * @return Returns the previewOnly. + */ + public String getPreviewOnly() { + return previewOnly; + } + /** + * @param previewOnly The previewOnly to set. + */ + public void setPreviewOnly(String previewOnly) { + this.previewOnly = previewOnly; + } + + /** + * @return Returns the totalQuestionCount. + */ + public String getTotalQuestionCount() { + return totalQuestionCount; + } + /** + * @param totalQuestionCount The totalQuestionCount to set. + */ + public void setTotalQuestionCount(String totalQuestionCount) { + this.totalQuestionCount = totalQuestionCount; + } + + /** + * @return Returns the listUserEntries. + */ + public List getListUserEntries() { + return listUserEntries; + } + /** + * @param listUserEntries The listUserEntries to set. + */ + public void setListUserEntries(List listUserEntries) { + this.listUserEntries = listUserEntries; + } + public int compareTo(Object o) + { + VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = (VoteGeneralLearnerFlowDTO) o; + + if (voteGeneralLearnerFlowDTO == null) + return 1; + else + return 0; + } + + public String toString() { + return new ToStringBuilder(this) + .append("activityInstructions: ", activityInstructions) + .append("activityTitle: ", activityTitle) + .append("revisitingUser: ", revisitingUser) + .append("userEntry: ", userEntry) + .append("castVoteCount: ", castVoteCount) + .append("maxNominationCountReached: ", maxNominationCountReached) + .append("activityRunOffline: ", activityRunOffline) + .append("toolSessionID: ", toolSessionID) + .append("learningMode: ", learningMode) + .append("maxNominationCount: ", maxNominationCount) + .append("allowTextEntry: ", allowTextEntry) + .append("lockOnFinish: ", lockOnFinish) + .append("voteChangable: ", voteChangable) + .append("toolContentID: ", toolContentID) + .append("toolContentUID: ", toolContentUID) + .append("totalQuestionCount: ", totalQuestionCount) + .append("requestLearningReport: ", requestLearningReport) + .append("requestLearningReportProgress: ", requestLearningReportProgress) + .append("nominationsSubmited: ", nominationsSubmited) + .append("mapGeneralCheckedOptionsContent: ", mapGeneralCheckedOptionsContent) + .append("mapStandardNominationsContent: ", mapStandardNominationsContent) + .append("mapStandardNominationsHTMLedContent: ", mapStandardNominationsHTMLedContent) + .append("mapStandardRatesContent: ", mapStandardRatesContent) + .append("mapStandardUserCount: ", mapStandardUserCount) + .append("mapStandardQuestionUid: ", mapStandardQuestionUid) + .append("mapStandardToolSessionUid: ", mapStandardToolSessionUid) + .append("listMonitoredAnswersContainerDto: ", listMonitoredAnswersContainerDto) + .append("listUserEntries: ", listUserEntries) + .toString(); + } + + + /** + * @return Returns the nominationsSubmited. + */ + public String getNominationsSubmited() { + return nominationsSubmited; + } + /** + * @param nominationsSubmited The nominationsSubmited to set. + */ + public void setNominationsSubmited(String nominationsSubmited) { + this.nominationsSubmited = nominationsSubmited; + } + /** + * @return Returns the requestLearningReport. + */ + public String getRequestLearningReport() { + return requestLearningReport; + } + /** + * @param requestLearningReport The requestLearningReport to set. + */ + public void setRequestLearningReport(String requestLearningReport) { + this.requestLearningReport = requestLearningReport; + } + /** + * @return Returns the requestLearningReportProgress. + */ + public String getRequestLearningReportProgress() { + return requestLearningReportProgress; + } + /** + * @param requestLearningReportProgress The requestLearningReportProgress to set. + */ + public void setRequestLearningReportProgress( + String requestLearningReportProgress) { + this.requestLearningReportProgress = requestLearningReportProgress; + } + /** + * @return Returns the mapStandardNominationsContent. + */ + public Map getMapStandardNominationsContent() { + return mapStandardNominationsContent; + } + /** + * @param mapStandardNominationsContent The mapStandardNominationsContent to set. + */ + public void setMapStandardNominationsContent( + Map mapStandardNominationsContent) { + this.mapStandardNominationsContent = mapStandardNominationsContent; + } + /** + * @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 listMonitoredAnswersContainerDto. + */ + public List getListMonitoredAnswersContainerDto() { + return listMonitoredAnswersContainerDto; + } + /** + * @param listMonitoredAnswersContainerDto The listMonitoredAnswersContainerDto to set. + */ + public void setListMonitoredAnswersContainerDto( + List listMonitoredAnswersContainerDto) { + this.listMonitoredAnswersContainerDto = listMonitoredAnswersContainerDto; + } + /** + * @return Returns the mapGeneralCheckedOptionsContent. + */ + public Map getMapGeneralCheckedOptionsContent() { + return mapGeneralCheckedOptionsContent; + } + /** + * @param mapGeneralCheckedOptionsContent The mapGeneralCheckedOptionsContent to set. + */ + public void setMapGeneralCheckedOptionsContent( + Map mapGeneralCheckedOptionsContent) { + this.mapGeneralCheckedOptionsContent = mapGeneralCheckedOptionsContent; + } + /** + * @return Returns the mapStandardQuestionUid. + */ + public Map getMapStandardQuestionUid() { + return mapStandardQuestionUid; + } + /** + * @param mapStandardQuestionUid The mapStandardQuestionUid to set. + */ + public void setMapStandardQuestionUid(Map mapStandardQuestionUid) { + this.mapStandardQuestionUid = mapStandardQuestionUid; + } + /** + * @return Returns the mapStandardToolSessionUid. + */ + public Map getMapStandardToolSessionUid() { + return mapStandardToolSessionUid; + } + /** + * @param mapStandardToolSessionUid The mapStandardToolSessionUid to set. + */ + public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { + this.mapStandardToolSessionUid = mapStandardToolSessionUid; + } +} Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/Attic/VoteUtils.java,v diff -u -r1.13 -r1.14 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java 14 Jul 2006 04:50:06 -0000 1.13 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java 11 Aug 2006 12:34:07 -0000 1.14 @@ -125,7 +125,7 @@ return (DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); } - public static void persistInSessionTimeZone(HttpServletRequest request) + public static void saveTimeZone(HttpServletRequest request) { TimeZone timeZone=TimeZone.getDefault(); logger.debug("current timezone: " + timeZone.getDisplayName()); @@ -235,7 +235,7 @@ } - public static void persistInSessionRichText(HttpServletRequest request) + public static void saveInSessionRichText(HttpServletRequest request) { logger.debug("doing persistRichText: "); String richTextTitle = request.getParameter(TITLE); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java,v diff -u -r1.40 -r1.41 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 1 Jul 2006 14:30:41 -0000 1.40 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 11 Aug 2006 12:34:07 -0000 1.41 @@ -154,11 +154,11 @@ } - public VoteContent retrieveVote(Long toolContentId) throws VoteApplicationException + public VoteContent retrieveVote(Long toolContentID) throws VoteApplicationException { try { - return voteContentDAO.findVoteContentById(toolContentId); + return voteContentDAO.findVoteContentById(toolContentID); } catch (DataAccessException e) { @@ -538,11 +538,11 @@ } } - public VoteQueUsr retrieveVoteQueUsr(Long userId) throws VoteApplicationException + public VoteQueUsr retrieveVoteQueUsr(Long userID) throws VoteApplicationException { try { - VoteQueUsr voteQueUsr=voteUserDAO.findVoteUserById(userId); + VoteQueUsr voteQueUsr=voteUserDAO.findVoteUserById(userID); return voteQueUsr; } catch (DataAccessException e) @@ -1174,11 +1174,11 @@ } } - public int getLastNominationCount(Long userId) throws VoteApplicationException + public int getLastNominationCount(Long userID) throws VoteApplicationException { try { - int lastNomCount=voteUsrAttemptDAO.getLastNominationCount(userId); + int lastNomCount=voteUsrAttemptDAO.getLastNominationCount(userID); return lastNomCount; } catch (DataAccessException e) @@ -1497,23 +1497,23 @@ /** * implemented as part of the tool contract. Removes content and uploaded files from the content repository. - * removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException + * removeToolContent(Long toolContentID, boolean removeSessionData) throws SessionDataExistsException, ToolException * @param toContentId * @param removeSessionData * @return * @throws ToolException */ - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException + public void removeToolContent(Long toolContentID, boolean removeSessionData) throws SessionDataExistsException, ToolException { - logger.debug("start of removeToolContent with toolContentId: " + toolContentId + "removeSessionData: " + removeSessionData); + logger.debug("start of removeToolContent with toolContentID: " + toolContentID + "removeSessionData: " + removeSessionData); - if (toolContentId == null) + if (toolContentID == null) { - logger.error("toolContentId is null"); - throw new ToolException("toolContentId is missing"); + logger.error("toolContentID is null"); + throw new ToolException("toolContentID is missing"); } - VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentID); logger.debug("retrieving voteContent: " + voteContent); if (voteContent != null) @@ -1568,34 +1568,34 @@ } } } - logger.debug("removed all existing responses of toolContent with toolContentId:" + - toolContentId); - voteContentDAO.removeVoteById(toolContentId); + logger.debug("removed all existing responses of toolContent with toolContentID:" + + toolContentID); + voteContentDAO.removeVoteById(toolContentID); logger.debug("removed voteContent:" + voteContent); } else { logger.error("Warning!!!, We should have not come here. voteContent is null."); - throw new ToolException("toolContentId is missing"); + throw new ToolException("toolContentID is missing"); } } /** * Export the XML fragment for the tool's content, along with any files needed * for the content. - * @throws DataMissingException if no tool content matches the toolSessionId + * @throws DataMissingException if no tool content matches the toolSessionID * @throws ToolException if any other error occurs */ - public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException { - VoteContent toolContentObj = voteContentDAO.findVoteContentById(toolContentId); + public void exportToolContent(Long toolContentID, String rootPath) throws DataMissingException, ToolException { + VoteContent toolContentObj = voteContentDAO.findVoteContentById(toolContentID); if(toolContentObj == null) - throw new DataMissingException("Unable to find tool content by given id :" + toolContentId); + throw new DataMissingException("Unable to find tool content by given id :" + toolContentID); try { //set ToolContentHandler as null to avoid copy file node in repository again. - toolContentObj = VoteContent.newInstance(null,toolContentObj,toolContentId); + toolContentObj = VoteContent.newInstance(null,toolContentObj,toolContentID); //clear unnecessary information attach toolContentObj.setVoteSessions(null); @@ -1604,7 +1604,7 @@ que.setMcUsrAttempts(null); } exportContentService.registerFileClassForExport(VoteUploadedFile.class.getName(),"uuid",null); - exportContentService.exportToolContent( toolContentId, toolContentObj,voteToolContentHandler, rootPath); + exportContentService.exportToolContent( toolContentID, toolContentObj,voteToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); } catch (ItemNotFoundException e) { @@ -1619,7 +1619,7 @@ * for the content. * @throws ToolException if any other error occurs */ - public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath) throws ToolException { + public void importToolContent(Long toolContentID, Integer newUserUid, String toolContentPath) throws ToolException { try { exportContentService.registerFileClassForImport(VoteUploadedFile.class.getName() ,"uuid",null,"filename","fileProperty",null,null); @@ -1629,8 +1629,8 @@ throw new ImportToolContentException("Import Vote tool content failed. Deserialized object is " + toolPOJO); VoteContent toolContentObj = (VoteContent) toolPOJO; -// reset it to new toolContentId - toolContentObj.setVoteContentId(toolContentId); +// reset it to new toolContentID + toolContentObj.setVoteContentId(toolContentID); toolContentObj.setCreatedBy(newUserUid); voteContentDAO.saveVoteContent(toolContentObj); @@ -1641,126 +1641,126 @@ /** * Implemented as part of the tool contract. Sets the defineLater to true on this content. - * setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException - * @param toolContentId + * setAsDefineLater(Long toolContentID) throws DataMissingException, ToolException + * @param toolContentID * @return * @throws ToolException */ - public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException + public void setAsDefineLater(Long toolContentID) throws DataMissingException, ToolException { - logger.debug("request for setAsDefineLater with toolContentId: " + toolContentId); - if (toolContentId == null) + logger.debug("request for setAsDefineLater with toolContentID: " + toolContentID); + if (toolContentID == null) { - logger.error("throwing DataMissingException: WARNING!: retrieved toolContentId is null."); - throw new DataMissingException("toolContentId is missing"); + logger.error("throwing DataMissingException: WARNING!: retrieved toolContentID is null."); + throw new DataMissingException("toolContentID is missing"); } - VoteContent voteContent=retrieveVote(toolContentId); + VoteContent voteContent=retrieveVote(toolContentID); if (voteContent == null) { logger.error("throwing DataMissingException: WARNING!: retrieved voteContent is null."); throw new DataMissingException("voteContent is missing"); } voteContent.setDefineLater(true); saveVoteContent(voteContent); - logger.debug("success: end of setAsDefineLater on toolContentId:" + toolContentId); + logger.debug("success: end of setAsDefineLater on toolContentID:" + toolContentID); } /** * Implemented as part of the tool contract. Sets the runOffline to true on this content. - * setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException + * setAsRunOffline(Long toolContentID) throws DataMissingException, ToolException * - * @param toolContentId + * @param toolContentID * return * @throws ToolException */ - public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException + public void setAsRunOffline(Long toolContentID) throws DataMissingException, ToolException { - logger.debug("request for setAsRunOffline with toolContentId:" + toolContentId); - if (toolContentId == null) + logger.debug("request for setAsRunOffline with toolContentID:" + toolContentID); + if (toolContentID == null) { - logger.error("throwing DataMissingException: WARNING!: retrieved toolContentId is null."); - throw new DataMissingException("toolContentId is missing"); + logger.error("throwing DataMissingException: WARNING!: retrieved toolContentID is null."); + throw new DataMissingException("toolContentID is missing"); } - VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentID); if (voteContent == null) { logger.error("throwing DataMissingException: WARNING!: retrieved voteContent is null."); throw new DataMissingException("voteContent is missing"); } voteContent.setRunOffline(true); saveVoteContent(voteContent); - logger.debug("success: end of setAsRunOffline on toolContentId:" + toolContentId); + logger.debug("success: end of setAsRunOffline on toolContentID:" + toolContentID); } /** * it is possible that the tool session id already exists in the tool sessions table * as the users from the same session are involved. - * existsSession(long toolSessionId) - * @param toolSessionId + * existsSession(long toolSessionID) + * @param toolSessionID * @return boolean */ - public boolean existsSession(Long toolSessionId) + public boolean existsSession(Long toolSessionID) { - VoteSession voteSession= retrieveVoteSession(toolSessionId); + VoteSession voteSession= retrieveVoteSession(toolSessionID); if (voteSession == null) { - logger.error("voteSession does not exist yet: " + toolSessionId); + logger.error("voteSession does not exist yet: " + toolSessionID); return false; } else { - logger.debug("retrieving an existing voteSession: " + voteSession + " " + toolSessionId); + logger.debug("retrieving an existing voteSession: " + voteSession + " " + toolSessionID); } return true; } /** * Implemented as part of the tool contract. * Gets called only in the Learner mode. - * All the learners in the same group have the same toolSessionId. + * All the learners in the same group have the same toolSessionID. * - * @param toolSessionId the generated tool session id. + * @param toolSessionID the generated tool session id. * @param toolSessionName the tool session name. - * @param toolContentId the tool content id specified. + * @param toolContentID the tool content id specified. * @throws ToolException if an error occurs e.g. defaultContent is missing. * */ - public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException + public void createToolSession(Long toolSessionID, String toolSessionName, Long toolContentID) throws ToolException { - logger.debug("start of createToolSession with ids: " + toolSessionId + " and " + toolContentId); + logger.debug("start of createToolSession with ids: " + toolSessionID + " and " + toolContentID); logger.debug("toolSessionName: " + toolSessionName); - if (toolSessionId == null) + if (toolSessionID == null) { - logger.error("toolSessionId is null"); - throw new ToolException("toolSessionId is missing"); + logger.error("toolSessionID is null"); + throw new ToolException("toolSessionID is missing"); } long defaultContentId=0; - if (toolContentId == null) + if (toolContentID == null) { - logger.error("toolContentId is null."); + logger.error("toolContentID is null."); logger.error("attempt retrieving tool's default content id with signatute : " + MY_SIGNATURE); try { defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE); - toolContentId=new Long(defaultContentId); - logger.debug("updated toolContentId to: " + toolContentId); + toolContentID=new Long(defaultContentId); + logger.debug("updated toolContentID to: " + toolContentID); } catch(Exception e) { logger.error("default content id has not been setup for signature: " + MY_SIGNATURE); throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!"); } } - logger.debug("final toolSessionId and toolContentId: " + toolSessionId + " " + toolContentId); + logger.debug("final toolSessionID and toolContentID: " + toolSessionID + " " + toolContentID); - VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentId); + VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentID); logger.debug("retrieved voteContent: " + voteContent); if (voteContent == null) @@ -1771,28 +1771,28 @@ try { defaultContentId=getToolDefaultContentIdBySignature(MY_SIGNATURE); - toolContentId=new Long(defaultContentId); - logger.debug("updated toolContentId to: " + toolContentId); + toolContentID=new Long(defaultContentId); + logger.debug("updated toolContentID to: " + toolContentID); } catch(Exception e) { logger.error("default content id has not been setup for signature: " + MY_SIGNATURE); throw new ToolException("WARNING! default content has not been setup for signature" + MY_SIGNATURE + " Can't continue!"); } - voteContent = voteContentDAO.findVoteContentById(toolContentId); + voteContent = voteContentDAO.findVoteContentById(toolContentID); } logger.debug("final - retrieved voteContent: " + voteContent); /* * create a new a new tool session if it does not already exist in the tool session table */ - if (!existsSession(toolSessionId)) + if (!existsSession(toolSessionID)) { try { - VoteSession voteSession = new VoteSession(toolSessionId, + VoteSession voteSession = new VoteSession(toolSessionID, new Date(System.currentTimeMillis()), VoteSession.INCOMPLETE, toolSessionName, @@ -1815,26 +1815,26 @@ /** * Implemented as part of the tool contract. - * removeToolSession(Long toolSessionId) throws DataMissingException, ToolException - * @param toolSessionId - * @param toolContentId + * removeToolSession(Long toolSessionID) throws DataMissingException, ToolException + * @param toolSessionID + * @param toolContentID * return * @throws ToolException */ - public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException + public void removeToolSession(Long toolSessionID) throws DataMissingException, ToolException { - logger.debug("start of removeToolSession with id: " + toolSessionId); - if (toolSessionId == null) + logger.debug("start of removeToolSession with id: " + toolSessionID); + if (toolSessionID == null) { - logger.error("toolSessionId is null"); - throw new DataMissingException("toolSessionId is missing"); + logger.error("toolSessionID is null"); + throw new DataMissingException("toolSessionID is missing"); } VoteSession voteSession=null; try { - voteSession=retrieveVoteSession(toolSessionId); + voteSession=retrieveVoteSession(toolSessionID); logger.debug("retrieved voteSession: " + voteSession); } catch(VoteApplicationException e) @@ -1866,16 +1866,16 @@ /** * Implemtented as part of the tool contract. - * leaveToolSession(Long toolSessionId,Long learnerId) throws DataMissingException, ToolException - * @param toolSessionId + * leaveToolSession(Long toolSessionID,Long learnerId) throws DataMissingException, ToolException + * @param toolSessionID * @param learnerId * return String * @throws ToolException * */ - public String leaveToolSession(Long toolSessionId,Long learnerId) throws DataMissingException, ToolException + public String leaveToolSession(Long toolSessionID,Long learnerId) throws DataMissingException, ToolException { - logger.debug("start of leaveToolSession with toolSessionId:" + toolSessionId + " and learnerId:" + learnerId); + logger.debug("start of leaveToolSession with toolSessionID:" + toolSessionID + " and learnerId:" + learnerId); logger.debug("make sure learnerService is available. Is it?" + learnerService); if (learnerService == null) @@ -1887,16 +1887,16 @@ throw new DataMissingException("learnerId is missing"); } - if (toolSessionId == null) + if (toolSessionID == null) { - logger.error("toolSessionId is null"); - throw new DataMissingException("toolSessionId is missing"); + logger.error("toolSessionID is null"); + throw new DataMissingException("toolSessionID is missing"); } VoteSession voteSession=null; try { - voteSession=retrieveVoteSession(toolSessionId); + voteSession=retrieveVoteSession(toolSessionID); logger.debug("retrieved voteSession: " + voteSession); } catch(VoteApplicationException e) @@ -1911,7 +1911,7 @@ voteSessionDAO.updateVoteSession(voteSession); logger.debug("updated voteSession to COMPLETED" + voteSession); - String nextUrl= learnerService.completeToolSession(toolSessionId,learnerId); + String nextUrl= learnerService.completeToolSession(toolSessionID,learnerId); logger.debug("nextUrl: " + nextUrl); if (nextUrl == null) { @@ -1923,24 +1923,24 @@ /** - * exportToolSession(Long toolSessionId) throws DataMissingException, ToolException - * @param toolSessionId + * exportToolSession(Long toolSessionID) throws DataMissingException, ToolException + * @param toolSessionID * return ToolSessionExportOutputData * @throws ToolException */ - public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException + public ToolSessionExportOutputData exportToolSession(Long toolSessionID) throws DataMissingException, ToolException { throw new ToolException("not yet implemented"); } /** - * exportToolSession(Long toolSessionId) throws DataMissingException, ToolException - * @param toolSessionIds + * exportToolSession(Long toolSessionID) throws DataMissingException, ToolException + * @param toolSessionIDs * return ToolSessionExportOutputData * @throws ToolException */ - public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException + public ToolSessionExportOutputData exportToolSession(List toolSessionIDs) throws DataMissingException, ToolException { throw new ToolException("not yet implemented"); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java,v diff -u -r1.10 -r1.11 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 4 Aug 2006 09:43:26 -0000 1.10 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 11 Aug 2006 12:34:07 -0000 1.11 @@ -125,7 +125,8 @@ 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); + voteMonitoringAction.refreshSummaryData(request, content, voteService, true, true, + toolSessionID.toString(), userID.toString() , true, null); MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), voteSession.getUid()); logger.debug("post prepareChartDataForExport"); @@ -161,7 +162,7 @@ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); logger.debug("starting refreshSummaryData."); - voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false); + voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null); logger.debug("teacher uses content id: " + content.getVoteContentId()); MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/LearningUtil.java,v diff -u -r1.18 -r1.19 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 1 Jul 2006 16:40:57 -0000 1.18 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 11 Aug 2006 12:34:07 -0000 1.19 @@ -59,9 +59,9 @@ * @param checkedOptions collection of String display IDs to which to restrict the map (optional) * @return Map of display id -> nomination text. */ - public static Map buildQuestionContentMap(HttpServletRequest request, VoteContent voteContent, Collection
|
||||||||||||||||||||||
| |
|||||||||||||||||||||
@@ -119,17 +126,17 @@ |
-
-
|
| ||||||||||||||||
| ||||||||||||||||
- |
||||||||||||||||
|