Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r1edbb81f16cedfcc1326e4eca6e520b5b48cbddc -r7817bc4fce30416c9737875ae2d137be0c6aa8ba Binary files differ Index: lams_central/web/includes/javascript/ckconfig_custom.js =================================================================== diff -u -r4237913487aea29065b43a6dacb34c7c4b53d260 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 4237913487aea29065b43a6dacb34c7c4b53d260) +++ lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -13,6 +13,18 @@ ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['equation','About'], ['TextColor','BGColor'], + ['Image','Table','HorizontalRule','Smiley','SpecialChar'], + ['Format','Font','FontSize'] +] ; + +CKEDITOR.config.toolbar_DefaultMonitor = [ + ['Preview','PasteFromWord'], + ['Undo','Redo'], + ['Bold','Italic','Underline', '-','Subscript','Superscript'], + ['NumberedList','BulletedList','-','Outdent','Indent'], + ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], + ['equation','About'], + ['TextColor','BGColor'], ['Table','HorizontalRule','Smiley','SpecialChar'], ['Format','Font','FontSize'] ] ; Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java =================================================================== diff -u -r99e3a149353a816bdf69f7e26e3a49f5b3d4d384 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java (.../ILamsToolService.java) (revision 99e3a149353a816bdf69f7e26e3a49f5b3d4d384) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsToolService.java (.../ILamsToolService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -34,46 +34,55 @@ /** - * This interface defines all the service available for self contained tool - * module from lams. Any service that would be used by other lams module - * such as, lams_learning etc, should not appear in this interface. + * This interface defines all the service available for self contained tool module from lams. Any service that would be + * used by other lams module such as, lams_learning etc, should not appear in this interface. * * @author chris * @author Jacky Fang * @author Ozgur Demirtas 24/06/2005 */ -public interface ILamsToolService -{ +public interface ILamsToolService { /** - * Returns a list of all learners who can use a specific set of tool content. - * Note that none/some/all of these users may not reach the associated activity - * so they may not end up using the content. - * The purpose of this method is to provide a way for tools to do logic based on - * completions against potential completions. - * @param toolContentID a long value that identifies the tool content (in the Tool and in LAMS). + * Returns a list of all learners who can use a specific set of tool content. Note that none/some/all of these users + * may not reach the associated activity so they may not end up using the content. The purpose of this method is to + * provide a way for tools to do logic based on completions against potential completions. + * + * @param toolContentID + * a long value that identifies the tool content (in the Tool and in LAMS). * @return a List of all the Learners who are scheduled to use the content. - * @exception in case of any problems. + * @exception in + * case of any problems. */ - public Set getAllPotentialLearners(long toolSessionID) throws LamsToolServiceException; + Set getAllPotentialLearners(long toolSessionID) throws LamsToolServiceException; - public IToolVO getToolBySignature(final String toolSignature); + IToolVO getToolBySignature(final String toolSignature); - public long getToolDefaultContentIdBySignature(final String toolSignature); + long getToolDefaultContentIdBySignature(final String toolSignature); - public String generateUniqueContentFolder() throws FileUtilException, IOException; + String generateUniqueContentFolder() throws FileUtilException, IOException; - public void saveOrUpdateTool(Tool tool); + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + String getLearnerContentFolder(Long toolSessionId, Long userId); - public Tool getPersistToolBySignature(final String toolSignature); + void saveOrUpdateTool(Tool tool); - public ToolSession getToolSession(Long toolSessionId); + Tool getPersistToolBySignature(final String toolSignature); + ToolSession getToolSession(Long toolSessionId); + /** * Allows the tool to ask whether or not the activity is grouped and therefore it should expect more than one tool * session. * * @param toolContentID * @return */ - public Boolean isGroupedActivity(long toolContentID); + Boolean isGroupedActivity(long toolContentID); } Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java =================================================================== diff -u -rceb94497a0e987d11b569559f65afb81cf0f9a7c -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java (.../LamsToolService.java) (revision ceb94497a0e987d11b569559f65afb81cf0f9a7c) +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsToolService.java (.../LamsToolService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -30,6 +30,7 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.tool.IToolVO; import org.lamsfoundation.lams.tool.Tool; import org.lamsfoundation.lams.tool.ToolSession; @@ -45,7 +46,6 @@ * * @author Jacky Fang * @since 2005-3-17 - * @version * * @author Ozgur Demirtas 24/06/2005 * @@ -57,9 +57,7 @@ public IToolSessionDAO toolSessionDAO; public IToolContentDAO toolContentDAO; - /** - * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#getAllPotentialLearners(long) - */ + @Override public Set getAllPotentialLearners(long toolSessionId) throws LamsToolServiceException { ToolSession session = toolSessionDAO.getToolSession(toolSessionId); @@ -71,20 +69,67 @@ } } + @Override public IToolVO getToolBySignature(final String toolSignature) { Tool tool = toolDAO.getToolBySignature(toolSignature); return tool.createBasicToolVO(); } + @Override public Tool getPersistToolBySignature(final String toolSignature) { return toolDAO.getToolBySignature(toolSignature); } + @Override public long getToolDefaultContentIdBySignature(final String toolSignature) { return toolDAO.getToolDefaultContentIdBySignature(toolSignature); } + @Override + public String generateUniqueContentFolder() throws FileUtilException, IOException { + + return FileUtil.generateUniqueContentFolderID(); + } + + @Override + public String getLearnerContentFolder(Long toolSessionId, Long userId) { + + ToolSession toolSession = this.getToolSession(toolSessionId); + Long lessonId = toolSession.getLesson().getLessonId(); + String learnerContentFolder = FileUtil.getLearnerContentFolder(lessonId, userId); + + return learnerContentFolder; + } + + @Override + public void saveOrUpdateTool(Tool tool) { + toolDAO.saveOrUpdateTool(tool); + } + /** + * Get the tool session object using the toolSessionId + * + * @param toolSessionId + * @return + */ + @Override + public ToolSession getToolSession(Long toolSessionId) { + return toolSessionDAO.getToolSession(toolSessionId); + } + + @Override + public Boolean isGroupedActivity(long toolContentID) { + List activities = toolContentDAO.findByProperty(Activity.class, "toolContentId", toolContentID); + if (activities.size() == 1) { + Activity activity = activities.get(0); + return activity.getApplyGrouping(); + } else { + log.debug("ToolContent contains multiple activities, can't test whether grouping applies."); + return null; + } + } + + /** * @return Returns the toolDAO. */ public IToolDAO getToolDAO() { @@ -93,7 +138,7 @@ /** * @param toolDAO - * The toolDAO to set. + * The toolDAO to set. */ public void setToolDAO(IToolDAO toolDAO) { this.toolDAO = toolDAO; @@ -112,45 +157,14 @@ * @return */ public IToolContentDAO getToolContentDAO() { - return toolContentDAO; + return toolContentDAO; } /** * * @param toolContentDAO */ public void setToolContentDAO(IToolContentDAO toolContentDAO) { - this.toolContentDAO = toolContentDAO; + this.toolContentDAO = toolContentDAO; } - - public String generateUniqueContentFolder() throws FileUtilException, IOException { - - return FileUtil.generateUniqueContentFolderID(); - - } - - public void saveOrUpdateTool(Tool tool) { - toolDAO.saveOrUpdateTool(tool); - } - - /** - * Get the tool session object using the toolSessionId - * @param toolSessionId - * @return - */ - public ToolSession getToolSession(Long toolSessionId) - { - return toolSessionDAO.getToolSession(toolSessionId); - } - - public Boolean isGroupedActivity(long toolContentID) { - List activities = toolContentDAO.findByProperty(Activity.class, "toolContentId", toolContentID); - if (activities.size() == 1) { - Activity activity = activities.get(0); - return activity.getApplyGrouping(); - } else { - log.debug("ToolContent contains multiple activities, can't test whether grouping applies."); - return null; - } - } } Index: lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java =================================================================== diff -u -r5340a74cf11fbd5145b1a7d2d42697587b1bbea4 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java (.../FileUtil.java) (revision 5340a74cf11fbd5145b1a7d2d42697587b1bbea4) +++ lams_common/src/java/org/lamsfoundation/lams/util/FileUtil.java (.../FileUtil.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -48,6 +48,7 @@ import org.hibernate.id.UUIDHexGenerator; import org.jdom.JDOMException; import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.ToolSession; import org.lamsfoundation.lams.util.zipfile.ZipFileUtilException; import com.thoughtworks.xstream.XStream; @@ -66,6 +67,7 @@ public static final String LAMS_WWW_SECURE_DIR = "secure"; public static final String LAMS_WWW_DIR = "lams-www.war"; + public static final String LAMS_RUNTIME_CONTENT_DIR = "runtime"; private static final long numMilliSecondsInADay = 24 * 60 * 60 * 1000; private static final int FILE_COPY_BUFFER_SIZE = 1024; @@ -700,6 +702,30 @@ return newUniqueContentFolderID; } + + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + public static String getLearnerContentFolder(Long lessonId, Long userId) { + return LAMS_RUNTIME_CONTENT_DIR + "/" + lessonId + "/" + userId; + } + + /** + * Return lesson's content folder which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + public static String getLearnerContentFolder(Long lessonId) { + return LAMS_RUNTIME_CONTENT_DIR + "/" + lessonId; + } /** * Call xstream to get the POJOs from the XML file. To make it backwardly compatible we catch any exceptions due to Index: lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java (.../AttributeNames.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java (.../AttributeNames.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -83,6 +83,7 @@ public static final String ATTR_UPDATE_PROGRESS_BAR = "updateProgressBar"; public static final String ATTR_SESSION_STATUS = "sessionStatus"; public static final String ATTR_ACTIVITY_POSITION = "activityPosition"; + public static final String ATTR_LEARNER_CONTENT_FOLDER = "learnerContentFolder"; // for Pedagogical Planner public static final String PARAM_COMMAND = "command"; Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java =================================================================== diff -u -r8179037dc958585c054547eb7de9be14c6aed233 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision 8179037dc958585c054547eb7de9be14c6aed233) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/ImageBundler.java (.../ImageBundler.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -53,6 +53,7 @@ List directoriesRequired = null; String outputDirectory = null; String contentFolderId = null; + String learnerContentFolder = null; String lamsWwwPath = null; String lamsCentralPath = null; @@ -62,11 +63,12 @@ * @param contentFolderId * the 32-character content folder name */ - public ImageBundler(String outputDirectory, String contentFolderId) { + public ImageBundler(String outputDirectory, String contentFolderId, String learnerContentFolder) { filesToCopy = new HashMap(); directoriesRequired = new ArrayList(); this.outputDirectory = outputDirectory; this.contentFolderId = contentFolderId; + this.learnerContentFolder = learnerContentFolder; String lamsEarDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR); if (lamsEarDir == null) { @@ -89,16 +91,23 @@ if (lamsWwwPath != null) { ImageBundler.log.debug("Copying user generated content from path " + lamsWwwPath); + // copy content folder to output File contentFolderDir = new File(lamsWwwPath + File.separatorChar + "secure" + File.separatorChar + contentFolderId); - if (contentFolderDir.exists() && contentFolderDir.isDirectory()) { - // copy content folder to output File destDir = new File(outputDirectory + File.separatorChar + contentFolderId); FileUtils.copyDirectory(contentFolderDir, destDir); } else { ImageBundler.log.debug("Folder for contentFolderId:" + contentFolderId + "doesn't exist"); } + + // copy learner content folder to output + File learnerContentFolderDir = new File(lamsWwwPath + File.separatorChar + "secure" + File.separatorChar + + learnerContentFolder); + if (learnerContentFolderDir.exists() && learnerContentFolderDir.isDirectory()) { + File destDir = new File(outputDirectory + File.separatorChar + learnerContentFolder); + FileUtils.copyDirectory(learnerContentFolderDir, destDir); + } } File central = new File(lamsCentralPath); Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java =================================================================== diff -u -r3a95b6e5a65bc77a5f4a3a9a011e452aebf30a3f -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java (.../MainExportServlet.java) (revision 3a95b6e5a65bc77a5f4a3a9a011e452aebf30a3f) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/web/action/MainExportServlet.java (.../MainExportServlet.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -107,10 +107,12 @@ MainExportServlet.log.debug("Doing export portfolio"); Portfolio portfolios = null; - Long lessonID = null; String role = null; ToolAccessMode accessMode = null; String exportFilename = ""; + Long lessonID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID)); + //lesson's runtime content folder + String learnerContentFolder = FileUtil.getLearnerContentFolder(lessonID); /** * Get the cookies that were sent along with this request, then pass it onto export service @@ -132,7 +134,6 @@ // TODO check if the user id is coming from the request then the current user should have monitoring // privilege Integer userId = getLearnerUserID(request); - lessonID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID)); if ((role = WebUtil.readStrParam(request, AttributeNames.PARAM_ROLE, true)) != null) { accessMode = role.equals(ToolAccessMode.TEACHER.toString()) ? ToolAccessMode.TEACHER : null; @@ -145,7 +146,6 @@ + learnerLogin + ".zip"; } else if (mode.equals(ToolAccessMode.TEACHER.toString())) { // done in the monitoring environment - lessonID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID)); portfolios = exportService.exportPortfolioForTeacher(lessonID, cookies); exportFilename = ExportPortfolioConstants.EXPORT_TEACHER_PREFIX + " " + portfolios.getLessonName() + ".zip"; } @@ -163,14 +163,14 @@ } // correct all image links in created htmls. - replaceImageFolderLinks(portfolios.getContentFolderID()); + replaceImageFolderLinks(portfolios.getContentFolderID(), learnerContentFolder); // bundle the stylesheet with the package CSSBundler bundler = new CSSBundler(request, cookies, exportTmpDir, exportService.getUserThemes()); bundler.bundleStylesheet(); // bundle all user uploaded content and CKEditor smileys with the package - ImageBundler imageBundler = new ImageBundler(exportTmpDir, portfolios.getContentFolderID()); + ImageBundler imageBundler = new ImageBundler(exportTmpDir, portfolios.getContentFolderID(), learnerContentFolder); imageBundler.bundleImages(); // zip up the contents of the temp export folder using a constant name @@ -198,8 +198,10 @@ * * @param contentFolderI * 32-character content folder name + * @param learnerContentFolder + * runtime content folder */ - private void replaceImageFolderLinks(String contentFolderID) { + private void replaceImageFolderLinks(String contentFolderID, String learnerContentFolder) { File tempDir = new File(exportTmpDir); // finds all the html extension files @@ -209,7 +211,7 @@ for (Iterator it = jspFiles.iterator(); it.hasNext();) { Object element = it.next(); MainExportServlet.log.debug("Correcting links in file " + element.toString()); - replaceImageFolderLinks(element.toString(), contentFolderID); + replaceImageFolderLinks(element.toString(), contentFolderID, learnerContentFolder); } } @@ -220,22 +222,24 @@ * filename * @param contentFolderID * 32-character content folder name - * @param lamsOrRams - * "rams/" if we are running rams and "lams/" otherwise + * @param learnerContentFolder + * runtime content folder */ - private void replaceImageFolderLinks(String filename, String contentFolderID) { + private void replaceImageFolderLinks(String filename, String contentFolderID, String learnerContentFolder) { try { // String to find String ckeditorpath = "/lams/www/secure/" + contentFolderID; String ckeditorrecpath = "../" + contentFolderID + "/Recordings"; String ckeditorsmiley = "/lams/ckeditor/images/smiley"; String ckeditorvr = "/lams/ckeditor/plugins/videorecorder"; + String learnerContentPath = "/+lams/+www/+secure/+" + learnerContentFolder; // Replacing string String newckeditorpath = "../" + contentFolderID; String newckeditorrecpath = "../../../../" + contentFolderID + "/Recordings"; String newckeditorsmiley = "../ckeditor/images/smiley"; String newckeditorvr = "../ckeditor/plugins/videorecorder"; + String newLearnerContentPath = "../" + learnerContentFolder;; File fin = new File(filename); // Open and input stream @@ -255,6 +259,9 @@ Pattern p4 = Pattern.compile(ckeditorvr); Matcher m4 = p4.matcher(""); + + Pattern p5 = Pattern.compile(learnerContentPath); + Matcher m5 = p5.matcher(""); String aLine = null; String output = ""; @@ -275,7 +282,11 @@ // Replace the p3 matching patterns with the newckeditorvr m4.reset(thirdpass); - String result = m4.replaceAll(newckeditorvr); + String forthpass = m4.replaceAll(newckeditorvr); + + // Replace the p4 matching patterns with the newLearnerContentPath + m5.reset(forthpass); + String result = m5.replaceAll(newLearnerContentPath); output = output + result + "\n"; } Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== diff -u -r65e3365a66b2977b268fafdd0b9fe2e5eae732a4 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 65e3365a66b2977b268fafdd0b9fe2e5eae732a4) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java (.../AssessmentServiceImpl.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -67,6 +67,7 @@ import org.lamsfoundation.lams.tool.ToolContentManager; import org.lamsfoundation.lams.tool.ToolOutput; import org.lamsfoundation.lams.tool.ToolOutputDefinition; +import org.lamsfoundation.lams.tool.ToolSession; import org.lamsfoundation.lams.tool.ToolSessionExportOutputData; import org.lamsfoundation.lams.tool.ToolSessionManager; import org.lamsfoundation.lams.tool.assessment.AssessmentConstants; @@ -785,6 +786,21 @@ public AssessmentUser getUser(Long uid) { return (AssessmentUser) assessmentUserDao.getObject(AssessmentUser.class, uid); } + + @Override + public String getMessage(String key) { + return messageService.getMessage(key); + } + + @Override + public boolean isGroupedActivity(long toolContentID) { + return toolService.isGroupedActivity(toolContentID); + } + + @Override + public String getLearnerContentFolder(Long toolSessionId, Long userId) { + return toolService.getLearnerContentFolder(toolSessionId, userId); + } // ***************************************************************************** // private methods @@ -902,20 +918,6 @@ return node; } - /** - * Get a message from the language files with the given key - * - * @param key - * @return - */ - public String getMessage(String key) { - return messageService.getMessage(key); - } - - public boolean isGroupedActivity(long toolContentID) { - return toolService.isGroupedActivity(toolContentID); - } - // ***************************************************************************** // set methods for Spring Bean // ***************************************************************************** Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java =================================================================== diff -u -r65e3365a66b2977b268fafdd0b9fe2e5eae732a4 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision 65e3365a66b2977b268fafdd0b9fe2e5eae732a4) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/IAssessmentService.java (.../IAssessmentService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -275,6 +275,16 @@ * @return */ boolean isGroupedActivity(long toolContentID); + + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + String getLearnerContentFolder(Long toolSessionId, Long userId); } Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java =================================================================== diff -u -r1edbb81f16cedfcc1326e4eca6e520b5b48cbddc -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision 1edbb81f16cedfcc1326e4eca6e520b5b48cbddc) +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/action/LearningAction.java (.../LearningAction.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -197,27 +197,26 @@ int attemptsAllowed = assessment.getAttemptsAllowed(); AssessmentResult lastResult = service.getLastAssessmentResult(assessment.getUid(), assessmentUser.getUserId()); boolean finishedLockForMonitor = (mode != null) && mode.isTeacher() && (lastResult != null) && (lastResult.getFinishDate() != null); - boolean finishedLock = ((assessmentUser != null) && assessmentUser.isSessionFinished() && (attemptsAllowed != 0)) + boolean finishedLock = (assessmentUser.isSessionFinished() && (attemptsAllowed != 0)) || finishedLockForMonitor || ((attemptsAllowed <= dbResultCount) && (attemptsAllowed != 0)); // get notebook entry String entryText = new String(); - if (assessmentUser != null) { NotebookEntry notebookEntry = service.getEntry(toolSessionId, assessmentUser.getUserId().intValue()); if (notebookEntry != null) { entryText = notebookEntry.getEntry(); } - } // basic information sessionMap.put(AssessmentConstants.ATTR_TITLE, assessment.getTitle()); sessionMap.put(AssessmentConstants.ATTR_INSTRUCTIONS, assessment.getInstructions()); sessionMap.put(AssessmentConstants.ATTR_IS_RESUBMIT_ALLOWED, false); sessionMap.put(AssessmentConstants.ATTR_FINISHED_LOCK, finishedLock); - sessionMap.put(AssessmentConstants.ATTR_USER_FINISHED, assessmentUser != null && assessmentUser.isSessionFinished()); + sessionMap.put(AssessmentConstants.ATTR_USER_FINISHED, assessmentUser.isSessionFinished()); sessionMap.put(AssessmentConstants.PARAM_RUN_OFFLINE, assessment.getRunOffline()); - + sessionMap.put(AttributeNames.ATTR_LEARNER_CONTENT_FOLDER, + service.getLearnerContentFolder(toolSessionId, assessmentUser.getUserId())); sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId); sessionMap.put(AssessmentConstants.ATTR_USER, assessmentUser); sessionMap.put(AttributeNames.ATTR_MODE, mode); Index: lams_tool_assessment/web/pages/learning/parts/essay.jsp =================================================================== diff -u -r8179037dc958585c054547eb7de9be14c6aed233 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_assessment/web/pages/learning/parts/essay.jsp (.../essay.jsp) (revision 8179037dc958585c054547eb7de9be14c6aed233) +++ lams_tool_assessment/web/pages/learning/parts/essay.jsp (.../essay.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -9,7 +9,7 @@ - + ${question.answerString} Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== diff -u -r1edbb81f16cedfcc1326e4eca6e520b5b48cbddc -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 1edbb81f16cedfcc1326e4eca6e520b5b48cbddc) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -714,12 +714,14 @@ } + @Override public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, String entryText) { return coreNotebookService.createNotebookEntry(sessionId, notebookToolType, toolSignature, userId, "", entryText); } + @Override public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID) { List list = coreNotebookService.getEntry(sessionId, idType, signature, userID); if (list == null || list.isEmpty()) { @@ -729,16 +731,20 @@ } } - /** - * @param notebookEntry - */ + @Override public void updateEntry(NotebookEntry notebookEntry) { coreNotebookService.updateEntry(notebookEntry); } + @Override public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } + + @Override + public String getLearnerContentFolder(Long toolSessionId, Long userId) { + return toolService.getLearnerContentFolder(toolSessionId, userId); + } // *************************************************************************************************************** // ToolContentManager and ToolSessionManager methods Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java =================================================================== diff -u -r901372af1b71238311d32a55f25ec8ba637bf5ca -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java (.../IForumService.java) (revision 901372af1b71238311d32a55f25ec8ba637bf5ca) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/IForumService.java (.../IForumService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -58,7 +58,7 @@ * @param contentID * @return */ - public Forum getDefaultContent(Long contentID); + Forum getDefaultContent(Long contentID); /** * Update forum by given Forum. If forum does not exist, the create a new forum. @@ -67,7 +67,7 @@ * @return * @throws PersistenceException */ - public Forum updateForum(Forum forum) throws PersistenceException; + Forum updateForum(Forum forum) throws PersistenceException; /** * Upload instruction file @@ -77,7 +77,7 @@ * @return * @throws PersistenceException */ - public Attachment uploadInstructionFile(FormFile file, String type) throws PersistenceException; + Attachment uploadInstructionFile(FormFile file, String type) throws PersistenceException; /** * Get forum by forum UID @@ -86,7 +86,7 @@ * @return * @throws PersistenceException */ - public Forum getForum(Long forumUid) throws PersistenceException; + Forum getForum(Long forumUid) throws PersistenceException; /** * Get forum by forum ID(not record UID) @@ -95,15 +95,15 @@ * @return * @throws PersistenceException */ - public Forum getForumByContentId(Long contentID) throws PersistenceException; + Forum getForumByContentId(Long contentID) throws PersistenceException; /** * Delete authoring page instruction files. * * @param attachmentId * @throws PersistenceException */ - public void deleteForumAttachment(Long attachmentId) throws PersistenceException; + void deleteForumAttachment(Long attachmentId) throws PersistenceException; // ************************************************************************************ // Topic Method @@ -135,7 +135,7 @@ * @return * @throws PersistenceException */ - public Message createRootTopic(Long forumId, Long sessionId, Message message) throws PersistenceException; + Message createRootTopic(Long forumId, Long sessionId, Message message) throws PersistenceException; /** * Update a topic by give Message instance. @@ -144,7 +144,7 @@ * @return * @throws PersistenceException */ - public Message updateTopic(Message message) throws PersistenceException; + Message updateTopic(Message message) throws PersistenceException; /** * Hide a message by given Message instance @@ -153,7 +153,7 @@ * @return * @throws PersistenceException */ - public Message updateMessageHideFlag(Long messageId, boolean hideFlag) throws PersistenceException; + Message updateMessageHideFlag(Long messageId, boolean hideFlag) throws PersistenceException; /** * Reply a topic. @@ -165,15 +165,15 @@ * @return * @throws PersistenceException */ - public Message replyTopic(Long parentId, Long sessionId, Message message) throws PersistenceException; + Message replyTopic(Long parentId, Long sessionId, Message message) throws PersistenceException; /** * Delete the topic by given topic ID. The function will delete all children topics under this topic. * * @param topicId * @throws PersistenceException */ - public void deleteTopic(Long topicId) throws PersistenceException; + void deleteTopic(Long topicId) throws PersistenceException; /** * Upload message attachment file into repository. This method only upload the given file into system repository. It @@ -183,7 +183,7 @@ * @return Attachment A new instance of attachment has uploaded file VersionID and UUID information. * @throws PersistenceException */ - public Attachment uploadAttachment(FormFile file) throws PersistenceException; + Attachment uploadAttachment(FormFile file) throws PersistenceException; /** * Delete file from repository. @@ -192,7 +192,7 @@ * @param versionID * @throws PersistenceException */ - public void deleteFromRepository(Long uuID, Long versionID) throws PersistenceException; + void deleteFromRepository(Long uuID, Long versionID) throws PersistenceException; // ************************************************************************************ // *********************Get topic methods ********************** @@ -203,7 +203,7 @@ * @param rootTopicId * @return List of MessageDTO */ - public List getTopicThread(Long rootTopicId); + List getTopicThread(Long rootTopicId); /** * Get root topics by a given sessionID value. Simultanousely, it gets back topics, which author posted in authoring @@ -216,22 +216,22 @@ * @param sessionId * @return List of MessageDTO */ - public List getRootTopics(Long sessionId); + List getRootTopics(Long sessionId); /** * Get topics posted by author role. Note that the return type is DTO. * * @return List of MessageDTO */ - public List getAuthoredTopics(Long forumId); + List getAuthoredTopics(Long forumId); /** * This method will look up root topic ID by any level topicID. * * @param topicId * @return */ - public Long getRootTopicId(Long topicId); + Long getRootTopicId(Long topicId); /** * Get message by given message UID @@ -240,15 +240,15 @@ * @return Message * @throws PersistenceException */ - public Message getMessage(Long messageUid) throws PersistenceException; + Message getMessage(Long messageUid) throws PersistenceException; /** * Get message list posted by given user. Note that the return type is DTO. * * @param userId * @return */ - public List getMessagesByUserUid(Long userId, Long sessionId); + List getMessagesByUserUid(Long userId, Long sessionId); /** * Get how many post of this user post in a special session. DOES NOT include posts from author. @@ -257,7 +257,7 @@ * @param sessionId * @return */ - public int getTopicsNum(Long userID, Long sessionId); + int getTopicsNum(Long userID, Long sessionId); /** * Returns the number of posts this user has made in this topic. @@ -266,7 +266,7 @@ * @param topicId * @return */ - public int getNumOfPostsByTopic(Long userId, Long topicId); + int getNumOfPostsByTopic(Long userId, Long topicId); // ************************************************************************************ // Session Method @@ -277,23 +277,23 @@ * @param sessionId * @return */ - public ForumToolSession getSessionBySessionId(Long sessionId); + ForumToolSession getSessionBySessionId(Long sessionId); /** * Get session list according to content ID. * * @param contentID * @return List */ - public List getSessionsByContentId(Long contentID); + List getSessionsByContentId(Long contentID); /** * Get all message according to the given session ID. * * @param sessionID * @return */ - public List getAllTopicsFromSession(Long sessionID); + List getAllTopicsFromSession(Long sessionID); // ************************************************************************************ // User Method @@ -303,39 +303,39 @@ * * @param forumUser */ - public void createUser(ForumUser forumUser); + void createUser(ForumUser forumUser); /** * Get user by user ID (not record UID). * * @param userId * @return */ - public ForumUser getUserByUserAndSession(Long userId, Long sessionId); + ForumUser getUserByUserAndSession(Long userId, Long sessionId); /** * Get user list by given session ID. * * @param sessionID * @return */ - public List getUsersBySessionId(Long sessionID); + List getUsersBySessionId(Long sessionID); /** * Get user by uid * * @param userUid * @return */ - public ForumUser getUser(Long userUid); + ForumUser getUser(Long userUid); /** * Get user by user ID * * @param userId * @return */ - public ForumUser getUserByID(Long userId); + ForumUser getUserByID(Long userId); /** * Update report contained inside specified message. @@ -351,17 +351,17 @@ // ************************************************************************************ // Miscellaneous Method // ************************************************************************************ - public void releaseMarksForSession(Long sessionID); + void releaseMarksForSession(Long sessionID); /** The topic updates (for monitoring) are done in the web layer, so need the audit service to log the updates */ - public IAuditService getAuditService(); + IAuditService getAuditService(); /** * Mark user completing a session. * * @param currentUser */ - public void finishUserSession(ForumUser currentUser); + void finishUserSession(ForumUser currentUser); /** * Create refection entry into notebook tool. @@ -372,7 +372,7 @@ * @param userId * @param entryText */ - public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, + Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, String entryText); /** @@ -384,14 +384,14 @@ * @param userID * @return */ - public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID); + NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID); /** * @param notebookEntry */ - public void updateEntry(NotebookEntry notebookEntry); + void updateEntry(NotebookEntry notebookEntry); - public IEventNotificationService getEventNotificationService(); + IEventNotificationService getEventNotificationService(); /** * Gets a message from resource bundle. Same as in JSP pages. @@ -412,9 +412,9 @@ * existing conditions; required to check if a condition with the same name does not exist. * @return unique ForumCondition name */ - public String createTextSearchConditionName(Collection existingConditions); + String createTextSearchConditionName(Collection existingConditions); - public void deleteCondition(ForumCondition condition) throws PersistenceException; + void deleteCondition(ForumCondition condition) throws PersistenceException; void sendNotificationsOnNewPosting(Long forumId, Long sessionId, Message message); @@ -426,6 +426,16 @@ */ boolean isGroupedActivity(long toolContentID); + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + String getLearnerContentFolder(Long toolSessionId, Long userId); + AverageRatingDTO rateMessage(Long messageId, Long userId, Long toolSessionID, float rating); AverageRatingDTO getAverageRatingDTOByMessage(Long responseId); Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java =================================================================== diff -u -r1edbb81f16cedfcc1326e4eca6e520b5b48cbddc -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java (.../LearningAction.java) (revision 1edbb81f16cedfcc1326e4eca6e520b5b48cbddc) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java (.../LearningAction.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -231,6 +231,8 @@ sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); sessionMap.put(ForumConstants.ATTR_FORUM_TITLE, forum.getTitle()); sessionMap.put(ForumConstants.ATTR_FORUM_INSTRCUTION, forum.getInstructions()); + sessionMap.put(AttributeNames.ATTR_LEARNER_CONTENT_FOLDER, + forumService.getLearnerContentFolder(sessionId, forumUser.getUserId())); sessionMap.put(ForumConstants.ATTR_MINIMUM_REPLY, forum.getMinimumReply()); sessionMap.put(ForumConstants.ATTR_MAXIMUM_REPLY, forum.getMaximumReply()); Index: lams_tool_forum/web/jsps/learning/message/bodyarea.jsp =================================================================== diff -u -rdb44c0602e8fa1b68b2ebce18a58a3d8215cc61b -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_forum/web/jsps/learning/message/bodyarea.jsp (.../bodyarea.jsp) (revision db44c0602e8fa1b68b2ebce18a58a3d8215cc61b) +++ lams_tool_forum/web/jsps/learning/message/bodyarea.jsp (.../bodyarea.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -4,9 +4,9 @@ - + + <%-- Does not user general tag becuase this field need keep compatible with FCKEditor's content --%> Index: lams_tool_forum/web/jsps/monitoring/updatemarks.jsp =================================================================== diff -u -rdb44c0602e8fa1b68b2ebce18a58a3d8215cc61b -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_forum/web/jsps/monitoring/updatemarks.jsp (.../updatemarks.jsp) (revision db44c0602e8fa1b68b2ebce18a58a3d8215cc61b) +++ lams_tool_forum/web/jsps/monitoring/updatemarks.jsp (.../updatemarks.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -70,7 +70,7 @@
+ toolbarSet="DefaultMonitor"> Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java =================================================================== diff -u -r629b2631320321b57015e15be850e7c6b747225f -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java (.../IQaService.java) (revision 629b2631320321b57015e15be850e7c6b747225f) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java (.../IQaService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -60,19 +60,19 @@ * @return the qa object */ - public QaContent getQa(long toolContentId) throws QaApplicationException; + QaContent getQa(long toolContentId) throws QaApplicationException; - public void saveOrUpdateQa(QaContent qa) throws QaApplicationException; + void saveOrUpdateQa(QaContent qa) throws QaApplicationException; - public int getTotalNumberOfUsers(QaContent qa) throws QaApplicationException; + int getTotalNumberOfUsers(QaContent qa) throws QaApplicationException; - public int countSessionComplete(QaContent qa) throws QaApplicationException; + int countSessionComplete(QaContent qa) throws QaApplicationException; - public void updateQaQueUsr(QaQueUsr qaQueUsr) throws QaApplicationException; + void updateQaQueUsr(QaQueUsr qaQueUsr) throws QaApplicationException; - public QaQueUsr loadQaQueUsr(Long userId) throws QaApplicationException; + QaQueUsr loadQaQueUsr(Long userId) throws QaApplicationException; - public QaUsrResp getResponseByUserAndQuestion(final Long queUsrId, final Long qaQueContentId) + QaUsrResp getResponseByUserAndQuestion(final Long queUsrId, final Long qaQueContentId) throws QaApplicationException; /** @@ -84,25 +84,25 @@ */ void updateResponseWithNewAnswer(String newAnswer, String toolSessionID, Long questionDisplayOrder); - public void createQaQue(QaQueContent qaQuestion) throws QaApplicationException; + void createQaQue(QaQueContent qaQuestion) throws QaApplicationException; - public void removeQaQueContent(QaQueContent qaQuestion) throws QaApplicationException; + void removeQaQueContent(QaQueContent qaQuestion) throws QaApplicationException; - public void createQaUsrResp(QaUsrResp qaUsrResp) throws QaApplicationException; + void createQaUsrResp(QaUsrResp qaUsrResp) throws QaApplicationException; - public void updateUserResponse(QaUsrResp resp) throws QaApplicationException; + void updateUserResponse(QaUsrResp resp) throws QaApplicationException; - public QaUsrResp getResponseById(Long responseId) throws QaApplicationException; + QaUsrResp getResponseById(Long responseId) throws QaApplicationException; - public QaQueContent getQuestionContentByQuestionText(final String question, Long contentUid) + QaQueContent getQuestionContentByQuestionText(final String question, Long contentUid) throws QaApplicationException; - public QaQueContent getQuestionByContentAndDisplayOrder(Long displayOrder, Long contentUid) + QaQueContent getQuestionByContentAndDisplayOrder(Long displayOrder, Long contentUid) throws QaApplicationException; - public List getAllQuestionEntriesSorted(final long qaContentId) throws QaApplicationException; + List getAllQuestionEntriesSorted(final long qaContentId) throws QaApplicationException; - public void saveOrUpdateQaQueContent(QaQueContent qaQuestion) throws QaApplicationException; + void saveOrUpdateQaQueContent(QaQueContent qaQuestion) throws QaApplicationException; /** * Return the qa session object according to the requested session id. @@ -111,55 +111,55 @@ * qa session id * @return the qa session object */ - public QaSession retrieveQaSession(long qaSessionId) throws QaApplicationException; + QaSession retrieveQaSession(long qaSessionId) throws QaApplicationException; - public QaSession getSessionById(long qaSessionId) throws QaApplicationException; + QaSession getSessionById(long qaSessionId) throws QaApplicationException; - public void createQaSession(QaSession qaSession) throws QaApplicationException; + void createQaSession(QaSession qaSession) throws QaApplicationException; - public List getSessionNamesFromContent(QaContent qaContent) throws QaApplicationException; + List getSessionNamesFromContent(QaContent qaContent) throws QaApplicationException; - public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException; + void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException; - public List getSessionsFromContent(QaContent qaContent) throws QaApplicationException; + List getSessionsFromContent(QaContent qaContent) throws QaApplicationException; - public QaQueUsr createUser(Long toolSessionID) throws QaApplicationException; + QaQueUsr createUser(Long toolSessionID) throws QaApplicationException; - public void updateQaSession(QaSession qaSession) throws QaApplicationException; + void updateQaSession(QaSession qaSession) throws QaApplicationException; - public QaQueUsr getQaQueUsrById(long qaQueUsrId) throws QaApplicationException; + QaQueUsr getQaQueUsrById(long qaQueUsrId) throws QaApplicationException; - public void updateQa(QaContent qa) throws QaApplicationException; + void updateQa(QaContent qa) throws QaApplicationException; - public void createQa(QaContent qa) throws QaApplicationException; + void createQa(QaContent qa) throws QaApplicationException; - public void hideResponse(QaUsrResp qaUsrResp) throws QaApplicationException; + void hideResponse(QaUsrResp qaUsrResp) throws QaApplicationException; - public void showResponse(QaUsrResp qaUsrResp) throws QaApplicationException; + void showResponse(QaUsrResp qaUsrResp) throws QaApplicationException; - public QaContent retrieveQaBySession(long qaSessionId) throws QaApplicationException; + QaContent retrieveQaBySession(long qaSessionId) throws QaApplicationException; - public QaQueUsr getUserByIdAndSession(final Long queUsrId, final Long qaSessionId) throws QaApplicationException; + QaQueUsr getUserByIdAndSession(final Long queUsrId, final Long qaSessionId) throws QaApplicationException; - public void removeUserResponse(QaUsrResp resp) throws QaApplicationException; + void removeUserResponse(QaUsrResp resp) throws QaApplicationException; - public List getAllQuestionEntries(final Long uid) throws QaApplicationException; + List getAllQuestionEntries(final Long uid) throws QaApplicationException; - public List getUserBySessionOnly(final QaSession qaSession) throws QaApplicationException; + List getUserBySessionOnly(final QaSession qaSession) throws QaApplicationException; /** * copyToolContent(Long fromContentId, Long toContentId) return void * * @param fromContentId * @param toContentId */ - public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; + void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException; + void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException; - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException; + void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException; - public boolean isStudentActivityOccurredGlobal(QaContent qaContent) throws QaApplicationException; + boolean isStudentActivityOccurredGlobal(QaContent qaContent) throws QaApplicationException; /** * createToolSession(Long toolSessionId,String toolSessionName, Long @@ -171,7 +171,7 @@ * @param toolSessionId * @param toolContentId */ - public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException; + void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException; /** * leaveToolSession(Long toolSessionId, Long learnerId) @@ -182,40 +182,40 @@ * @param toolSessionId * @param toolContentId */ - public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException; + String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException; - public IToolVO getToolBySignature(String toolSignature) throws QaApplicationException; + IToolVO getToolBySignature(String toolSignature) throws QaApplicationException; - public long getToolDefaultContentIdBySignature(String toolSignature) throws QaApplicationException; + long getToolDefaultContentIdBySignature(String toolSignature) throws QaApplicationException; - public ITicket getRepositoryLoginTicket() throws QaApplicationException; + ITicket getRepositoryLoginTicket() throws QaApplicationException; - public void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException; + void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException; - public InputStream downloadFile(Long uuid, Long versionID) throws QaApplicationException; + InputStream downloadFile(Long uuid, Long versionID) throws QaApplicationException; - public void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) + void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) throws QaApplicationException; - public void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException; + void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException; - public void removeFile(Long submissionId) throws QaApplicationException; + void removeFile(Long submissionId) throws QaApplicationException; - public List retrieveQaUploadedFiles(QaContent qa) throws QaApplicationException; + List retrieveQaUploadedFiles(QaContent qa) throws QaApplicationException; - public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry); + Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry); - public NotebookEntry getEntry(Long id, Integer idType, String signature, Integer userID); + NotebookEntry getEntry(Long id, Integer idType, String signature, Integer userID); /** * Get the LAMS audit service. Needed as the web layer controls the staff * updating of an answer, so the log entry must be made by the web layer. */ - public IAuditService getAuditService(); + IAuditService getAuditService(); - public void updateEntry(NotebookEntry notebookEntry); + void updateEntry(NotebookEntry notebookEntry); - public QaContent getQaContentBySessionId(Long sessionId); + QaContent getQaContentBySessionId(Long sessionId); /** * Creates an unique name for a QaCondition. It consists of the tool output @@ -226,69 +226,69 @@ * the same name does not exist. * @return unique QaCondition name */ - public String createConditionName(Collection existingConditions); + String createConditionName(Collection existingConditions); - public void deleteCondition(QaCondition condition); + void deleteCondition(QaCondition condition); - public QaCondition createDefaultComplexCondition(QaContent qaContent); + QaCondition createDefaultComplexCondition(QaContent qaContent); /** * Gets the qa config item with the given key * * @param configKey * @return */ - public QaConfigItem getConfigItem(String configKey); + QaConfigItem getConfigItem(String configKey); /** * Saves or updates a qa config item * * @param configItem */ - public void saveOrUpdateConfigItem(QaConfigItem configItem); + void saveOrUpdateConfigItem(QaConfigItem configItem); /** * Gets the set of wizard categories from the database * * @return */ - public SortedSet getWizardCategories(); + SortedSet getWizardCategories(); /** * Saves the entire set of QaWizardCategories (including the child cognitive * skills and questions) * * @param categories */ - public void saveOrUpdateQaWizardCategories(SortedSet categories); + void saveOrUpdateQaWizardCategories(SortedSet categories); /** * Deletes a wizard category from the db * * @param uid */ - public void deleteWizardCategoryByUID(Long uid); + void deleteWizardCategoryByUID(Long uid); /** * Deletes a wizard cognitive skill from the db * * @param uid */ - public void deleteWizardSkillByUID(Long uid); + void deleteWizardSkillByUID(Long uid); /** * Deletes a wizard question from the db * * @param uid */ - public void deleteWizardQuestionByUID(Long uid); + void deleteWizardQuestionByUID(Long uid); /** * Deletes all categories, sub skills and sub questions */ - public void deleteAllWizardCategories(); + void deleteAllWizardCategories(); - public void removeQuestionsFromCache(QaContent qaContent); + void removeQuestionsFromCache(QaContent qaContent); /** * Returns whether activity is grouped and therefore it is expected more than one tool session. @@ -297,6 +297,16 @@ * @return */ boolean isGroupedActivity(long toolContentID); + + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + String getLearnerContentFolder(Long toolSessionId, Long userId); AverageRatingDTO rateResponse(Long responseId, Long userId, Long toolSessionID, float rating); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== diff -u -r629b2631320321b57015e15be850e7c6b747225f -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision 629b2631320321b57015e15be850e7c6b747225f) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java (.../QaServicePOJO.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -1076,10 +1076,12 @@ qaUploadedFileDAO.removeUploadFile(submissionId); } + @Override public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); } + @Override public NotebookEntry getEntry(Long id, Integer idType, String signature, Integer userID) { List list = coreNotebookService.getEntry(id, idType, signature, userID); @@ -1090,9 +1092,15 @@ } } + @Override public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } + + @Override + public String getLearnerContentFolder(Long toolSessionId, Long userId) { + return toolService.getLearnerContentFolder(toolSessionId, userId); + } /** * @return Returns the cred. Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== diff -u -r629b2631320321b57015e15be850e7c6b747225f -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 629b2631320321b57015e15be850e7c6b747225f) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java (.../QaLearningStarterAction.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -141,13 +141,16 @@ Map mapQuestions = new TreeMap(); String httpSessionID = qaLearningForm.getHttpSessionID(); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); if (sessionMap == null) { - sessionMap = new SessionMap(); + sessionMap = new SessionMap(); Map mapSequentialAnswers = new HashMap(); sessionMap.put(MAP_SEQUENTIAL_ANSWERS_KEY, mapSequentialAnswers); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); qaLearningForm.setHttpSessionID(sessionMap.getSessionID()); + + sessionMap.put(AttributeNames.ATTR_LEARNER_CONTENT_FOLDER, + qaService.getLearnerContentFolder(new Long(toolSessionID), qaUser.getQueUsrId())); } GeneralLearnerFlowDTO generalLearnerFlowDTO = LearningUtil.buildGeneralLearnerFlowDTO(qaContent); Index: lams_tool_laqa/web/learning/AnswersContent.jsp =================================================================== diff -u -r96624ae172b4b193603927a3d39c54572e0d6b4c -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision 96624ae172b4b193603927a3d39c54572e0d6b4c) +++ lams_tool_laqa/web/learning/AnswersContent.jsp (.../AnswersContent.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -9,7 +9,7 @@ - + Index: lams_tool_laqa/web/learning/CombinedAnswersContent.jsp =================================================================== diff -u -r96624ae172b4b193603927a3d39c54572e0d6b4c -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 96624ae172b4b193603927a3d39c54572e0d6b4c) +++ lams_tool_laqa/web/learning/CombinedAnswersContent.jsp (.../CombinedAnswersContent.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -34,7 +34,7 @@ + contentFolderID="${sessionMap.learnerContentFolder}" toolbarSet="DefaultLearner"> Index: lams_tool_laqa/web/learning/SequentialAnswersContent.jsp =================================================================== diff -u -r96624ae172b4b193603927a3d39c54572e0d6b4c -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision 96624ae172b4b193603927a3d39c54572e0d6b4c) +++ lams_tool_laqa/web/learning/SequentialAnswersContent.jsp (.../SequentialAnswersContent.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -38,7 +38,7 @@ + contentFolderID="${sessionMap.learnerContentFolder}" toolbarSet="DefaultLearner"> Index: lams_tool_laqa/web/monitoring/AllSessionsSummary.jsp =================================================================== diff -u -r053dac6b5d6c7b63fa4278c80e140717c2b5cd33 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/web/monitoring/AllSessionsSummary.jsp (.../AllSessionsSummary.jsp) (revision 053dac6b5d6c7b63fa4278c80e140717c2b5cd33) +++ lams_tool_laqa/web/monitoring/AllSessionsSummary.jsp (.../AllSessionsSummary.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -147,7 +147,7 @@ + toolbarSet="DefaultMonitor"> Index: lams_tool_laqa/web/monitoring/IndividualSessionSummary.jsp =================================================================== diff -u -r053dac6b5d6c7b63fa4278c80e140717c2b5cd33 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_laqa/web/monitoring/IndividualSessionSummary.jsp (.../IndividualSessionSummary.jsp) (revision 053dac6b5d6c7b63fa4278c80e140717c2b5cd33) +++ lams_tool_laqa/web/monitoring/IndividualSessionSummary.jsp (.../IndividualSessionSummary.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -134,7 +134,7 @@ + toolbarSet="DefaultMonitor"> Fisheye: Tag 7817bc4fce30416c9737875ae2d137be0c6aa8ba refers to a dead (removed) revision in file `lams_tool_notebook/.settings/org.eclipse.jdt.core.prefs'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java =================================================================== diff -u -r6b8c709afa957841178a62f129e7d036a2478311 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java (.../INotebookService.java) (revision 6b8c709afa957841178a62f129e7d036a2478311) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java (.../INotebookService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -176,4 +176,15 @@ void deleteCondition(NotebookCondition condition); boolean isGroupedActivity(long toolContentID); + + /** + * Return content folder (unique to each learner and lesson) which is used for storing user generated content. + * It's been used by CKEditor. + * + * @param toolSessionId + * @param userId + * @return + */ + String getLearnerContentFolder(Long toolSessionId, Long userId); + } \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java =================================================================== diff -u -r37b49e5e78d2b57936d98e68f6057539472b7725 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java (.../NotebookService.java) (revision 37b49e5e78d2b57936d98e68f6057539472b7725) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java (.../NotebookService.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -661,9 +661,15 @@ } } + @Override public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } + + @Override + public String getLearnerContentFolder(Long toolSessionId, Long userId) { + return toolService.getLearnerContentFolder(toolSessionId, userId); + } public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { return getNotebookOutputFactory().getSupportedDefinitionClasses(definitionType); Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java (.../LearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java (.../LearningAction.java) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -165,6 +165,9 @@ } request.setAttribute("finishedActivity", notebookUser.isFinishedActivity()); + request.setAttribute(AttributeNames.ATTR_LEARNER_CONTENT_FOLDER, + notebookService.getLearnerContentFolder(toolSessionID, notebookUser.getUserId())); + // date and time restriction LDEV-2657 Date submissionDeadline = notebook.getSubmissionDeadline(); if (submissionDeadline != null) { Index: lams_tool_notebook/web/pages/learning/notebook.jsp =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_notebook/web/pages/learning/notebook.jsp (.../notebook.jsp) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_notebook/web/pages/learning/notebook.jsp (.../notebook.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -81,14 +81,13 @@ + value="<%=request.getAttribute(org.apache.struts.taglib.html.Constants.BEAN_KEY)%>" /> - Index: lams_tool_sbmt/web/monitoring/mark/updatemark.jsp =================================================================== diff -u -r8179037dc958585c054547eb7de9be14c6aed233 -r7817bc4fce30416c9737875ae2d137be0c6aa8ba --- lams_tool_sbmt/web/monitoring/mark/updatemark.jsp (.../updatemark.jsp) (revision 8179037dc958585c054547eb7de9be14c6aed233) +++ lams_tool_sbmt/web/monitoring/mark/updatemark.jsp (.../updatemark.jsp) (revision 7817bc4fce30416c9737875ae2d137be0c6aa8ba) @@ -87,7 +87,7 @@
+ toolbarSet="DefaultMonitor">