Index: lams_central/web/includes/javascript/authoring/authoringProperty.js =================================================================== diff -u -r707c51d0e1951053e406ad4fac8013ccb7f550ab -r9fed0019a75212121fd9f371484bdd4a5c55c4d6 --- lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision 707c51d0e1951053e406ad4fac8013ccb7f550ab) +++ lams_central/web/includes/javascript/authoring/authoringProperty.js (.../authoringProperty.js) (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -1,4 +1,4 @@ -/** +/** * This file contains methods for Activity properties dialogs. */ Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rdecee05de5d7a90fe2aef3af04f588494262685b -r9fed0019a75212121fd9f371484bdd4a5c55c4d6 --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision decee05de5d7a90fe2aef3af04f588494262685b) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -46,13 +46,13 @@ audit.lesson.created = Lesson "{0}" created with learning design "{1}" ({2}) label.branching.general.instructions = Place the lesson participants in their branches. Initially you can add and remove learners, but once a participant starts one of the branches then you will not be able to remove learners from any branches. If you try to remove someone from a branch and they will not remove then check their progress - if they start using the branch while you are on this screen you will not get any errors but you will not be able to remove them from the branch. You will still be able to add learners to branches. label.branching.branch.heading = Branch -label.branching.non.allocated.users.heading = Learners without a branch label.branching.allocated.users.heading = Members of selected branch button.branching.add.user.to.branch = Add selected to branch button.branching.remove.user.from.branch = Remove selected from branch label.branching.general.group.instructions = Place the groups in their branches. Initially you can add and remove groups, but once a participant starts one of the branches then you will not be able to remove groups from any branches. You will still be able to add groups to branches. label.branching.non.allocated.groups.heading = Groups without a branch label.branching.allocated.groups.heading = Groups of the selected branch +label.branching.no.mappings.created = No groups have been assigned to branches in authoring. label.started = Started label.not.started = Not started label.completed = Completed @@ -531,4 +531,4 @@ label.monitoring.edit = Edit label.monitoring.burning.questions = Burning Questions label.monitoring.teams.question.results.question = Question -label.monitoring.teams.question.results = Question results +label.monitoring.teams.question.results = Question results \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java =================================================================== diff -u --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java (revision 0) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/BranchingController.java (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -0,0 +1,40 @@ +package org.lamsfoundation.lams.monitoring.web; + +import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.BranchActivityEntry; +import org.lamsfoundation.lams.learningdesign.BranchingActivity; +import org.lamsfoundation.lams.monitoring.service.IMonitoringFullService; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.Comparator; +import java.util.Set; +import java.util.TreeSet; + +@Controller +public class BranchingController { + @Autowired + private IMonitoringFullService monitoringService; + + @RequestMapping(path = "/groupedBranching", method = RequestMethod.GET) + public String viewGroupeBranchingMappings(@RequestParam(name = AttributeNames.PARAM_ACTIVITY_ID) long activityId, + Model model) { + + Activity activity = monitoringService.getActivityById(activityId); + if (!activity.isGroupBranchingActivity()) { + throw new IllegalArgumentException("Activity with ID " + activityId + " is not grouped branching activity"); + } + BranchingActivity branchingActivity = (BranchingActivity) activity; + Set branchActiivtyEntries = new TreeSet<>( + Comparator.comparing(e -> e.getGroup().getGroupName())); + branchActiivtyEntries.addAll(branchingActivity.getBranchActivityEntries()); + model.addAttribute("branchActivityEntries", branchActiivtyEntries); + + return "branching/viewGroupedBranching"; + } +} \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java =================================================================== diff -u -rd416d14c233164ac4787360cbd490f31227694cd -r9fed0019a75212121fd9f371484bdd4a5c55c4d6 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision d416d14c233164ac4787360cbd490f31227694cd) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringController.java (.../MonitoringController.java) (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -23,48 +23,14 @@ package org.lamsfoundation.lams.monitoring.web; -import java.io.IOException; -import java.io.PrintWriter; -import java.security.InvalidParameterException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.TreeSet; -import java.util.Vector; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.lamsfoundation.lams.authoring.IAuthoringService; import org.lamsfoundation.lams.learning.service.ILearnerService; -import org.lamsfoundation.lams.learningdesign.Activity; -import org.lamsfoundation.lams.learningdesign.BranchingActivity; -import org.lamsfoundation.lams.learningdesign.ChosenBranchingActivity; -import org.lamsfoundation.lams.learningdesign.ComplexActivity; -import org.lamsfoundation.lams.learningdesign.ContributionTypes; -import org.lamsfoundation.lams.learningdesign.GateActivity; -import org.lamsfoundation.lams.learningdesign.Group; -import org.lamsfoundation.lams.learningdesign.GroupingActivity; -import org.lamsfoundation.lams.learningdesign.LearningDesign; -import org.lamsfoundation.lams.learningdesign.OptionsWithSequencesActivity; -import org.lamsfoundation.lams.learningdesign.SequenceActivity; -import org.lamsfoundation.lams.learningdesign.ToolActivity; -import org.lamsfoundation.lams.learningdesign.Transition; +import org.lamsfoundation.lams.learningdesign.*; import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException; import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; import org.lamsfoundation.lams.lesson.LearnerProgress; @@ -86,12 +52,7 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.exception.UserException; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; -import org.lamsfoundation.lams.util.CommonConstants; -import org.lamsfoundation.lams.util.DateUtil; -import org.lamsfoundation.lams.util.JsonUtil; -import org.lamsfoundation.lams.util.MessageService; -import org.lamsfoundation.lams.util.ValidationUtil; -import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.util.*; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.beans.factory.annotation.Autowired; @@ -103,9 +64,18 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.util.HtmlUtils; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; +import java.io.PrintWriter; +import java.security.InvalidParameterException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.Map.Entry; /** * The action servlet that provide all the monitoring functionalities. It interact with the teacher via JSP monitoring @@ -323,7 +293,8 @@ boolean allowRestart = WebUtil.readBooleanParam(request, "allowRestart", false); boolean precedingLessonEnable = WebUtil.readBooleanParam(request, "precedingLessonEnable", false); - Long precedingLessonId = precedingLessonEnable ? WebUtil.readLongParam(request, "precedingLessonId", true) + Long precedingLessonId = precedingLessonEnable + ? WebUtil.readLongParam(request, "precedingLessonId", true) : null; boolean timeLimitEnable = WebUtil.readBooleanParam(request, "timeLimitEnable", false); Integer timeLimitDays = WebUtil.readIntParam(request, "timeLimitDays", true); @@ -351,10 +322,10 @@ String staffGroupName = organisation.getName() + " staff"; // either all users participate in a lesson, or we split them among instances - List lessonInstanceLearners = splitNumberLessons == null ? learners - : new ArrayList<>((learners.size() / splitNumberLessons) + 1); - for (int lessonIndex = 1; lessonIndex <= (splitNumberLessons == null ? 1 - : splitNumberLessons); lessonIndex++) { + List lessonInstanceLearners = + splitNumberLessons == null ? learners : new ArrayList<>((learners.size() / splitNumberLessons) + 1); + for (int lessonIndex = 1; + lessonIndex <= (splitNumberLessons == null ? 1 : splitNumberLessons); lessonIndex++) { String lessonInstanceName = lessonName; String learnerGroupInstanceName = learnerGroupName; String staffGroupInstanceName = staffGroupName; @@ -365,16 +336,16 @@ learnerGroupInstanceName += " " + lessonIndex; staffGroupInstanceName += " " + lessonIndex; lessonInstanceLearners.clear(); - for (int learnerIndex = lessonIndex - 1; learnerIndex < learners - .size(); learnerIndex += splitNumberLessons) { + for (int learnerIndex = lessonIndex - 1; + learnerIndex < learners.size(); learnerIndex += splitNumberLessons) { lessonInstanceLearners.add(learners.get(learnerIndex)); } } if (log.isDebugEnabled()) { - log.debug("Creating lesson " - + (splitNumberLessons == null ? "" : "(" + lessonIndex + "/" + splitNumberLessons + ") ") - + "\"" + lessonInstanceName + "\""); + log.debug("Creating lesson " + (splitNumberLessons == null + ? "" + : "(" + lessonIndex + "/" + splitNumberLessons + ") ") + "\"" + lessonInstanceName + "\""); } Lesson lesson = null; @@ -447,8 +418,8 @@ return; } Lesson lesson = lessonService.getLesson(lessonId); - Vector learners = userManagementService - .getUsersFromOrganisationByRole(lesson.getOrganisation().getOrganisationId(), Role.LEARNER, true); + Vector learners = userManagementService.getUsersFromOrganisationByRole( + lesson.getOrganisation().getOrganisationId(), Role.LEARNER, true); lessonService.addLearners(lesson, learners); } @@ -727,7 +698,8 @@ orderAscending); // if the result is less then page size, then no need for full check of user count - Integer userCount = users.size() < MonitoringController.USER_PAGE_SIZE ? users.size() + Integer userCount = users.size() < MonitoringController.USER_PAGE_SIZE + ? users.size() : userManagementService.getCountRoleForOrg(lesson.getOrganisation().getOrganisationId(), isMonitor ? Role.ROLE_MONITOR : Role.ROLE_LEARNER, searchPhrase); @@ -844,8 +816,9 @@ log.info((add ? "Added a " : "Removed a ") + role + " with ID " + userId + (add ? " to" : " from") + " lesson " + lessonId); } else { - log.warn("Failed when trying to " + (add ? "add a " : "remove a ") + role + " with ID " + userId - + (add ? " to" : " from") + " lesson " + lessonId); + log.warn("Failed when trying to " + (add ? "add a " : "remove a ") + role + " with ID " + userId + (add + ? " to" + : " from") + " lesson " + lessonId); } } @@ -883,8 +856,8 @@ String languageOutput = ""; for (int i = 0; i < languageCollection.size(); i++) { - languageOutput += "" - + messageService.getMessage(languageCollection.get(i)) + ""; + languageOutput += "" + messageService.getMessage( + languageCollection.get(i)) + ""; } languageOutput += ""; @@ -972,8 +945,9 @@ Organisation organisation = (Organisation) userManagementService.findById(Organisation.class, lessonDTO.getOrganisationID()); request.setAttribute("notificationsAvailable", organisation.getEnableCourseNotifications()); - boolean enableLiveEdit = organisation.getEnableLiveEdit() - && userManagementService.isUserInRole(user.getUserID(), organisation.getOrganisationId(), Role.AUTHOR); + boolean enableLiveEdit = + organisation.getEnableLiveEdit() && userManagementService.isUserInRole(user.getUserID(), + organisation.getOrganisationId(), Role.AUTHOR); request.setAttribute("enableLiveEdit", enableLiveEdit); request.setAttribute("lesson", lessonDTO); request.setAttribute("isTBLSequence", learningDesignService.isTBLSequence(lessonDTO.getLearningDesignID())); @@ -1045,8 +1019,8 @@ responseJSON.put("lessonName", HtmlUtils.htmlEscape(lesson.getLessonName())); responseJSON.put("lessonInstructions", learningDesign.getDescription()); - Date startOrScheduleDate = lesson.getStartDateTime() == null ? lesson.getScheduleStartDate() - : lesson.getStartDateTime(); + Date startOrScheduleDate = + lesson.getStartDateTime() == null ? lesson.getScheduleStartDate() : lesson.getStartDateTime(); Date finishDate = lesson.getScheduleEndDate(); DateFormat indfm = null; @@ -1156,15 +1130,15 @@ // find leaders from Leader Selection Tool if (activity.isToolActivity()) { ToolActivity toolActivity = (ToolActivity) activity; - if (ILamsToolService.LEADER_SELECTION_TOOL_SIGNATURE - .equals(toolActivity.getTool().getToolSignature())) { + if (ILamsToolService.LEADER_SELECTION_TOOL_SIGNATURE.equals( + toolActivity.getTool().getToolSignature())) { leaders.addAll(lamsToolService.getLeaderUserId(activity.getActivityId())); } } } - Map learnerCounts = monitoringService - .getCountLearnersCurrentActivities(activityIds.toArray(new Long[activityIds.size()])); + Map learnerCounts = monitoringService.getCountLearnersCurrentActivities( + activityIds.toArray(new Long[activityIds.size()])); ArrayNode activitiesJSON = JsonNodeFactory.instance.arrayNode(); for (Activity activity : activities) { @@ -1185,10 +1159,10 @@ activityJSON.put("x", MonitoringController.getActivityCoordinate(ba.getStartXcoord())); activityJSON.put("y", MonitoringController.getActivityCoordinate(ba.getStartYcoord())); } else if (activity.isOptionsWithSequencesActivity()) { - activityJSON.put("x", MonitoringController - .getActivityCoordinate(((OptionsWithSequencesActivity) activity).getStartXcoord())); - activityJSON.put("y", MonitoringController - .getActivityCoordinate(((OptionsWithSequencesActivity) activity).getStartYcoord())); + activityJSON.put("x", MonitoringController.getActivityCoordinate( + ((OptionsWithSequencesActivity) activity).getStartXcoord())); + activityJSON.put("y", MonitoringController.getActivityCoordinate( + ((OptionsWithSequencesActivity) activity).getStartYcoord())); } else if ((parentActivity != null) && (parentActivity.isOptionsActivity() || parentActivity.isParallelActivity() || parentActivity.isFloatingActivity())) { // Optional Activity children had coordinates relative to parent @@ -1203,7 +1177,7 @@ String monitorUrl = monitoringService.getActivityMonitorURL(lessonId, activityId, contentFolderId, monitorUserId); - if (monitorUrl != null && !activity.isBranchingActivity()) { + if (monitorUrl != null && !(activity.isBranchingActivity() && !activity.isGroupBranchingActivity())) { // whole activity monitor URL activityJSON.put("url", monitorUrl); } @@ -1228,7 +1202,7 @@ // insert the searched learner as the first one if ((searchedLearnerProgress != null) && (searchedLearnerProgress.getCurrentActivity() != null) && activity.getActivityId() - .equals(searchedLearnerProgress.getCurrentActivity().getActivityId())) { + .equals(searchedLearnerProgress.getCurrentActivity().getActivityId())) { // put the searched learner in front latestLearners = MonitoringController.insertHighlightedLearner(searchedLearnerProgress.getUser(), latestLearners, MonitoringController.LATEST_LEARNER_PROGRESS_ACTIVITY_DISPLAY_LIMIT); @@ -1383,8 +1357,8 @@ result = true; } else if (precedingActivity.isComplexActivity()) { // check descendants of a complex activity - ComplexActivity complexActivity = (ComplexActivity) monitoringService - .getActivityById(precedingActivity.getActivityId()); + ComplexActivity complexActivity = (ComplexActivity) monitoringService.getActivityById( + precedingActivity.getActivityId()); if (containsActivity(complexActivity, activityAid, monitoringService)) { result = true; } @@ -1407,8 +1381,8 @@ return true; } if (childActivity.isComplexActivity()) { - ComplexActivity childComplexActivity = (ComplexActivity) monitoringService - .getActivityById(childActivity.getActivityId()); + ComplexActivity childComplexActivity = (ComplexActivity) monitoringService.getActivityById( + childActivity.getActivityId()); if (containsActivity(childComplexActivity, targetActivityId, monitoringService)) { return true; } @@ -1548,8 +1522,8 @@ @RequestMapping(path = "/isLearningDesignHasGroupings", method = RequestMethod.GET) @ResponseBody public String isLearningDesignHasGroupings(@RequestParam long learningDesignId) { - List groupingActivities = monitoringService - .getGroupingActivitiesByLearningDesignId(learningDesignId); + List groupingActivities = monitoringService.getGroupingActivitiesByLearningDesignId( + learningDesignId); for (GroupingActivity activity : groupingActivities) { if (!activity.getCreateGrouping().isUsedForBranching()) { return Boolean.TRUE.toString(); @@ -1589,17 +1563,17 @@ List resultContributeActivities = new ArrayList<>(); for (ContributeActivityDTO contributeActivity : contributeActivities) { if (contributeActivity.getContributeEntries() != null) { - Iterator entryIterator = contributeActivity - .getContributeEntries().iterator(); + Iterator entryIterator = contributeActivity.getContributeEntries() + .iterator(); while (entryIterator.hasNext()) { ContributeActivityDTO.ContributeEntry contributeEntry = entryIterator.next(); // extra filtering for chosen branching: do not show in Sequence tab if all users were assigned - if (skipCompletedBranching - && ContributionTypes.CHOSEN_BRANCHING.equals(contributeEntry.getContributionType())) { + if (skipCompletedBranching && ContributionTypes.CHOSEN_BRANCHING.equals( + contributeEntry.getContributionType())) { Set learners = new HashSet<>(lesson.getLessonClass().getLearners()); - ChosenBranchingActivity branching = (ChosenBranchingActivity) monitoringService - .getActivityById(contributeActivity.getActivityID()); + ChosenBranchingActivity branching = (ChosenBranchingActivity) monitoringService.getActivityById( + contributeActivity.getActivityID()); for (SequenceActivity branch : (Set) (Set) branching.getActivities()) { Group group = branch.getSoleGroupForBranch(); if (group != null) { @@ -1640,4 +1614,4 @@ } return updatedLatestLearners; } -} +} \ No newline at end of file Fisheye: Tag 9fed0019a75212121fd9f371484bdd4a5c55c4d6 refers to a dead (removed) revision in file `lams_monitoring/web/assets/styles/main.css'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_monitoring/web/branching/viewGroupedBranching.jsp =================================================================== diff -u --- lams_monitoring/web/branching/viewGroupedBranching.jsp (revision 0) +++ lams_monitoring/web/branching/viewGroupedBranching.jsp (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -0,0 +1,81 @@ +<%-- +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 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 +--%> + + +<%@ include file="/taglibs.jsp"%> + + + + <fmt:message key="label.branching.branch.heading"/> + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+
+
+ +
+ + + + +
\ No newline at end of file Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r449847476facd8c4e2486f0f19799d199eb25f84 -r9fed0019a75212121fd9f371484bdd4a5c55c4d6 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 449847476facd8c4e2486f0f19799d199eb25f84) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 9fed0019a75212121fd9f371484bdd4a5c55c4d6) @@ -1,4 +1,4 @@ -// ********** GLOBAL VARIABLES ********** +// ********** GLOBAL VARIABLES ********** // copy of lesson SVG so it does no need to be fetched every time var originalSequenceCanvas = null, // DIV container for lesson SVG @@ -2834,4 +2834,4 @@ lastTapTarget = event.currentTarget; }); -} +} \ No newline at end of file