Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r79ca692b2e37b3fb8dfec4a65af72e685d56358e -ra1ac7d32cbc081bed2b01a84c50ea7fc67ec9d18 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 79ca692b2e37b3fb8dfec4a65af72e685d56358e) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision a1ac7d32cbc081bed2b01a84c50ea7fc67ec9d18) @@ -1,4 +1,4 @@ -// ********** GLOBAL VARIABLES ********** +// ********** GLOBAL VARIABLES ********** // copy of lesson SVG so it does no need to be fetched every time var originalSequenceCanvas = null, // DIV container for lesson SVG @@ -513,6 +513,7 @@ $('#learnerGroupDialogCloseButton', learnerGroupDialogContents).click(function(){ $('#learnerGroupDialog').modal('hide'); }); + // initialise lesson dialog var learnerGroupDialog = showDialog('learnerGroupDialog',{ 'autoOpen' : false, @@ -563,48 +564,6 @@ } }); - $('#forceBackwardsDialog').dialog({ - 'autoOpen' : false, - 'modal' : true, - 'resizable' : false, - 'minWidth' : 350, - 'show' : 'fold', - 'hide' : 'fold', - 'title' : LABELS.FORCE_COMPLETE_BUTTON, - 'open' : function(){ - autoRefreshBlocked = true; - }, - 'close' : function(){ - autoRefreshBlocked = false; - }, - 'buttons' : [ - { - 'text' : LABELS.FORCE_COMPLETE_REMOVE_CONTENT_NO, - 'click' : function() { - $(this).dialog('close'); - forceCompleteExecute($(this).dialog('option', 'learners'), - $(this).dialog('option', 'activityId'), - false); - } - }, - { - 'text' : LABELS.FORCE_COMPLETE_REMOVE_CONTENT_YES, - 'click' : function() { - $(this).dialog('close'); - forceCompleteExecute($(this).dialog('option', 'learners'), - $(this).dialog('option', 'activityId'), - true); - } - }, - { - 'text' : LABELS.CLOSE_BUTTON, - 'click' : function() { - $(this).dialog('close'); - } - } - ] - }); - // search for users with the term the Monitor entered $("#sequenceSearchPhrase").autocomplete( { 'source' : LAMS_URL + "monitoring/monitoring.do?method=autocomplete&scope=lesson&lessonID=" + lessonId, @@ -618,33 +577,68 @@ return false; } }); -} + var forceBackwardsDialogContents = $('#forceBackwardsDialogContents'); + showDialog('forceBackwardsDialog', { + 'autoOpen' : false, + 'modal' : true, + 'resizable' : true, + 'height' : 300, + 'width' : 400, + 'title' : LABELS.FORCE_COMPLETE_BUTTON, + 'open' : function(){ + autoRefreshBlocked = true; + }, + 'close' : function(){ + autoRefreshBlocked = false; + } + }, false); + // only need to do this once as then it updates the msg field directly. + $('.modal-body', '#forceBackwardsDialog').empty().append($('#forceBackwardsDialogContents').show()); + + $('#forceBackwardsRemoveContentNoButton', forceBackwardsDialogContents).click(function(){ + var forceBackwardsDialog = $('#forceBackwardsDialog'); + forceCompleteExecute(forceBackwardsDialog.data('learners'), + forceBackwardsDialog.data('activityId'), + false); + forceBackwardsDialog.modal('hide'); + }); + $('#forceBackwardsRemoveContentYesButton', forceBackwardsDialogContents).click(function(){ + var forceBackwardsDialog = $('#forceBackwardsDialog'); + forceCompleteExecute(forceBackwardsDialog.data('learners'), + forceBackwardsDialog.data('activityId'), + true); + forceBackwardsDialog.modal('hide'); + }); -function showSequenceInfoDialog(){ + $('#forceBackwardsCloseButton', forceBackwardsDialogContents).click(function(){ + $('#forceBackwardsDialog').modal('hide'); + }); + // small info box on Sequence tab, activated when the tab is showed - var sequenceInfoDialog = showDialog('sequenceInfoDialog', { + showDialog('sequenceInfoDialog', { + 'autoOpen' : false, 'height' : 150, 'width' : 300, 'modal' : false, 'resizable' : false, + 'title' : LABELS.HELP, 'open' : function(){ - $('.modal-body', sequenceInfoDialog).empty().append($('#sequenceInfoDialogContents').show()); // close after given time setTimeout(function(){ - sequenceInfoDialog.modal('hide') + $('#sequenceInfoDialog').modal('hide') }, sequenceInfoTimeout); + }, + 'close' : function(){ } }, false); - -} + $('.modal-body', '#sequenceInfoDialog').empty().append($('#sequenceInfoDialogContents').show()); -function closeSequenceInfoDialog(){ - var sequenceInfoDialog = $('#sequenceInfoDialog'); - if ( sequenceInfoDialog && sequenceInfoDialog.data() && sequenceInfoDialog.data('bs.modal').isShown ) { - sequenceInfoDialog.modal('hide'); - } + $('#sequenceInfoDialogCloseButton', '#sequenceInfoDialogContents').click(function(){ + $('#sequenceInfoDialog').modal('hide'); + }); + } /** @@ -745,8 +739,8 @@ if (sequenceSearchedLearner != null && !response.searchedLearnerFound) { // the learner has not started the lesson yet, display an info box sequenceClearSearchPhrase(); - $('#sequenceInfoDialogContent').text(LABELS.PROGRESS_NOT_STARTED); - showSequenceInfoDialog(); + $('#sequenceInfoDialogContents').html(LABELS.PROGRESS_NOT_STARTED); + $('#sequenceInfoDialog').modal('show'); } var learnerTotalCount = learnerCount + response.completedLearnerCount; @@ -903,13 +897,13 @@ // check if the target activity was found or we are moving the learner from end of lesson if (moveBackwards) { // move the learner backwards - $('#forceBackwardsDialog').text(LABELS.FORCE_COMPLETE_REMOVE_CONTENT - .replace('[0]', learnerNames).replace('[1]', targetActivityName)) - .dialog('option', { - 'learners' : learners, - 'activityId': targetActivityId - }) - .dialog('open'); + var msgString = LABELS.FORCE_COMPLETE_REMOVE_CONTENT + .replace('[0]', learnerNames).replace('[1]', targetActivityName); + $('#forceBackwardsMsg', '#forceBackwardsDialogContents').html(msgString); + $('#forceBackwardsDialog').data({ + 'learners' : learners, + 'activityId': targetActivityId}); + $('#forceBackwardsDialog').modal('show'); // so autoRefreshBlocked = false is not set return; } else { Index: lams_monitoring/web/monitor.jsp =================================================================== diff -u -r79ca692b2e37b3fb8dfec4a65af72e685d56358e -ra1ac7d32cbc081bed2b01a84c50ea7fc67ec9d18 --- lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 79ca692b2e37b3fb8dfec4a65af72e685d56358e) +++ lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision a1ac7d32cbc081bed2b01a84c50ea7fc67ec9d18) @@ -54,16 +54,14 @@ LABELS = { FORCE_COMPLETE_CLICK : decoderDiv.html('').text(), + + FORCE_COMPLETE_BUTTON : '', FORCE_COMPLETE_END_LESSON_CONFIRM : decoderDiv.html('').text(), FORCE_COMPLETE_ACTIVITY_CONFIRM : decoderDiv.html('').text(), FORCE_COMPLETE_REMOVE_CONTENT : decoderDiv.html('').text(), - - FORCE_COMPLETE_REMOVE_CONTENT_YES : '', - - FORCE_COMPLETE_REMOVE_CONTENT_NO : '', FORCE_COMPLETE_DROP_FAIL : '', @@ -153,7 +151,9 @@ CONTRIBUTE_BUTTON : '', - CONTRIBUTE_ATTENTION : '' + CONTRIBUTE_ATTENTION : '', + HELP : '' + } $(document).ready(function(){ @@ -177,11 +177,11 @@ var sequenceInfoDialog = $('#sequenceInfoDialog'); if ( tabId == '2' ) { if (sequenceTabShowInfo) { - showSequenceInfoDialog(); + sequenceInfoDialog.modal("show"); sequenceTabShowInfo = false; // only show it once } } else { - closeSequenceInfoDialog(); + sequenceInfoDialog.modal("hide"); } } @@ -554,13 +554,13 @@
- - -
-
+
+
+
+ + + + + + +
+