Index: lams_tool_forum/.classpath =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/.classpath (.../.classpath) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_forum/.classpath (.../.classpath) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -2,7 +2,7 @@ - + Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java =================================================================== diff -u -r82bfa2d1d62378051c32cff20a826607fdf7a8e5 -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java (.../LearningController.java) (revision 82bfa2d1d62378051c32cff20a826607fdf7a8e5) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/LearningController.java (.../LearningController.java) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -676,11 +676,11 @@ * Display replay topic page. Message form subject will include parent topics same subject. */ @RequestMapping("/newReplyTopic") - public String newReplyTopic(@ModelAttribute MessageForm messageForm, HttpServletRequest request) { + public String newReplyTopic(@ModelAttribute("replyForm") MessageForm replyForm, HttpServletRequest request) { String sessionMapID = request.getParameter(ForumConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = getSessionMap(request, messageForm); - messageForm.setSessionMapID(sessionMapID); + SessionMap sessionMap = getSessionMap(request, replyForm); + replyForm.setSessionMapID(sessionMapID); Long parentId = WebUtil.readLongParam(request, ForumConstants.ATTR_PARENT_TOPIC_ID); sessionMap.put(ForumConstants.ATTR_PARENT_TOPIC_ID, parentId); @@ -696,9 +696,9 @@ // echo back current topic subject to web page if (reTitle != null && !reTitle.trim().startsWith("Re:")) { - messageForm.getMessage().setSubject("Re:" + reTitle); + replyForm.getMessage().setSubject("Re:" + reTitle); } else { - messageForm.getMessage().setSubject(reTitle); + replyForm.getMessage().setSubject(reTitle); } } @@ -717,14 +717,14 @@ * Create a replayed topic for a parent topic. */ @RequestMapping("/replyTopic") - public String replyTopic(@ModelAttribute MessageForm messageForm, HttpServletRequest request, + public String replyTopic(@ModelAttribute("replyForm") MessageForm replyForm, HttpServletRequest request, HttpServletResponse response) throws InterruptedException { - SessionMap sessionMap = getSessionMap(request, messageForm); + SessionMap sessionMap = getSessionMap(request, replyForm); Long parentId = (Long) sessionMap.get(ForumConstants.ATTR_PARENT_TOPIC_ID); Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - Message message = messageForm.getMessage(); + Message message = replyForm.getMessage(); boolean isTestHarness = Boolean.valueOf(request.getParameter("testHarness")); if (isTestHarness) { message.setBody(request.getParameter("message.body__textarea")); @@ -736,7 +736,7 @@ ForumUser forumUser = getCurrentUser(request, sessionId); message.setCreatedBy(forumUser); message.setModifiedBy(forumUser); - setAttachment(messageForm, message); + setAttachment(replyForm, message); setMonitorMode(sessionMap, message); // save message into database @@ -751,7 +751,7 @@ ForumToolSession session = forumService.getSessionBySessionId(sessionId); Forum forum = session.getForum(); - setupViewTopicPagedDTOList(request, rootTopicId, messageForm.getSessionMapID(), forumUser, forum, null, null); + setupViewTopicPagedDTOList(request, rootTopicId, replyForm.getSessionMapID(), forumUser, forum, null, null); // notify learners and teachers Long forumId = (Long) sessionMap.get(ForumConstants.ATTR_FORUM_ID); @@ -765,14 +765,14 @@ */ @RequestMapping(path = "/replyTopicInline", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @ResponseBody - public String replyTopicInline(@ModelAttribute MessageForm messageForm, HttpServletRequest request, + public String replyTopicInline(@ModelAttribute("replyForm") MessageForm replyForm, HttpServletRequest request, HttpServletResponse response) throws InterruptedException, IOException { - SessionMap sessionMap = getSessionMap(request, messageForm); + SessionMap sessionMap = getSessionMap(request, replyForm); Long parentId = (Long) sessionMap.get(ForumConstants.ATTR_PARENT_TOPIC_ID); Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); - Message message = messageForm.getMessage(); + Message message = replyForm.getMessage(); boolean isTestHarness = Boolean.valueOf(request.getParameter("testHarness")); if (isTestHarness) { message.setBody(request.getParameter("message.body__textarea")); @@ -784,7 +784,7 @@ ForumUser forumUser = getCurrentUser(request, sessionId); message.setCreatedBy(forumUser); message.setModifiedBy(forumUser); - setAttachment(messageForm, message); + setAttachment(replyForm, message); setMonitorMode(sessionMap, message); // save message into database @@ -805,7 +805,7 @@ ObjectNode.put(ForumConstants.ATTR_NO_MORE_POSTS, noMorePosts); ObjectNode.put(ForumConstants.ATTR_NUM_OF_POSTS, numOfPosts); ObjectNode.put(ForumConstants.ATTR_THREAD_ID, newMessageSeq.getThreadMessage().getUid()); - ObjectNode.put(ForumConstants.ATTR_SESSION_MAP_ID, messageForm.getSessionMapID()); + ObjectNode.put(ForumConstants.ATTR_SESSION_MAP_ID, replyForm.getSessionMapID()); ObjectNode.put(ForumConstants.ATTR_ROOT_TOPIC_UID, rootTopicId); ObjectNode.put(ForumConstants.ATTR_PARENT_TOPIC_ID, newMessageSeq.getMessage().getParent().getUid()); Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java =================================================================== diff -u -re062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java (.../MonitoringController.java) (revision e062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/controller/MonitoringController.java (.../MonitoringController.java) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -696,7 +696,7 @@ // display root topic rather than leaf one Long rootTopicId = forumService.getRootTopicId(msg.getUid()); - String redirect = "redirect:/viewTopic.do"; + String redirect = "redirect:/monitoring/viewTopic.do"; redirect = WebUtil.appendParameterToURL(redirect, ForumConstants.ATTR_SESSION_MAP_ID, markForm.getSessionMapID()); redirect = WebUtil.appendParameterToURL(redirect, ForumConstants.ATTR_USER, user.toString()); Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/MessageForm.java =================================================================== diff -u -r82bfa2d1d62378051c32cff20a826607fdf7a8e5 -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/MessageForm.java (.../MessageForm.java) (revision 82bfa2d1d62378051c32cff20a826607fdf7a8e5) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/forms/MessageForm.java (.../MessageForm.java) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -28,15 +28,13 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.forum.persistence.Attachment; -import org.lamsfoundation.lams.tool.forum.persistence.Forum; import org.lamsfoundation.lams.tool.forum.persistence.Message; import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.FileValidatorSpringUtil; import org.lamsfoundation.lams.util.MessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; +import org.springframework.validation.Errors; import org.springframework.web.multipart.MultipartFile; /** @@ -75,24 +73,23 @@ * MessageForm validation method from STRUCT interface. * */ - public MultiValueMap validate(HttpServletRequest request) { + public Errors validate(HttpServletRequest request, Errors errors) { - MultiValueMap errorMap = new LinkedMultiValueMap<>(); try { if (StringUtils.isBlank(message.getSubject())) { - errorMap.add("message.subject", messageService.getMessage("error.subject.required")); + errors.reject("message.subject", messageService.getMessage("error.subject.required")); } boolean isTestHarness = Boolean.valueOf(request.getParameter("testHarness")); if (!isTestHarness && StringUtils.isBlank(message.getBody())) { - errorMap.add("message.body", messageService.getMessage("error.body.required")); + errors.reject("message.body", messageService.getMessage("error.body.required")); } // validate item size boolean largeFile = true; if (request.getRequestURI().indexOf("/learning/") != -1) { if ((this.getAttachmentFile() != null) && FileUtil.isExecutableFile(this.getAttachmentFile().getOriginalFilename())) { - errorMap.add("message.attachment", messageService.getMessage("error.attachment.executable")); + errors.reject("message.attachment", messageService.getMessage("error.attachment.executable")); } largeFile = false; } @@ -102,7 +99,7 @@ } catch (Exception e) { MessageForm.logger.error("", e); } - return errorMap; + return errors; } // -------------------------get/set methods---------------- Index: lams_tool_forum/web/jsps/authoring/message/edit.jsp =================================================================== diff -u -r82bfa2d1d62378051c32cff20a826607fdf7a8e5 -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision 82bfa2d1d62378051c32cff20a826607fdf7a8e5) +++ lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -19,7 +19,7 @@ "> - +
Index: lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp =================================================================== diff -u -re062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp (.../pedagogicalPlannerForm.jsp) (revision e062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf) +++ lams_tool_forum/web/jsps/authoring/pedagogicalPlannerForm.jsp (.../pedagogicalPlannerForm.jsp) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -37,7 +37,7 @@ + focus="textarea#messageBody" enctype="multipart/form-data" modelAttribute="replyForm" id="replyForm" > Index: lams_tool_forum/web/jsps/monitoring/editactivity.jsp =================================================================== diff -u -re062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/web/jsps/monitoring/editactivity.jsp (.../editactivity.jsp) (revision e062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf) +++ lams_tool_forum/web/jsps/monitoring/editactivity.jsp (.../editactivity.jsp) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -1,5 +1,14 @@ <%@ include file="/common/taglibs.jsp"%> + + + + + + + + + Index: lams_tool_forum/web/jsps/monitoring/summary.jsp =================================================================== diff -u -re062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf -r9f988c0cf9ce45c8812158692f38e74688b96ea4 --- lams_tool_forum/web/jsps/monitoring/summary.jsp (.../summary.jsp) (revision e062c5aeec4bd7e7f970ae5e907e8a7e59edaeaf) +++ lams_tool_forum/web/jsps/monitoring/summary.jsp (.../summary.jsp) (revision 9f988c0cf9ce45c8812158692f38e74688b96ea4) @@ -143,6 +143,14 @@ }); }) + + function downloadMarks(sessionId){ + var url = ""; + var reqIDVar = new Date(); + var param = "?toolSessionID=" + sessionId +"&reqID="+reqIDVar.getTime(); + url = url + param; + location.href = url; + } @@ -216,11 +224,12 @@ - - - " /> - - + + + + +