Index: lams_monitoring/.classpath =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/.classpath (.../.classpath) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/.classpath (.../.classpath) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -2,7 +2,7 @@ - + Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java (.../BranchingController.java) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java (.../BranchingController.java) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -119,7 +119,7 @@ if (log.isDebugEnabled()) { log.debug("viewBranching: Branching activity " + dto); } - return "chosenSelection"; + return "viewBranches"; } // Can't do this in BranchingDTO (although that's where it should be) as we have Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java (.../EmailNotificationsController.java) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailNotificationsController.java (.../EmailNotificationsController.java) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -128,7 +128,7 @@ private static ILessonService lessonService; // --------------------------------------------------------------------- - // Struts Dispatch Method + // Method // --------------------------------------------------------------------- /** Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java (.../EmailProgressController.java) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/EmailProgressController.java (.../EmailProgressController.java) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -93,7 +93,7 @@ private static ISecurityService securityService; // --------------------------------------------------------------------- - // Struts Dispatch Method + // Dispatch Method // --------------------------------------------------------------------- /** Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateController.java (.../GateController.java) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -215,7 +215,6 @@ * Dispatch view the according to the gate type. * */ - @RequestMapping("/findViewByGateType") private String findViewByGateType(@ModelAttribute GateForm gateForm, GateActivity gate) { lessonService = MonitoringServiceProxy.getLessonService(applicationContext.getServletContext()); Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupBasedBranchingAJAXAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupBasedBranchingAJAXController.java =================================================================== diff -u --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupBasedBranchingAJAXController.java (revision 0) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupBasedBranchingAJAXController.java (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -0,0 +1,310 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.monitoring.web; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.SortedSet; +import java.util.TreeSet; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.ActivityTitleComparator; +import org.lamsfoundation.lams.learningdesign.BranchingActivity; +import org.lamsfoundation.lams.learningdesign.Group; +import org.lamsfoundation.lams.learningdesign.SequenceActivity; +import org.lamsfoundation.lams.lesson.service.LessonServiceException; +import org.lamsfoundation.lams.monitoring.service.IMonitoringService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * The action servlet that provides the support for the + *
    + *
  • AJAX based Groups Based Branching screen
  • + *
+ * + * @author Fiona Malikoff + * + * + * + * + * + * + * + * + * + * + */ +@Controller +@RequestMapping("/groupedBranching") +public class GroupBasedBranchingAJAXController extends BranchingController { + + @Autowired + @Qualifier("monitoringService") + private IMonitoringService monitoringService; + + private static Logger log = Logger.getLogger(BranchingController.class); + + //--------------------------------------------------------------------- + + private static final String GROUPED_SELECTION_SCREEN = "groupedSelection"; + public static final String PARAM_BRANCH_ID = "branchID"; + public static final String PARAM_MAY_DELETE = "mayDelete"; + public static final String PARAM_GROUPS = "groups"; + + /** + * Start the process of doing the group to branch mapping. Used for define later. + * + * Input parameters: activityID + */ + @RequestMapping("/assignBranch") + public String assignBranch(HttpServletRequest request) throws IOException, ServletException { + + Long activityID = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); + Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); + + BranchingActivity activity = (BranchingActivity) monitoringService.getActivityById(activityID, + BranchingActivity.class); + + if (activity.isGroupBranchingActivity()) { + + // in general the progress engine expects the activity and lesson id to be in the request, + // so follow that standard. + request.setAttribute(AttributeNames.PARAM_ACTIVITY_ID, activityID); + request.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonId); + request.setAttribute(AttributeNames.PARAM_TITLE, activity.getTitle()); + + // can we still move groups? Only allowed if no users have started the branching activity + boolean usersStartedBranching = monitoringService.isActivityAttempted(activity); + request.setAttribute(PARAM_MAY_DELETE, !usersStartedBranching); + + return "branching/groupedSelection"; + + } else { + // something gone wrong - shouldn't be here so revert to standard screen for viewing branching. + return viewBranching(activity, lessonId, false, request, monitoringService); + } + + } + + /** + * Get a list of branch names, their associated group id and the number of groups for this branch. Designed to + * respond to an AJAX call. + * + * Input parameters: activityID (which is the branching activity id) + * + * Output format: "branchid,name,num groups;branchid,groupid,name,num groups" + */ + @RequestMapping("/getBranches") + @ResponseBody + public String getBranches(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + + // get the branching data and sort it. + Long activityID = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); + BranchingActivity activity = (BranchingActivity) monitoringService.getActivityById(activityID); + + TreeSet sortedBranches = new TreeSet(new ActivityTitleComparator()); + sortedBranches.addAll(activity.getActivities()); + + // build the output string to return to the chosen branching page. + // there should only ever be one group for each branch in chosen branching + String branchesOutput = ""; + + boolean first = true; + for (Activity childActivity : sortedBranches) { + + SequenceActivity branch = (SequenceActivity) monitoringService + .getActivityById(childActivity.getActivityId(), SequenceActivity.class); + + Long branchId = branch.getActivityId(); + String name = branch.getTitle(); + + SortedSet groups = branch.getGroupsForBranch(); + int numberOfGroups = groups != null ? groups.size() : 0; + + if (!first) { + branchesOutput = branchesOutput + ";"; + } else { + first = false; + } + + branchesOutput = branchesOutput + branchId + "," + name + "," + numberOfGroups; + } + + if (log.isDebugEnabled()) { + log.debug("getBranches activity id " + activityID + " returning " + branchesOutput); + } + + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + if (branchesOutput.length() > 0) { + writer.println(branchesOutput); + } + return null; + } + + /** + * Get a list of all the class members who aren't grouped yet. Designed to respond to an AJAX call. + * + * Input parameters: activityID (which is the branching activity id) + * + * Output format: "groupid,groupname;groupid,groupname" + */ + @RequestMapping("/getGroupsNotAssignedToBranch") + @ResponseBody + public String getGroupsNotAssignedToBranch(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + + // get the grouping data and sort it. + Long activityID = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); + SortedSet groups = monitoringService.getGroupsNotAssignedToBranch(activityID); + String groupOutput = buildGroupString(groups); + + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + + if (groupOutput.length() > 0) { + writer.println(groupOutput); + } + return null; + + } + + /** + * Get a list of groups associated with this branch. Designed to respond to an AJAX call. + * + * Input parameters: branchID which is sequence activity id + * + * Output format: "groupid,groupname;" + */ + @RequestMapping("/getBranchGroups") + @ResponseBody + public String getBranchGroups(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + + Long branchID = WebUtil.readLongParam(request, PARAM_BRANCH_ID); + SequenceActivity branch = (SequenceActivity) monitoringService.getActivityById(branchID); + + SortedSet groups = branch.getGroupsForBranch(); + String groupOutput = buildGroupString(groups); + + if (log.isDebugEnabled()) { + log.debug("getBranchGroups branch id " + branchID + " returning " + groupOutput); + } + + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + + if (groupOutput.length() > 0) { + writer.println(groupOutput); + } + return null; + } + + /** + * @param groups + * @return + */ + private String buildGroupString(SortedSet groups) { + String groupOutput = ""; + boolean first = true; + + for (Group group : groups) { + if (!first) { + groupOutput = groupOutput + ";"; + } else { + first = false; + } + groupOutput = groupOutput + group.getGroupId() + "," + group.getGroupName(); + } + return groupOutput; + } + + /** + * Add groups to a branch. Designed to respond to an AJAX call. + * + * Input parameters: branchID, groups: comma separated list of group ids + * + * Output format: no data returned - just the header + */ + @RequestMapping("/addGroups") + @ResponseBody + public String addGroups(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, LessonServiceException { + + Long branchID = WebUtil.readLongParam(request, PARAM_BRANCH_ID); + + String groups = WebUtil.readStrParam(request, PARAM_GROUPS, true); + if (groups != null) { + String[] groupsSplit = groups.split(","); + monitoringService.addGroupToBranch(branchID, groupsSplit); + } + + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + writer.println("OK"); + + return null; + } + + /** + * Remove a list of users from a group. Designed to respond to an AJAX call. + * + * Input parameters: branchID, groups: comma separated list of group ids + * + * Output format: no data returned - just the header + */ + @RequestMapping("/removeGroups") + @ResponseBody + public String removeGroups(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, LessonServiceException { + + Long branchID = WebUtil.readLongParam(request, PARAM_BRANCH_ID); + + String groups = WebUtil.readStrParam(request, PARAM_GROUPS, true); + if (groups != null) { + String[] groupsSplit = groups.split(","); + + monitoringService.removeGroupFromBranch(branchID, groupsSplit); + } + + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + writer.println("OK"); + + return null; + } + +} Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java =================================================================== diff -u --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java (revision 0) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingUploadAJAXController.java (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -0,0 +1,577 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.monitoring.web; + +import java.io.IOException; +import java.security.InvalidParameterException; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.ss.usermodel.Cell; +import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.Group; +import org.lamsfoundation.lams.learningdesign.GroupComparator; +import org.lamsfoundation.lams.learningdesign.Grouping; +import org.lamsfoundation.lams.learningdesign.GroupingActivity; +import org.lamsfoundation.lams.lesson.Lesson; +import org.lamsfoundation.lams.lesson.service.ILessonService; +import org.lamsfoundation.lams.monitoring.service.IMonitoringService; +import org.lamsfoundation.lams.security.ISecurityService; +import org.lamsfoundation.lams.usermanagement.Organisation; +import org.lamsfoundation.lams.usermanagement.OrganisationGroup; +import org.lamsfoundation.lams.usermanagement.OrganisationGrouping; +import org.lamsfoundation.lams.usermanagement.Role; +import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.AlphanumComparator; +import org.lamsfoundation.lams.util.ExcelCell; +import org.lamsfoundation.lams.util.ExcelUtil; +import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; +import org.springframework.web.multipart.MultipartFile; + +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +/** + * The action servlet that provides the support for the AJAX based Chosen Grouping upload from File + * + * @author Fiona Malikoff + */ +@Controller +@RequestMapping("/") +public class GroupingUploadAJAXController { + + @Autowired + private WebApplicationContext applicationContext; + + @Autowired + @Qualifier("monitoringService") + private IMonitoringService monitoringService; + + private static Logger log = Logger.getLogger(GroupingUploadAJAXController.class); + + private static IUserManagementService userManagementService; + private static ILessonService lessonService; + private static ISecurityService securityService; + private static MessageService centralMessageService; + + /** + * Get the spreadsheet file containing list of the current users, ready for uploading with groups. If lesson + * supplied, + * list lesson users, otherwise list organisation users (course grouping screen has just the organisation). + * + * @throws Exception + */ + @RequestMapping("/getGroupTemplateFile") + public String getGroupTemplateFile(HttpServletRequest request, HttpServletResponse response) throws Exception { + + Integer userId = getUserDTO().getUserID(); + Integer organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID, true); + Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true); + + if (lessonId == null && organisationId == null) { + log.error("Cannot create group template file as lessonId and organisationId are both null."); + response.sendError(HttpServletResponse.SC_FORBIDDEN, "Invalid parameters"); + } + + Lesson lesson = null; + String lessonOrOrganisationName = null; + + if (lessonId != null) { + lesson = (Lesson) getUserManagementService().findById(Lesson.class, lessonId); + lessonOrOrganisationName = lesson.getLessonName(); + organisationId = lesson.getOrganisation().getOrganisationId(); + } else { + Organisation organisation = (Organisation) getUserManagementService().findById(Organisation.class, + organisationId); + lessonOrOrganisationName = organisation.getName(); + } + + // check if user is allowed to view and edit groups + if (!getSecurityService().hasOrgRole(organisationId, userId, + new String[] { Role.GROUP_ADMIN, Role.GROUP_MANAGER, Role.MONITOR, Role.AUTHOR }, + "view organisation groups", false)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a participant in the organisation"); + return null; + } + + String fileName = new StringBuilder( + getCentralMessageService().getMessage("filename.create.grouping.template").trim()).append(" ") + .append(lessonOrOrganisationName).append(".xls").toString().replaceAll(" ", "-"); + fileName = FileUtil.encodeFilenameForDownload(request, fileName); + + LinkedHashMap dataToExport = null; + + if (lesson != null) { + Set learners = lesson.getLessonClass().getLearners(); + // check for any groups already exist in this grouping + Long activityId = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID); + Activity activity = monitoringService.getActivityById(activityId); + Grouping grouping = activity.isChosenBranchingActivity() ? activity.getGrouping() + : ((GroupingActivity) activity).getCreateGrouping(); + dataToExport = exportLearnersForGrouping(learners, grouping.getGroups(), null); + + } else { + Long groupingId = WebUtil.readLongParam(request, "groupingId", true); + Set groups = null; + if (groupingId != null) { + OrganisationGrouping orgGrouping = (OrganisationGrouping) getUserManagementService() + .findById(OrganisationGrouping.class, groupingId); + if (orgGrouping != null) { + groups = orgGrouping.getGroups(); + } + } + Vector learners = getUserManagementService().getUsersFromOrganisationByRole(organisationId, + Role.LEARNER, true); + dataToExport = exportLearnersForGrouping(learners, null, groups); + } + + // set cookie that will tell JS script that export has been finished + String downloadTokenValue = WebUtil.readStrParam(request, "downloadTokenValue"); + Cookie fileDownloadTokenCookie = new Cookie("fileDownloadToken", downloadTokenValue); + fileDownloadTokenCookie.setPath("/"); + response.addCookie(fileDownloadTokenCookie); + + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName); + ServletOutputStream out = response.getOutputStream(); + ExcelUtil.createExcelXLS(out, dataToExport, null, false); + return null; + } + + private LinkedHashMap exportLearnersForGrouping(Collection learners, Set groups, + Set orgGroups) { + + List rowList = new LinkedList<>(); + int numberOfColumns = 4; + + ExcelCell[] title = new ExcelCell[numberOfColumns]; + title[0] = new ExcelCell(getCentralMessageService().getMessage("spreadsheet.column.login"), false); + title[1] = new ExcelCell(getCentralMessageService().getMessage("spreadsheet.column.firstname"), false); + title[2] = new ExcelCell(getCentralMessageService().getMessage("spreadsheet.column.lastname"), false); + title[3] = new ExcelCell(getCentralMessageService().getMessage("spreadsheet.column.groupname"), false); + rowList.add(title); + + if (groups != null) { + List groupList = new LinkedList<>(groups); + Collections.sort(groupList, new GroupComparator()); + for (Group group : groupList) { + String groupName = group.getGroupName(); + for (User groupUser : group.getUsers()) { + rowList.add(generateUserRow(numberOfColumns, groupName, groupUser)); + learners.remove(groupUser); + } + } + } + + if (orgGroups != null) { + List groupList = new LinkedList<>(orgGroups); + for (OrganisationGroup group : groupList) { + String groupName = group.getName(); + for (User groupUser : group.getUsers()) { + rowList.add(generateUserRow(numberOfColumns, groupName, groupUser)); + learners.remove(groupUser); + } + } + } + + // all the remaining users are unassigned to any group + for (User unassignedUser : learners) { + rowList.add(generateUserRow(numberOfColumns, null, unassignedUser)); + } + + ExcelCell[][] summaryData = rowList.toArray(new ExcelCell[][] {}); + LinkedHashMap dataToExport = new LinkedHashMap<>(); + dataToExport.put(getCentralMessageService().getMessage("label.course.groups.prefix"), summaryData); + return dataToExport; + } + + private ExcelCell[] generateUserRow(int numberOfColumns, String groupName, User groupUser) { + ExcelCell[] userRow = new ExcelCell[numberOfColumns]; + userRow[0] = new ExcelCell(groupUser.getLogin(), false); + userRow[1] = new ExcelCell(groupUser.getFirstName(), false); + userRow[2] = new ExcelCell(groupUser.getLastName(), false); + userRow[3] = new ExcelCell(groupName, false); + return userRow; + } + + /** + * Saves a course grouping. + */ + @RequestMapping("/importLearnersForGrouping") + @ResponseBody + public String importLearnersForGrouping(@ModelAttribute FileUploadForm form, HttpServletRequest request, + HttpServletResponse response) throws InvalidParameterException, IOException { + + Integer userId = getUserDTO().getUserID(); + Integer organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID, true); + boolean isLessonMode = WebUtil.readBooleanParam(request, "lessonMode", true); + + // used for lesson based grouping + Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true); + Long activityId = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID, true); + Lesson lesson = lessonId != null ? (Lesson) getUserManagementService().findById(Lesson.class, lessonId) : null; + + // used for course grouping + Long groupingId = WebUtil.readLongParam(request, "groupingId", true); + String name = WebUtil.readStrParam(request, "name", true); + if (isLessonMode && activityId == null) { + log.error("Lesson grouping to be saved but activityId is missing"); + response.sendError(HttpServletResponse.SC_FORBIDDEN, "Invalid parameters"); + } else if (!isLessonMode) { + if ((groupingId == null && name == null) || organisationId == null) { + log.error("Course grouping to be saved but groupingId, grouping name or organisationId is missing"); + response.sendError(HttpServletResponse.SC_FORBIDDEN, "Invalid parameters"); + } + } + + Organisation organisation; + if (organisationId == null) { + // read organisation ID from lesson + organisation = lesson.getOrganisation(); + organisationId = organisation.getOrganisationId(); + } else { + organisation = (Organisation) getUserManagementService().findById(Organisation.class, organisationId); + } + + // check if user is allowed to save grouping + if (!getSecurityService().hasOrgRole(organisationId, userId, + new String[] { Role.GROUP_ADMIN, Role.GROUP_MANAGER, Role.MONITOR, Role.AUTHOR }, + "save organisation grouping from spreadsheet", false)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a manager or admin in the organisation"); + return null; + } + + Hashtable fileElements = null; // null because there are commented lines +// form.getMultipartRequestHandler().getFileElements(); +// if (fileElements.size() == 0) { +// response.sendError(HttpServletResponse.SC_FORBIDDEN, "No file provided"); +// } + if (log.isDebugEnabled()) { + log.debug("Saving course groups from spreadsheet for user " + userId + " and organisation " + organisationId + + " filename " + fileElements); + } + + ObjectNode responseJSON = isLessonMode ? saveLessonGrouping(lessonId, activityId, fileElements) + : saveCourseGrouping(organisation, groupingId, name, fileElements); + + return responseJSON.toString(); + } + + /** Create the new course grouping */ + private ObjectNode saveCourseGrouping(Organisation organisation, Long orgGroupingId, String name, + Hashtable fileElements) throws IOException { + + OrganisationGrouping orgGrouping = null; + if (orgGroupingId != null) { + orgGrouping = (OrganisationGrouping) getUserManagementService().findById(OrganisationGrouping.class, + orgGroupingId); + } + if (orgGrouping == null) { + orgGrouping = new OrganisationGrouping(); + orgGrouping.setOrganisationId(organisation.getOrganisationId()); + orgGrouping.setName(name); + } + + Map existingGroupNameToId = new HashMap<>(); + if (orgGrouping.getGroups() != null) { + for (OrganisationGroup group : orgGrouping.getGroups()) { + existingGroupNameToId.put(group.getName(), group.getGroupId()); + } + } + + Map> groups = new HashMap<>(); + int totalUsersSkipped = parseGroupSpreadsheet((MultipartFile) fileElements.elements().nextElement(), + orgGroupingId, groups); + int totalUsersAdded = 0; + + List orgGroups = new LinkedList<>(); + for (Map.Entry> groupEntry : groups.entrySet()) { + String groupName = groupEntry.getKey(); + // just overwrite existing groups; they will be updated if already exist + Set learners = new HashSet<>(); + for (String login : groupEntry.getValue()) { + User learner = getUserManagementService().getUserByLogin(login); + if (learner == null) { + log.warn("Unable to add learner " + login + " for group in related to grouping " + orgGroupingId + + " as learner cannot be found."); + totalUsersSkipped++; + + //Check user is a part of the organisation + } else if (!getSecurityService().hasOrgRole(organisation.getOrganisationId(), learner.getUserId(), + new String[] { Role.GROUP_MANAGER, Role.LEARNER, Role.MONITOR, Role.AUTHOR }, + "be added to grouping", false)) { + + totalUsersSkipped++; + + } else { + totalUsersAdded++; + learners.add(learner); + } + } + OrganisationGroup orgGroup = new OrganisationGroup(); + Long orgGroupId = existingGroupNameToId.get(groupName); + if (orgGroupId != null) { + orgGroup.setGroupId(orgGroupId); + orgGroup.setGroupingId(orgGroupingId); + } + orgGroup.setName(groupName); + orgGroup.setUsers(learners); + orgGroups.add(orgGroup); + } + + getUserManagementService().saveOrganisationGrouping(orgGrouping, orgGroups); + return createResponseJSON(false, null, true, orgGrouping.getGroupingId(), totalUsersAdded, totalUsersSkipped); + + } + + /** Clean out and reuse any existing groups */ + private ObjectNode saveLessonGrouping(Long lessonId, Long activityId, Hashtable fileElements) throws IOException { + + int totalUsersSkipped = 0; + int totalUsersAdded = 0; + + // Lesson grouping case so clean out and reuse any existing groups + Activity activity = monitoringService.getActivityById(activityId); + Grouping grouping = activity.isChosenBranchingActivity() ? activity.getGrouping() + : ((GroupingActivity) activity).getCreateGrouping(); + + Set existingGroupNames = new HashSet<>(); + // check for any users starting to use the groups since the page was loaded. + for (Group group : grouping.getGroups()) { + existingGroupNames.add(group.getGroupName()); + if (!group.mayBeDeleted()) { + String error = getCentralMessageService().getMessage("error.groups.upload.locked"); + return createResponseJSON(true, error, true, grouping.getGroupingId(), 0, 0); + } + } + + Map> groups = new HashMap<>(); + totalUsersSkipped = parseGroupSpreadsheet((MultipartFile) fileElements.elements().nextElement(), + grouping.getGroupingId(), groups); + + // if branching must use the already specified groups or cannot match to a branch! + if (activity.isChosenBranchingActivity()) { + for (Map.Entry> groupEntry : groups.entrySet()) { + if (!existingGroupNames.contains(groupEntry.getKey())) { + StringBuilder groupNamesStrBlder = new StringBuilder(); + for (String name : existingGroupNames) { + groupNamesStrBlder.append("'").append(name).append("' "); + } + String error = getCentralMessageService().getMessage( + "error.branching.upload.must.use.existing.groups", + new String[] { groupNamesStrBlder.toString() }); + return createResponseJSON(true, error.toString(), false, grouping.getGroupingId(), 0, 0); + } + } + } + + //check all users exist and are learners in the specified lesson + for (Map.Entry> groupEntry : groups.entrySet()) { + Set logins = groupEntry.getValue(); + + Iterator iter = logins.iterator(); + while (iter.hasNext()) { + String login = iter.next(); + User learner = getUserManagementService().getUserByLogin(login); + if (learner == null) { + log.warn("Unable to add learner " + login + " to lesson grouping as learner cannot be found."); + totalUsersSkipped++; + iter.remove(); + + } else if (!getSecurityService().isLessonLearner(lessonId, learner.getUserId(), "be added to grouping", + false)) { + //log.warn("Unable to add learner " + login + " to lesson grouping as learner doesn't belong to the lesson."); + totalUsersSkipped++; + iter.remove(); + } + } + } + + // remove all the existing users from their groups + getLessonService().removeAllLearnersFromGrouping(grouping); + + // Now put in the new users groupings + for (Map.Entry> groupEntry : groups.entrySet()) { + int added = monitoringService.addUsersToGroupByLogins(activityId, groupEntry.getKey(), + groupEntry.getValue()); + totalUsersAdded += added; + totalUsersSkipped += groupEntry.getValue().size() - added; + } + + return createResponseJSON(false, null, true, grouping.getGroupingId(), totalUsersAdded, totalUsersSkipped); + } + + private ObjectNode createResponseJSON(boolean isError, String errorMessage, boolean reload, Long groupingId, + int totalUsersAdded, int totalUsersSkipped) { + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + if (isError) { + responseJSON.put("result", "FAIL"); + responseJSON.put("reload", reload); + responseJSON.put("error", errorMessage); + } else { + responseJSON.put("result", "OK"); + responseJSON.put("added", totalUsersAdded); + responseJSON.put("skipped", totalUsersSkipped); + } + responseJSON.put("groupingId", groupingId); + return responseJSON; + } + + /* XLS Version Parse */ + private String parseStringCell(HSSFCell cell) { + if (cell != null) { + cell.setCellType(Cell.CELL_TYPE_STRING); + if (cell.getStringCellValue() != null) { + return cell.getStringCellValue().trim(); + } + } + return null; + } + + public int parseGroupSpreadsheet(MultipartFile fileItem, Long groupingID, Map> groups) + throws IOException { + POIFSFileSystem fs = new POIFSFileSystem(fileItem.getInputStream()); + HSSFWorkbook wb = new HSSFWorkbook(fs); + HSSFSheet sheet = wb.getSheetAt(0); + + int startRow = sheet.getFirstRowNum(); + int endRow = sheet.getLastRowNum(); + int skipped = 0; + + for (int i = startRow + 1; i < (endRow + 1); i++) { + HSSFRow row = sheet.getRow(i); + String login = parseStringCell(row.getCell(0)); + if (login != null) { + login = login.trim(); + if (login.length() > 0) { + String groupName = row.getLastCellNum() > 3 ? parseStringCell(row.getCell(3)) : null; + groupName = groupName != null ? groupName.trim() : null; + if (groupName == null || groupName.length() == 0) { + skipped++; + GroupingUploadAJAXController.log.warn("Unable to add learner " + login + + " for group in related to grouping " + groupingID + " as group name is missing."); + } else { + Set users = groups.get(groupName); + if (users == null) { + users = new HashSet<>(); + groups.put(groupName, users); + } + users.add(login); + } + } + } + } + return skipped; + } + + final Comparator ORG_GROUP_COMPARATOR = new Comparator<>() { + @Override + public int compare(OrganisationGroup o1, OrganisationGroup o2) { + String grp1Name = o1 != null ? o1.getName() : ""; + String grp2Name = o2 != null ? o2.getName() : ""; + + AlphanumComparator comparator = new AlphanumComparator(); + return comparator.compare(grp1Name, grp2Name); + } + }; + + private UserDTO getUserDTO() { + HttpSession ss = SessionManager.getSession(); + return (UserDTO) ss.getAttribute(AttributeNames.USER); + } + + private IUserManagementService getUserManagementService() { + if (userManagementService == null) { + WebApplicationContext ctx = WebApplicationContextUtils + .getRequiredWebApplicationContext(applicationContext.getServletContext()); + userManagementService = (IUserManagementService) ctx.getBean("userManagementService"); + } + return userManagementService; + } + + private ILessonService getLessonService() { + if (lessonService == null) { + WebApplicationContext ctx = WebApplicationContextUtils + .getRequiredWebApplicationContext(applicationContext.getServletContext()); + lessonService = (ILessonService) ctx.getBean("lessonService"); + } + return lessonService; + } + + private ISecurityService getSecurityService() { + if (securityService == null) { + WebApplicationContext ctx = WebApplicationContextUtils + .getRequiredWebApplicationContext(applicationContext.getServletContext()); + securityService = (ISecurityService) ctx.getBean("securityService"); + } + return securityService; + } + + private MessageService getCentralMessageService() { + if (centralMessageService == null) { + WebApplicationContext ctx = WebApplicationContextUtils + .getRequiredWebApplicationContext(applicationContext.getServletContext()); + centralMessageService = (MessageService) ctx.getBean("centralMessageService"); + } + return centralMessageService; + } + +} Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -49,8 +49,6 @@ import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.authoring.ObjectExtractor; import org.lamsfoundation.lams.authoring.service.IAuthoringService; import org.lamsfoundation.lams.learning.service.ILearnerService; @@ -122,15 +120,8 @@ private static Logger log = Logger.getLogger(MonitoringController.class); // --------------------------------------------------------------------- - // Instance variables - // --------------------------------------------------------------------- - - // --------------------------------------------------------------------- // Class level constants - Struts forward // --------------------------------------------------------------------- - private static final String NOT_SUPPORTED_SCREEN = "notsupported"; - private static final String TIME_CHART_SCREEN = "timeChart"; - private static final String ERROR = "error"; private static final DateFormat LESSON_SCHEDULING_DATETIME_FORMAT = new SimpleDateFormat("MM/dd/yy HH:mm"); private static final int LATEST_LEARNER_PROGRESS_LESSON_DISPLAY_LIMIT = 53; @@ -176,8 +167,9 @@ * Currently used only in TestHarness and Authoring Preview. */ @RequestMapping("/initializeLesson") - public String initializeLesson(HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @ResponseBody + public String initializeLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { String title = WebUtil.readStrParam(request, "lessonName"); if (title == null) { @@ -213,7 +205,9 @@ } } - return (newLesson.getLessonId()).toString(); + PrintWriter writer = response.getWriter(); + writer.println(newLesson.getLessonId()); + return null; } /** @@ -225,8 +219,9 @@ * @throws ServletException */ @RequestMapping("/startLesson") - public String startLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @ResponseBody + public String startLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { getMonitoringService().startLesson(lessonId, getUserId()); @@ -240,9 +235,9 @@ return null; } - @RequestMapping("/") - public String createLessonClass(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/createLessonClass") + public String createLessonClass(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { int organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID); Integer userID = WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID); long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); @@ -268,9 +263,9 @@ return null; } - @RequestMapping("/") - public String addLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, ParseException { + @RequestMapping("/addLesson") + public String addLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, ParseException { String lessonName = request.getParameter("lessonName"); if (!ValidationUtil.isOrgNameValid(lessonName)) { throw new IOException("Lesson name contains invalid characters"); @@ -415,9 +410,9 @@ /** * Adds all course learners to the given lesson. */ - @RequestMapping("/") - public String addAllOrganisationLearnersToLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { + @RequestMapping("/addAllOrganisationLearnersToLesson") + public String addAllOrganisationLearnersToLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException { Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); if (!getSecurityService().isLessonMonitor(lessonId, getUserId(), "add all lesson learners to lesson", false)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); @@ -430,9 +425,9 @@ return null; } - @RequestMapping("/") - public String startOnScheduleLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws ParseException, IOException { + @RequestMapping("/startOnScheduleLesson") + public String startOnScheduleLesson(HttpServletRequest request, HttpServletResponse response) + throws ParseException, IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); String dateStr = WebUtil.readStrParam(request, MonitoringConstants.PARAM_LESSON_START_DATE); Date startDate = MonitoringController.LESSON_SCHEDULING_DATETIME_FORMAT.parse(dateStr); @@ -451,9 +446,9 @@ * @throws IOException * @throws ServletException */ - @RequestMapping("/") - public String archiveLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/archiveLesson") + public String archiveLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { @@ -471,9 +466,9 @@ * @throws IOException * @throws ServletException */ - @RequestMapping("/") - public String unarchiveLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/unarchiveLesson") + public String unarchiveLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { getMonitoringService().unarchiveLesson(lessonId, getUserId()); @@ -488,9 +483,9 @@ * created or a not started (ie scheduled) lesson as they will not be shown on the learner interface anyway! If the * teacher tries to suspend a lesson that is not in the STARTED_STATE, then an error should be returned to UI. */ - @RequestMapping("/") - public String suspendLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException, ParseException { + @RequestMapping("/suspendLesson") + public String suspendLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException, ParseException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); String dateStr = WebUtil.readStrParam(request, MonitoringConstants.PARAM_LESSON_END_DATE, true); try { @@ -518,9 +513,9 @@ * @throws IOException * @throws ServletException */ - @RequestMapping("/") - public String unsuspendLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/unsuspendLesson") + public String unsuspendLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); try { getMonitoringService().unsuspendLesson(lessonId, getUserId()); @@ -542,9 +537,10 @@ * @throws IOException * @throws ServletException */ - @RequestMapping("/") - public String removeLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/removeLesson") + @ResponseBody + public String removeLesson(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); Integer userId = getUserId(); boolean permanently = WebUtil.readBooleanParam(request, "permanently", false); @@ -571,8 +567,7 @@ } response.setContentType("application/json;charset=utf-8"); - response.getWriter().print(jsonObject); - return null; + return jsonObject.toString(); } /** @@ -589,9 +584,10 @@ * @throws ServletException * @throws JSONException */ - @RequestMapping("/") - public String forceComplete(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + @RequestMapping("/forceComplete") + @ResponseBody + public String forceComplete(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { // get parameters Long activityId = null; @@ -668,8 +664,9 @@ * Get learners who are part of the lesson class. */ @RequestMapping("/getLessonLearners") + @ResponseBody public String getLessonLearners(HttpServletRequest request, HttpServletResponse response) throws IOException { - + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); if (!getSecurityService().isLessonMonitor(lessonId, getUserId(), "get lesson learners", false)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); @@ -760,8 +757,7 @@ */ @RequestMapping("/getCurrentLearners") @ResponseBody - public String getCurrentLearners(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { + public String getCurrentLearners(HttpServletRequest request, HttpServletResponse response) throws IOException { ArrayNode learnersJSON = JsonNodeFactory.instance.arrayNode(); Integer learnerCount = null; @@ -902,18 +898,19 @@ response.setContentType("text/xml"); response.setCharacterEncoding("UTF-8"); + response.getWriter().print(languageOutput); - return languageOutput; + return null; } /** * Calls the server to bring up the learner progress page. Assumes destination is a new window. The userid that * comes from UI is the user id of the learner for which we are calculating the url. This is different to all the * other calls. */ - @RequestMapping("/") - public String getLearnerActivityURL(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, LamsToolServiceException { + @RequestMapping("/getLearnerActivityURL") + public String getLearnerActivityURL(HttpServletRequest request, HttpServletResponse response) + throws IOException, LamsToolServiceException { Integer learnerUserID = new Integer(WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID)); Long activityID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID)); @@ -929,7 +926,6 @@ /** Calls the server to bring up the activity's monitoring page. Assumes destination is a new window */ @RequestMapping("/getActivityMonitorURL") - @ResponseBody public String getActivityMonitorURL(HttpServletRequest request, HttpServletResponse response) throws IOException, LamsToolServiceException { Long activityID = new Long(WebUtil.readLongParam(request, "activityID")); @@ -1084,8 +1080,7 @@ */ @RequestMapping("/getLearnerProgressPage") @ResponseBody - public String getLearnerProgressPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { + public String getLearnerProgressPage(HttpServletRequest request, HttpServletResponse response) throws IOException { long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); if (!getSecurityService().isLessonMonitor(lessonId, getUserId(), "get learner progress page", false)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); @@ -1707,7 +1702,7 @@ return "systemErrorContent"; } - return "timeChart"; + return "timer"; } /** Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/struts-config.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -32,8 +32,8 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> <%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ attribute name="formID" required="true" rtexprvalue="true" %> <%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> @@ -123,11 +123,11 @@ } \ No newline at end of file Index: lams_monitoring/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (.../AuthoringRatingAllStyleCriteria.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (.../AuthoringRatingAllStyleCriteria.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -8,7 +8,6 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-function" prefix="fn" %> Index: lams_monitoring/web/WEB-INF/tags/AuthoringRatingCriteria.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/AuthoringRatingCriteria.tag (.../AuthoringRatingCriteria.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/AuthoringRatingCriteria.tag (.../AuthoringRatingCriteria.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -8,7 +8,6 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-function" prefix="fn" %> @@ -284,42 +283,42 @@ - - + + - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + - - + + - - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + Index: lams_monitoring/web/WEB-INF/tags/CommentsAuthor.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/CommentsAuthor.tag (.../CommentsAuthor.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/CommentsAuthor.tag (.../CommentsAuthor.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,7 +1,7 @@ <%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> <%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ attribute name="allowCommentsVariableName" required="false" rtexprvalue="true"%> <%@ attribute name="allowCommentLabelKey" required="false" rtexprvalue="true"%> @@ -42,23 +42,21 @@
-     -   +     +  
Index: lams_monitoring/web/WEB-INF/tags/Page.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/Page.tag (.../Page.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -4,6 +4,7 @@ <%@ taglib uri="tags-lams" prefix="lams"%> <%@ attribute name="type" required="true" rtexprvalue="true"%> +<%@ attribute name="formID" required="false" rtexprvalue="true"%> <%@ attribute name="style" required="false" rtexprvalue="true"%> <%@ attribute name="title" required="false" rtexprvalue="true"%> <%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> @@ -88,8 +89,8 @@ - - + + ${toolForm.toolSessionID} @@ -434,4 +435,4 @@
- + \ No newline at end of file Index: lams_monitoring/web/WEB-INF/tags/Rating.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/Rating.tag (.../Rating.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/Rating.tag (.../Rating.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -8,7 +8,6 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-function" prefix="fn" %> Index: lams_monitoring/web/WEB-INF/tags/StyledRating.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/StyledRating.tag (.../StyledRating.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/StyledRating.tag (.../StyledRating.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -8,7 +8,6 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-function" prefix="fn" %> Index: lams_monitoring/web/WEB-INF/tags/TabBody.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/TabBody.tag (.../TabBody.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/TabBody.tag (.../TabBody.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -34,7 +34,6 @@ <%@ attribute name="titleKey" required="false" rtexprvalue="true"%> <%@ attribute name="page" required="false" rtexprvalue="true"%> <%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-bean" prefix="bean"%> Index: lams_monitoring/web/WEB-INF/tags/TabBodyArea.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/TabBodyArea.tag (.../TabBodyArea.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/TabBodyArea.tag (.../TabBodyArea.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -30,7 +30,6 @@ %> <%@ taglib uri="tags-core" prefix="c"%> -<%@ taglib uri="tags-bean" prefix="bean"%>
Index: lams_monitoring/web/WEB-INF/tags/TextSearch.tag =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tags/TextSearch.tag (.../TextSearch.tag) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tags/TextSearch.tag (.../TextSearch.tag) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -32,12 +32,11 @@ <%@ tag body-content="scriptless" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-fmt" prefix="fmt" %> -<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <%@ taglib uri="tags-lams" prefix="lams" %> <%-- Required attributes --%> <%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %> -<%@ attribute name="wrapInFormTag" required="true" rtexprvalue="true" %> <%-- Optional attributes --%> <%@ attribute name="action" required="false" rtexprvalue="true" %> @@ -53,10 +52,10 @@ <%-- Default value for message key --%> - + - + @@ -85,52 +84,40 @@ - -
- - -

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

+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
\ No newline at end of file Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tiles-defs.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -212,192 +212,6 @@ - - STRUTS-textarea - org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag - empty - - accesskey - false - true - - - alt - false - true - - - altKey - false - true - - - bundle - false - true - - - cols - false - true - - - disabled - false - true - - - errorKey - false - true - - - errorStyle - false - true - - - errorStyleClass - false - true - - - errorStyleId - false - true - - - index - false - true - - - indexed - false - true - - - name - false - true - - - onblur - false - true - - - onchange - false - true - - - onclick - false - true - - - ondblclick - false - true - - - onfocus - false - true - - - onkeydown - false - true - - - onkeypress - false - true - - - onkeyup - false - true - - - onmousedown - false - true - - - onmousemove - false - true - - - onmouseout - false - true - - - onmouseover - false - true - - - onmouseup - false - true - - - property - true - true - - - readonly - false - true - - - rows - false - true - - - style - false - true - - - styleClass - false - true - - - styleId - false - true - - - tabindex - false - true - - - title - false - true - - - titleKey - false - true - - - value - false - true - - - Small portrait of a user User Portrait Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-bean-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-bean.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-html-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-html.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-logic-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-logic.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-nested.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-tiles-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/tlds/struts/struts-tiles.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/validation.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/WEB-INF/validator-rules.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/web/WEB-INF/web.xml =================================================================== diff -u -r6e7ab7890111cde84e6557c3507a1e9d3682e318 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision 6e7ab7890111cde84e6557c3507a1e9d3682e318) +++ lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -82,28 +82,6 @@ 1 - - action - org.apache.struts.action.ActionServlet - - config - /WEB-INF/struts-config.xml - - - debug - 999 - - - detail - 2 - - - validate - true - - 2 - - spring *.do @@ -123,43 +101,7 @@ - - - - - tags-bean - /WEB-INF/tlds/struts/struts-bean.tld - - - tags-html - /WEB-INF/tlds/struts/struts-html.tld - - - tags-logic - /WEB-INF/tlds/struts/struts-logic.tld - - - tags-tiles - /WEB-INF/tlds/struts/struts-tiles.tld - - - tags-bean-el - /WEB-INF/tlds/struts/struts-bean-el.tld - - - tags-html-el - /WEB-INF/tlds/struts/struts-html-el.tld - - - tags-logic-el - /WEB-INF/tlds/struts/struts-logic-el.tld - - - tags-tiles-el - /WEB-INF/tlds/struts/struts-tiles-el.tld - - Index: lams_monitoring/web/complexProgress.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/complexProgress.jsp (.../complexProgress.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/complexProgress.jsp (.../complexProgress.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - Index: lams_monitoring/web/emailnotifications/archivedEmailList.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/emailnotifications/archivedEmailList.jsp (.../archivedEmailList.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/emailnotifications/archivedEmailList.jsp (.../archivedEmailList.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,8 +1,9 @@ + + <%@ include file="/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.util.Configuration"%> <%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys"%> - Index: lams_monitoring/web/emailnotifications/courseNotifications.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/emailnotifications/courseNotifications.jsp (.../courseNotifications.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/emailnotifications/courseNotifications.jsp (.../courseNotifications.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,7 +1,8 @@ + + <%@ include file="/taglibs.jsp"%> <% pageContext.setAttribute("newLineChar", "\n"); %> - @@ -43,7 +44,7 @@ jQuery("#list3").jqGrid({ guiStyle: "bootstrap", iconSet: 'fontAwesome', - url: "" + getSearchParams(), + url: "" + getSearchParams(), datatype: "json", colNames:[''], colModel:[ @@ -213,7 +214,7 @@ - +
Index: lams_monitoring/web/emailnotifications/lessonNotifications.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/emailnotifications/lessonNotifications.jsp (.../lessonNotifications.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/emailnotifications/lessonNotifications.jsp (.../lessonNotifications.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,7 +1,8 @@ + + <%@ include file="/taglibs.jsp"%> <% pageContext.setAttribute("newLineChar", "\n"); %> - @@ -182,15 +183,15 @@ - +
- - Index: lams_monitoring/web/emailnotifications/scheduledEmailList.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/emailnotifications/scheduledEmailList.jsp (.../scheduledEmailList.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/emailnotifications/scheduledEmailList.jsp (.../scheduledEmailList.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,8 +1,9 @@ + + <%@ include file="/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.util.Configuration"%> <%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys"%> - Index: lams_monitoring/web/gate/conditionGateContent.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/gate/conditionGateContent.jsp (.../conditionGateContent.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/gate/conditionGateContent.jsp (.../conditionGateContent.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - Index: lams_monitoring/web/gate/permissionGateContent.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - @@ -43,7 +44,7 @@ - + <%@ include file="gateInfo.jsp" %> Index: lams_monitoring/web/gate/scheduleGateContent.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/gate/scheduleGateContent.jsp (.../scheduleGateContent.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/gate/scheduleGateContent.jsp (.../scheduleGateContent.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - @@ -78,7 +79,7 @@ - + <%@ include file="gateInfo.jsp" %> Index: lams_monitoring/web/gate/sychGateContent.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/gate/sychGateContent.jsp (.../sychGateContent.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/gate/sychGateContent.jsp (.../sychGateContent.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - Index: lams_monitoring/web/grouping/chosenGrouping.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/grouping/chosenGrouping.jsp (.../chosenGrouping.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/grouping/chosenGrouping.jsp (.../chosenGrouping.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - <c:out value="${title}"/> @@ -59,7 +60,7 @@

- + Index: lams_monitoring/web/grouping/viewGroups.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/grouping/viewGroups.jsp (.../viewGroups.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/grouping/viewGroups.jsp (.../viewGroups.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,57 +18,72 @@ http://www.gnu.org/licenses/gpl.txt --%> + <%@ include file="/taglibs.jsp"%> - - - -
- - - - - + + + + + + + + + + - - - - - col-xs-12 - - - col-xs-6 - - - col-xs-4 - - - col-md-3 - - - - -
-
-

- - - +
+ + + + + + + + + + + col-xs-12 + + col-xs-6 + + + col-xs-4 + - - - - -
+ col-md-3
-
-
- - - -
- -
\ No newline at end of file + + +
+
+

+ + + + + + + + + +
+
+
+
+
+
+
+
+
+ +
+ + + + +
Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -47,10 +47,9 @@ $('#presenceButton').click(function(){ var checked = $(this).toggleClass('btn-success').hasClass('btn-success'); $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/presenceAvailable.do', cache : false, data : { - 'method' : 'presenceAvailable', 'presenceAvailable' : checked, 'lessonID' : lessonId }, @@ -72,10 +71,9 @@ $('#imButton').click(function(){ var checked = $(this).toggleClass('btn-success').hasClass('btn-success'); $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/presenceImAvailable.do', cache : false, data : { - 'method' : 'presenceImAvailable', 'presenceImAvailable' : checked, 'lessonID' : lessonId }, @@ -122,7 +120,7 @@ // search for users in the organisation with the term the Monitor entered $('.dialogSearchPhrase', classDialog).autocomplete({ - 'source' : LAMS_URL + "monitoring/monitoring.do?method=autocomplete&scope=organisation&lessonID=" + lessonId, + 'source' : LAMS_URL + "monitoring/monitoring/autocomplete.do?scope=organisation&lessonID=" + lessonId, 'delay' : 700, 'select' : function(event, ui){ var phraseField = $(this), @@ -174,10 +172,9 @@ $('#gradebookOnCompleteButton').click(function(){ var checked = $(this).toggleClass('btn-success').hasClass('btn-success'); $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/gradebookOnComplete.do', cache : false, data : { - 'method' : 'gradebookOnComplete', 'gradebookOnComplete' : checked, 'lessonID' : lessonId }, @@ -199,9 +196,8 @@ */ function showLessonLearnersDialog() { var ajaxProperties = { - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getLessonLearners.do', data : { - 'method' : 'getLessonLearners', 'lessonID' : lessonId } }; @@ -460,7 +456,7 @@ }); drawChart('pie', 'chartDiv', - LAMS_URL + 'monitoring/monitoring.do?method=getLessonChartData&lessonID=' + lessonId, + LAMS_URL + 'monitoring/monitoring/getLessonChartData.do?lessonID=' + lessonId, true); updatePresenceAvailableCount(); @@ -478,10 +474,9 @@ if (date) { if ( checkScheduleDate (date, lessonEndDate) ) { $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/startOnScheduleLesson.do', cache : false, data : { - 'method' : 'startOnScheduleLesson', 'lessonID' : lessonId, 'lessonStartDate' : date }, @@ -502,10 +497,9 @@ function startLesson(){ $.ajax({ dataType : 'text', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/startLesson.do', cache : false, data : { - 'method' : 'startLesson', 'lessonID' : lessonId }, success : function() { @@ -559,7 +553,7 @@ var dialog = $(this); // load contents after opening the dialog $('iframe', dialog).attr('src', - LAMS_URL + 'emailUser.do?method=composeMail&lessonID=' + lessonId + LAMS_URL + 'emailUser/composeMail.do?lessonID=' + lessonId + '&userID=' + userId); }, 'close' : function(){ @@ -576,10 +570,9 @@ if (checked) { $.ajax({ dataType : 'text', - url : LAMS_URL + 'learning/learner.do', + url : LAMS_URL + 'learning/learner/getPresenceChatActiveUserCount.do', cache : false, data : { - 'method' : 'getPresenceChatActiveUserCount', 'lessonID' : lessonId }, success : function(result) { @@ -640,11 +633,10 @@ add = dateCheckbox.is(':checked'); $.ajax({ - url : LAMS_URL + 'monitoring/emailProgress.do', + url : LAMS_URL + 'monitoring/emailProgress/updateEmailProgressDate.do', type : 'POST', cache : false, data : { - 'method' : 'updateEmailProgressDate', 'lessonID' : lessonId, 'id' : dateid, 'add' : add @@ -672,11 +664,10 @@ // initialise ajax config ajaxProperties = { dataType : 'json', - url : LAMS_URL + 'monitoring/emailProgress.do', + url : LAMS_URL + 'monitoring/emailProgress/getEmailProgressDates.do', cache : false, async : false, data : { - 'method' : 'getEmailProgressDates', 'lessonID' : lessonId }}; dialog.data('ajaxProperties', ajaxProperties); @@ -734,10 +725,9 @@ if ( confirm(LABELS.PROGRESS_EMAIL_SEND_NOW_QUESTION) ) { $.ajax({ dataType : 'json', - url : LAMS_URL + 'monitoring/emailProgress.do', + url : LAMS_URL + 'monitoring/emailProgress/sendLessonProgressEmail.do', cache : false, data : { - 'method' : 'sendLessonProgressEmail', 'lessonID' : lessonId }, success : function(response) { @@ -894,7 +884,7 @@ // search for users with the term the Monitor entered $('.dialogSearchPhrase', learnerGroupDialog).autocomplete({ - 'source' : LAMS_URL + "monitoring/monitoring.do?method=autocomplete&scope=lesson&lessonID=" + lessonId, + 'source' : LAMS_URL + "monitoring/monitoring/autocomplete.do?scope=lesson&lessonID=" + lessonId, 'delay' : 700, 'select' : function(event, ui){ var phraseField = $(this), @@ -926,7 +916,7 @@ // search for users with the term the Monitor entered $("#sequenceSearchPhrase").autocomplete( { - 'source' : LAMS_URL + "monitoring/monitoring.do?method=autocomplete&scope=lesson&lessonID=" + lessonId, + 'source' : LAMS_URL + "monitoring/monitoring/autocomplete.do?scope=lesson&lessonID=" + lessonId, 'delay' : 700, 'select' : function(event, ui){ // put the learner first name, last name and login into the box @@ -1014,7 +1004,7 @@ 'resizable' : false, 'title' : LABELS.LESSON_INTRODUCTION, 'open' : function(){ - $('iframe', this).attr('src', LAMS_URL + 'editLessonIntro.do?method=edit&lessonID='+lessonId); + $('iframe', this).attr('src', LAMS_URL + 'editLessonIntro/edit.do?lessonID='+lessonId); $('iframe', this).css('height', '360px'); autoRefreshBlocked = true; }, @@ -1064,10 +1054,9 @@ $.ajax({ dataType : 'json', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getLessonProgress.do', cache : false, data : { - 'method' : 'getLessonProgress', 'lessonID' : lessonId, 'searchedLearnerId' : sequenceSearchedLearner }, @@ -1158,11 +1147,10 @@ // fetch SVG just once, since it is immutable $.ajax({ dataType : 'text', - url : LAMS_URL + 'home.do', + url : LAMS_URL + 'home/getLearningDesignThumbnail.do', async : false, cache : false, data : { - 'method' : 'getLearningDesignThumbnail', 'ldId' : ldId }, success : function(response) { @@ -1187,7 +1175,7 @@ // run the whole fetch again updateSequenceTab(); }).attr('src', LAMS_URL - + 'authoring/author.do?method=generateSVG&selectable=false&learningDesignID=' + ldId).attr('width',0).attr('height',0).attr('style','border: 0px'); + + 'authoring/author/generateSVG.do?selectable=false&learningDesignID=' + ldId).attr('width',0).attr('height',0).attr('style','border: 0px'); } }); @@ -1269,11 +1257,10 @@ if (currentActivityId) { $.ajax({ dataType : 'text', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/isActivityPreceding.do', async : false, cache : false, data : { - 'method' : 'isActivityPreceding', 'activityA' : targetActivityId, 'activityB' : currentActivityId }, @@ -1322,10 +1309,9 @@ $.ajax({ dataType : 'text', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/forceComplete.do', cache : false, data : { - 'method' : 'forceComplete', 'lessonID' : lessonId, 'learnerID' : learnerIds.slice(0, -1), 'activityID' : activityId, @@ -1476,7 +1462,7 @@ dblTap(learnerIcon, function(event){ // double click on learner icon to see activity from his perspective event.stopPropagation(); - var url = LAMS_URL + 'monitoring/monitoring.do?method=getLearnerActivityURL&userID=' + var url = LAMS_URL + 'monitoring/monitoring/getLearnerActivityURL.do?userID=' + learner.id + '&activityID=' + activity.id + '&lessonID=' + lessonId; openPopUp(url, "LearnActivity", popupHeight, popupWidth, true); }); @@ -1497,9 +1483,8 @@ // double click on learner group icon to see list of learners event.stopPropagation(); var ajaxProperties = { - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getCurrentLearners.do', data : { - 'method' : 'getCurrentLearners', 'activityID' : activity.id } }; @@ -1584,9 +1569,8 @@ dblTap(groupIcon, function(){ var ajaxProperties = { - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getCurrentLearners.do', data : { - 'method' : 'getCurrentLearners', 'lessonID' : lessonId } }; @@ -1727,11 +1711,10 @@ // initialise ajax config ajaxProperties = { dataType : 'json', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getClassMembers.do', cache : false, async : false, data : { - 'method' : 'getClassMembers', 'lessonID' : lessonId, 'role' : role.toUpperCase(), 'pageNumber' : 1, @@ -1804,11 +1787,10 @@ add = userCheckbox.is(':checked'); $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/updateLessonClass.do', type : 'POST', cache : false, data : { - 'method' : 'updateLessonClass', 'lessonID' : lessonId, 'userID' : userID, 'role' : role, @@ -1823,11 +1805,10 @@ function addAllLearners(){ if (confirm(LABELS.CLASS_ADD_ALL_CONFIRM)) { $.ajax({ - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/addAllOrganisationLearnersToLesson.do', type : 'POST', cache : false, data : { - 'method' : 'addAllOrganisationLearnersToLesson', 'lessonID' : lessonId }, success : function(){ @@ -1845,11 +1826,10 @@ if (confirm(LABELS.LIVE_EDIT_CONFIRM)) { $.ajax({ dataType : 'text', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/startLiveEdit.do', cache : false, async : false, data : { - 'method' : 'startLiveEdit', 'ldId' : ldId }, success : function(response) { @@ -1892,7 +1872,7 @@ function initLearnersTab() { // search for users with the term the Monitor entered $("#learnersSearchPhrase").autocomplete( { - 'source' : LAMS_URL + "monitoring/monitoring.do?method=autocomplete&scope=lesson&lessonID=" + lessonId, + 'source' : LAMS_URL + "monitoring/monitoring/autocomplete.do?scope=lesson&lessonID=" + lessonId, 'delay' : 700, 'select' : function(event, ui){ // learner's ID in ui.item.value is not used here @@ -2035,10 +2015,9 @@ $.ajax({ dataType : 'json', - url : LAMS_URL + 'monitoring/monitoring.do', + url : LAMS_URL + 'monitoring/monitoring/getLearnerProgressPage.do', cache : false, data : { - 'method' : 'getLearnerProgressPage', 'lessonID' : lessonId, 'searchPhrase' : learnersSearchPhrase, 'pageNumber' : pageNumber, @@ -2265,7 +2244,7 @@ togglePagingCells(learnerGroupDialog, pageNumber, maxPageNumber); $.each(learners, function(learnerIndex, learner) { - var viewUrl = allowView ? LAMS_URL + 'monitoring/monitoring.do?method=getLearnerActivityURL&userID=' + var viewUrl = allowView ? LAMS_URL + 'monitoring/monitoring/getLearnerActivityURL.do?userID=' + learner.id + '&activityID=' + ajaxProperties.data.activityID + '&lessonID=' + lessonId : null, learnerDiv = $('
').attr({ Index: lams_monitoring/web/monitor.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,12 +1,14 @@ + + <%@ include file="/taglibs.jsp"%> <%@ page import="org.lamsfoundation.lams.util.Configuration" import="org.lamsfoundation.lams.util.ConfigurationKeys" %> + <%=Configuration.get(ConfigurationKeys.ALLOW_DIRECT_LESSON_LAUNCH)%> <%=Configuration.get(ConfigurationKeys.SERVER_URL)%> ${serverURL}/ - @@ -252,7 +254,7 @@ function switchToTblMonitor() { $("#content").load( - "", + "", { lessonID: ${lesson.lessonID} } Index: lams_monitoring/web/notsupported.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/notsupported.jsp (.../notsupported.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/notsupported.jsp (.../notsupported.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,8 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> -<%@ include file="/taglibs.jsp"%> + +<%@ include file="/taglibs.jsp"%> + Index: lams_monitoring/web/previewdeleted.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/previewdeleted.jsp (.../previewdeleted.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/previewdeleted.jsp (.../previewdeleted.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + <%@ include file="/taglibs.jsp"%> - + Index: lams_monitoring/web/systemErrorContent.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/systemErrorContent.jsp (.../systemErrorContent.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/systemErrorContent.jsp (.../systemErrorContent.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,9 +18,10 @@ http://www.gnu.org/licenses/gpl.txt --%> + + <%@ include file="/taglibs.jsp"%> - Index: lams_monitoring/web/tblmonitor/tblmonitor.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/tblmonitor/tblmonitor.jsp (.../tblmonitor.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/tblmonitor/tblmonitor.jsp (.../tblmonitor.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,6 +1,7 @@ + + <%@ include file="/template/taglibs.jsp"%> - <fmt:message key="label.tbl.monitor"/> @@ -38,8 +39,8 @@ //hide burning-questions if it's disabled in a tool if ("${traToolContentId}" != "") { $.ajax({ - url: 'tool/lascrt11/tblmonitoring.do', - data: 'method=isBurningQuestionsEnabled&toolContentID=${traToolContentId}', + url: 'tool/lascrt11/tblmonitoring/isBurningQuestionsEnabled.do', + data: 'toolContentID=${traToolContentId}', type: 'post', success: function (json) { if (!json.isBurningQuestionsEnabled) { @@ -142,7 +143,7 @@ } function switchToRegularMonitor() { - location.href = "home.do?method=monitorLesson&lessonID=${lesson.lessonId}"; + location.href = "home/monitorLesson.do?lessonID=${lesson.lessonId}"; } Index: lams_monitoring/web/tblmonitor/teams.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/tblmonitor/teams.jsp (.../teams.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_monitoring/web/tblmonitor/teams.jsp (.../teams.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,8 +18,8 @@ var leaderUserId = $('#change-leader-select-' + groupId).val(); $.ajax({ - url: '/tool/lalead11/tblmonitoring.do', - data: 'method=changeLeader&userID=' + leaderUserId + "&toolContentID=${leaderselectionToolContentId}", + url: '/tool/lalead11/tblmonitoring/changeLeader.do', + data: 'userID=' + leaderUserId + "&toolContentID=${leaderselectionToolContentId}", type: 'post', success: function (json) { if (json.isSuccessful) { @@ -110,11 +110,10 @@ $('#ira-user-score').html(userScore); //load modal dialog content using Ajax - var url = "${isIraMcqAvailable}" == "true" ? "tool/lamc11/tblmonitoring.do" : "tool/laasse10/tblmonitoring.do"; + var url = "${isIraMcqAvailable}" == "true" ? "tool/lamc11/tblmonitoring/getModalDialogForTeamsTab.do" : "tool/laasse10/tblmonitoring/getModalDialogForTeamsTab.do"; $('#ira-modal .modal-body').load( url, { - method: "getModalDialogForTeamsTab", toolContentID: "${iraToolContentId}", userID: userId }, Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/template/baseContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e962cd60c6fc58a68e93516844801045ed956870 refers to a dead (removed) revision in file `lams_monitoring/web/template/template.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/web/timer.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/timer.jsp (.../timer.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/timer.jsp (.../timer.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -1,4 +1,5 @@ + <%@ include file="/taglibs.jsp"%> Index: lams_monitoring/web/viewSequence.jsp =================================================================== diff -u -r3eb0caa98564b709116d6e84af92eb3f60c9ff3a -re962cd60c6fc58a68e93516844801045ed956870 --- lams_monitoring/web/viewSequence.jsp (.../viewSequence.jsp) (revision 3eb0caa98564b709116d6e84af92eb3f60c9ff3a) +++ lams_monitoring/web/viewSequence.jsp (.../viewSequence.jsp) (revision e962cd60c6fc58a68e93516844801045ed956870) @@ -18,15 +18,20 @@ http://www.gnu.org/licenses/gpl.txt --%> -<%@ include file="/taglibs.jsp"%> + +<%@ include file="/taglibs.jsp"%> + + +
+

@@ -50,5 +55,4 @@ -