Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180729.sql =================================================================== diff -u -r7ea9b852e5fe8dc5688f983f162064d862f147de -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180729.sql (.../patch20180729.sql) (revision 7ea9b852e5fe8dc5688f983f162064d862f147de) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180729.sql (.../patch20180729.sql) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -11,7 +11,7 @@ learner_progress_url = 'tool/laqa11/learning/learning.do?mode=teacher', monitor_url = 'tool/laqa11/monitoring/monitoring.do', pedagogical_planner_url = 'tool/laqa11/pedagogicalPlanner/initPedagogicalPlannerForm.do', - admin_url= 'tool/laqa11/admin/admin.do' + admin_url= 'tool/laqa11/admin.do' WHERE tool_signature = 'laqa11'; ----------------------Put all sql statements above here------------------------- Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaAdminController.java =================================================================== diff -u -r7ea9b852e5fe8dc5688f983f162064d862f147de -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaAdminController.java (.../QaAdminController.java) (revision 7ea9b852e5fe8dc5688f983f162064d862f147de) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaAdminController.java (.../QaAdminController.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -85,7 +85,7 @@ /** * Sets up the admin page */ - @RequestMapping("/admin") + @RequestMapping("") public String unspecified(QaAdminForm adminForm, HttpServletRequest request) { QaConfigItem enableQaWizard = qaService.getConfigItem(QaConfigItem.KEY_ENABLE_QAWIZARD); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaLearningController.java =================================================================== diff -u -r8be1632bead5d286d578fc73a79fcd662af012d5 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaLearningController.java (.../QaLearningController.java) (revision 8be1632bead5d286d578fc73a79fcd662af012d5) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaLearningController.java (.../QaLearningController.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -868,7 +868,7 @@ QaQueUsr qaQueUsr = getCurrentUser(toolSessionID); //prohibit users from submitting answers after response is finalized but Resubmit button is not pressed (e.g. using 2 browsers) if (qaQueUsr.isResponseFinalized()) { - String redirectURL = "redirect:learning/learningIndex.jsp"; + String redirectURL = "redirect:learning/LearnerRep.jsp"; redirectURL = WebUtil.appendParameterToURL(redirectURL, AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionID.toString()); redirectURL = WebUtil.appendParameterToURL(redirectURL, QaAppConstants.MODE, "learner"); @@ -880,6 +880,7 @@ storeSequentialAnswer(qaLearningForm, request, generalLearnerFlowDTO, true); qaLearningForm.resetAll(); + request.setAttribute("learningForm",qaLearningForm); return "learning/AnswersContent"; } @@ -893,7 +894,7 @@ * @param getNextQuestion * @return */ - private Object[] storeSequentialAnswer(@ModelAttribute("qaLearningForm") QaLearningForm qaLearningForm, + private Object[] storeSequentialAnswer(QaLearningForm qaLearningForm, HttpServletRequest request, GeneralLearnerFlowDTO generalLearnerFlowDTO, boolean getNextQuestion) { String httpSessionID = qaLearningForm.getHttpSessionID(); SessionMap sessionMap = (SessionMap) request.getSession() Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaPedagogicalPlannerController.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaPedagogicalPlannerController.java (.../QaPedagogicalPlannerController.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/controller/QaPedagogicalPlannerController.java (.../QaPedagogicalPlannerController.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -48,7 +48,7 @@ @Autowired private IQaService qaService; - @RequestMapping("/") + @RequestMapping("") protected String unspecified(QaPedagogicalPlannerForm pedagogicalPlannerForm, HttpServletRequest request, HttpServletResponse response) { return initPedagogicalPlannerForm(pedagogicalPlannerForm, request); Index: lams_tool_laqa/web/learning/LearnerRep.jsp =================================================================== diff -u -r7ea9b852e5fe8dc5688f983f162064d862f147de -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/web/learning/LearnerRep.jsp (.../LearnerRep.jsp) (revision 7ea9b852e5fe8dc5688f983f162064d862f147de) +++ lams_tool_laqa/web/learning/LearnerRep.jsp (.../LearnerRep.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -249,7 +249,7 @@ - + Index: lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp =================================================================== diff -u -r7ea9b852e5fe8dc5688f983f162064d862f147de -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp (.../RevisitedLearnerRep.jsp) (revision 7ea9b852e5fe8dc5688f983f162064d862f147de) +++ lams_tool_laqa/web/learning/RevisitedLearnerRep.jsp (.../RevisitedLearnerRep.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -11,7 +11,7 @@ - + <fmt:message key="activity.title" /> @@ -234,8 +234,8 @@ function submitMethod(actionMethod) { $('.btn').prop('disabled', true); - document.learningForm.action=actionMethod+".do"; - document.learningForm.submit(); + document.forms.learningForm.action=actionMethod+".do"; + document.forms.learningForm.submit(); } Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/actions/AdminAction.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/actions/AuthoringAction.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/actions/ClearSessionAction.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/actions/LearningAction.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/actions/MonitoringAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AdminController.java =================================================================== diff -u --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AdminController.java (revision 0) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AdminController.java (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,61 @@ +package org.lamsfoundation.lams.tool.pixlr.web.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.lamsfoundation.lams.tool.pixlr.model.PixlrConfigItem; +import org.lamsfoundation.lams.tool.pixlr.service.IPixlrService; +import org.lamsfoundation.lams.tool.pixlr.web.forms.AdminForm; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author + * @version + * + * + * + * + * + */ +@Controller +@RequestMapping("/lapixl10admin") +public class AdminController { + @Autowired + private IPixlrService pixlrService; + + @RequestMapping("") + public String unspecified(@ModelAttribute("lapixl10AdminForm") AdminForm lapixl10AdminForm, + HttpServletRequest request, HttpServletResponse response) { + // set up mdlForumService + + PixlrConfigItem pixlrKey = pixlrService.getConfigItem(PixlrConfigItem.KEY_LANGUAGE_CSV); + if (pixlrKey != null) { + lapixl10AdminForm.setLanguagesCSV(pixlrKey.getConfigValue()); + } + + request.setAttribute("error", false); + return "pages/admin/config"; + } + + @RequestMapping("/saveContent") + public String saveContent(@ModelAttribute("lapixl10AdminForm") AdminForm lapixl10AdminForm, + HttpServletRequest request) { + + if (lapixl10AdminForm.getLanguagesCSV() != null && !lapixl10AdminForm.getLanguagesCSV().equals("")) { + // set up mdlForumService + + PixlrConfigItem pixlrKey = pixlrService.getConfigItem(PixlrConfigItem.KEY_LANGUAGE_CSV); + pixlrKey.setConfigValue(lapixl10AdminForm.getLanguagesCSV()); + pixlrService.saveOrUpdatePixlrConfigItem(pixlrKey); + + request.setAttribute("savedSuccess", true); + return "pages/admin/config"; + } else { + request.setAttribute("error", true); + return "pages/admin/config"; + } + } +} Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AuthoringController.java =================================================================== diff -u --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AuthoringController.java (revision 0) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/AuthoringController.java (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,386 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.pixlr.web.controller; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.util.Date; + +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.pixlr.model.Pixlr; +import org.lamsfoundation.lams.tool.pixlr.service.IPixlrService; +import org.lamsfoundation.lams.tool.pixlr.util.PixlrConstants; +import org.lamsfoundation.lams.tool.pixlr.util.PixlrException; +import org.lamsfoundation.lams.tool.pixlr.web.forms.AuthoringForm; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.util.FileValidatorSpringUtil; +import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.multipart.MultipartFile; + +/** + */ +@Controller +@RequestMapping("/authoring") +public class AuthoringController { + + private static Logger logger = Logger.getLogger(AuthoringController.class); + + @Autowired + @Qualifier("pixlrService") + private IPixlrService pixlrService; + + @Autowired + @Qualifier("pixlrMessageService") + private MessageService messageService; + + // Authoring SessionMap key names + private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; + private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID"; + private static final String KEY_MODE = "mode"; + + /** + * Default method when no dispatch parameter is specified. It is expected + * that the parameter toolContentID will be passed in. This + * will be used to retrieve content for this tool. + * + */ + @RequestMapping("") + protected String unspecified(@ModelAttribute("authoringForm") AuthoringForm authoringForm, + HttpServletRequest request) { + + // Extract toolContentID from parameters. + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + + ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + + // set up pixlrService + + // retrieving Pixlr with given toolContentID + Pixlr pixlr = pixlrService.getPixlrByContentId(toolContentID); + if (pixlr == null) { + pixlr = pixlrService.copyDefaultContent(toolContentID); + pixlr.setCreateDate(new Date()); + pixlrService.saveOrUpdatePixlr(pixlr); + // TODO NOTE: this causes DB orphans when LD not saved. + } + + if (mode.isTeacher()) { + // Set the defineLater flag so that learners cannot use content + // while we + // are editing. This flag is released when updateContent is called. + pixlr.setDefineLater(true); + pixlrService.saveOrUpdatePixlr(pixlr); + + //audit log the teacher has started editing activity in monitor + pixlrService.auditLogStartEditingActivityInMonitor(toolContentID); + } + + String imageUrl = PixlrConstants.LAMS_WWW_PIXLR_FOLDER_URL; + Boolean imageExists = false; + if ((pixlr.getImageFileName() != null && !pixlr.getImageFileName().equals(""))) { + imageUrl += pixlr.getImageFileName(); + if (!pixlr.getImageFileName().equals(pixlrService.getDefaultContent().getImageFileName())) { + imageExists = true; + } + } else { + imageUrl += pixlrService.getDefaultContent().getImageFileName(); + } + request.setAttribute("imageURL", imageUrl); + request.setAttribute("imageExists", imageExists); + + // Set up the authForm. + updateAuthForm(authoringForm, pixlr); + authoringForm.setToolContentID(toolContentID); + authoringForm.setMode(mode.toString()); + authoringForm.setContentFolderID(contentFolderID); + + // Set up sessionMap + SessionMap map = createSessionMap(pixlr, mode, contentFolderID, toolContentID); + authoringForm.setSessionMapID(map.getSessionID()); + + // add the sessionMap to HTTPSession. + request.getSession().setAttribute(map.getSessionID(), map); + request.setAttribute(PixlrConstants.ATTR_SESSION_MAP, map); + + return "pages/authoring/authoring"; + } + + @RequestMapping("/updateContent") + public String updateContent(@ModelAttribute("authoringForm") AuthoringForm authoringForm, + HttpServletRequest request) throws PixlrException { + // TODO need error checking. + + // get authForm and session map. + SessionMap map = getSessionMap(request, authoringForm); + ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringController.KEY_MODE); + + // get pixlr content. + Pixlr pixlr = pixlrService.getPixlrByContentId((Long) map.get(AuthoringController.KEY_TOOL_CONTENT_ID)); + MultiValueMap errorMap = new LinkedMultiValueMap<>(); + + try { + // TODO: Need to check if this is an edit, if so, delete the old image + if (authoringForm.getExistingImageFileName().equals(PixlrConstants.DEFAULT_IMAGE_FILE_NAME) + || authoringForm.getExistingImageFileName().trim().equals("")) { + errorMap = validateImageFile(authoringForm); + + if (!errorMap.isEmpty()) { + request.setAttribute("errorMap", errorMap); + updateAuthForm(authoringForm, pixlr); + if (mode != null) { + authoringForm.setMode(mode.toString()); + } else { + authoringForm.setMode(""); + } + return "pages/authoring/authoring"; + } + uploadFormImage(authoringForm, pixlr); + } + } catch (Exception e) { + logger.error("Problem uploading image", e); + errorMap.add("GLOBAL", messageService.getMessage(PixlrConstants.ERROR_MSG_FILE_UPLOAD)); + //throw new PixlrException("Problem uploading image", e); + } + + // update pixlr content using form inputs. + updatePixlr(pixlr, authoringForm); + + // set the update date + pixlr.setUpdateDate(new Date()); + + // releasing defineLater flag so that learner can start using the tool. + pixlr.setDefineLater(false); + + pixlrService.saveOrUpdatePixlr(pixlr); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); + + // add the sessionMapID to form + authoringForm.setSessionMapID(map.getSessionID()); + + request.setAttribute(PixlrConstants.ATTR_SESSION_MAP, map); + + updateAuthForm(authoringForm, pixlr); + if (mode != null) { + authoringForm.setMode(mode.toString()); + } else { + authoringForm.setMode(""); + } + + return "pages/authoring/authoring"; + } + + /* ========== Private Methods ********** */ + + /** + * Updates Pixlr content using AuthoringForm inputs. + * + * @param authForm + * @param mode + * @return + */ + private void updatePixlr(Pixlr pixlr, AuthoringForm authForm) { + pixlr.setTitle(authForm.getTitle()); + pixlr.setInstructions(authForm.getInstructions()); + pixlr.setLockOnFinished(authForm.isLockOnFinished()); + pixlr.setReflectOnActivity(authForm.isReflectOnActivity()); + pixlr.setReflectInstructions(authForm.getReflectInstructions()); + pixlr.setAllowViewOthersImages(authForm.isAllowViewOthersImages()); + } + + /** + * Updates AuthoringForm using Pixlr content. + * + * @param pixlr + * @param authForm + * @return + */ + private void updateAuthForm(AuthoringForm authForm, Pixlr pixlr) { + authForm.setTitle(pixlr.getTitle()); + authForm.setInstructions(pixlr.getInstructions()); + authForm.setLockOnFinished(pixlr.isLockOnFinished()); + authForm.setReflectOnActivity(pixlr.isReflectOnActivity()); + authForm.setExistingImageFileName(pixlr.getImageFileName()); + authForm.setReflectInstructions(pixlr.getReflectInstructions()); + authForm.setAllowViewOthersImages(pixlr.isAllowViewOthersImages()); + + if (pixlr.getImageFileName() == null || pixlr.getImageFileName().trim().equals("")) { + authForm.setFileName(PixlrConstants.DEFAULT_IMAGE_FILE_NAME); + } else { + authForm.setFileName(pixlr.getImageFileName()); + } + } + + /** + * Updates SessionMap using Pixlr content. + * + * @param pixlr + * @param mode + */ + private SessionMap createSessionMap(Pixlr pixlr, ToolAccessMode mode, String contentFolderID, + Long toolContentID) { + + SessionMap map = new SessionMap<>(); + + map.put(AuthoringController.KEY_MODE, mode); + map.put(AuthoringController.KEY_CONTENT_FOLDER_ID, contentFolderID); + map.put(AuthoringController.KEY_TOOL_CONTENT_ID, toolContentID); + + return map; + } + + /** + * Retrieve the SessionMap from the HttpSession. + * + * @param request + * @param authForm + * @return + */ + @SuppressWarnings("unchecked") + private SessionMap getSessionMap(HttpServletRequest request, AuthoringForm authForm) { + return (SessionMap) request.getSession().getAttribute(authForm.getSessionMapID()); + } + + /** + * Validate imageGallery item. + * + * @param itemForm + * @return + */ + private MultiValueMap validateImageFile(AuthoringForm itemForm) { + MultiValueMap errorMap = new LinkedMultiValueMap<>(); + + // validate file size + FileValidatorSpringUtil.validateFileSize(itemForm.getFile(), true); + // for edit validate: file already exist + if (!itemForm.isHasFile() + && ((itemForm.getFile() == null) || StringUtils.isEmpty(itemForm.getFile().getOriginalFilename()))) { + errorMap.add("GLOBAL", messageService.getMessage(PixlrConstants.ERROR_MSG_FILE_BLANK)); + } + + // check for allowed format : gif, png, jpg + if (itemForm.getFile() != null) { + String contentType = itemForm.getFile().getContentType(); + if (StringUtils.isEmpty(contentType) || !(contentType.equals("image/gif") || contentType.equals("image/png") + || contentType.equals("image/jpg") || contentType.equals("image/jpeg") + || contentType.equals("image/pjpeg"))) { + errorMap.add("GLOBAL", messageService.getMessage(PixlrConstants.ERROR_MSG_NOT_ALLOWED_FORMAT)); + } + } + + return errorMap; + } + + /** + * Upload the image to the open www/images/pixlr folder + * + * @param request + * @param imageForm + * @throws ImageGalleryException + */ + private void uploadFormImage(AuthoringForm imageForm, Pixlr pixlr) throws Exception { + + String filename = PixlrConstants.DEFAULT_IMAGE_FILE_NAME; + + // set up pixlrService + + if (imageForm.getFile() != null) { + + // check the directory exists, then create it if it doesnt + File pixlrDir = new File(PixlrConstants.LAMS_PIXLR_BASE_DIR); + if (!pixlrDir.exists()) { + pixlrDir.mkdirs(); + } + + MultipartFile formFile = imageForm.getFile(); + + filename = FileUtil.generateUniqueContentFolderID() + + pixlrService.getFileExtension(formFile.getOriginalFilename()); + String fileWriteName = PixlrConstants.LAMS_PIXLR_BASE_DIR + File.separator + filename; + File uploadFile = new File(fileWriteName); + FileOutputStream out = new FileOutputStream(uploadFile); + + out.write(formFile.getBytes()); + + // Now save the image size + BufferedImage imageFile = ImageIO.read(uploadFile); + int width = imageFile.getWidth(); + int height = imageFile.getHeight(); + + pixlr.setImageFileName(filename); + pixlr.setImageHeight(new Long(height)); + pixlr.setImageWidth(new Long(width)); + } + + } + + @RequestMapping("/deleteImage") + public String deleteImage(@ModelAttribute("authoringForm") AuthoringForm authoringForm, + HttpServletRequest request) { + + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + + // retrieving Pixlr with given toolContentID + Pixlr pixlr = pixlrService.getPixlrByContentId(toolContentID); + if (pixlr != null && !pixlr.getImageFileName().equals(PixlrConstants.DEFAULT_IMAGE_FILE_NAME)) { + String realBaseDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + File.separator + + FileUtil.LAMS_WWW_DIR + File.separator + "images" + File.separator + "pixlr"; + String fileName = WebUtil.readStrParam(request, "existingImageFileName"); + + String imageFileName = realBaseDir + File.separator + fileName; + + File imageFile = new File(imageFileName); + + if (imageFile.exists()) { + imageFile.delete(); + } + + pixlr.setImageFileName(PixlrConstants.DEFAULT_IMAGE_FILE_NAME); + pixlrService.saveOrUpdatePixlr(pixlr); + } + + return unspecified(authoringForm, request); + } +} Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/ClearSessionController.java =================================================================== diff -u --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/ClearSessionController.java (revision 0) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/ClearSessionController.java (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,67 @@ +/**************************************************************** + * 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.0 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.pixlr.web.controller; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishController; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.WebApplicationContext; + +/** + * This class give a chance to clear HttpSession when user save/close authoring page. + * + * @author Steve.Ni + * + * + * + * + * @version $Revision$ + */ +@Controller +public class ClearSessionController extends LamsAuthoringFinishController { + + @Autowired + private WebApplicationContext applicationContext; + + @RequestMapping("/clearsession") + public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException { + super.execute(request, response, applicationContext); + } + + @Override + public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) { + if (mode.isAuthor()) { + session.removeAttribute(customiseSessionID); + } + } + +} \ No newline at end of file Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/LearningController.java =================================================================== diff -u --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/LearningController.java (revision 0) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/LearningController.java (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,480 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.pixlr.web.controller; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map.Entry; +import java.util.Set; + +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.exception.DataMissingException; +import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.pixlr.dto.PixlrDTO; +import org.lamsfoundation.lams.tool.pixlr.dto.PixlrUserDTO; +import org.lamsfoundation.lams.tool.pixlr.model.Pixlr; +import org.lamsfoundation.lams.tool.pixlr.model.PixlrConfigItem; +import org.lamsfoundation.lams.tool.pixlr.model.PixlrSession; +import org.lamsfoundation.lams.tool.pixlr.model.PixlrUser; +import org.lamsfoundation.lams.tool.pixlr.service.IPixlrService; +import org.lamsfoundation.lams.tool.pixlr.service.PixlrServiceProxy; +import org.lamsfoundation.lams.tool.pixlr.util.PixlrConstants; +import org.lamsfoundation.lams.tool.pixlr.util.PixlrException; +import org.lamsfoundation.lams.tool.pixlr.web.forms.LearningForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.WebApplicationContext; + +/** + * @author + * @version + * + * + * + * + * + * + * + * + */ +@Controller +@RequestMapping("/learning") +public class LearningController { + + private static Logger log = Logger.getLogger(LearningController.class); + + private static final boolean MODE_OPTIONAL = false; + private static final String PIXLR_UTL = "http://www.pixlr.com/editor/"; + + @Autowired + private IPixlrService pixlrService; + + @Autowired + private WebApplicationContext applicationContext; + + @RequestMapping("/") + public String unspecified(@ModelAttribute("learningForm") LearningForm learningForm, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + // 'toolSessionID' and 'mode' paramters are expected to be present. + // TODO need to catch exceptions and handle errors. + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, MODE_OPTIONAL); + + Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + String redoQuestion = request.getParameter("redoQuestion"); + boolean isRedo = false; + if (redoQuestion != null && redoQuestion.equals("true")) { + isRedo = true; + } + + // Retrieve the session and content. + PixlrSession pixlrSession = pixlrService.getSessionBySessionId(toolSessionID); + if (pixlrSession == null) { + throw new PixlrException("Cannot retrieve session with toolSessionID" + toolSessionID); + } + + Pixlr pixlr = pixlrSession.getPixlr(); + + // check defineLater + if (pixlr.isDefineLater()) { + return "pages/learning/defineLater"; + } + + // set mode, toolSessionID and PixlrDTO + request.setAttribute("mode", mode.toString()); + request.setAttribute("toolSessionID", toolSessionID); + learningForm.setToolSessionID(toolSessionID); + + PixlrDTO pixlrDTO = new PixlrDTO(pixlr); + request.setAttribute("pixlrDTO", pixlrDTO); + + // Set the content in use flag. + if (!pixlr.isContentInUse()) { + pixlr.setContentInUse(new Boolean(true)); + pixlrService.saveOrUpdatePixlr(pixlr); + } + + LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, + applicationContext.getServletContext()); + + // get the user + PixlrUser pixlrUser; + if (mode.equals(ToolAccessMode.TEACHER)) { + Long userID = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); + pixlrUser = pixlrService.getUserByUserIdAndSessionId(userID, toolSessionID); + } else { + pixlrUser = getCurrentUser(toolSessionID); + } + + // return to the viewAll images page if the user has already clicked it + if (pixlrUser.isFinishedActivity() && pixlr.isAllowViewOthersImages() && !isRedo) { + return viewAllImages(request); + } + + // set up the user dto + PixlrUserDTO pixlrUserDTO = new PixlrUserDTO(pixlrUser); + if (pixlrUser.isFinishedActivity()) { + // get the notebook entry. + NotebookEntry notebookEntry = pixlrService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + PixlrConstants.TOOL_SIGNATURE, pixlrUser.getUserId().intValue()); + if (notebookEntry != null) { + pixlrUserDTO.notebookEntry = notebookEntry.getEntry(); + pixlrUserDTO.setFinishedReflection(true); + } + } + request.setAttribute("pixlrUserDTO", pixlrUserDTO); + + String returnURL = Configuration.get(ConfigurationKeys.SERVER_URL) + "/tool/lapixl10/learning.do?"; + returnURL += "dispatch=updatePixlrImage"; + returnURL += "&toolSessionID=" + pixlrSession.getSessionId(); + + String url = PIXLR_UTL + "?"; + url += "&title=" + URLEncoder.encode(pixlr.getTitle(), "UTF8"); + url += "&referrer=LAMS"; + url += "&loc=" + getPixlrLocale(); + + String currentImageURL; + + if (pixlrUser.getImageFileName() != null && !pixlrUser.getImageFileName().equals("")) { + currentImageURL = PixlrConstants.LAMS_WWW_PIXLR_FOLDER_URL + pixlrUser.getImageFileName(); + returnURL += "&existingImage=" + URLEncoder.encode(pixlrUser.getImageFileName(), "UTF8"); + } else { + returnURL += "&existingImage="; + currentImageURL = PixlrConstants.LAMS_WWW_PIXLR_FOLDER_URL + pixlr.getImageFileName(); + } + + request.setAttribute("currentImageURL", currentImageURL); + request.setAttribute("pixlrURL", URLEncoder.encode(url, "UTF-8")); + request.setAttribute("returnURL", returnURL); + + // set readOnly flag. + if (mode.equals(ToolAccessMode.TEACHER) || (pixlr.isLockOnFinished() && pixlrUser.isFinishedActivity())) { + request.setAttribute("contentEditable", false); + } else { + request.setAttribute("contentEditable", true); + } + request.setAttribute("finishedActivity", pixlrUser.isFinishedActivity()); + return "pages/learning/pixlr"; + } + + @RequestMapping("/updatePixlrImage") + public String updatePixlrImage(HttpServletRequest request) { + Boolean success; + + log.debug("Saving image from pixlr"); + + String imageURL = WebUtil.readStrParam(request, "image"); + Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID"); + + PixlrUser pixlrUser = getCurrentUser(toolSessionID); + + String imageName = WebUtil.readStrParam(request, "existingImage", true); + + if (imageName == null || imageName.equals("")) { + imageName = FileUtil.generateUniqueContentFolderID() + ".jpg"; + } + + try { + InputStream is = LearningController.getResponseInputStreamFromExternalServer(imageURL, + new HashMap()); + + String realBaseDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + File.separator + + FileUtil.LAMS_WWW_DIR + File.separator + "images" + File.separator + "pixlr"; + + File imageFile = new File(realBaseDir + File.separator + imageName); + + FileOutputStream out = new FileOutputStream(imageFile); + + byte[] buf = new byte[1024]; + int len; + while ((len = is.read(buf)) > 0) { + out.write(buf, 0, len); + } + + pixlrUser.setImageFileName(imageName); + + // Now save the image size + BufferedImage imageBufferedFile = ImageIO.read(imageFile); + int width = imageBufferedFile.getWidth(); + int height = imageBufferedFile.getHeight(); + pixlrUser.setImageHeight(new Long(height)); + pixlrUser.setImageWidth(new Long(width)); + pixlrService.saveOrUpdatePixlrUser(pixlrUser); + success = true; + } catch (Exception e) { + log.error("Failed to copy pixlr image from pixlr server with URL: " + imageURL, e); + success = false; + } + + request.setAttribute("success", success); + return "pages/learning/success"; + } + + private PixlrUser getCurrentUser(Long toolSessionId) { + UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + + // attempt to retrieve user using userId and toolSessionId + PixlrUser pixlrUser = pixlrService.getUserByUserIdAndSessionId(new Long(user.getUserID().intValue()), + toolSessionId); + + if (pixlrUser == null) { + PixlrSession pixlrSession = pixlrService.getSessionBySessionId(toolSessionId); + pixlrUser = pixlrService.createPixlrUser(user, pixlrSession); + } + + return pixlrUser; + } + + @RequestMapping("/finishActivity") + public String finishActivity(HttpServletRequest request, HttpServletResponse response) { + + Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID"); + + PixlrUser pixlrUser = getCurrentUser(toolSessionID); + + if (pixlrUser != null) { + pixlrUser.setFinishedActivity(true); + pixlrService.saveOrUpdatePixlrUser(pixlrUser); + } else { + log.error("finishActivity(): couldn't find PixlrUser with id: " + pixlrUser.getUserId() + + "and toolSessionID: " + toolSessionID); + } + + ToolSessionManager sessionMgrService = PixlrServiceProxy + .getPixlrSessionManager(applicationContext.getServletContext()); + + String nextActivityUrl; + try { + nextActivityUrl = sessionMgrService.leaveToolSession(toolSessionID, pixlrUser.getUserId()); + response.sendRedirect(nextActivityUrl); + } catch (DataMissingException e) { + throw new PixlrException(e); + } catch (ToolException e) { + throw new PixlrException(e); + } catch (IOException e) { + throw new PixlrException(e); + } + + return null; // TODO need to return proper page. + } + + public static InputStream getResponseInputStreamFromExternalServer(String urlStr, HashMap params) + throws ToolException, IOException { + if (!urlStr.endsWith("?")) { + urlStr += "?"; + } + + for (Entry entry : params.entrySet()) { + urlStr += "&" + entry.getKey() + "=" + entry.getValue(); + } + + log.debug("Making request to external servlet: " + urlStr); + + URL url = new URL(urlStr); + URLConnection conn = url.openConnection(); + if (!(conn instanceof HttpURLConnection)) { + log.error("Fail to connect to external server though url: " + urlStr); + throw new ToolException("Fail to connect to external server though url: " + urlStr); + } + + HttpURLConnection httpConn = (HttpURLConnection) conn; + if (httpConn.getResponseCode() != HttpURLConnection.HTTP_OK) { + log.error("Fail to fetch data from external server, response code: " + httpConn.getResponseCode() + + " Url: " + urlStr); + throw new ToolException("Fail to fetch data from external server, response code: " + + httpConn.getResponseCode() + " Url: " + urlStr); + } + + InputStream is = url.openConnection().getInputStream(); + if (is == null) { + log.error("Fail to fetch data from external server, return InputStream null: " + urlStr); + throw new ToolException("Fail to fetch data from external server, return inputStream null: " + urlStr); + } + + return is; + } + + @RequestMapping("/openNotebook") + public String openNotebook(@ModelAttribute("reflectEditForm") LearningForm reflectEditForm, + HttpServletRequest request, HttpServletResponse response) { + + // set the finished flag + PixlrUser pixlrUser = this.getCurrentUser(reflectEditForm.getToolSessionID()); + PixlrDTO pixlrDTO = new PixlrDTO(pixlrUser.getPixlrSession().getPixlr()); + + request.setAttribute("pixlrDTO", pixlrDTO); + + NotebookEntry notebookEntry = pixlrService.getEntry(pixlrUser.getPixlrSession().getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, PixlrConstants.TOOL_SIGNATURE, pixlrUser.getUserId().intValue()); + + if (notebookEntry != null) { + reflectEditForm.setEntryText(notebookEntry.getEntry()); + } + + LearningWebUtil.putActivityPositionInRequestByToolSessionId(pixlrUser.getPixlrSession().getSessionId(), request, + applicationContext.getServletContext()); + + request.setAttribute("messageForm", reflectEditForm); + return "pages/learning/notebook"; + } + + @RequestMapping("/submitReflection") + public String submitReflection(@ModelAttribute("messageForm") LearningForm messageForm, HttpServletRequest request, + HttpServletResponse response) { + + // save the reflection entry and call the notebook. + + PixlrUser pixlrUser = this.getCurrentUser(messageForm.getToolSessionID()); + Long toolSessionID = pixlrUser.getPixlrSession().getSessionId(); + Integer userID = pixlrUser.getUserId().intValue(); + + // check for existing notebook entry + NotebookEntry entry = pixlrService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + PixlrConstants.TOOL_SIGNATURE, userID); + + if (entry == null) { + // create new entry + pixlrService.createNotebookEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + PixlrConstants.TOOL_SIGNATURE, userID, messageForm.getEntryText()); + } else { + // update existing entry + entry.setEntry(messageForm.getEntryText()); + entry.setLastModified(new Date()); + pixlrService.updateEntry(entry); + } + + return finishActivity(request, response); + } + + public String viewAllImages(HttpServletRequest request) { + + Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, MODE_OPTIONAL); + + // Retrieve the session and content. + PixlrSession pixlrSession = pixlrService.getSessionBySessionId(toolSessionID); + if (pixlrSession == null) { + throw new PixlrException("Cannot retrieve session with toolSessionID" + toolSessionID); + } + + Pixlr pixlr = pixlrSession.getPixlr(); + + // get the user + PixlrUser pixlrUser; + if (mode.equals(ToolAccessMode.TEACHER)) { + Long userID = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); + pixlrUser = pixlrService.getUserByUserIdAndSessionId(userID, toolSessionID); + } else { + pixlrUser = getCurrentUser(toolSessionID); + } + + // set completed + pixlrUser.setFinishedActivity(true); + pixlrService.saveOrUpdatePixlrUser(pixlrUser); + + // set up the of images learner set + Set learnerSet = new HashSet<>(); + for (PixlrUser learner : pixlrSession.getPixlrUsers()) { + if (learner.getImageFileName() != null && !learner.getImageFileName().equals("") + && !learner.getImageFileName().equals(pixlr.getImageFileName())) { + + PixlrUserDTO userDTO = new PixlrUserDTO(learner); + if (userDTO.getImageFileName() == null || userDTO.getImageFileName().equals("")) { + userDTO.setImageFileName(pixlr.getImageFileName()); + userDTO.setImageHeight(pixlr.getImageHeight()); + userDTO.setImageWidth(pixlr.getImageWidth()); + } + learnerSet.add(userDTO); + } + } + request.setAttribute("learnerDTOs", learnerSet); + request.setAttribute("pixlrDTO", new PixlrDTO(pixlr)); + request.setAttribute("mode", mode); + request.setAttribute("pixlrImageFolderURL", PixlrConstants.LAMS_WWW_PIXLR_FOLDER_URL); + + LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, + applicationContext.getServletContext()); + + return "pages/learning/viewAll"; + } + + /** + * Work out if this user's language is supported by pixlr + * + * @return + */ + private String getPixlrLocale() { + String locale = "en"; + + String languagesCSV = pixlrService.getConfigItem(PixlrConfigItem.KEY_LANGUAGE_CSV) != null + ? pixlrService.getConfigItem(PixlrConfigItem.KEY_LANGUAGE_CSV).getConfigValue() + : null; + + if (languagesCSV != null && !languagesCSV.equals("")) { + UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + + String[] languages = languagesCSV.split(","); + + for (int i = 0; i < languages.length; i++) { + if (languages[i].equals(user.getFckLanguageMapping())) { + locale = languages[i]; + break; + } + } + + } + + return locale; + } +} Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/MonitoringController.java =================================================================== diff -u --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/MonitoringController.java (revision 0) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/controller/MonitoringController.java (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,175 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.pixlr.web.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.pixlr.dto.PixlrDTO; +import org.lamsfoundation.lams.tool.pixlr.dto.PixlrSessionDTO; +import org.lamsfoundation.lams.tool.pixlr.dto.PixlrUserDTO; +import org.lamsfoundation.lams.tool.pixlr.model.Pixlr; +import org.lamsfoundation.lams.tool.pixlr.model.PixlrUser; +import org.lamsfoundation.lams.tool.pixlr.service.IPixlrService; +import org.lamsfoundation.lams.tool.pixlr.util.PixlrConstants; +import org.lamsfoundation.lams.tool.pixlr.web.forms.MonitoringForm; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author + * @version + * + * + * + * + * + * + * + * + */ +@Controller +@RequestMapping("/monitoring") +public class MonitoringController { + + @Autowired + private IPixlrService pixlrService; + + @RequestMapping("/") + public String unspecified(HttpServletRequest request) { + + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + + Pixlr pixlr = pixlrService.getPixlrByContentId(toolContentID); + + if (pixlr == null) { + // TODO error page. + } + + PixlrDTO pixlrDT0 = new PixlrDTO(pixlr); + + for (PixlrSessionDTO sessionDTO : pixlrDT0.getSessionDTOs()) { + Long toolSessionID = sessionDTO.getSessionID(); + + for (PixlrUserDTO userDTO : sessionDTO.getUserDTOs()) { + // get the notebook entry. + NotebookEntry notebookEntry = pixlrService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + PixlrConstants.TOOL_SIGNATURE, userDTO.getUserId().intValue()); + if (notebookEntry != null) { + userDTO.notebookEntry = notebookEntry.getEntry(); + userDTO.setFinishedReflection(true); + } + + } + } + + Long currentTab = WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true); + pixlrDT0.setCurrentTab(currentTab); + + request.setAttribute("pixlrDTO", pixlrDT0); + request.setAttribute("contentFolderID", contentFolderID); + request.setAttribute("toolContentID", toolContentID); + request.setAttribute("pixlrImageFolderURL", PixlrConstants.LAMS_WWW_PIXLR_FOLDER_URL); + request.setAttribute("isGroupedActivity", pixlrService.isGroupedActivity(toolContentID)); + return "pages/monitoring/monitoring"; + } + + @RequestMapping("/showPixlr") + public String showPixlr(HttpServletRequest request) { + + Long uid = new Long(WebUtil.readLongParam(request, "userUID")); + + PixlrUser user = pixlrService.getUserByUID(uid); + + PixlrUserDTO userDTO = new PixlrUserDTO(user); + + request.setAttribute("userDTO", userDTO); + + return "pages/monitoring/pixlrDisplay"; + } + + /** + * set up pixlrService + */ + + /** + * Opens a user's reflection + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + @RequestMapping("/openNotebook") + public String openNotebook(HttpServletRequest request) { + + //MonitoringForm monitorForm = (MonitoringForm) form; + Long toolSessionId = WebUtil.readLongParam(request, "toolSessionID", false); + Long userID = WebUtil.readLongParam(request, "userID", false); + + PixlrUser pixlrUser = pixlrService.getUserByUserIdAndSessionId(userID, toolSessionId); + + NotebookEntry notebookEntry = pixlrService.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + PixlrConstants.TOOL_SIGNATURE, userID.intValue()); + + PixlrUserDTO pixlrUserDTO = new PixlrUserDTO(pixlrUser); + pixlrUserDTO.setNotebookEntry(notebookEntry.getEntry()); + + request.setAttribute("pixlrUserDTO", pixlrUserDTO); + + return "/pages/learning/notebook"; + } + + /** + * Opens a user's reflection + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + @RequestMapping("/toggleHideImage") + public String toggleHideImage(MonitoringForm monitorForm, HttpServletRequest request, + HttpServletResponse response) { + + PixlrUser pixlrUser = pixlrService.getUserByUID(monitorForm.getHideUserImageUid()); + + if (pixlrUser.isImageHidden()) { + pixlrUser.setImageHidden(false); + } else { + pixlrUser.setImageHidden(true); + } + pixlrService.saveOrUpdatePixlrUser(pixlrUser); + return unspecified(request); + } +} Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AdminForm.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AdminForm.java (.../AdminForm.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AdminForm.java (.../AdminForm.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -34,7 +34,7 @@ /** * */ -public class AdminForm extends ActionForm { +public class AdminForm{ private static final long serialVersionUID = 378528935723874238L; @@ -43,13 +43,6 @@ public AdminForm() { } - @Override - public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) { - ActionErrors ac = new ActionErrors(); - ac.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("this is an error")); - return ac; - } - public String getLanguagesCSV() { return languagesCSV; } Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AuthoringForm.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -21,8 +21,6 @@ * **************************************************************** */ - - package org.lamsfoundation.lams.tool.pixlr.web.forms; import javax.servlet.http.HttpServletRequest; @@ -32,14 +30,14 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.multipart.MultipartFile; /** * */ @SuppressWarnings("unchecked") -public class AuthoringForm extends ActionForm { +public class AuthoringForm{ private static final long serialVersionUID = 3950453134542135495L; @@ -61,9 +59,9 @@ String reflectInstructions; - FormFile onlineFile; + MultipartFile onlineFile; - FormFile offlineFile; + MultipartFile offlineFile; String currentTab; @@ -88,16 +86,8 @@ private Long fileUuid; private Long fileVersionId; private String fileName; - private FormFile file; + private MultipartFile file; - @Override - public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) { - ActionErrors ac = new ActionErrors(); - ac.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("this is an error")); - - return ac; - } - public String getSessionMapID() { return sessionMapID; } @@ -138,11 +128,11 @@ this.lockOnFinished = lockOnFinished; } - public FormFile getOfflineFile() { + public MultipartFile getOfflineFile() { return offlineFile; } - public void setOfflineFile(FormFile offlineFile) { + public void setOfflineFile(MultipartFile offlineFile) { this.offlineFile = offlineFile; } @@ -154,11 +144,11 @@ this.offlineInstruction = offlineInstruction; } - public FormFile getOnlineFile() { + public MultipartFile getOnlineFile() { return onlineFile; } - public void setOnlineFile(FormFile onlineFile) { + public void setOnlineFile(MultipartFile onlineFile) { this.onlineFile = onlineFile; } @@ -234,11 +224,11 @@ this.fileName = fileName; } - public FormFile getFile() { + public MultipartFile getFile() { return file; } - public void setFile(FormFile file) { + public void setFile(MultipartFile file) { this.file = file; } Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/LearningForm.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/LearningForm.java (.../LearningForm.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/LearningForm.java (.../LearningForm.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -33,7 +33,7 @@ * * */ -public class LearningForm extends ActionForm { +public class LearningForm{ private static final long serialVersionUID = -4728946254882237144L; Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/MonitoringForm.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/MonitoringForm.java (.../MonitoringForm.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/web/forms/MonitoringForm.java (.../MonitoringForm.java) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -30,7 +30,7 @@ /** * */ -public class MonitoringForm extends ActionForm { +public class MonitoringForm{ private static final long serialVersionUID = 9096908688391850595L; Index: lams_tool_pixlr/web/WEB-INF/spring-servlet.xml =================================================================== diff -u --- lams_tool_pixlr/web/WEB-INF/spring-servlet.xml (revision 0) +++ lams_tool_pixlr/web/WEB-INF/spring-servlet.xml (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file Index: lams_tool_pixlr/web/WEB-INF/tags/Page.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -4,6 +4,7 @@ <%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> +<%@ attribute name="formID" required="false" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> @@ -88,8 +89,8 @@ - - + + ${toolForm.toolSessionID} Index: lams_tool_pixlr/web/WEB-INF/tags/TabBody.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/WEB-INF/tags/TabBody.tag (.../TabBody.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/WEB-INF/tags/TabBody.tag (.../TabBody.tag) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -34,7 +34,6 @@ <%@ attribute name="titleKey" required="false" rtexprvalue="true"%> <%@ attribute name="page" required="false" rtexprvalue="true"%> <%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-bean" prefix="bean"%> Index: lams_tool_pixlr/web/WEB-INF/tags/TabBodyArea.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/WEB-INF/tags/TabBodyArea.tag (.../TabBodyArea.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/WEB-INF/tags/TabBodyArea.tag (.../TabBodyArea.tag) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -30,7 +30,6 @@ %> <%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-bean" prefix="bean"%>
Index: lams_tool_pixlr/web/WEB-INF/tags/TextSearch.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/WEB-INF/tags/TextSearch.tag (.../TextSearch.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/WEB-INF/tags/TextSearch.tag (.../TextSearch.tag) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -32,12 +32,11 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ taglib uri="tags-lams" prefix="lams" %> <%-- Required attributes --%> <%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %> -<%@ attribute name="wrapInFormTag" required="true" rtexprvalue="true" %> <%-- Optional attributes --%> <%@ attribute name="action" required="false" rtexprvalue="true" %> @@ -53,10 +52,10 @@ <%-- Default value for message key --%> - + - + @@ -85,52 +84,40 @@ - -
- - -

- - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- - - - - - - - - + +

+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
\ No newline at end of file Index: lams_tool_pixlr/web/WEB-INF/web.xml =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/WEB-INF/web.xml (.../web.xml) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/WEB-INF/web.xml (.../web.xml) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -64,24 +64,10 @@ - action - org.apache.struts.action.ActionServlet - - config - /WEB-INF/struts-config.xml - - - debug - 999 - - - detail - 2 - - - validate - true - + spring + + org.springframework.web.servlet.DispatcherServlet + 1 @@ -116,7 +102,7 @@ - action + spring *.do Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/common/empty.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/common/header.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/common/learnerheader.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_pixlr/web/common/message.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/common/message.jsp (.../message.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/common/message.jsp (.../message.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,5 +1,35 @@ + <%@ include file="/common/taglibs.jsp"%> -

- ${requestScope.message}; -

+ + < + + + + + + + + + <fmt:message key="activity.title" /> + + + + + + + + + + + +
+

+ ${requestScope.message}; +

+
+ +
+ + +
Index: lams_tool_pixlr/web/common/messages.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/common/messages.jsp (.../messages.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/common/messages.jsp (.../messages.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,8 +1,9 @@ <%-- Error Messages --%> - - - -
-
-
-
+ + + + +
+
+
+
Index: lams_tool_pixlr/web/common/taglibs.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/common/taglibs.jsp (.../taglibs.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/common/taglibs.jsp (.../taglibs.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,12 +1,7 @@ <%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> -<%@ taglib uri="tags-bean" prefix="bean"%> -<%@ taglib uri="tags-logic" prefix="logic"%> -<%@ taglib uri="tags-tiles" prefix="tiles"%> -<%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-core" prefix="c"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> <%@ taglib uri="tags-function" prefix="fn" %> <%@ taglib uri="tags-lams" prefix="lams"%> - - +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/layouts/defaultLayout.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/layouts/learningLayout.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/layouts/tabLayout.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_pixlr/web/pages/admin/config.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/admin/config.jsp (.../config.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/admin/config.jsp (.../config.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -28,18 +28,17 @@
- + - - - + + - + - + Index: lams_tool_pixlr/web/pages/authoring/advanced.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/authoring/advanced.jsp (.../advanced.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/authoring/advanced.jsp (.../advanced.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -5,7 +5,7 @@
@@ -14,21 +14,21 @@
- +
Index: lams_tool_pixlr/web/pages/authoring/authoring.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,3 +1,4 @@ + <%@ include file="/common/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.tool.pixlr.util.PixlrConstants"%> <%@ page import="org.lamsfoundation.lams.util.Configuration" %> @@ -6,70 +7,107 @@ <%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE)%> <%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))%> - + + + + + + + - - - - - - - - - - - - - - - - - + + + <fmt:message key="activity.title" /> + + + + + + + + + + + + - - <%@ include file="/common/messages.jsp"%> - - - - - - + + + + + - -
- -
-
+ + + + + + + + + + + + + + + + + + + + + + <%@ include file="/common/messages.jsp"%> + + + + + + + + +
+ +
+
+ +
+ + -
+ - + +
+<%@ include file="/common/taglibs.jsp"%> + Index: lams_tool_pixlr/web/pages/authoring/basic.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,16 +1,15 @@ <%@ include file="/common/taglibs.jsp"%> - - - + + + + + + + + + + + + + + + + + + Index: lams_tool_pixlr/web/pages/learning/notebook.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/learning/notebook.jsp (.../notebook.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/learning/notebook.jsp (.../notebook.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -34,18 +34,17 @@ - - - + + +
- + - - + @@ -56,8 +55,8 @@ - -
+ + Index: lams_tool_pixlr/web/pages/learning/pixlr.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/learning/pixlr.jsp (.../pixlr.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/learning/pixlr.jsp (.../pixlr.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,152 +1,177 @@ + <%@ include file="/common/taglibs.jsp"%> - + + + + + + - function refresh() { - window.location.href = "/learning.do?mode=${mode}&toolSessionID=${toolSessionID}&redoQuestion=true"; - } - - function disableFinishButton() { - var finishButton = document.getElementById("finishButton"); - if (finishButton != null) { - finishButton.disabled = true; - } - } - - function submitForm(methodName){ - var f = document.getElementById('learningForm'); - f.submit(); - } - - - - -
- -
- - - - - - - - + + +
+ +
+ + + - - + + - + + + + + + + + -
-
-
-
- -
- " - onclick="openImage('${currentImageURL}')" src="${currentImageURL}" /> + + -
-
- - - - - - - -
- - - <%--Reflection--------------------------------------------------%> - - - - - - +
+ " + onclick="openImage('${currentImageURL}')" src="${currentImageURL}" /> -
-
- ${pixlrDTO.reflectInstructions} -
- -
- - - - - - - - - - - - - -
- -
- - - - - <%--Finish buttons--------------------------------------------------%> - - - - - -
- +
+
- - - - + + + + + +
+ + + <%--Reflection--------------------------------------------------%> + + + + + + +
+
+ ${pixlrDTO.reflectInstructions} +
- +
+ + + + + + + + + + + +
+ +
+ +
+
+ + <%--Finish buttons--------------------------------------------------%> + + + + +
+ - - - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - -
-
- +
+ +
+ +
+ + + +<%@ include file="/common/taglibs.jsp"%> -
+ Index: lams_tool_pixlr/web/pages/learning/success.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/learning/success.jsp (.../success.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/learning/success.jsp (.../success.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -26,9 +26,9 @@ - + Index: lams_tool_pixlr/web/pages/learning/viewAll.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/learning/viewAll.jsp (.../viewAll.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/learning/viewAll.jsp (.../viewAll.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -34,11 +34,10 @@ - - - - - + + + + @@ -79,26 +78,26 @@ <%--Bottom buttons--------------------------------------------------%> - + - + - + Index: lams_tool_pixlr/web/pages/monitoring/editActivity.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/monitoring/editActivity.jsp (.../editActivity.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/monitoring/editActivity.jsp (.../editActivity.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -33,8 +33,8 @@ - + - + Fisheye: Tag 46e01bf046d755f571ba59957ac869c086bad58c refers to a dead (removed) revision in file `lams_tool_pixlr/web/pages/monitoring/headItems.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_pixlr/web/pages/monitoring/monitoring.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,22 +1,54 @@ + <%@ include file="/common/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.tool.pixlr.util.PixlrConstants"%> - + + + + + + + - - - - - - + + + <fmt:message key="activity.title" /> + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + Index: lams_tool_pixlr/web/pages/monitoring/pixlrDisplay.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/monitoring/pixlrDisplay.jsp (.../pixlrDisplay.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/monitoring/pixlrDisplay.jsp (.../pixlrDisplay.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -1,38 +1,73 @@ + <%@ include file="/common/taglibs.jsp"%> - - - - + + < + + + + + - - - - - - - - - + + + <fmt:message key="activity.title" /> + + + + + - - - - -
-

- ${userDTO.firstName} ${userDTO.lastName } -

-
- - - -
- - - -
- - - -
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+

+ ${userDTO.firstName} ${userDTO.lastName } +

+
+ + + +
+ + + +
+ + + +
+
+ +
+ + + Index: lams_tool_pixlr/web/pages/monitoring/summary.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r46e01bf046d755f571ba59957ac869c086bad58c --- lams_tool_pixlr/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_pixlr/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 46e01bf046d755f571ba59957ac869c086bad58c) @@ -35,12 +35,11 @@
- + - - - - + + + @@ -135,7 +134,7 @@ - +