Index: lams_tool_vote/conf/language/ApplicationResources.properties =================================================================== diff -u -r2a908e1de2e7fea80b982480879f7a3ec972386a -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 2a908e1de2e7fea80b982480879f7a3ec972386a) +++ lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -131,6 +131,8 @@ label.refresh =Refresh label.continue =Continue label.reflect =Reflect on Voting +label.notebook.entries = Notebook Entries +label.reflection = Reflection +label.learner =Learner - #======= End labels: Exported 136 labels for en AU ===== Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r5399ff761841ef5f7a767b9df7828fdb4f783aa6 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 5399ff761841ef5f7a767b9df7828fdb4f783aa6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -101,6 +101,10 @@ public static final String OFFLINE_INSTRUCTIONS_KEY = "offlineInstructionsKey"; public static final String EXPORT_PORTFOLIO_DTO = "exportPortfolioDto"; + public static final String NOTEBOOK ="notebook"; + public static final String ENTRY_TEXT ="entryText"; + public static final String REFLECTION_SUBJECT ="reflectionSubject"; + /* * authoring mode controllers Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralLearnerFlowDTO.java =================================================================== diff -u -r1584ef78e1cf4a5bbdc726bda5345d69be190801 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralLearnerFlowDTO.java (.../VoteGeneralLearnerFlowDTO.java) (revision 1584ef78e1cf4a5bbdc726bda5345d69be190801) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralLearnerFlowDTO.java (.../VoteGeneralLearnerFlowDTO.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -67,6 +67,14 @@ protected String voteChangable; + protected String notebookEntriesVisible; + + protected String reflection; + + protected String reflectionSubject; + + protected String notebookEntry; + protected String totalQuestionCount; protected String previewOnly; @@ -513,4 +521,54 @@ public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { this.mapStandardToolSessionUid = mapStandardToolSessionUid; } + + /** + * @return Returns the notebookEntriesVisible. + */ + public String getNotebookEntriesVisible() { + return notebookEntriesVisible; + } + /** + * @param notebookEntriesVisible The notebookEntriesVisible to set. + */ + public void setNotebookEntriesVisible(String notebookEntriesVisible) { + this.notebookEntriesVisible = notebookEntriesVisible; + } + /** + * @return Returns the notebookEntry. + */ + public String getNotebookEntry() { + return notebookEntry; + } + /** + * @param notebookEntry The notebookEntry to set. + */ + public void setNotebookEntry(String notebookEntry) { + this.notebookEntry = notebookEntry; + } + /** + * @return Returns the reflection. + */ + public String getReflection() { + return reflection; + } + /** + * @param reflection The reflection to set. + */ + public void setReflection(String reflection) { + this.reflection = reflection; + } + /** + * @return Returns the reflectionSubject. + */ + public String getReflectionSubject() { + return reflectionSubject; + } + /** + * @param reflectionSubject The reflectionSubject to set. + */ + public void setReflectionSubject(String reflectionSubject) { + this.reflectionSubject = reflectionSubject; + } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r5c9c47d5e75fb6d0229862af0f08c84229b6056c -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 5c9c47d5e75fb6d0229862af0f08c84229b6056c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -53,7 +53,17 @@ public abstract class VoteUtils implements VoteAppConstants { static Logger logger = Logger.getLogger(VoteUtils.class.getName()); + + public static String replaceNewLines(String text) + { + logger.debug("using text: " + text); + String newText = text.replaceAll("\n","
"); + logger.debug("newText: " + newText); + + return newText; + } + /** * * getGMTDateTime(HttpServletRequest request) @@ -69,6 +79,7 @@ return date; } + public static UserDTO getToolUser() { @@ -182,6 +193,7 @@ voteAuthoringForm.setAllowTextEntry(defaultVoteContent.isAllowText()?ON:OFF); voteAuthoringForm.setVoteChangable(defaultVoteContent.isVoteChangable()?ON:OFF); voteAuthoringForm.setLockOnFinish(defaultVoteContent.isLockOnFinish()?ON:OFF); + voteAuthoringForm.setReflect(defaultVoteContent.isReflect()?ON:OFF); voteAuthoringForm.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); voteAuthoringForm.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java =================================================================== diff -u -r5399ff761841ef5f7a767b9df7828fdb4f783aa6 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 5399ff761841ef5f7a767b9df7828fdb4f783aa6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -62,7 +62,7 @@ private String instructions; - /** nullable persistent field */ + /** nullable persistent field */ private boolean defineLater; /** nullable persistent field */ @@ -110,8 +110,8 @@ /** full constructor */ public VoteContent(Long voteContentId, String content, String title, String instructions, boolean defineLater, boolean runOffline, - Date creationDate, Date updateDate, boolean voteChangable, boolean allowText,boolean reflect, String maxNominationCount, - long createdBy, boolean lockOnFinish, boolean contentInUse, String offlineInstructions, + Date creationDate, Date updateDate, boolean voteChangable, boolean allowText,boolean reflect, String reflectionSubject, + String maxNominationCount, long createdBy, boolean lockOnFinish, boolean contentInUse, String offlineInstructions, String onlineInstructions, Set voteQueContents, Set voteSessions, Set voteAttachments) { this.voteContentId = voteContentId; @@ -126,6 +126,7 @@ this.maxNominationCount=maxNominationCount; this.allowText=allowText; this.reflect=reflect; + this.reflectionSubject=reflectionSubject; this.createdBy = createdBy; this.lockOnFinish = lockOnFinish; this.contentInUse = contentInUse; @@ -174,6 +175,7 @@ vote.isVoteChangable(), vote.isAllowText(), vote.isReflect(), + vote.getReflectionSubject(), vote.getMaxNominationCount(), vote.getCreatedBy(), vote.isLockOnFinish(), Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== diff -u -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -30,6 +30,7 @@ import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.lesson.Lesson; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.IToolVO; import org.lamsfoundation.lams.tool.ToolSessionExportOutputData; import org.lamsfoundation.lams.tool.exception.DataMissingException; @@ -295,6 +296,14 @@ public List getSessionsFromContent(VoteContent mcContent) throws VoteApplicationException; public Set getAttemptsForUserAndSession(final Long queUsrId, final Long voteSessionId) throws VoteApplicationException; + + public Long createNotebookEntry(Long id, Integer idType, String signature, + Integer userID, String entry); + + public NotebookEntry getEntry(Long id, Integer idType, String signature, + Integer userID); + + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r24ca84b9e61b98c068eaa369cb194a35e5511162 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 24ca84b9e61b98c068eaa369cb194a35e5511162) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -51,6 +51,8 @@ import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException; import org.lamsfoundation.lams.lesson.Lesson; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; import org.lamsfoundation.lams.tool.IToolVO; import org.lamsfoundation.lams.tool.ToolContentImport102Manager; import org.lamsfoundation.lams.tool.ToolContentManager; @@ -117,7 +119,8 @@ private IAuditService auditService; private ILamsToolService toolService; private IExportToolContentService exportContentService; - + + private ICoreNotebookService coreNotebookService; private IToolContentHandler voteToolContentHandler = null; public VoteServicePOJO(){} @@ -2330,22 +2333,7 @@ } - /* - public List retrieveVoteUploadedOfflineFilesUuidPlusFilename(Long voteContentId) throws VoteApplicationException { - try - { - return voteUploadedFileDAO.retrieveVoteUploadedOfflineFilesUuidPlusFilename(voteContentId); - } - catch (DataAccessException e) - { - throw new VoteApplicationException("Exception occured when lams is loading vote uploaded offline file uuid plus filename: " - + e.getMessage(), - e); - } - } - */ - /** * @return Returns the logger. */ @@ -2622,6 +2610,21 @@ this.exportContentService = exportContentService; } + + /** + * @return Returns the coreNotebookService. + */ + public ICoreNotebookService getCoreNotebookService() { + return coreNotebookService; + } + /** + * @param coreNotebookService The coreNotebookService to set. + */ + public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { + this.coreNotebookService = coreNotebookService; + } + + /* ===============Methods implemented from ToolContentImport102Manager =============== */ @@ -2704,5 +2707,25 @@ // qaContent.setReflectInstructions(description); } - //========================================================================================= + public Long createNotebookEntry(Long id, Integer idType, String signature, + Integer userID, String entry) { + logger.debug("coreNotebookService: " + coreNotebookService); + return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); + } + + + + + public NotebookEntry getEntry(Long id, Integer idType, String signature, + Integer userID) { + + List list = coreNotebookService.getEntry(id, idType, signature, userID); + if (list == null || list.isEmpty()) { + return null; + } else { + return list.get(0); + } + } + + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml =================================================================== diff -u -r24ca84b9e61b98c068eaa369cb194a35e5511162 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (.../voteApplicationContext.xml) (revision 24ca84b9e61b98c068eaa369cb194a35e5511162) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (.../voteApplicationContext.xml) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -75,11 +75,12 @@ - + + Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -r369b6c2ca857c6b74ee143e081534f50b0b94106 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 369b6c2ca857c6b74ee143e081534f50b0b94106) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -878,6 +878,12 @@ String allowTextEntry=voteAuthoringForm.getAllowText(); logger.debug("allowTextEntry: " + allowTextEntry); + String reflect=voteAuthoringForm.getReflect(); + logger.debug("reflect: " + reflect); + + String reflectionSubject=voteAuthoringForm.getReflectionSubject(); + logger.debug("reflectionSubject: " + reflectionSubject); + String maxNomcount= voteAuthoringForm.getMaxNominationCount(); logger.debug("maxNomcount: " + maxNomcount); @@ -900,6 +906,7 @@ boolean voteChangableBoolean=false; boolean lockedOnFinishBoolean=false; boolean allowTextBoolean=false; + boolean reflectBoolean=false; if (setCommonContent) { @@ -911,6 +918,9 @@ if (allowTextEntry.equalsIgnoreCase(ON)) allowTextBoolean=true; + + if (reflect.equalsIgnoreCase(ON)) + reflectBoolean=true; } @@ -969,6 +979,8 @@ voteContent.setVoteChangable(voteChangableBoolean); voteContent.setLockOnFinish(lockedOnFinishBoolean); voteContent.setAllowText(allowTextBoolean); + voteContent.setReflect(reflectBoolean); + voteContent.setReflectionSubject(reflectionSubject); voteContent.setMaxNominationCount(maxNomcount); voteContent.setOnlineInstructions(richTextOnlineInstructions); voteContent.setOfflineInstructions(richTextOfflineInstructions); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -r93c2c8a448c8530551612078fac7c7dd63401dfa -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 93c2c8a448c8530551612078fac7c7dd63401dfa) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -29,10 +29,12 @@ import java.util.Set; import java.util.Map; import java.util.TreeMap; +import java.util.TreeSet; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.Globals; @@ -41,6 +43,7 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; @@ -56,7 +59,10 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; /** *

Action class that controls the logic of tool behavior.

@@ -269,10 +275,13 @@ voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); logger.debug("end of prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); - voteLearningForm.resetCommands(); + + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + + voteLearningForm.resetCommands(); - - logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); + logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); @@ -426,6 +435,9 @@ setContentInUse(request, voteService, toolContentID); logger.debug("requested redoQuestionsOk, user is sure to redo the questions."); + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + voteLearningForm.resetCommands(); logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); @@ -472,6 +484,36 @@ VoteQueUsr voteQueUsr=voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); logger.debug("voteQueUsr:" + voteQueUsr); + + /* it is possible that voteQueUsr can be null if the content is set as runoffline and reflection is on*/ + if (voteQueUsr == null) + { + logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); + HttpSession ss = SessionManager.getSession(); + + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName=toolUser.getLogin(); + String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId=new Long(toolUser.getUserID().longValue()); + logger.debug("retrieving toolUser fullname: " + fullName); + + voteQueUsr= new VoteQueUsr(new Long(userID), + userName, + fullName, + voteSession, + new TreeSet()); + voteService.createVoteQueUsr(voteQueUsr); + logger.debug("createVoteQueUsr - voteQueUsr: " + voteQueUsr); + logger.debug("session uid: " + voteSession.getUid()); + } + + voteQueUsr.setResponseFinalised(true); voteService.updateVoteUser(voteQueUsr); logger.debug("user's response is finalised:" + voteQueUsr); @@ -488,7 +530,10 @@ voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); logger.debug("attempting to leave/complete session with toolSessionID:" + toolSessionID + " and userID:"+userID); - + + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO,voteGeneralLearnerFlowDTO); @@ -726,6 +771,9 @@ MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + logger.debug("fwding to INDIVIDUAL_REPORT: " + INDIVIDUAL_REPORT); voteLearningForm.resetCommands(); @@ -796,6 +844,9 @@ voteLearningForm.setUserEntry(""); + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + logger.debug("fwd'ing to LOAD_LEARNER : " + LOAD_LEARNER); voteLearningForm.resetCommands(); @@ -818,8 +869,8 @@ voteService.saveVoteContent(voteContent); } + - /** * persists error messages to request scope * @param request @@ -832,8 +883,109 @@ logger.debug("add " + message +" to ActionMessages:"); saveErrors(request,errors); } + + public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, ToolException + { + logger.debug("dispatching submitReflection..."); + VoteLearningForm voteLearningForm = (VoteLearningForm) form; + + repopulateRequestParameters(request,voteLearningForm); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + voteLearningForm.setToolSessionID(toolSessionID); + + String userID=request.getParameter("userID"); + logger.debug("userID: " + userID); + voteLearningForm.setUserID(userID); + + String reflectionEntry=request.getParameter(ENTRY_TEXT); + logger.debug("reflectionEntry: " + reflectionEntry); + + VoteSession voteSession=voteService.retrieveVoteSession(new Long(toolSessionID)); + logger.debug("retrieving voteSession: " + voteSession); + + VoteQueUsr voteQueUsr=voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); + logger.debug("voteQueUsr:" + voteQueUsr); + + /* it is possible that voteQueUsr can be null if the content is set as runoffline and reflection is on*/ + if (voteQueUsr == null) + { + logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); + HttpSession ss = SessionManager.getSession(); + + UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); + logger.debug("retrieving toolUser: " + toolUser); + logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); + logger.debug("retrieving toolUser username: " + toolUser.getLogin()); + + String userName=toolUser.getLogin(); + String fullName= toolUser.getFirstName() + " " + toolUser.getLastName(); + logger.debug("retrieving toolUser fullname: " + fullName); + + Long userId=new Long(toolUser.getUserID().longValue()); + logger.debug("retrieving toolUser fullname: " + fullName); + + voteQueUsr= new VoteQueUsr(new Long(userID), + userName, + fullName, + voteSession, + new TreeSet()); + voteService.createVoteQueUsr(voteQueUsr); + logger.debug("createVoteQueUsr - voteQueUsr: " + voteQueUsr); + logger.debug("session uid: " + voteSession.getUid()); + } + + logger.debug("voteQueUsr:" + voteQueUsr); + logger.debug("toolSessionID:" + toolSessionID); + logger.debug("CoreNotebookConstants.NOTEBOOK_TOOL:" + CoreNotebookConstants.NOTEBOOK_TOOL); + logger.debug("MY_SIGNATURE:" + MY_SIGNATURE); + logger.debug("userID:" + userID); + logger.debug("reflectionEntry:" + reflectionEntry); + + voteService.createNotebookEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID), reflectionEntry); + + voteLearningForm.resetUserActions(); /*resets all except submitAnswersContent */ + return learnerFinished(mapping, form, request, response); + } + + + public ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, ToolException + { + logger.debug("dispatching forwardtoReflection..."); + VoteLearningForm voteLearningForm = (VoteLearningForm) form; + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + + String toolSessionID=request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); + logger.debug("toolSessionID: " + toolSessionID); + + VoteSession voteSession=voteService.retrieveVoteSession(new Long(toolSessionID)); + logger.debug("retrieving voteSession: " + voteSession); + + VoteContent voteContent=voteSession.getVoteContent(); + logger.debug("using voteContent: " + voteContent); + + VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO= new VoteGeneralLearnerFlowDTO(); + voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + + request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); + logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); + voteLearningForm.resetCommands(); + + logger.debug("fwd'ing to: " + NOTEBOOK); + return (mapping.findForward(NOTEBOOK)); + } + protected void repopulateRequestParameters(HttpServletRequest request, VoteLearningForm voteLearningForm) { logger.debug("starting repopulateRequestParameters"); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java =================================================================== diff -u -ra8e5c42d584e4b8b9b67224179acbc53850d279f -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision a8e5c42d584e4b8b9b67224179acbc53850d279f) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningForm.java (.../VoteLearningForm.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -82,14 +82,19 @@ protected String getPreviousQuestion; protected String endLearning; protected String refreshVotes; + protected String submitReflection; + protected String forwardtoReflection; + protected String reflection; + protected String nominationsSubmited; protected String revisitingUser; protected String maxNominationCountReached; protected int castVoteCount; protected Map mapGeneralCheckedOptionsContent; + protected String entryText; protected String userID; protected String toolSessionID; protected String learningMode; @@ -225,6 +230,8 @@ this.setDonePreview(null); this.setDoneLearnerProgress(null); this.setRefreshVotes(null); + this.setSubmitReflection(null); + this.setForwardtoReflection(null); } public void resetParameters() @@ -756,6 +763,32 @@ this.previewOnly = previewOnly; } + /** + * @return Returns the forwardtoReflection. + */ + public String getForwardtoReflection() { + return forwardtoReflection; + } + /** + * @param forwardtoReflection The forwardtoReflection to set. + */ + public void setForwardtoReflection(String forwardtoReflection) { + this.forwardtoReflection = forwardtoReflection; + } + /** + * @return Returns the submitReflection. + */ + public String getSubmitReflection() { + return submitReflection; + } + /** + * @param submitReflection The submitReflection to set. + */ + public void setSubmitReflection(String submitReflection) { + this.submitReflection = submitReflection; + } + + public String toString() { return new ToStringBuilder(this) .append("activityInstructions: ", activityInstructions) @@ -776,4 +809,28 @@ .toString(); } + /** + * @return Returns the entryText. + */ + public String getEntryText() { + return entryText; + } + /** + * @param entryText The entryText to set. + */ + public void setEntryText(String entryText) { + this.entryText = entryText; + } + /** + * @return Returns the reflection. + */ + public String getReflection() { + return reflection; + } + /** + * @param reflection The reflection to set. + */ + public void setReflection(String reflection) { + this.reflection = reflection; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r2a908e1de2e7fea80b982480879f7a3ec972386a -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 2a908e1de2e7fea80b982480879f7a3ec972386a) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -166,6 +166,8 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; @@ -282,6 +284,29 @@ voteGeneralLearnerFlowDTO.setToolContentUID(voteContent.getUid().toString()); + String userID=voteLearningForm.getUserID(); + logger.debug("userID: " + userID); + + logger.debug("is tool reflective: " + voteContent.isReflect()); + voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); + logger.debug("reflection subject: " + voteContent.getReflectionSubject()); + voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); + + logger.debug("attempt getting notebookEntry: "); + NotebookEntry notebookEntry = voteService.getEntry(new Long(toolSessionID), + CoreNotebookConstants.NOTEBOOK_TOOL, + MY_SIGNATURE, new Integer(userID)); + + logger.debug("notebookEntry: " + notebookEntry); + + if (notebookEntry != null) { + String notebookEntryPresentable=VoteUtils.replaceNewLines(notebookEntry.getEntry()); + voteGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); + } + + + + /* Is the request for a preview by the author? Preview The tool must be able to show the specified content as if it was running in a lesson. It will be the learner url with tool access mode set to ToolAccessMode.AUTHOR @@ -386,7 +411,7 @@ * his answers must be displayed read-only * */ - String userID=voteLearningForm.getUserID(); + logger.debug("userID:" + userID); logger.debug("voteSession uid :" + voteSession.getUid()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r2da37d46f5f9f140f21e1c7d93924f7a4ed6188a -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 2da37d46f5f9f140f21e1c7d93924f7a4ed6188a) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -498,6 +498,10 @@ voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); } + + voteAuthoringForm.setReflectionSubject(voteContent.getReflectionSubject()); + + /* * get the nominations */ Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== diff -u -r5399ff761841ef5f7a767b9df7828fdb4f783aa6 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 5399ff761841ef5f7a767b9df7828fdb4f783aa6) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -216,6 +216,12 @@ path="/learning/defineLater.jsp" redirect="false" /> + + + + + - + Index: lams_tool_vote/web/learning/AllNominations.jsp =================================================================== diff -u -r658c9122d9bbb47bd4c3e6a9431cf175ced2870e -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision 658c9122d9bbb47bd4c3e6a9431cf175ced2870e) +++ lams_tool_vote/web/learning/AllNominations.jsp (.../AllNominations.jsp) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -191,6 +191,30 @@ + + + + + + + + + + + + +
+ +
+ +
+ + + + + + + @@ -212,11 +236,19 @@ - - - + + + + + + + + + + + + + Index: lams_tool_vote/web/learning/Notebook.jsp =================================================================== diff -u --- lams_tool_vote/web/learning/Notebook.jsp (revision 0) +++ lams_tool_vote/web/learning/Notebook.jsp (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -0,0 +1,106 @@ +<%-- +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 +--%> + + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + <bean:message key="activity.title" /> + + + + + + +
+ +

+ +

+ + +
+ + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ + + +
+ + +
+
+ + + + +
+ +
+ + + + + + + + Index: lams_tool_vote/web/learning/RunOffline.jsp =================================================================== diff -u -r5399ff761841ef5f7a767b9df7828fdb4f783aa6 -rfadef2b7b1f00478057ecade707ca37aa24ebe15 --- lams_tool_vote/web/learning/RunOffline.jsp (.../RunOffline.jsp) (revision 5399ff761841ef5f7a767b9df7828fdb4f783aa6) +++ lams_tool_vote/web/learning/RunOffline.jsp (.../RunOffline.jsp) (revision fadef2b7b1f00478057ecade707ca37aa24ebe15) @@ -36,6 +36,15 @@ <bean:message key="activity.title" /> + + + @@ -45,10 +54,38 @@
-
-       -
+ + + + +
+       + + + + + +
+
+ + + + + + + + + + + + + +
+
+
+
+