Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.138.2.1 -r1.138.2.2 --- lams_central/conf/language/lams/ApplicationResources.properties 17 Oct 2014 18:43:43 -0000 1.138.2.1 +++ lams_central/conf/language/lams/ApplicationResources.properties 22 Oct 2014 10:52:11 -0000 1.138.2.2 @@ -457,7 +457,8 @@ authoring.fla.branching.end.suffix =end authoring.fla.remove.activity.confirm =Are you sure you want to remove the whole branching activity? authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here? -authoring.fla.transition.to.exists.error =Transition to this activity already exists +authoring.fla.transition.to.exists.error =Transition to this activity already exists. +authoring.fla.circular.sequence.error =You are not allowed to have a circular sequence. authoring.fla.default.annotation.label.title =Label authoring.fla.region.fit.button.tooltip =Fit authoring.fla.new.folder.button =New Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.111.2.1 -r1.111.2.2 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 17 Oct 2014 18:43:43 -0000 1.111.2.1 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 22 Oct 2014 10:52:11 -0000 1.111.2.2 @@ -457,7 +457,8 @@ authoring.fla.branching.end.suffix =end authoring.fla.remove.activity.confirm =Are you sure you want to remove the whole branching activity? authoring.fla.branching.create.confirm =Transition from this activity already exists.\\nDo you want to create branching here? -authoring.fla.transition.to.exists.error =Transition to this activity already exists +authoring.fla.transition.to.exists.error =Transition to this activity already exists. +authoring.fla.circular.sequence.error =You are not allowed to have a circular sequence. authoring.fla.default.annotation.label.title =Label authoring.fla.region.fit.button.tooltip =Fit authoring.fla.new.folder.button =New Index: lams_central/web/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/authoring/authoring.jsp,v diff -u -r1.6.2.2 -r1.6.2.3 --- lams_central/web/authoring/authoring.jsp 17 Oct 2014 18:44:32 -0000 1.6.2.2 +++ lams_central/web/authoring/authoring.jsp 22 Oct 2014 10:52:11 -0000 1.6.2.3 @@ -52,6 +52,7 @@ REMOVE_ACTIVITY_CONFIRM : '', BRANCHING_CREATE_CONFIRM : '', TRANSITION_TO_EXISTS_ERROR : '', + CIRCULAR_SEQUENCE_ERROR : '', // DecorationLib DEFAULT_ANNOTATION_LABEL_TITLE : '', Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringActivity.js,v diff -u -r1.38.2.1 -r1.38.2.2 --- lams_central/web/includes/javascript/authoring/authoringActivity.js 19 Oct 2014 06:29:57 -0000 1.38.2.1 +++ lams_central/web/includes/javascript/authoring/authoringActivity.js 22 Oct 2014 10:52:11 -0000 1.38.2.2 @@ -849,6 +849,23 @@ return; } + // check for circular sequences + var candidate = fromActivity; + do { + if (candidate.transitions && candidate.transitions.to.length > 0) { + candidate = candidate.transitions.to[0].fromActivity; + } else if (candidate.branchingActivity && !candidate.isStart) { + candidate = candidate.branchingActivity.start; + } else { + candidate = null; + } + + if (toActivity == candidate) { + alert(LABELS.CIRCULAR_SEQUENCE_ERROR); + return; + } + } while (candidate != null); + // branchData can be either an existing branch or a title for the new branch var branch = branchData && branchData instanceof ActivityDefs.BranchActivity ? branchData : null, transition = null;