Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r092ede3b8b3828ffa688c4db18c5d535e3364b98 -rae292bdf413a0bcfa8931ddb62754e2b705d69cc --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 092ede3b8b3828ffa688c4db18c5d535e3364b98) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ae292bdf413a0bcfa8931ddb62754e2b705d69cc) @@ -493,6 +493,7 @@ authoring.fla.sequence.not.valid =The sequence is not valid.
It needs to be corrected before it can be used in lessons. authoring.fla.sequence.validation.issues =While saving the sequence there were following validation issues: authoring.fla.save.successful =Congratulations! Your design is valid and has been saved. +authoring.fla.save.successful.check.grouping =Your design is valid and has been saved.\\nYou may want to make all activities grouped, please verify. authoring.fla.liveedit.save.successful =Changes were successfully applied. authoring.fla.navigate.away.confirm =Your design is not saved.\\nAny changes you made since you last saved will be lost. authoring.fla.delete.node.confirm =Are you sure you want to delete this Index: lams_central/web/authoring/authoring.jsp =================================================================== diff -u -r248e47a1f8714d3e57be1e4dc12b4fae4f396cb3 -rae292bdf413a0bcfa8931ddb62754e2b705d69cc --- lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision 248e47a1f8714d3e57be1e4dc12b4fae4f396cb3) +++ lams_central/web/authoring/authoring.jsp (.../authoring.jsp) (revision ae292bdf413a0bcfa8931ddb62754e2b705d69cc) @@ -94,6 +94,8 @@ SEQUENCE_VALIDATION_ISSUES : '', SAVE_SUCCESSFUL : decoderDiv.html('').text(), + + SAVE_SUCCESSFUL_CHECK_GROUPING : decoderDiv.html('').text(), LIVEEDIT_SAVE_SUCCESSFUL : decoderDiv.html('').text(), Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -rb97b1cb641605fec844ccd19ca53a0ac5e53e7e3 -rae292bdf413a0bcfa8931ddb62754e2b705d69cc --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision b97b1cb641605fec844ccd19ca53a0ac5e53e7e3) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision ae292bdf413a0bcfa8931ddb62754e2b705d69cc) @@ -1479,6 +1479,52 @@ }, /** + * If sequence starts with of Grouping->(MCQ or Assessment)->Leader Selection->Scratchie, + * there is a good chance this is a TBL sequence and all activities must be grouped. + */ + checkTBLGrouping : function(){ + var firstGroupingActivity = null; + $.each(layout.activities, function(){ + if (this instanceof ActivityDefs.GroupingActivity && this.transitions + && this.transitions.to.length === 0 && this.transitions.from.length > 0){ + firstGroupingActivity = this; + return false; + } + }); + if (!firstGroupingActivity) { + return true; + } + var secondActivity = firstGroupingActivity.transitions.from.length > 0 ? firstGroupingActivity.transitions.from[0].toActivity : null; + var templateContainer = $('#templateContainerCell'); + var isTBL = secondActivity instanceof ActivityDefs.ToolActivity + && (secondActivity.learningLibraryID == $('.template[learningLibraryTitle="Assessment"]', templateContainer).attr('learningLibraryId') + || secondActivity.learningLibraryID == $('.template[learningLibraryTitle="MCQ"]', templateContainer).attr('learningLibraryId')); + if (!isTBL){ + return true; + } + var thirdActivity = secondActivity.transitions.from.length > 0 ? secondActivity.transitions.from[0].toActivity : null; + isTBL = thirdActivity instanceof ActivityDefs.ToolActivity + && thirdActivity.learningLibraryID == $('.template[learningLibraryTitle="Leaderselection"]', templateContainer).attr('learningLibraryId'); + if (!isTBL){ + return true; + } + var fourthActivity = thirdActivity.transitions.from.length > 0 ? thirdActivity.transitions.from[0].toActivity : null; + isTBL = fourthActivity instanceof ActivityDefs.ToolActivity + && fourthActivity.learningLibraryID == $('.template[learningLibraryTitle="Scratchie"]', templateContainer).attr('learningLibraryId'); + if (!isTBL){ + return true; + } + var result = true; + $.each(layout.activities, function(){ + if (this != firstGroupingActivity && this instanceof ActivityDefs.ToolActivity && !this.grouping){ + result = false; + return false; + } + }); + return result; + }, + + /** * Escapes HTML tags to prevent XSS injection. */ escapeHtml : function(unsafe) { @@ -2695,7 +2741,11 @@ GeneralLib.setModified(false); // close the Live Edit dialog - alert(LABELS.LIVEEDIT_SAVE_SUCCESSFUL); + if (GeneralLib.checkTBLGrouping()) { + alert(LABELS.LIVEEDIT_SAVE_SUCCESSFUL); + } else { + alert(LABELS.SAVE_SUCCESSFUL_CHECK_GROUPING); + } window.parent.closeDialog('dialogAuthoring'); } }); @@ -2709,8 +2759,12 @@ alert(LABELS.SVG_SAVE_ERROR); } - if (response.validation.length == 0) { - alert(LABELS.SAVE_SUCCESSFUL); + if (!layout.ld.invalid) { + if (GeneralLib.checkTBLGrouping()) { + alert(LABELS.SAVE_SUCCESSFUL); + } else { + alert(LABELS.SAVE_SUCCESSFUL_CHECK_GROUPING); + } } GeneralLib.setModified(false);