Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.142 -r1.143 --- lams_central/conf/language/lams/ApplicationResources.properties 17 Oct 2014 18:40:18 -0000 1.142 +++ lams_central/conf/language/lams/ApplicationResources.properties 22 Oct 2014 10:23:28 -0000 1.143 @@ -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.114 -r1.115 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 17 Oct 2014 18:40:18 -0000 1.114 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 22 Oct 2014 10:23:28 -0000 1.115 @@ -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.8 -r1.9 --- lams_central/web/authoring/authoring.jsp 17 Oct 2014 18:41:17 -0000 1.8 +++ lams_central/web/authoring/authoring.jsp 22 Oct 2014 10:23:28 -0000 1.9 @@ -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.39 -r1.40 --- lams_central/web/includes/javascript/authoring/authoringActivity.js 19 Oct 2014 06:28:43 -0000 1.39 +++ lams_central/web/includes/javascript/authoring/authoringActivity.js 22 Oct 2014 10:23:28 -0000 1.40 @@ -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;