Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml (.../Activity.hbm.xml) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml (.../Activity.hbm.xml) (revision a94909694731838faabd950b35db3ec905f28529) @@ -275,6 +275,19 @@ @hibernate.class public abstract + + @hibernate.property column="start_xcoord" length="11" + + + @hibernate.property column="start_ycoord" length="11" + + + @hibernate.property column="end_xcoord" length="11" + + + @hibernate.property column="end_ycoord" length="11" + + @hibernate.class Index: lams_common/db/model/lams_11.clay =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/db/model/lams_11.clay (.../lams_11.clay) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/db/model/lams_11.clay (.../lams_11.clay) (revision a94909694731838faabd950b35db3ec905f28529) @@ -637,8 +637,8 @@ - + @@ -647,6 +647,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3869,7 +3921,7 @@ - + Index: lams_common/db/sql/create_lams_11_tables.sql =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision a94909694731838faabd950b35db3ec905f28529) @@ -516,6 +516,10 @@ , read_only TINYINT DEFAULT 0 , initialised TINYINT DEFAULT 0 , first_activity_id BIGINT(20) + , start_xcoord INT(11) + , start_ycoord INT(11) + , end_xcoord INT(11) + , end_ycoord INT(11) , PRIMARY KEY (activity_id) , INDEX (learning_library_id) , CONSTRAINT FK_lams_learning_activity_7 FOREIGN KEY (learning_library_id) Index: lams_common/db/sql/updatescripts/alter_21_branching.sql =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/db/sql/updatescripts/alter_21_branching.sql (.../alter_21_branching.sql) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/db/sql/updatescripts/alter_21_branching.sql (.../alter_21_branching.sql) (revision a94909694731838faabd950b35db3ec905f28529) @@ -24,7 +24,12 @@ )TYPE=InnoDB; ALTER TABLE lams_learning_activity -ADD COLUMN first_activity_id BIGINT(20); +ADD COLUMN first_activity_id BIGINT(20) +,ADD COLUMN start_xcoord INT(11) +,ADD COLUMN start_ycoord INT(11) +,ADD COLUMN end_xcoord INT(11) +,ADD COLUMN end_ycoord INT(11); + INSERT INTO lams_learning_activity_type VALUES (10, 'BRANCHING_CHOSEN'); INSERT INTO lams_learning_activity_type VALUES (11, 'BRANCHING_GROUP'); Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchingActivity.java =================================================================== diff -u -r6e041b14d83c90f3f910fac33c7755fca1486b3e -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchingActivity.java (.../BranchingActivity.java) (revision 6e041b14d83c90f3f910fac33c7755fca1486b3e) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/BranchingActivity.java (.../BranchingActivity.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -24,10 +24,7 @@ package org.lamsfoundation.lams.learningdesign; import java.io.Serializable; -import java.util.Date; import java.util.Set; - -import org.apache.commons.lang.builder.ToStringBuilder; import org.lamsfoundation.lams.learningdesign.strategy.BranchingActivityStrategy; /** @@ -38,6 +35,17 @@ */ abstract public class BranchingActivity extends ComplexActivity implements Serializable { + // types are used on the URLS to determine which type of branch is expected + // the code should always then check against the activity to make sure it is correct + public static final String CHOSEN_TYPE = "chosen"; + public static final String GROUP_BASED_TYPE = "group"; + public static final String TOOL_BASED_TYPE = "tool"; + + private Integer startXcoord; + private Integer startYcoord; + private Integer endXcoord; + private Integer endYcoord; + /** full constructor */ public BranchingActivity(Long activityId, Integer id, @@ -58,6 +66,10 @@ Transition transitionTo, Transition transitionFrom, String languageFile, + Integer startXcoord, + Integer startYcoord, + Integer endXcoord, + Integer endYcoord, Set activities) { super(activityId, id, @@ -80,6 +92,11 @@ languageFile, activities); super.activityStrategy = new BranchingActivityStrategy(this); + this.startXcoord = startXcoord; + this.startYcoord = startYcoord; + this.endXcoord = endXcoord; + this.endYcoord = endYcoord; + } /** default constructor */ @@ -121,5 +138,49 @@ return false; } + /** + * @hibernate.property column="end_xcoord" length="11" + */ + public Integer getEndXcoord() { + return endXcoord; + } + public void setEndXcoord(Integer endXcoord) { + this.endXcoord = endXcoord; + } + + /** + * @hibernate.property column="end_ycoord" length="11" + */ + public Integer getEndYcoord() { + return endYcoord; + } + + public void setEndYcoord(Integer endYcoord) { + this.endYcoord = endYcoord; + } + + /** + * @hibernate.property column="start_xcoord" length="11" + */ + public Integer getStartXcoord() { + return startXcoord; + } + + public void setStartXcoord(Integer startXcoord) { + this.startXcoord = startXcoord; + } + + /** + * @hibernate.property column="start_ycoord" length="11" + */ + public Integer getStartYcoord() { + return startYcoord; + } + + public void setStartYcoord(Integer startYcoord) { + this.startYcoord = startYcoord; + } + + } Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ChosenBranchingActivity.java =================================================================== diff -u -r6e041b14d83c90f3f910fac33c7755fca1486b3e -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ChosenBranchingActivity.java (.../ChosenBranchingActivity.java) (revision 6e041b14d83c90f3f910fac33c7755fca1486b3e) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ChosenBranchingActivity.java (.../ChosenBranchingActivity.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -24,11 +24,9 @@ package org.lamsfoundation.lams.learningdesign; import java.io.Serializable; -import java.util.Date; import java.util.Set; import org.apache.commons.lang.builder.ToStringBuilder; -import org.lamsfoundation.lams.learningdesign.strategy.BranchingActivityStrategy; /** * @author Mitchell Seaton @@ -60,6 +58,10 @@ Transition transitionTo, Transition transitionFrom, String languageFile, + Integer startXcoord, + Integer startYcoord, + Integer endXcoord, + Integer endYcoord, Set activities) { super(activityId, id, @@ -80,7 +82,11 @@ transitionTo, transitionFrom, languageFile, - activities); + startXcoord, + startYcoord, + endXcoord, + endYcoord, + activities); } /** default constructor */ Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupBranchingActivity.java =================================================================== diff -u -r6e041b14d83c90f3f910fac33c7755fca1486b3e -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupBranchingActivity.java (.../GroupBranchingActivity.java) (revision 6e041b14d83c90f3f910fac33c7755fca1486b3e) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupBranchingActivity.java (.../GroupBranchingActivity.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -58,6 +58,10 @@ Transition transitionTo, Transition transitionFrom, String languageFile, + Integer startXcoord, + Integer startYcoord, + Integer endXcoord, + Integer endYcoord, Set activities) { super(activityId, id, @@ -78,6 +82,10 @@ transitionTo, transitionFrom, languageFile, + startXcoord, + startYcoord, + endXcoord, + endYcoord, activities); } Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolBranchingActivity.java =================================================================== diff -u -r6e041b14d83c90f3f910fac33c7755fca1486b3e -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolBranchingActivity.java (.../ToolBranchingActivity.java) (revision 6e041b14d83c90f3f910fac33c7755fca1486b3e) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolBranchingActivity.java (.../ToolBranchingActivity.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -58,6 +58,10 @@ Transition transitionTo, Transition transitionFrom, String languageFile, + Integer startXcoord, + Integer startYcoord, + Integer endXcoord, + Integer endYcoord, Set activities) { super(activityId, id, @@ -78,6 +82,10 @@ transitionTo, transitionFrom, languageFile, + startXcoord, + startYcoord, + endXcoord, + endYcoord, activities); } Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java (.../AuthoringActivityDTO.java) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java (.../AuthoringActivityDTO.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -208,6 +208,12 @@ /** Used by a sequence activity to determine the start of the transition based sequence */ private Integer firstActivityUIID; + private Integer startXCoord; + private Integer startYCoord; + private Integer endXCoord; + private Integer endYCoord; + + /***************************************************************************** * Constructors *****************************************************************************/ @@ -227,7 +233,8 @@ Integer createGroupingUIID, Long libraryActivityID, Boolean applyGrouping,Integer groupingSupportType, Integer groupingType,GroupingDTO groupingDTO, - Boolean readOnly, Boolean initialised, Integer firstActivityUIID) { + Boolean readOnly, Boolean initialised, Integer firstActivityUIID, + Integer startXCoord, Integer startYCoord, Integer endXCoord, Integer endYCoord) { super(); this.activityID = activityID; this.activityUIID = activityUIID; @@ -271,14 +278,15 @@ //this.groupingDTO = groupingDTO; this.readOnly = readOnly; this.initialised = initialised; + // Sequence Activity field this.firstActivityUIID = firstActivityUIID; + // Branching Activity fields + this.startXCoord = startXCoord; + this.startYCoord = startYCoord; + this.endXCoord = endXCoord; + this.endYCoord = endYCoord; + } - public AuthoringActivityDTO(ToolActivity toolActivity){ - super(); - this.activityID = toolActivity.getActivityId(); - this.activityUIID = toolActivity.getActivityUIID(); - this.toolContentID = toolActivity.getToolContentId(); - } public AuthoringActivityDTO(Activity activity){ processActivityType(activity); this.activityID = activity.getActivityId(); @@ -319,6 +327,7 @@ this.groupingSupportType = activity.getGroupingSupportType(); this.readOnly = activity.getReadOnly(); this.initialised = activity.isInitialised(); + } @@ -360,6 +369,10 @@ private void addParallelActivityAttributes(ParallelActivity activity){ } private void addBranchingActivityAttributes(BranchingActivity activity){ + this.startXCoord = activity.getStartXcoord(); + this.startYCoord = activity.getStartYcoord(); + this.endXCoord = activity.getEndXcoord(); + this.endYCoord = activity.getEndYcoord(); } private void addSequenceActivityAttributes(SequenceActivity activity){ if ( activity.getFirstActivity() != null ) @@ -612,6 +625,96 @@ public Integer getyCoord() { return yCoord; } + /** Get the authoring url related to this tool */ + public String getAuthoringURL() { + return authoringURL; + } + /** + * @return Returns the readOnly. + */ + public Boolean getReadOnly() { + return readOnly; + } + /** + * Name of the file (including the package) that contains the text strings for + * this activity. e.g. org.lamsfoundation.lams.tool.sbmt.SbmtResources.properties. + */ + public String getLanguageFile() { + return languageFile; + } + /** Get the tool's display name */ + public String getToolDisplayName() { + return toolDisplayName; + } + /** Get the contribution url related to this tool */ + public String getContributeURL() { + return contributeURL; + } + /** Get the monitoring url related to this tool */ + public String getMonitoringURL() { + return monitoringURL; + } + public String getModerationURL() { + return moderationURL; + } + public String getHelpURL(){ + return helpURL; + } + public String getToolSignature() { + return toolSignature; + } + public String getToolVersion() { + return toolVersion; + } + public Boolean getInitialised() { + return initialised; + } + /** + * @return Returns the applyGrouping. + */ + public Boolean getApplyGrouping() { + return applyGrouping; + } + /** + * @return Returns the groupingSupportType. + */ + public Integer getGroupingSupportType() { + return groupingSupportType; + } + /** + * @return Returns the groupingType. + */ + public Integer getGroupingType() { + return groupingType; + } + /** Get the UI ID of the first activity within a sequence activity */ + public Integer getFirstActivityUIID() { + return firstActivityUIID; + } + /** + * @return Returns the xcoord of the end hub for a branching activity + */ + public Integer getEndXCoord() { + return endXCoord; + } + /** + * @return Returns the tcoord of the end hub for a branching activity + */ + public Integer getEndYCoord() { + return endYCoord; + } + /** + * @return Returns the xcoord of the start hub for a branching activity + */ + public Integer getStartXCoord() { + return startXCoord; + } + /** + * @return Returns the ycoord of the start hub for a branching activity + */ + public Integer getStartYCoord() { + return startYCoord; + } /************************************************* * Setters ************************************************/ @@ -851,141 +954,82 @@ this.yCoord = ycoord; } /** - * @return Returns the applyGrouping. - */ - public Boolean getApplyGrouping() { - return applyGrouping; - } - /** * @param applyGrouping The applyGrouping to set. */ public void setApplyGrouping(Boolean applyGrouping) { this.applyGrouping = applyGrouping; } /** - * @return Returns the groupingSupportType. - */ - public Integer getGroupingSupportType() { - return groupingSupportType; - } - /** * @param groupingSupportType The groupingSupportType to set. */ public void setGroupingSupportType(Integer groupingSupportType) { if(!groupingSupportType.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) this.groupingSupportType = groupingSupportType; } /** - * @return Returns the groupingType. - */ - public Integer getGroupingType() { - return groupingType; - } - /** * @param groupingType The groupingType to set. */ public void setGroupingType(Integer groupingType) { if(!groupingType.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) this.groupingType = groupingType; } /** - * GroupingDTO removed and is now part of the "groupings" array located in LearningDesignDTO * - public GroupingDTO getGroupingDTO() { - return groupingDTO; - } - - public void setGroupingDTO(GroupingDTO groupingDTO) { - this.groupingDTO = groupingDTO; - } */ - - /** - * @return Returns the readOnly. - */ - public Boolean getReadOnly() { - return readOnly; - } - /** - * * @param readOnly The readOnly to set. */ public void setReadOnly(Boolean readOnly) { if(!readOnly.equals(WDDXTAGS.BOOLEAN_NULL_VALUE)) this.readOnly = readOnly; } - /** Get the authoring url related to this tool */ - public String getAuthoringURL() { - return authoringURL; - } public void setAuthoringURL(String toolAuthoringURL) { this.authoringURL = toolAuthoringURL; } - /** Get the tool's display name */ - public String getToolDisplayName() { - return toolDisplayName; - } public void setToolDisplayName(String toolDisplayName) { this.toolDisplayName = toolDisplayName; } - /** - * Name of the file (including the package) that contains the text strings for - * this activity. e.g. org.lamsfoundation.lams.tool.sbmt.SbmtResources.properties. - */ - public String getLanguageFile() { - return languageFile; - } public void setLanguageFile(String languageFile) { this.languageFile = languageFile; } - /** Get the contribution url related to this tool */ - public String getContributeURL() { - return contributeURL; - } public void setContributeURL(String contributeURL) { this.contributeURL = contributeURL; } - /** Get the monitoring url related to this tool */ - public String getMonitoringURL() { - return monitoringURL; - } public void setMonitoringURL(String monitoringURL) { this.monitoringURL = monitoringURL; } - public String getModerationURL() { - return moderationURL; - } public void setModerationURL(String moderationURL) { this.moderationURL = moderationURL; } - public String getHelpURL(){ - return helpURL; - } public void setHelpURL(String helpURL) { this.helpURL = helpURL; } - public String getToolSignature() { - return toolSignature; - } public void setToolSignature(String toolSignature) { this.toolSignature = toolSignature; } - public String getToolVersion() { - return toolVersion; - } public void setToolVersion(String toolVersion) { this.toolVersion = toolVersion; } - public Boolean getInitialised() { - return initialised; - } public void setInitialised(Boolean initialised) { this.initialised = initialised; } - public Integer getFirstActivityUIID() { - return firstActivityUIID; - } public void setFirstActivityUIID(Integer firstActivityUIID) { - this.firstActivityUIID = firstActivityUIID; + if(!firstActivityUIID.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + this.firstActivityUIID = firstActivityUIID; } + public void setEndXCoord(Integer endXCoord) { + if(!endXCoord.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + this.endXCoord = endXCoord; + } + public void setEndYCoord(Integer endYCoord) { + if(!endYCoord.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + this.endYCoord = endYCoord; + } + public void setStartXCoord(Integer startXCoord) { + if(!startXCoord.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + this.startXCoord = startXCoord; + } + public void setStartYCoord(Integer startYCoord) { + if(!startYCoord.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + this.startYCoord = startYCoord; + } } Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java =================================================================== diff -u -reb0c055d846fcd1fda55eca93baef21971207d60 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision eb0c055d846fcd1fda55eca93baef21971207d60) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -1447,10 +1447,12 @@ // branch mappings - maps groups to branchs List entryDtoList = dto.getBranchMappings(); - Set entryList = new HashSet(); - for (GroupBranchActivityEntryDTO entryDto : entryDtoList) { - GroupBranchActivityEntry entry = getGroupBranchActivityEntry(entryDto, groupByUIIDMapper, activityByUIIDMapper); - entryList.add(entry); + if ( entryDtoList != null ) { + Set entryList = new HashSet(); + for (GroupBranchActivityEntryDTO entryDto : entryDtoList) { + GroupBranchActivityEntry entry = getGroupBranchActivityEntry(entryDto, groupByUIIDMapper, activityByUIIDMapper); + entryList.add(entry); + } } LearningDesign ld = getLearningDesign(dto,importer,folder,actList,transList,activityMapper); Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java =================================================================== diff -u -r4ca1b4e69d135a796d7db5eab3206e24e9503619 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java (.../ILessonService.java) (revision 4ca1b4e69d135a796d7db5eab3206e24e9503619) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java (.../ILessonService.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -110,46 +110,46 @@ /** * Perform the grouping, setting the given list of learners as one group. Used in suitations * where there is a grouping but no grouping activity (e.g. in branching). - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the object on which to perform the grouing. (mandatory) * @param groupName (optional) * @param learners to form one group (mandatory) */ public void performGrouping(Grouping grouping, String groupName, List learners) throws LessonServiceException; /** - * Perform grouping for all the learners who have started the lesson, based on the grouping activity. - * Currently used for chosen grouping. + * Perform grouping for all the learners who have started the lesson, based on the grouping. + * Currently used for chosen grouping and branching * @param lessonId lesson id (mandatory) * @param groupId group id (mandatory) - * @param groupingActivityId the activity that has create grouping. (mandatory) + * @param grouping the object on which to perform the grouing. (mandatory) */ - public void performGrouping(GroupingActivity groupingActivity, Long groupId, List learners) throws LessonServiceException; + public void performGrouping(Grouping grouping, Long groupId, List learners) throws LessonServiceException; /** * Remove learners from the given group. - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping from which to remove the learners (mandatory) * @param groupName if not null only remove user from this group, if null remove learner from any group. * @param learners the learners to be removed (mandatory) */ - public void removeLearnersFromGroup(GroupingActivity groupingActivity, Long groupId, List learners) throws LessonServiceException; + public void removeLearnersFromGroup(Grouping grouping, Long groupId, List learners) throws LessonServiceException; /** Create an empty group for the given grouping. If the group name is not supplied - * or the group name already exists then nothing happens. + * or the group name already exists then nothing happens. * - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping in which to create the group. (mandatory) * @param groupName (mandatory) */ - public void createGroup(GroupingActivity groupingActivity, String name) throws LessonServiceException; + public void createGroup(Grouping grouping, String name) throws LessonServiceException; /** * Remove a group for the given grouping. If the group is already used (e.g. a tool session exists) * then it throws a GroupingException. * - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping that contains the group to remove. (mandatory) * @param groupName (mandatory) */ - public void removeGroup(GroupingActivity groupingActivity, Long groupId) throws LessonServiceException; + public void removeGroup(Grouping grouping, Long groupId) throws LessonServiceException; /** * Add a learner to the lesson class. Checks for duplicates. Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java =================================================================== diff -u -r4ca1b4e69d135a796d7db5eab3206e24e9503619 -ra94909694731838faabd950b35db3ec905f28529 --- lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java (.../LessonService.java) (revision 4ca1b4e69d135a796d7db5eab3206e24e9503619) +++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java (.../LessonService.java) (revision a94909694731838faabd950b35db3ec905f28529) @@ -245,12 +245,12 @@ } /** - * Perform the grouping, setting the given list of learners as one group. Currently used for chosen grouping. - * @param groupingActivity the activity that has create grouping. (mandatory) + * Perform the grouping, setting the given list of learners as one group. Currently used for chosen grouping and + * teacher chosen branching + * @param grouping The grouping that needs to have the grouping performed.. (mandatory) * @param learners to form one group */ - public void performGrouping(GroupingActivity groupingActivity, Long groupId, List learners) throws LessonServiceException { - Grouping grouping = groupingActivity.getCreateGrouping(); + public void performGrouping(Grouping grouping, Long groupId, List learners) throws LessonServiceException { if ( grouping != null && grouping.isChosenGrouping() ) { Grouper grouper = grouping.getGrouper(); if ( grouper != null ) { @@ -263,21 +263,20 @@ groupingDAO.update(grouping); } } else { - String error = "The method performChosenGrouping supports only grouping methods where the supplied list should be used as a single group (currently only ChosenGrouping). Called with a groupingActivity with the wrong grouper "+groupingActivity.getActivityId(); + String error = "The method performChosenGrouping supports only grouping methods where the supplied list should be used as a single group (currently only ChosenGrouping). Called with a grouping with the wrong grouper "+grouping; log.error(error); throw new LessonServiceException(error); } } /** * Remove learners from the given group. - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping that contains the users to be removed (mandatory) * @param groupID if not null only remove user from this group, if null remove learner from any group. * @param learners the learners to be removed (mandatory) */ - public void removeLearnersFromGroup(GroupingActivity groupingActivity, Long groupID, List learners) throws LessonServiceException + public void removeLearnersFromGroup(Grouping grouping, Long groupID, List learners) throws LessonServiceException { - Grouping grouping = groupingActivity.getCreateGrouping(); if ( grouping != null ) { // get the real objects, not the CGLIB version grouping = groupingDAO.getGroupingById(grouping.getGroupingId()); @@ -296,12 +295,11 @@ /** Create an empty group for the given grouping. If the group name is not supplied * or the group name already exists then nothing happens. * - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping. (mandatory) * @param groupName (mandatory) */ - public void createGroup(GroupingActivity groupingActivity, String name) throws LessonServiceException + public void createGroup(Grouping grouping, String name) throws LessonServiceException { - Grouping grouping = groupingActivity.getCreateGrouping(); if ( grouping != null ) { // get the real objects, not the CGLIB version grouping = groupingDAO.getGroupingById(grouping.getGroupingId()); @@ -321,11 +319,10 @@ * Remove a group for the given grouping. If the group is already used (e.g. a tool session exists) * then it throws a GroupingException. * - * @param groupingActivity the activity that has create grouping. (mandatory) + * @param grouping the grouping that contains the group to be removed (mandatory) * @param groupID (mandatory) */ - public void removeGroup(GroupingActivity groupingActivity, Long groupID) throws LessonServiceException { - Grouping grouping = groupingActivity.getCreateGrouping(); + public void removeGroup(Grouping grouping, Long groupID) throws LessonServiceException { if ( grouping != null ) { // get the real objects, not the CGLIB version grouping = groupingDAO.getGroupingById(grouping.getGroupingId()); @@ -595,5 +592,6 @@ if ( log.isDebugEnabled() ) log.debug("Reset completed flag for "+count+" learners for lesson "+lessonId); } + }