Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/service/GradeBookService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/service/Attic/GradeBookService.java,v diff -u -r1.17 -r1.18 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/service/GradeBookService.java 6 Apr 2009 06:14:03 -0000 1.17 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/service/GradeBookService.java 7 Apr 2009 00:09:15 -0000 1.18 @@ -42,6 +42,8 @@ import org.lamsfoundation.lams.gradebook.dto.GBLessonGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GBUserGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GradeBookGridRowDTO; +import org.lamsfoundation.lams.gradebook.util.GBGridView; +import org.lamsfoundation.lams.gradebook.util.GradeBookConstants; import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.learningdesign.CompetenceMapping; import org.lamsfoundation.lams.learningdesign.ToolActivity; @@ -204,13 +206,14 @@ .getActivityId()); if (firstActivity.isToolActivity() && firstActivity instanceof ToolActivity) { - GBActivityGridRowDTO activityDTO = getGradeBookActivityDTO((ToolActivity)firstActivity, lesson); + GBActivityGridRowDTO activityDTO = getGradeBookActivityDTO((ToolActivity) firstActivity, lesson); gradeBookActivityDTOs.add(activityDTO); } for (Activity activity : activities) { - if (activity.getActivityId().longValue() != firstActivity.getActivityId().longValue() && activity instanceof ToolActivity) { - GBActivityGridRowDTO activityDTO = getGradeBookActivityDTO((ToolActivity)activity, lesson); + if (activity.getActivityId().longValue() != firstActivity.getActivityId().longValue() + && activity instanceof ToolActivity) { + GBActivityGridRowDTO activityDTO = getGradeBookActivityDTO((ToolActivity) activity, lesson); gradeBookActivityDTOs.add(activityDTO); } } @@ -351,7 +354,7 @@ * @see org.lamsfoundation.lams.gradebook.service.IGradeBookService#getGBLessonRows(org.lamsfoundation.lams.usermanagement.Organisation) */ @SuppressWarnings("unchecked") - public List getGBLessonRows(Organisation organisation, User user) { + public List getGBLessonRows(Organisation organisation, User user, GBGridView view) { List lessonRows = new ArrayList(); if (organisation != null) { @@ -367,16 +370,38 @@ lessonRow.setId(lesson.getLessonId()); lessonRow.setStartDate(getLocaleDateString(user, lesson.getStartDateTime())); - // Setting the timeTaken value as the average for the lesson, as this is not a specific user view - lessonRow.setAverageTimeTaken(gradeBookDAO.getAverageDurationLesson(lesson.getLessonId())); - lessonRow.setLessonDescription(lesson.getLessonDescription()); - lessonRow.setAverageMark(gradeBookDAO.getAverageMarkForLesson(lesson.getLessonId())); - String gbMonURL = Configuration.get(ConfigurationKeys.SERVER_URL) - + "gradebook/gradebookMonitoring.do?lessonID=" + lesson.getLessonId().toString(); + + if (view == GBGridView.MON_COURSE) { + + // Setting the averages for monitor view + lessonRow.setAverageTimeTaken(gradeBookDAO.getAverageDurationLesson(lesson.getLessonId())); + lessonRow.setAverageMark(gradeBookDAO.getAverageMarkForLesson(lesson.getLessonId())); - lessonRow.setGradeBookMonitorURL(gbMonURL); + // Set the gradebook monitor url + String gbMonURL = Configuration.get(ConfigurationKeys.SERVER_URL) + + "gradebook/gradebookMonitoring.do?lessonID=" + lesson.getLessonId().toString(); + lessonRow.setGradeBookMonitorURL(gbMonURL); + } else if (view == GBGridView.LRN_COURSE) { + + GradeBookUserLesson gbLesson = gradeBookDAO.getGradeBookUserDataForLesson(lesson.getLessonId(), user.getUserId()); + + if (gbLesson != null) { + lessonRow.setMark(gbLesson.getMark()); + } + + LearnerProgress learnerProgress = monitoringService.getLearnerProgress(user.getUserId(), lesson + .getLessonId()); + lessonRow.setStatus(getLessonStatusStr(learnerProgress)); + if (learnerProgress != null) { + if (learnerProgress.getStartDate() != null && learnerProgress.getFinishDate() != null) { + lessonRow.setTimeTaken(learnerProgress.getFinishDate().getTime() + - learnerProgress.getStartDate().getTime()); + } + } + } + if (lesson.getOrganisation().getOrganisationId() != organisation.getOrganisationId()) { lessonRow.setSubGroup(lesson.getOrganisation().getName()); } else { @@ -425,8 +450,9 @@ GBActivityGridRowDTO gactivityDTO = new GBActivityGridRowDTO(); gactivityDTO.setId(activity.getActivityId()); gactivityDTO.setRowName(activity.getTitle()); - - // setting the average time + + // Setting averages + gactivityDTO.setAverageMark(gradeBookDAO.getAverageMarkForActivity(activity.getActivityId())); gactivityDTO.setAverageTimeTaken(gradeBookDAO.getAverageDurationForActivity(activity.getActivityId())); String monitorUrl = Configuration.get(ConfigurationKeys.SERVER_URL) + activity.getTool().getMonitorUrl() + "?" @@ -449,26 +475,6 @@ } gactivityDTO.setCompetences(competenceMappingsStr); - List gradeBookUserActivities = gradeBookDAO - .getAllGradeBookUserActivitiesForActivity(activity.getActivityId()); - - if (gradeBookUserActivities != null) { - - double sum = 0; - double count = 0; - for (GradeBookUserActivity gact : gradeBookUserActivities) { - if (gact.getMark() != null) { - count++; - sum += gact.getMark(); - } - } - - // Setting the mark as an average for the class as this is not a specific user view - if (count != 0) { - gactivityDTO.setAverageMark(sum / count); - } - } - return gactivityDTO; } @@ -501,6 +507,10 @@ gactivityDTO.setTimeTaken(getActivityDuration(learnerProgress, activity)); gactivityDTO.setStatus(getActivityStatusStr(learnerProgress, activity)); + // Setting averages + gactivityDTO.setAverageMark(gradeBookDAO.getAverageMarkForActivity(activity.getActivityId())); + gactivityDTO.setAverageTimeTaken(gradeBookDAO.getAverageDurationForActivity(activity.getActivityId())); + // Get the competences for this activity Set competenceMappings = activity.getCompetenceMappings(); String competenceMappingsStr = ""; Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/service/IGradeBookService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/service/Attic/IGradeBookService.java,v diff -u -r1.7 -r1.8 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/service/IGradeBookService.java 3 Apr 2009 04:57:45 -0000 1.7 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/service/IGradeBookService.java 7 Apr 2009 00:09:15 -0000 1.8 @@ -28,6 +28,7 @@ import org.lamsfoundation.lams.gradebook.dto.GBLessonGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GBUserGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GradeBookGridRowDTO; +import org.lamsfoundation.lams.gradebook.util.GBGridView; import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.learningdesign.ToolActivity; import org.lamsfoundation.lams.lesson.Lesson; @@ -120,7 +121,7 @@ * @param organisation * @return */ - public List getGBLessonRows(Organisation organisation, User user); + public List getGBLessonRows(Organisation organisation, User user, GBGridView view); } \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/util/Attic/GradeBookConstants.java,v diff -u -r1.3 -r1.4 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookConstants.java 6 Apr 2009 06:14:03 -0000 1.3 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookConstants.java 7 Apr 2009 00:09:15 -0000 1.4 @@ -51,6 +51,7 @@ public static final String PARAM_TIME_TAKEN = "timeTaken"; public static final String PARAM_AVG_TIME_TAKEN = "avgTimeTaken"; public static final String PARAM_AVG_MARK = "avgMark"; + public static final String PARAM_VIEW = "view"; // Sort public static final String SORT_DESC = "desc"; @@ -64,9 +65,11 @@ public static final String SEARCH_CONTAINS = "cn"; // Views - public static final String VIEW_ACTIVITY = "activityView"; - public static final String VIEW_USER = "userView"; - + public static final String VIEW_MON_ACTIVITY = "monActivityView"; + public static final String VIEW_MON_USER = "monUserView"; + public static final String VIEW_MON_COURSE= "monCourse"; + public static final String VIEW_LRN_COURSE = "lrnCourse"; + // XML Elemetns public static final String ELEMENT_ROWS = "rows"; public static final String ELEMENT_PAGE = "page"; Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/util/Attic/GradeBookUtil.java,v diff -u -r1.7 -r1.8 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookUtil.java 6 Apr 2009 06:14:03 -0000 1.7 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/util/GradeBookUtil.java 7 Apr 2009 00:09:15 -0000 1.8 @@ -29,6 +29,7 @@ import java.util.Iterator; import java.util.List; +import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -45,6 +46,7 @@ import org.lamsfoundation.lams.gradebook.dto.comparators.GBMarkComparator; import org.lamsfoundation.lams.gradebook.dto.comparators.GBRowNameComparator; import org.lamsfoundation.lams.gradebook.dto.comparators.GBTimeTakenComparator; +import org.lamsfoundation.lams.util.WebUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -70,7 +72,7 @@ * @return */ @SuppressWarnings("unchecked") - public static String toGridXML(List gridRows, String view, String sortBy, boolean isSearch, String searchField, + public static String toGridXML(List gridRows, GBGridView view, String sortBy, boolean isSearch, String searchField, String searchOper, String searchString, String sortOrder, int rowLimit, int page) { // Alter the set based on the parameters @@ -106,7 +108,7 @@ * @return */ @SuppressWarnings("unchecked") - public static String toGridXML(List gridRows, int page, int totalPages, String view) { + public static String toGridXML(List gridRows, int page, int totalPages, GBGridView view) { String xml = ""; try { Document document = getDocument(); @@ -280,5 +282,21 @@ } return ret; } + + public static GBGridView readGBGridViewParam(HttpServletRequest request, String param_mode, boolean optional) { + String view = WebUtil.readStrParam(request, param_mode, optional); + if (view == null) { + return null; + } else if (view.equals(GradeBookConstants.VIEW_MON_USER)) + return GBGridView.MON_USER; + else if (view.equals(GradeBookConstants.VIEW_MON_ACTIVITY)) + return GBGridView.MON_ACTIVITY; + else if (view.equals(GradeBookConstants.VIEW_MON_COURSE)) + return GBGridView.MON_COURSE; + else if (view.equals(GradeBookConstants.VIEW_LRN_COURSE)) + return GBGridView.LRN_COURSE; + else + throw new IllegalArgumentException("[" + view + "] is not a legal mode" + "in LAMS"); + } } Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/Attic/GradeBookAction.java,v diff -u -r1.14 -r1.15 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookAction.java 6 Apr 2009 06:14:03 -0000 1.14 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookAction.java 7 Apr 2009 00:09:15 -0000 1.15 @@ -25,7 +25,6 @@ import java.io.PrintWriter; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Set; @@ -41,6 +40,7 @@ import org.lamsfoundation.lams.gradebook.dto.GBUserGridRowDTO; import org.lamsfoundation.lams.gradebook.dto.GradeBookGridRowDTO; import org.lamsfoundation.lams.gradebook.service.IGradeBookService; +import org.lamsfoundation.lams.gradebook.util.GBGridView; import org.lamsfoundation.lams.gradebook.util.GradeBookConstants; import org.lamsfoundation.lams.gradebook.util.GradeBookUtil; import org.lamsfoundation.lams.learningdesign.Activity; @@ -117,7 +117,7 @@ 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); - String view = WebUtil.readStrParam(request, GradeBookConstants.PARAM_METHOD); + GBGridView view = GradeBookUtil.readGBGridViewParam(request, GradeBookConstants.PARAM_VIEW, false); // Getting the lesson id Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); @@ -130,7 +130,7 @@ // Get the user gradebook list from the db // A slightly different list is needed for userview or activity view - if (view.equals(GradeBookConstants.VIEW_USER)) { + if (view == GBGridView.MON_USER) { Integer userID = WebUtil.readIntParam(request, GradeBookConstants.PARAM_USERID); User learner = (User) userService.findById(User.class, userID); if (learner != null) { @@ -140,7 +140,7 @@ logger.error("No learner found for: " + userID); return null; } - } else if (view.equals(GradeBookConstants.VIEW_ACTIVITY)) { + } else if (view == GBGridView.MON_ACTIVITY) { gradeBookActivityDTOs = gradeBookService.getGBActivityRowsForLesson(lesson); } @@ -196,7 +196,7 @@ 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); - String view = WebUtil.readStrParam(request, GradeBookConstants.PARAM_METHOD); + GBGridView view = GradeBookUtil.readGBGridViewParam(request, GradeBookConstants.PARAM_VIEW, false); Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); @@ -207,9 +207,9 @@ // Get the user gradebook list from the db List gradeBookUserDTOs = new ArrayList(); - if (view.equals(GradeBookConstants.VIEW_USER) || view.equals("courseMonitorView")) { + if (view == GBGridView.MON_USER || view == GBGridView.MON_COURSE) { gradeBookUserDTOs = gradeBookService.getGBUserRowsForLesson(lesson); - } else if (view.equals(GradeBookConstants.VIEW_ACTIVITY)) { + } else if (view == GBGridView.MON_ACTIVITY) { Long activityID = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); Activity activity = monitoringService.getActivityById(activityID); @@ -266,7 +266,7 @@ 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); - String view = WebUtil.readStrParam(request, GradeBookConstants.PARAM_METHOD); + GBGridView view = GradeBookUtil.readGBGridViewParam(request, GradeBookConstants.PARAM_VIEW, false); User user = getRealUser(); @@ -280,7 +280,7 @@ List gradeBookLessonDTOs = new ArrayList(); - gradeBookLessonDTOs = gradeBookService.getGBLessonRows(organisation, user); + gradeBookLessonDTOs = gradeBookService.getGBLessonRows(organisation, user, view); if (sortBy == null) { sortBy = GradeBookConstants.PARAM_ID; @@ -318,11 +318,6 @@ } } - private ActionForward displayMessage(ActionMapping mapping, HttpServletRequest req, String messageKey) { - req.setAttribute("messageKey", messageKey); - return mapping.findForward("message"); - } - private void initServices() { getUserService(); getLessonService(); Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/Attic/GradeBookLearningAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookLearningAction.java 7 Apr 2009 00:09:14 -0000 1.1 @@ -0,0 +1,159 @@ +/**************************************************************** + * Copyright (C) 2008 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: GradeBookLearningAction.java,v 1.1 2009/04/07 00:09:14 lfoxton Exp $ */ +package org.lamsfoundation.lams.gradebook.web.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.gradebook.service.IGradeBookService; +import org.lamsfoundation.lams.lesson.service.ILessonService; +import org.lamsfoundation.lams.usermanagement.Organisation; +import org.lamsfoundation.lams.usermanagement.Role; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * @author lfoxton + * + * Handles the learner interfaces for gradebook + * + * This is where marking for an activity/lesson takes place + * + * + * @struts.action path="/gradebook/gradebookLearning" parameter="dispatch" + * scope="request" validate="false" + * + * @struts:action-forward name="learnercoursegradebook" + * path="/gradebook/gradeBookCourseLearner.jsp" + * @struts:action-forward name="error" path=".error" + * @struts:action-forward name="message" path=".message" + */ +public class GradeBookLearningAction extends LamsDispatchAction{ + + private static Logger logger = Logger.getLogger(GradeBookLearningAction.class); + + private static IGradeBookService gradeBookService; + private static IUserManagementService userService; + private static ILessonService lessonService; + + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + return null; + } + + @SuppressWarnings("unchecked") + public ActionForward courseMonitor(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + try { + initServices(); + Integer oranisationID = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID); + + logger.debug("request learnerGradebook for organisation: " + oranisationID.toString()); + UserDTO user = getUser(); + if (user == null) { + logger.error("User missing from session. "); + return mapping.findForward("error"); + } else { + + Organisation organisation = (Organisation)userService.findById(Organisation.class, oranisationID); + if (organisation == null) { + logger.error("Organisation " + oranisationID + " does not exist. Unable to load gradebook"); + return mapping.findForward("error"); + } + + // Validate whether this user is a monitor for this organisation + if (!userService.isUserInRole(user.getUserID(), oranisationID, Role.MONITOR)) { + logger.error("User " + user.getLogin() + + " is not a learner in the requested course. Cannot access the course for gradebook."); + return displayMessage(mapping, request, "error.authorisation"); + } + + request.setAttribute("organisationID", oranisationID); + request.setAttribute("organisationName", organisation.getName()); + + return mapping.findForward("learnercoursegradebook"); + } + } catch (Exception e) { + logger.error("Failed to load gradebook monitor", e); + return mapping.findForward("error"); + } + } + + private UserDTO getUser() { + HttpSession ss = SessionManager.getSession(); + return (UserDTO) ss.getAttribute(AttributeNames.USER); + } + + private ActionForward displayMessage(ActionMapping mapping, HttpServletRequest req, String messageKey) { + req.setAttribute("messageKey", messageKey); + return mapping.findForward("message"); + } + + private void initServices() { + getUserService(); + getLessonService(); + getGradeBookService(); + } + + private IUserManagementService getUserService() { + if (userService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + userService = (IUserManagementService) ctx.getBean("userManagementService"); + } + return userService; + } + + private ILessonService getLessonService() { + if (lessonService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + lessonService = (ILessonService) ctx.getBean("lessonService"); + } + return lessonService; + } + + private IGradeBookService getGradeBookService() { + if (gradeBookService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + gradeBookService = (IGradeBookService) ctx.getBean("gradeBookService"); + } + return gradeBookService; + } + +} + \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/Attic/GradeBookMonitoringAction.java,v diff -u -r1.12 -r1.13 --- lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookMonitoringAction.java 6 Apr 2009 06:14:03 -0000 1.12 +++ lams_central/src/java/org/lamsfoundation/lams/gradebook/web/action/GradeBookMonitoringAction.java 7 Apr 2009 00:09:15 -0000 1.13 @@ -32,7 +32,9 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.gradebook.service.IGradeBookService; +import org.lamsfoundation.lams.gradebook.util.GBGridView; import org.lamsfoundation.lams.gradebook.util.GradeBookConstants; +import org.lamsfoundation.lams.gradebook.util.GradeBookUtil; import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.lesson.dto.LessonDetailsDTO; @@ -145,8 +147,6 @@ logger.debug("user is staff"); - - request.setAttribute("organisationID", oranisationID); request.setAttribute("organisationName", organisation.getName()); @@ -211,17 +211,17 @@ initServices(); Long lessonID = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - String method = WebUtil.readStrParam(request, GradeBookConstants.PARAM_METHOD); + GBGridView view = GradeBookUtil.readGBGridViewParam(request, GradeBookConstants.PARAM_VIEW, false); Long activityID = null; Integer userID = null; // Fetch the id based on which grid it came from - if (method.equals(GradeBookConstants.VIEW_ACTIVITY)) { + if (view == GBGridView.MON_ACTIVITY) { activityID = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); userID = WebUtil.readIntParam(request, GradeBookConstants.PARAM_ID); - } else if (method.equals(GradeBookConstants.VIEW_USER)) { + } else if (view == GBGridView.MON_USER) { activityID = WebUtil.readLongParam(request, GradeBookConstants.PARAM_ID); userID = WebUtil.readIntParam(request, GradeBookConstants.PARAM_USERID); } Index: lams_central/web/gradebook/gradeBookCourseLearner.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/gradebook/Attic/gradeBookCourseLearner.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/web/gradebook/gradeBookCourseLearner.jsp 7 Apr 2009 00:09:15 -0000 1.1 @@ -0,0 +1,144 @@ + + +<%@ page language="java" pageEncoding="UTF-8" + contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-core" prefix="c"%> + + + + Course GradeBook Learner + + + + + + + + + +
+ +
+ +
+

Course GradeBook for ${organisationName}

+
+
+
+
+ +
+
+
+ + +
+ +
\ No newline at end of file Index: lams_central/web/gradebook/gradeBookCourseMonitor.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/gradebook/Attic/gradeBookCourseMonitor.jsp,v diff -u -r1.4 -r1.5 --- lams_central/web/gradebook/gradeBookCourseMonitor.jsp 2 Apr 2009 02:31:55 -0000 1.4 +++ lams_central/web/gradebook/gradeBookCourseMonitor.jsp 7 Apr 2009 00:09:15 -0000 1.5 @@ -15,31 +15,30 @@