Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r1e3a5fea1c7260ba7ed4f8e13da8412b7e84c841 -r35ee206c5d47a350ae59a47321a2c11a96af6f04 --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 1e3a5fea1c7260ba7ed4f8e13da8412b7e84c841) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 35ee206c5d47a350ae59a47321a2c11a96af6f04) @@ -287,6 +287,7 @@ learner.finished.count =Finished Learners: [0] of [1] learner.finished.dialog.title =End of lesson learner.group.sort.button =Sort +learner.group.select.all =Select/Unselect all button.force.complete =Force complete button.view.learner =View learner button.close =Close Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -rf992a141ad8dac72d1db43fbe4a7ed460a093dd0 -r35ee206c5d47a350ae59a47321a2c11a96af6f04 --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision f992a141ad8dac72d1db43fbe4a7ed460a093dd0) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 35ee206c5d47a350ae59a47321a2c11a96af6f04) @@ -992,16 +992,38 @@ */ function fillClassDialogList(listId, users, disableCreator) { var list = $('#' + listId + 'List').empty(); + var selectAllInitState = true; + $.each(users, function(userIndex, user) { var checkbox = $('').attr({ 'type' : 'checkbox' + }).change(function(){ + var itemState = $(this).is(':checked'); + if (itemState) { + var selectAllState = true; + $('input', list).each(function(){ + if (!$(this).is(':checked')) { + selectAllState = false; + return false; + } + }); + + if (selectAllState) { + $('#' + listId + 'SelectAll').attr('checked', 'checked'); + } + } else { + $('#' + listId + 'SelectAll').attr('checked', null); + } + }); if (user.classMember) { checkbox.attr('checked', 'checked'); if (disableCreator && user.lessonCreator) { // user creator must not be deselected checkbox.attr('disabled', 'disabled'); } + } else { + selectAllInitState = false; } var userDiv = $('
').attr({ @@ -1022,6 +1044,8 @@ }) } }); + + $('#' + listId + 'SelectAll').attr('checked', selectAllInitState ? 'checked' : null); } @@ -1410,7 +1434,12 @@ } } +function selectAllInDialogList(listId) { + var targetState = $('#' + listId + 'SelectAll').is(':checked') ? 'checked' : null; + $('#' + listId + 'List input').attr('checked', targetState); +} + function colorDialogList(listId) { $('#' + listId + 'List div.dialogListItem').each(function(userIndex, userDiv){ // every odd learner has different background