Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r176599cc9ea522d8c6a1caf4aca77f34cbb5e9dd -r43bf0491691407c7567febca64ac9754dd959033 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 176599cc9ea522d8c6a1caf4aca77f34cbb5e9dd) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 43bf0491691407c7567febca64ac9754dd959033) @@ -898,6 +898,7 @@ label.multiple.lessons =Multiple lessons label.add.lessons.to.subgroups =Add lesson to all selected subcourses label.marks =Marks +authoring.fla.grouping.detached.error =Activity "{0}" was grouped with a grouping activity that is missing or is not one of previous activities. Grouping was cleared. +authoring.fla.input.detached.error =Activity "{0}" had an input activity that is missing or is not one of previous activities. Input was cleared. - #======= End labels: Exported 892 labels for en AU ===== Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -r495d8ba0d70ac286d4e8aaa40dd390669cf59e99 -r43bf0491691407c7567febca64ac9754dd959033 --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 495d8ba0d70ac286d4e8aaa40dd390669cf59e99) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 43bf0491691407c7567febca64ac9754dd959033) @@ -140,6 +140,10 @@ WEIGHTS_SUM_ERROR : decoderDiv.html('').text(), WEIGHTS_NONE_FOUND_ERROR : decoderDiv.html('').text(), + + GROUPING_DETACHED_ERROR : decoderDiv.html('').text(), + + INPUT_DETACHED_ERROR : decoderDiv.html('').text(), TEMPLATES : decoderDiv.html('').text(), Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -r495d8ba0d70ac286d4e8aaa40dd390669cf59e99 -r43bf0491691407c7567febca64ac9754dd959033 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 495d8ba0d70ac286d4e8aaa40dd390669cf59e99) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 43bf0491691407c7567febca64ac9754dd959033) @@ -1629,46 +1629,6 @@ } } - // redraw means that the transition will be drawn again in just a moment - // so do not do any structural changes - if (!redraw){ - // remove grouping or input references if chain was broken by the removed transition - $.each(layout.activities, function(){ - var coreActivity = this.branchingActivity || this; - if (coreActivity.grouping || coreActivity.input) { - var candidate = this.branchingActivity ? coreActivity.start : this, - groupingFound = false, - inputFound = false; - 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 if (!candidate.branchingActivity && candidate.parentActivity) { - candidate = candidate.parentActivity; - } else { - candidate = null; - } - - if (coreActivity.grouping == candidate) { - groupingFound = true; - } - if (coreActivity.input == candidate) { - inputFound = true; - } - } while (candidate != null); - - if (!groupingFound) { - coreActivity.grouping = null; - this.draw(); - } - if (!inputFound) { - coreActivity.input = null; - } - } - }); - } - transition.items.remove(); GeneralLib.setModified(true); }, Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -r03a7895aacb3b1f0830309dfbe2649b37d998c4f -r43bf0491691407c7567febca64ac9754dd959033 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 03a7895aacb3b1f0830309dfbe2649b37d998c4f) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 43bf0491691407c7567febca64ac9754dd959033) @@ -1,3240 +1,3298 @@ -/** - * This file contains main methods for Authoring. - */ - - -/** - * Initialises each part of the Authoring window. - */ -$(document).ready(function() { - canvas = $('#canvas'); - GeneralInitLib.initTemplates(); - if (!isReadOnlyMode) { - // in read-only mode (SVG generator), some parts are not necessary and not loaded - GeneralInitLib.initLayout(); - PropertyLib.init(); - - if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ - $('.desktopButton').hide(); - - document.addEventListener("touchstart", HandlerLib.touchHandler, true); - document.addEventListener("touchmove", HandlerLib.touchHandler, true); - document.addEventListener("touchend", HandlerLib.touchHandler, true); - document.addEventListener("touchcancel", HandlerLib.touchHandler, true); - } - } - - GeneralLib.newLearningDesign(true); - if (!isReadOnlyMode) { - layout.ld.contentFolderID = initContentFolderID; - } - if (initLearningDesignID) { - GeneralLib.openLearningDesign(+initLearningDesignID); - } - - // remove "loading..." screen - $('#loadingOverlay').remove(); -}); - - -/** - * A few publicly visible variables . - */ - - // The Snap Paper object -var paper = null, - // container for the paper - canvas = null, - - // configuration and storage of various elements - layout = { - // draw mode prevents some handlers (click, mouseover etc.) from triggering - 'drawMode' : false, - // is the LD being live edited? - 'liveEdit' : false, - // should the sequence be saved before exiting? - 'modified' : false, - // was start point of a new branching placed? - 'addBranchingStart' : null, - // list of all dialogs, so they can be easily closed all at once - 'dialogs' : [], - // icons for special activities - 'toolMetadata': { - 'gate' : { - 'iconPath' : '../images/stop.gif' - }, - 'grouping' : { - 'iconPath' : '../images/grouping.png' - } - }, - - // graphics contants - 'conf' : { - 'arrangeHorizontalSpace' : 200, - 'arrangeVerticalSpace' : 100, - 'arrangeHorizontalPadding' : 35, - 'arrangeVerticalPadding' : 50, - - 'dragStartThreshold' : 300, - - 'propertiesDialogDimOpacity' : 0.3, - 'propertiesDialogDimThreshold' : 100, - 'propertiesDialogDimThrottle' : 100, - - 'defaultGroupingGroupCount' : 2, - 'defaultGroupingLearnerCount' : 1, - - 'containerActivityEmptyWidth' : 50, - 'containerActivityEmptyHeight' : 70, - 'containerActivityPadding' : 20, - 'containerActivityChildrenPadding' : 10, - 'regionEmptyWidth' : 20, - 'regionEmptyHeight' : 20, - 'labelDefaultSize' : 10, - 'labelMinSize' : 9, - 'labelMaxSize' : 20, - - 'groupingEffectPadding' : 5, - 'selectEffectPadding' : 7, - - 'supportsDownloadAttribute' : typeof $('')[0].download != 'undefined', - - // will be initialised when paper gets created - 'readOnlyFilter' : null - }, - - 'colors' : { - 'activityBorder' : 'black', - 'toolActivityBorder' : ['','#00007f','#ff8300','#625F67','#ffa500','#00007f','#7aa712'], - // each activity type has its own colour - 'activity' : ['','#caddfb','#ffffbb','#ece9f7','#fdf1d3','#caddfb','#e9f9c0'], - 'activityText' : 'black', - // default region colour - 'annotation' : '#CCFF99', - // region colours to choose from - 'annotationPalette' : ['CCFF99', 'CDA5F3', 'FFFFCC', '99E6DF', '6495ED', - 'FFF8DC', 'FFDDB3', 'D1DFFA', 'DCDCDC', '20B2AA', - 'B0C4DE', 'FFE4E1', 'F9D2F9', 'FF2200'], - - // when mouse hovers over rubbish bin - 'binSelect' : 'red', - - 'branchingEdgeStart' : 'green', - 'branchingEdgeEnd' : 'red', - // highlight branching edges on mouse hover - 'branchingEdgeMatch' : 'blue', - 'gate' : 'red', - 'gateBorder' : '#801515', - 'gateText' : 'white', - 'grouping' : '#caddfb', - 'groupingBorder' : '#00007f', - 'optionalActivity' : '#caddfb', - 'optionalActivityBorder' : '#00007f', - // dashed border around a selected activity - 'selectEffect' : 'black', - 'transition' : 'rgb(119,126,157)', - // highlight TBL activities which should be grouped - 'activityRequireGrouping' : 'red', - 'activityReadOnly' : 'red' - }, - - 'defaultTextAttributes' : { - 'text-anchor' : 'middle', - 'font-size' : 10, - 'font-family' : 'sans-serif' - } -}, - - -/** - * Contains methods for Authoring window initialisation which are run only once at the beginning - */ -GeneralInitLib = { - /** - * Draw boxes with Tool Activity templates in the panel on the left. - */ - initTemplates : function(){ - // store some template data in JS structures - $('.template').each(function(){ - var learningLibraryID = +$(this).attr('learningLibraryId'), - learningLibraryTitle = $(this).attr('learningLibraryTitle'), - activityCategoryID = +$(this).attr('activityCategoryId'), - parallelChildActivityDefs = null; - - if (activityCategoryID == 5) { - var childToolIds = $(this).attr('childToolIds').split(','); - $.each(childToolIds, function(){ - var childToolId = this.trim(); - if (childToolId) { - parallelChildActivity = $('.template[toolId=' + childToolId + ']'); - if (parallelChildActivityDefs) { - parallelChildActivityDefs = parallelChildActivityDefs.add(parallelChildActivity); - } else { - parallelChildActivityDefs = parallelChildActivity; - } - } - }); - } - - // assign icons' data uris to their learning library IDs instead of labels - ActivityIcons[learningLibraryID] = ActivityIcons[learningLibraryTitle]; - delete ActivityIcons[learningLibraryTitle]; - $('').attr('src', ActivityIcons[learningLibraryID]).appendTo(".img-"+learningLibraryID); - // register tool properties so they are later easily accessible - layout.toolMetadata[learningLibraryID] = { - 'iconPath' : $(this).attr('iconPath'), - 'defaultToolContentID' : $(this).attr('defaultToolContentId'), - 'supportsOutputs' : $(this).attr('supportsOutputs'), - 'activityCategoryID' : activityCategoryID, - 'parallelChildActivityDefs' : parallelChildActivityDefs - }; - - }); - - if (!isReadOnlyMode){ - // store the initial window height now as on iPad the iframe grows when templates are show, - // reporting incorrect window height to the first resizePaper() run - layout.initWindowHeight = $(window).height(); - // create list of learning libraries for each group - var templateContainerCell = $('#templateContainerCell'), - learningLibraryGroupSelect = $('select', templateContainerCell), - allGroup = $('option', learningLibraryGroupSelect), - allTemplates = $('#templateContainerCell .templateContainer').show(); - - learningLibraryGroupSelect.change(function(){ - $('.templateContainer').hide(); - // show DIV with the selected learning libraries group - $('option:selected', this).data('templates').show(); - }); - allGroup.data('templates', allTemplates); - - $.each(learningLibraryGroups, function(){ - var learningLibraries = this.learningLibraries; - if (!learningLibraries) { - return true; - } - - var templates = allTemplates.clone().appendTo(templateContainerCell); - // cloned everything, now remove ones that are not in the list - $('.template', templates).each(function(){ - var learningLibraryId = $(this).attr('learningLibraryId'), - found = false; - $.each(learningLibraries, function(){ - if (learningLibraryId == this) { - found = true; - return false; - } - }); - - if (!found) { - $(this).remove(); - } - }); - - $('