Index: lams_build/lib/lams/lams-learning.jar =================================================================== diff -u -r0d77512288c6e2c920406ae8f3fe546bf0d93c1a -r9caa0418dd527221031dd5828fa3b3e32da2a7fc Binary files differ Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/ExportPortfolioService.java =================================================================== diff -u -r3c1bbdc3935fc040562568fd6f609bd0e17f1cff -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/ExportPortfolioService.java (.../ExportPortfolioService.java) (revision 3c1bbdc3935fc040562568fd6f609bd0e17f1cff) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/ExportPortfolioService.java (.../ExportPortfolioService.java) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -292,8 +292,23 @@ } } - /** @see org.lamsfoundation.lams.learning.export.service.IExportPortfolioService#setupPortfolios(java.util.Vector, org.lamsfoundation.lams.tool.ToolAccessMode, org.lamsfoundation.lams.usermanagement.User) */ - public Vector setupPortfolios(Vector sortedActivityList, ToolAccessMode accessMode, User user) throws LamsToolServiceException + /** + * This method will iterate through the list of ordered activities and create a Portfolio + * object for each activity. It will set up most of the properies of the Portfolio object. + * This method is used regardless of whether the export is being done by the teacher or + * the student. However, if the export is being done be the teacher, the User object should + * be null. + * + * If the list of ordered activities is null, then a Portfolio object will be created + * with the attribute exportTmpDir set and the array of ToolPortfolios being null. + * + * @param orderedActivityList The ordered activity list to iterate through + * @param accessMode The tool access mode, either Teacher or Learner. + * @param user The learner, or null if export is being done by the teacher. + * @return the array of Portfolio objects + * @throws LamsToolServiceException + */ + protected Vector setupPortfolios(Vector sortedActivityList, ToolAccessMode accessMode, User user) throws LamsToolServiceException { /* these checks are not really needed, the calling code ensures that the right parameters are supplied */ /* if (sortedActivityList == null) @@ -314,15 +329,15 @@ Iterator i = sortedActivityList.iterator(); Vector portfolioList = new Vector(); - Map mapOfValuesToAppend = new HashMap(); while(i.hasNext()) { Activity activity = (Activity)i.next(); if (activity.isToolActivity()) { ToolActivity toolActivity = (ToolActivity)activityDAO.getActivityByActivityId(activity.getActivityId()); - ToolPortfolio portfolio = createToolPortfolio(toolActivity); + ToolPortfolio portfolio = createToolPortfolio(toolActivity,accessMode); + String url = portfolio.getExportUrl(); /* * Append parameters to the export url. @@ -331,36 +346,34 @@ */ if (accessMode == ToolAccessMode.LEARNER) { + url = WebUtil.appendParameterToURL(url, AttributeNames.PARAM_USER_ID, user.getUserId().toString()); ToolSession toolSession = lamsCoreToolService.getToolSessionByActivity(user, toolActivity); - /*if (toolSession == null) - { - String error = "Cannot obtain the toolSessionId for this tool activity. The Tool Session for this user and activity is null. Cannot Continue"; - log.error(error); - throw new ExportPortfolioException(error); - }*/ - mapOfValuesToAppend.put(AttributeNames.PARAM_MODE, ToolAccessMode.LEARNER.toString()); - mapOfValuesToAppend.put(AttributeNames.PARAM_USER_ID, user.getUserId().toString()); - if (toolSession != null) - mapOfValuesToAppend.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSession.getToolSessionId().toString()); + if (toolSession != null) { + url = WebUtil.appendParameterToURL(url, AttributeNames.PARAM_TOOL_SESSION_ID, toolSession.getToolSessionId().toString()); + } } else if (accessMode == ToolAccessMode.TEACHER) { - mapOfValuesToAppend.put(AttributeNames.PARAM_MODE, ToolAccessMode.TEACHER.toString()); - mapOfValuesToAppend.put(AttributeNames.PARAM_TOOL_CONTENT_ID, toolActivity.getToolContentId().toString()); + url = WebUtil.appendParameterToURL(url, AttributeNames.PARAM_TOOL_CONTENT_ID, toolActivity.getToolContentId().toString()); } - - String url = setupExportUrl(mapOfValuesToAppend, portfolio.getExportUrl()); + portfolio.setExportUrl(url); - portfolioList.add(portfolio); //add the portfolio at the end of the list. } } return portfolioList; } - /** @see org.lamsfoundation.lams.learning.export.service.IExportPortfolioService#createToolPortfolio(org.lamsfoundation.lams.learningdesign.ToolActivity) */ - public ToolPortfolio createToolPortfolio(ToolActivity activity) + /** + * Obtains the Tool from the ToolActivity and creates a portfolio object with properties activityId, activityName, + * activityDescription, exportURL set to the value of the ToolActivity's properties activityId, toolDisplayName + * (retrieved from Tool object), title, exportPortfolioUrl respestively. + * + * @param activity The Tool Activity + * @return a Portfolio object + */ + protected ToolPortfolio createToolPortfolio(ToolActivity activity, ToolAccessMode accessMode) { if (activity == null) { @@ -375,31 +388,20 @@ p.setActivityDescription(activity.getTitle()); /* if the tool does not have an export url, use the url that points to the servlet that generates a page saying that the export is not supported */ - String exportUrlForTool = tool.getExportPortfolioUrl(); + String exportUrlForTool = null; + if (accessMode == ToolAccessMode.LEARNER) + exportUrlForTool = tool.getExportPortfolioLearnerUrl(); + else + exportUrlForTool = tool.getExportPortfolioClassUrl(); + if (exportUrlForTool == null || exportUrlForTool.equals("")) p.setExportUrl(ExportPortfolioConstants.URL_FOR_UNSUPPORTED_EXPORT); else - p.setExportUrl(tool.getExportPortfolioUrl()); + p.setExportUrl(exportUrlForTool); return p; } - /** @see org.lamsfoundation.lams.learning.export.service.IExportPortfolioService#setupExportUrl(java.util.Map, java.lang.String) */ - public String setupExportUrl(Map parametersToAppend, String url) - { - int mapSize = parametersToAppend.size(); - Iterator mapIterator = parametersToAppend.entrySet().iterator(); - String urlToReturn = url; - for (int i=0; i< mapSize; i++) - { - Map.Entry entry = (Map.Entry)mapIterator.next(); - String parameterName = (String)entry.getKey(); - String parameterValue = (String)entry.getValue(); - urlToReturn = WebUtil.appendParameterToURL(urlToReturn, parameterName, parameterValue); - } - return urlToReturn; - } - /** @see org.lamsfoundation.lams.learning.export.service.IExportPortfolioService#getOrderedActivityList(org.lamsfoundation.lams.lesson.LearnerProgress) */ public Vector getOrderedActivityList(LearnerProgress learnerProgress) { Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/IExportPortfolioService.java =================================================================== diff -u -r76508b861ffbd4946116702bcb05c9fcdcc98bfb -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/IExportPortfolioService.java (.../IExportPortfolioService.java) (revision 76508b861ffbd4946116702bcb05c9fcdcc98bfb) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/IExportPortfolioService.java (.../IExportPortfolioService.java) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -103,43 +103,6 @@ public Portfolio exportPortfolioForStudent(Integer userId, Long lessonID, boolean anonymity, Cookie[] cookies); /** - * A helper method that sets up the export url for the activity. Will go through all key-value pairs - * in this map, and append it to the url given. - * @param parametersToAppend Map containing parameter name-parameter value pairs, to be appended to the end of the url - * @param url The url in which the parameters should be appended. - * @return The url with all parameters appended. - */ - public String setupExportUrl(Map parametersToAppend, String url); - - /** - * Obtains the Tool from the ToolActivity and creates a portfolio object with properties activityId, activityName, - * activityDescription, exportURL set to the value of the ToolActivity's properties activityId, toolDisplayName - * (retrieved from Tool object), title, exportPortfolioUrl respestively. - * - * @param activity The Tool Activity - * @return a Portfolio object - */ - public ToolPortfolio createToolPortfolio(ToolActivity activity); - - /** - * This method will iterate through the list of ordered activities and create a Portfolio - * object for each activity. It will set up most of the properies of the Portfolio object. - * This method is used regardless of whether the export is being done by the teacher or - * the student. However, if the export is being done be the teacher, the User object should - * be null. - * - * If the list of ordered activities is null, then a Portfolio object will be created - * with the attribute exportTmpDir set and the array of ToolPortfolios being null. - * - * @param orderedActivityList The ordered activity list to iterate through - * @param accessMode The tool access mode, either Teacher or Learner. - * @param user The learner, or null if export is being done by the teacher. - * @return the array of Portfolio objects - * @throws LamsToolServiceException - */ - public Vector setupPortfolios(Vector orderedActivityList, ToolAccessMode accessMode, User user) throws LamsToolServiceException; - - /** * Returns the ordered activity list (ordered by the ActivityOrderComparator) * containing all activities present in the learning design. The list will * only contain Tool Activities. If it comes across a Complex Activity, it Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml =================================================================== diff -u -r05391c36b578d825a02985084cbdd948366ae182 -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 05391c36b578d825a02985084cbdd948366ae182) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -67,8 +67,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java =================================================================== diff -u -rac7570e7c9856db7e7f0d349cdb796c8991cbe21 -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java (.../ActivityMapping.java) (revision ac7570e7c9856db7e7f0d349cdb796c8991cbe21) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java (.../ActivityMapping.java) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -298,7 +298,7 @@ { try { - return toolService.getLearnerToolURLByMode(activity,learner,ToolAccessMode.LEARNER); + return toolService.getToolLearnerURL(activity,learner); } catch (LamsToolServiceException e) { Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java =================================================================== diff -u -rb484303f0791f74da268d0706057ce4dd4281946 -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision b484303f0791f74da268d0706057ce4dd4281946) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -300,6 +300,8 @@ * enviornment. This is the URL that opens up when the user/teacher clicks on * the activity in the monitoring enviornment and then selects a learner OR * in the LEARNER tab when a learner's activity is clicked. + * + * This is also known as the learner progress url. * * @param activityID The activity_id of the activity for which the URL is required * @param userID The user_id of the Learner for whom the URL is being fetched Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== diff -u -rb3427e993a239a27615187eb0b89678c5f0e4e87 -r9caa0418dd527221031dd5828fa3b3e32da2a7fc --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision b3427e993a239a27615187eb0b89678c5f0e4e87) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 9caa0418dd527221031dd5828fa3b3e32da2a7fc) @@ -962,7 +962,7 @@ }else{ if(activity.isToolActivity()){ ToolActivity toolActivity = (ToolActivity)activity; - String toolURL = lamsCoreToolService.getLearnerToolURLByMode(toolActivity,user,ToolAccessMode.TEACHER); + String toolURL = lamsCoreToolService.getToolLearnerProgressURL(toolActivity,user); flashMessage = new FlashMessage("getLearnerActivityURL",new ProgressActivityDTO(activityID,toolURL)); }else{ flashMessage = new FlashMessage("getLearnerActivityURL",