Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r865e149fd204483f902dfd91d22f97a181f26773 -r7c9df6d1e46ee42d1084104ce7cf2908b6e273c5 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 865e149fd204483f902dfd91d22f97a181f26773) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 7c9df6d1e46ee42d1084104ce7cf2908b6e273c5) @@ -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 =================================================================== diff -u -r865e149fd204483f902dfd91d22f97a181f26773 -r7c9df6d1e46ee42d1084104ce7cf2908b6e273c5 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 865e149fd204483f902dfd91d22f97a181f26773) +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 7c9df6d1e46ee42d1084104ce7cf2908b6e273c5) @@ -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 =================================================================== diff -u -r1a1fa63851c7b61e5c875dd3c5ea57027ddad53a -r7c9df6d1e46ee42d1084104ce7cf2908b6e273c5 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 1a1fa63851c7b61e5c875dd3c5ea57027ddad53a) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 7c9df6d1e46ee42d1084104ce7cf2908b6e273c5) @@ -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 =================================================================== diff -u -r95c938f934ccea2c2c205e5704c62f80710a73c7 -r7c9df6d1e46ee42d1084104ce7cf2908b6e273c5 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 95c938f934ccea2c2c205e5704c62f80710a73c7) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 7c9df6d1e46ee42d1084104ce7cf2908b6e273c5) @@ -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;