Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r81d937bb6b9380b64f53e9feb482514c6b6a42b1 -r6c765552ace140caa004eebd60096ff9ff26bb7c Binary files differ Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java =================================================================== diff -u -re6b3b4b473ebb151c10733808c40d4276b4f81ab -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision e6b3b4b473ebb151c10733808c40d4276b4f81ab) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/GradebookService.java (.../GradebookService.java) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -62,7 +62,6 @@ import org.lamsfoundation.lams.learningdesign.FloatingActivity; import org.lamsfoundation.lams.learningdesign.Group; import org.lamsfoundation.lams.learningdesign.Grouping; -import org.lamsfoundation.lams.learningdesign.GroupingActivity; import org.lamsfoundation.lams.learningdesign.LearningDesign; import org.lamsfoundation.lams.learningdesign.OptionsActivity; import org.lamsfoundation.lams.learningdesign.ParallelActivity; @@ -110,7 +109,7 @@ private static Logger logger = Logger.getLogger(GradebookService.class); private static final ExcelCell[] EMPTY_ROW = new ExcelCell[4]; - + private static final String TOOL_SIGNATURE_ASSESSMENT = "laasse10"; public static final String TOOL_SIGNATURE_SCRATCHIE = "lascrt11"; public static final String TOOL_SIGNATURE_MCQ = "lamc11"; @@ -193,6 +192,46 @@ } @Override + public List getGBLessonComplete(Long lessonId, Integer userId) { + GradebookService.logger + .debug("Getting lesson complete gradebook user data for lesson: " + lessonId + ". For user: " + userId); + + Lesson lesson = lessonService.getLesson(lessonId); + User learner = (User) userService.findById(User.class, userId); + + List gradebookActivityDTOs = new ArrayList(); + + List activities = getLessonActivitiesForLearner(lesson, userId); + for (ToolActivity activity : activities) { + String groupName = null; + Long groupId = null; + if (activity.getGrouping() != null) { + Group group = activity.getGroupFor(learner); + if (group != null) { + groupName = group.getGroupName(); + groupId = group.getGroupId(); + } + } + GBActivityGridRowDTO activityDTO = new GBActivityGridRowDTO(activity, groupName, groupId); + + GradebookUserActivity gradebookActivity = gradebookDAO + .getGradebookUserDataForActivity(activity.getActivityId(), learner.getUserId()); + if (gradebookActivity != null) { + activityDTO.setMark(gradebookActivity.getMark()); + } + activityDTO.setAverageMark(gradebookDAO.getAverageMarkForActivity(activity.getActivityId())); + + LearnerProgress learnerProgress = lessonService.getUserProgressForLesson(learner.getUserId(), + lesson.getLessonId()); + activityDTO.setStatus(getActivityStatusStr(learnerProgress, activity)); + + gradebookActivityDTOs.add(activityDTO); + } + + return gradebookActivityDTOs; + } + + @Override public List getGBActivityRowsForLesson(Long lessonId, TimeZone userTimezone) { GradebookService.logger.debug("Getting gradebook data for lesson: " + lessonId); @@ -491,7 +530,8 @@ Integer userId = user.getUserId(); GradebookUserLesson gradebookUserLesson = userToGradebookUserLessonMap.get(userId); - List userActivities = gradebookDAO.getGradebookUserActivitiesForLesson(lessonId, userId); + List userActivities = gradebookDAO.getGradebookUserActivitiesForLesson(lessonId, + userId); Double totalMark = calculateLessonMark(isWeightedMarks(lesson.getLearningDesign()), userActivities, null); if (totalMark != null) { @@ -608,29 +648,32 @@ gradebookUserActivity, gradebookUserLesson); } + @Override public boolean isWeightedMarks(LearningDesign design) { - Set activities = (Set) design.getActivities(); - for ( Activity activity : activities) { - if ( activity.isToolActivity() ) { + Set activities = design.getActivities(); + for (Activity activity : activities) { + if (activity.isToolActivity()) { // fetch real object, otherwise there is a cast error - ToolActivity act = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId()); + ToolActivity act = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId()); ActivityEvaluation eval = act.getEvaluation(); - if ( eval != null && eval.getWeight() != null && eval.getWeight() > 0) + if (eval != null && eval.getWeight() != null && eval.getWeight() > 0) { return true; + } } } return false; } + @Override public List getWeights(LearningDesign design) { List evaluations = new ArrayList(); - Set activities = (Set) design.getActivities(); - for ( Activity activity : activities) { - if ( activity.isToolActivity() ) { + Set activities = design.getActivities(); + for (Activity activity : activities) { + if (activity.isToolActivity()) { // fetch real object, otherwise there is a cast error - ToolActivity act = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId()); + ToolActivity act = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId()); ActivityEvaluation eval = act.getEvaluation(); - if ( eval != null && eval.getWeight() != null && eval.getWeight() > 0) { + if (eval != null && eval.getWeight() != null && eval.getWeight() > 0) { String[] evaluation = new String[3]; evaluation[0] = act.getTitle(); evaluation[1] = eval.getToolOutputDefinition(); @@ -672,8 +715,8 @@ gradebookUserLesson.setLesson(lesson); } - aggregateTotalMarkForLesson(isWeightedMarks(lesson.getLearningDesign()), - gradebookUserLesson, gradebookUserActivity, oldActivityMark); + aggregateTotalMarkForLesson(isWeightedMarks(lesson.getLearningDesign()), gradebookUserLesson, + gradebookUserActivity, oldActivityMark); // audit log changed gradebook mark if (isAuditLogRequired) { @@ -742,7 +785,7 @@ if (organisation != null) { - List lessons = ( view == GBGridView.MON_COURSE || view == GBGridView.LIST ) + List lessons = (view == GBGridView.MON_COURSE || view == GBGridView.LIST) ? gradebookDAO.getLessonsByGroupAndUser(userId, orgId, page, size, sortBy, sortOrder, searchString) : lessonService.getLessonsByGroupAndUser(userId, orgId); @@ -939,9 +982,10 @@ // Adding the lesson average data to the summary Object lessonAverageMarkValue = getAverageMarkForLesson(lesson.getLessonId()); - if ( isWeighted ) - lessonAverageMarkValue = GradebookUtil.niceFormatting((Double)lessonAverageMarkValue, true); - + if (isWeighted) { + lessonAverageMarkValue = GradebookUtil.niceFormatting((Double) lessonAverageMarkValue, true); + } + ExcelCell[] lessonAverageMark = new ExcelCell[2]; lessonAverageMark[0] = new ExcelCell(getMessage("gradebook.export.average.lesson.mark"), true); lessonAverageMark[1] = new ExcelCell(lessonAverageMarkValue, false); @@ -1002,8 +1046,9 @@ for (GBUserGridRowDTO userRow : userRows) { // Adding the user data for the lesson Object userMarkValue = userRow.getMark(); - if ( userMarkValue != null && isWeighted ) - userMarkValue = GradebookUtil.niceFormatting((Double)userMarkValue, true); + if (userMarkValue != null && isWeighted) { + userMarkValue = GradebookUtil.niceFormatting((Double) userMarkValue, true); + } ExcelCell[] userDataRow = new ExcelCell[6]; userDataRow[0] = new ExcelCell(userRow.getLastName(), false); @@ -1024,12 +1069,12 @@ for (ToolActivity activity : activityToUserDTOMap.keySet()) { String toolSignature = activity.getTool().getToolSignature(); //check whether toolActivity has a NumericToolOutput - if ( activity.getEvaluation() != null && (TOOL_SIGNATURE_ASSESSMENT.equals(toolSignature) + if (activity.getEvaluation() != null && (TOOL_SIGNATURE_ASSESSMENT.equals(toolSignature) || TOOL_SIGNATURE_MCQ.equals(toolSignature) || TOOL_SIGNATURE_SCRATCHIE.equals(toolSignature))) { filteredActivityToUserDTOMap.put(activity, activityToUserDTOMap.get(activity)); } } - + //add header ExcelCell[] headerRow = new ExcelCell[1]; headerRow[0] = new ExcelCell(getMessage("gradebook.summary.activity.marks"), true); @@ -1050,7 +1095,7 @@ } headerRow[count] = new ExcelCell(getMessage("gradebook.export.total.mark"), true); rowList.add(headerRow); - + //iterating through all users in a lesson for (GBUserGridRowDTO userRow : userRows) { ExcelCell[] userDataRow = new ExcelCell[4 + filteredActivityToUserDTOMap.keySet().size()]; @@ -1060,7 +1105,7 @@ userDataRow[count++] = new ExcelCell(userRow.getLogin(), false); for (Activity activity : filteredActivityToUserDTOMap.keySet()) { - + //find according userActivityMark Double userActivityMark = null; List userDtos = filteredActivityToUserDTOMap.get(activity); @@ -1072,10 +1117,11 @@ } userDataRow[count++] = new ExcelCell(userActivityMark, false); } - + Object userMarkValue = userRow.getMark(); - if ( userMarkValue != null && isWeighted ) - userMarkValue = GradebookUtil.niceFormatting((Double)userMarkValue, true); + if (userMarkValue != null && isWeighted) { + userMarkValue = GradebookUtil.niceFormatting((Double) userMarkValue, true); + } userDataRow[count] = new ExcelCell(userMarkValue, false); rowList.add(userDataRow); @@ -1214,7 +1260,7 @@ Set lessons = new TreeSet(new LessonComparator()); lessons.addAll(lessonService.getLessonsByGroupAndUser(userId, organisationId)); - + Map isWeightedLessonMap = new HashMap(); if ((lessons != null) && (lessons.size() > 0)) { @@ -1340,7 +1386,7 @@ if (gradebookUserLesson != null) { Double rawMark = gradebookUserLesson.getMark(); - if ( rawMark != null && isWeightedLessonMap.get(lesson.getLessonId()) ) { + if (rawMark != null && isWeightedLessonMap.get(lesson.getLessonId())) { mark = GradebookUtil.niceFormatting(rawMark, true); } else { mark = rawMark; @@ -1826,19 +1872,20 @@ * * @param gradebookUserLesson */ - private void aggregateTotalMarkForLesson(boolean useWeightings, GradebookUserLesson gradebookUserLesson, GradebookUserActivity markedActivity, - Double oldActivityMark) { - - List userActivities = gradebookDAO.getGradebookUserActivitiesForLesson(gradebookUserLesson.getLesson().getLessonId(), - gradebookUserLesson.getLearner().getUserId()); + private void aggregateTotalMarkForLesson(boolean useWeightings, GradebookUserLesson gradebookUserLesson, + GradebookUserActivity markedActivity, Double oldActivityMark) { + List userActivities = gradebookDAO.getGradebookUserActivitiesForLesson( + gradebookUserLesson.getLesson().getLessonId(), gradebookUserLesson.getLearner().getUserId()); + Double totalMark; if (oldActivityMark == null || gradebookUserLesson.getMark() == null) { totalMark = calculateLessonMark(useWeightings, userActivities, markedActivity); - } else if ( ! useWeightings ) { + } else if (!useWeightings) { totalMark = gradebookUserLesson.getMark() - oldActivityMark; - if ( markedActivity.getMark() != null ) + if (markedActivity.getMark() != null) { totalMark += markedActivity.getMark(); + } } else { Double oldWeightedMark = getWeightedMark(true, markedActivity, oldActivityMark); Double newWeighterMark = getWeightedMark(true, markedActivity, markedActivity.getMark()); @@ -1848,41 +1895,40 @@ gradebookUserLesson.setMark(totalMark); gradebookDAO.insertOrUpdate(gradebookUserLesson); } - - private Double calculateLessonMark(boolean useWeightings, List userActivities, + + private Double calculateLessonMark(boolean useWeightings, List userActivities, GradebookUserActivity markedActivity) { - - Double totalMark = markedActivity != null ? - getWeightedMark(useWeightings, markedActivity, markedActivity.getMark()) : 0.0; - - for ( GradebookUserActivity guact : userActivities ) { - if ( markedActivity == null || guact.getUid() != markedActivity.getUid() ) { - if ( useWeightings ) { - totalMark = totalMark + getWeightedMark(useWeightings, guact, guact.getMark()); - } else { + + Double totalMark = markedActivity != null + ? getWeightedMark(useWeightings, markedActivity, markedActivity.getMark()) + : 0.0; + + for (GradebookUserActivity guact : userActivities) { + if (markedActivity == null || guact.getUid() != markedActivity.getUid()) { + if (useWeightings) { + totalMark = totalMark + getWeightedMark(useWeightings, guact, guact.getMark()); + } else { totalMark = totalMark + guact.getMark(); - } + } } } return totalMark; } - - private Double getWeightedMark( boolean useWeightings, GradebookUserActivity guact, Double inputRawMark) { + + private Double getWeightedMark(boolean useWeightings, GradebookUserActivity guact, Double inputRawMark) { Double rawMark = inputRawMark != null ? inputRawMark : 0.0; - if ( useWeightings ) { + if (useWeightings) { ToolActivity activity = guact.getActivity(); ActivityEvaluation eval = activity.getEvaluation(); Long maxMark = toolService.getActivityMaxPossibleMark(activity); - if ( maxMark == null ) { - logger.error(new StringBuilder("Unable to correctly calculate weighted mark as no maximum mark is known for activity \"") - .append(activity.getTitle()) - .append("\" (") - .append(activity.getActivityId()) - .append("). This activity will be skipped.") - .toString()); + if (maxMark == null) { + logger.error(new StringBuilder( + "Unable to correctly calculate weighted mark as no maximum mark is known for activity \"") + .append(activity.getTitle()).append("\" (").append(activity.getActivityId()) + .append("). This activity will be skipped.").toString()); return 0.0; } - if ( maxMark == 0 ) { + if (maxMark == 0) { return 0.0; } return rawMark / maxMark * eval.getWeight(); @@ -2268,6 +2314,5 @@ public void setMessageService(MessageService messageService) { this.messageService = messageService; } - // ------------------------------------------------------------------------- -} +} \ No newline at end of file Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookService.java =================================================================== diff -u -ra949c337adc53b2df9207aa1de6e500281de7c20 -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookService.java (.../IGradebookService.java) (revision a949c337adc53b2df9207aa1de6e500281de7c20) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/service/IGradebookService.java (.../IGradebookService.java) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -93,6 +93,8 @@ List getGBUserRowsForLesson(Lesson lesson, int page, int size, String sortBy, String sortOrder, String searchString, TimeZone userTimezone); + List getGBLessonComplete(Long lessonId, Integer userId); + // /** // * Gets the user rows containing only users' names. Do proper paging on DB side. // * @@ -311,17 +313,18 @@ */ LinkedHashMap exportSelectedLessonsGradebook(Integer userId, Integer organisationId, String[] lessonIds, boolean simplified); - + /** * Get the raw overall marks for a lesson for charting purposes + * * @param lessonId * @return */ List getMarksArray(Long lessonId); /** Will the marks caculation take into account weighting? */ boolean isWeightedMarks(LearningDesign design); - + /** Get a summary of the weightings */ List getWeights(LearningDesign design); Index: lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java =================================================================== diff -u -re6b3b4b473ebb151c10733808c40d4276b4f81ab -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java (.../GradebookAction.java) (revision e6b3b4b473ebb151c10733808c40d4276b4f81ab) +++ lams_gradebook/src/java/org/lamsfoundation/lams/gradebook/web/action/GradebookAction.java (.../GradebookAction.java) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -20,7 +20,6 @@ * **************************************************************** */ - package org.lamsfoundation.lams.gradebook.web.action; import java.util.ArrayList; @@ -35,6 +34,8 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONArray; +import org.apache.tomcat.util.json.JSONObject; import org.lamsfoundation.lams.gradebook.GradebookUserLesson; import org.lamsfoundation.lams.gradebook.dto.GBLessonGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GBUserGridRowDTO; @@ -64,7 +65,7 @@ /** * @author lfoxton * - * Handles the general requests for content in gradebook + * Handles the general requests for content in gradebook */ public class GradebookAction extends LamsDispatchAction { @@ -110,7 +111,7 @@ String searchOper = WebUtil.readStrParam(request, GradebookConstants.PARAM_SEARCH_OPERATION, true); String searchString = WebUtil.readStrParam(request, GradebookConstants.PARAM_SEARCH_STRING, true); GBGridView view = GradebookUtil.readGBGridViewParam(request, GradebookConstants.PARAM_VIEW, false); - + Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); if (!getSecurityService().isLessonParticipant(lessonID, getUser().getUserID(), "get activity gradebook data", false)) { @@ -134,9 +135,11 @@ // Get the user gradebook list from the db // A slightly different list is needed for userview or activity view if ((view == GBGridView.MON_USER) || (view == GBGridView.LRN_ACTIVITY)) {//2nd level && from personal marks page (2nd level or 1st) - gradebookActivityDTOs = getGradebookService().getGBActivityRowsForLearner(lessonID, userID, currentUserDTO.getTimeZone()); + gradebookActivityDTOs = getGradebookService().getGBActivityRowsForLearner(lessonID, userID, + currentUserDTO.getTimeZone()); } else if (view == GBGridView.MON_ACTIVITY) { - gradebookActivityDTOs = getGradebookService().getGBActivityRowsForLesson(lessonID, currentUserDTO.getTimeZone()); + gradebookActivityDTOs = getGradebookService().getGBActivityRowsForLesson(lessonID, + currentUserDTO.getTimeZone()); } if ((sortBy == null) || sortBy.equals("")) { @@ -150,6 +153,45 @@ return null; } + public ActionForward getLessonCompleteGridData(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + // Getting the params passed in from the jqGrid + Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + UserDTO currentUserDTO = getUser(); + Integer userId = currentUserDTO.getUserID(); + if (!getSecurityService().isLessonParticipant(lessonID, userId, "get lesson complete gradebook data", false)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a learner in the lesson"); + return null; + } + + List gradebookActivityDTOs = getGradebookService().getGBLessonComplete(lessonID, userId); + + JSONObject resultJSON = new JSONObject(); + resultJSON.put(GradebookConstants.ELEMENT_RECORDS, gradebookActivityDTOs.size()); + + JSONArray rowsJSON = new JSONArray(); + for (GradebookGridRowDTO gradebookActivityDTO : gradebookActivityDTOs) { + JSONObject rowJSON = new JSONObject(); + rowJSON.put(GradebookConstants.ELEMENT_ID, gradebookActivityDTO.getId()); + + JSONArray cellJSON = new JSONArray(); + cellJSON.put(gradebookActivityDTO.getRowName()); + cellJSON.put(gradebookActivityDTO.getStatus()); + cellJSON.put(gradebookActivityDTO.getAverageMark()); + cellJSON.put(gradebookActivityDTO.getMark()); + + rowJSON.put(GradebookConstants.ELEMENT_CELL, cellJSON); + rowsJSON.put(rowJSON); + } + resultJSON.put(GradebookConstants.ELEMENT_ROWS, rowsJSON); + + resultJSON.put("averageLessonMark", getGradebookService().getAverageMarkForLesson(lessonID)); + + response.setContentType("application/json;charset=utf-8"); + response.getWriter().print(resultJSON.toString()); + return null; + } + /** * Returns an xml representation of the user grid for gradebook * @@ -180,7 +222,6 @@ String sortBy = WebUtil.readStrParam(request, GradebookConstants.PARAM_SIDX, true); Boolean isSearch = WebUtil.readBooleanParam(request, GradebookConstants.PARAM_SEARCH); String searchField = WebUtil.readStrParam(request, GradebookConstants.PARAM_SEARCH_FIELD, true); - String searchOper = WebUtil.readStrParam(request, GradebookConstants.PARAM_SEARCH_OPERATION, true); String searchString = WebUtil.readStrParam(request, GradebookConstants.PARAM_SEARCH_STRING, true); GBGridView view = GradebookUtil.readGBGridViewParam(request, GradebookConstants.PARAM_VIEW, false); Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true); @@ -191,7 +232,6 @@ // parameters if (isSearch && (searchField == null)) { searchField = GradebookConstants.PARAM_ROW_NAME; - searchOper = GradebookConstants.SEARCH_CONTAINS; searchString = WebUtil.readStrParam(request, GradebookConstants.PARAM_ROW_NAME, true); } @@ -252,7 +292,7 @@ } } - // 2nd table of gradebook course monitor + // 2nd table of gradebook course monitor // if organisationID is specified (but not lessonID) then show results for organisation } else if (organisationID != null) { if (!getSecurityService().isGroupMonitor(organisationID, user.getUserID(), "get gradebook", false)) { @@ -511,7 +551,6 @@ return null; } - Lesson lesson = getLessonService().getLesson(lessonID); Double averageMark = getGradebookService().getAverageMarkForLesson(lessonID); if (averageMark != null) { Index: lams_learning/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r6455f6e20efee02e4c447821693548724bb9cf8c -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6455f6e20efee02e4c447821693548724bb9cf8c) +++ lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -11,6 +11,8 @@ message.activity.loading =The next task is loading. Please wait.... message.lesson.finished =Congratulations, {0}, you have finished. message.lesson.finishedCont =You have now completed the {0} lesson. You can return at anytime to this lesson and revisit and review activities by double clicking on the round icons in progress bar. You can now close this window. +message.lesson.finished.report.load.error =Error while loading data for report +message.lesson.finished.ok =OK label.next.button =Next label.finish.button =Next Activity message.activity.parallel.partialComplete =You have to complete the other task before progressing to the next activity.... @@ -149,4 +151,9 @@ button.kumalive.ok =OK button.kumalive.report.export.all =Export all button.kumalive.report.export.selected =Export selected +gradebook.columntitle.mark =Mark +gradebook.columntitle.activity =Activity +gradebook.columntitle.averageMark =Average mark +gradebook.columntitle.progress =Progress +gradebook.lesson.complete =Grades for this lesson #======= End labels: Exported 102 labels for en AU ===== Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java =================================================================== diff -u -r0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java (.../LessonCompleteActivityAction.java) (revision 0ddeb3a1dcf29cbbba6ed0fccbd139f9c31c347f) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LessonCompleteActivityAction.java (.../LessonCompleteActivityAction.java) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -21,7 +21,6 @@ * **************************************************************** */ - package org.lamsfoundation.lams.learning.web.action; import java.io.UnsupportedEncodingException; @@ -56,9 +55,9 @@ public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException { LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request, getLearnerService()); - - Set releasedLessons = getLessonService().getReleasedSucceedingLessons( - learnerProgress.getLesson().getLessonId(), learnerProgress.getUser().getUserId()); + Lesson lesson = learnerProgress.getLesson(); + Set releasedLessons = getLessonService().getReleasedSucceedingLessons(lesson.getLessonId(), + learnerProgress.getUser().getUserId()); if (!releasedLessons.isEmpty()) { StringBuilder releasedLessonNames = new StringBuilder(); for (Lesson releasedLesson : releasedLessons) { @@ -70,11 +69,12 @@ //checks for lessonFinishUrl parameter String lessonFinishCallbackUrl = getIntegrationService().getLessonFinishCallbackUrl(learnerProgress.getUser(), - learnerProgress.getLesson()); + lesson); if (lessonFinishCallbackUrl != null) { request.setAttribute("lessonFinishUrl", lessonFinishCallbackUrl); } - request.setAttribute("lessonID", learnerProgress.getLesson().getLessonId()); + request.setAttribute("lessonID", lesson.getLessonId()); + request.setAttribute("gradebookOnComplete", lesson.getGradebookOnComplete()); return mapping.findForward("lessonComplete"); } Index: lams_learning/web/lessonComplete.jsp =================================================================== diff -u -r88ac5b72b62094a9a9a45fc38a90dd3e88e29caf -r6c765552ace140caa004eebd60096ff9ff26bb7c --- lams_learning/web/lessonComplete.jsp (.../lessonComplete.jsp) (revision 88ac5b72b62094a9a9a45fc38a90dd3e88e29caf) +++ lams_learning/web/lessonComplete.jsp (.../lessonComplete.jsp) (revision 6c765552ace140caa004eebd60096ff9ff26bb7c) @@ -29,8 +29,21 @@ + + + + @@ -112,4 +184,14 @@ + +
+  
+ +

:

+ +
+
+
+