Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -r3766c345983c3eeb37befb5ee15e01cdcde9b160 -r90d5d886ec84b60e0d5ee543c8caeccc7fd183e6 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 3766c345983c3eeb37befb5ee15e01cdcde9b160) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 90d5d886ec84b60e0d5ee543c8caeccc7fd183e6) @@ -358,6 +358,7 @@ }); this.items = paper.g(shape, icon); + this.items.addClass('svg-activity-branching'); if (this.readOnly && !isReadOnlyMode) { this.items.attr('filter', layout.conf.readOnlyFilter); } @@ -419,6 +420,7 @@ } this.items.data('parentObject', this); + this.items.addClass('svg-activity-floating'); }, @@ -448,6 +450,7 @@ }); this.items = paper.g(shape); + this.items.addClass('svg-activity-gate'); if (this.readOnly && !isReadOnlyMode) { this.items.attr('filter', layout.conf.readOnlyFilter); } @@ -508,6 +511,7 @@ 'data-height': height }); + this.items.addClass('svg-activity-grouping'); if (this.readOnly && !isReadOnlyMode) { this.items.attr('filter', layout.conf.readOnlyFilter); } @@ -572,6 +576,7 @@ } this.items.data('parentObject', this); + this.items.addClass('svg-activity-optional'); }, @@ -626,6 +631,7 @@ } this.items.data('parentObject', this); + this.items.addClass('svg-activity-parallel'); }, @@ -690,7 +696,7 @@ 'data-width' : width, 'data-height': height }); - this.items.addClass('toolActivity'); + this.items.addClass('svg-activity-tool'); this.items.shape = shape; if (this.grouping) { Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r4032b1b03d4bf650f44d7c49a5745e3524a876d7 -r90d5d886ec84b60e0d5ee543c8caeccc7fd183e6 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 4032b1b03d4bf650f44d7c49a5745e3524a876d7) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 90d5d886ec84b60e0d5ee543c8caeccc7fd183e6) @@ -1151,14 +1151,11 @@ return; } sequenceRefreshInProgress = true; - // SVG modifications are made only the first time this method is called - var sequenceCanvasFirstFetch = false; - + if (originalSequenceCanvas) { // put bottom layer, LD SVG sequenceCanvas.html(originalSequenceCanvas); } else { - sequenceCanvasFirstFetch = true; var exit = loadLearningDesignSVG(); if (exit) { // when SVG gets re-created, this update method will be run again @@ -1186,35 +1183,15 @@ 'searchedLearnerId' : sequenceSearchedLearner }, success : function(response) { - if (sequenceCanvasFirstFetch) { - // activities have uiids but no ids, set it here - $.each(response.activities, function(activityIndex, activity){ - $('g[uiid="' + activity.uiid + '"]', sequenceCanvas).attr('id', activity.id); - }); - - // add some metadata to activities - $.each(response.activities, function(activityIndex, activity){ - var activityGroup = $('g[id="' + activity.id + '"]', sequenceCanvas), - isGate = [3,4,5,14].indexOf(activity.type) > -1, - isOptional = activity.type == 7, - isFloating = activity.type == 15; - if (isGate) { - activityGroup.addClass('gate'); - } else if (isOptional) { - activityGroup.addClass('optional'); - } else if (isFloating) { - activityGroup.addClass('floating'); - } - }); - - originalSequenceCanvas = sequenceCanvas.html(); - } - + // activities have uiids but no ids, set it here + $.each(response.activities, function(){ + $('g[uiid="' + this.uiid + '"]', sequenceCanvas).attr('id', this.id); + }); + // remove the loading animation $('img#sequenceCanvasLoading', sequenceTopButtonsContainer).remove(); - var learnerCount = 0, - reloadSVG = false; + var learnerCount = 0; $.each(response.activities, function(index, activity){ var activityGroup = $('g[id="' + activity.id + '"]', sequenceCanvas), isGate = [3,4,5,14].indexOf(activity.type) > -1; @@ -1248,27 +1225,19 @@ } } - // are there any learners in this or any activity? - learnerCount += activity.learnerCount; if (response.contributeActivities) { $.each(response.contributeActivities, function(){ if (activity.id == this.activityID) { activity.requiresAttention = true; - reloadSVG = true; return false; } }); } + // put learner and attention icons on each activity shape addActivityIcons(activity); }); - reloadSVG |= learnerCount > 0; - if (reloadSVG) { - // IMPORTANT! Reload SVG, otherwise added icons will not get displayed - sequenceCanvas.html(sequenceCanvas.html()); - } - if (sequenceSearchedLearner != null && !response.searchedLearnerFound) { // the learner has not started the lesson yet, display an info box sequenceClearSearchPhrase(); @@ -1296,7 +1265,7 @@ // remove any existing popovers $('.popover[role="tooltip"]').remove(); - initializePortraitPopover(LAMS_URL, 'large', 'left'); + initializePortraitPopover(LAMS_URL, 'large', 'right'); // update the cache global values so that the contributions & the Live Edit buttons will update lockedForEdit = response.lockedForEdit;