mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
3afce1a574
AMOS BEGIN MOV [participation:view,coursereport_participation],[participation:view,report_participation] MOV [pluginpagetype,coursereport_participation],[pluginpagetype,report_participation] MOV [pluginname,coursereport_participation],[pluginname,report_participation] AMOS END
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
|
|
M.report_participation = {};
|
|
|
|
M.report_participation.init = function(Y) {
|
|
|
|
Y.on('submit', function(e) {
|
|
Y.one('#formactionselect').get('options').each(function() {
|
|
if (this.get('selected') && this.get('value') == '') {
|
|
// no action selected
|
|
e.preventDefault();
|
|
}
|
|
});
|
|
var ok = false;
|
|
Y.all('input.usercheckbox').each(function() {
|
|
if (this.get('checked')) {
|
|
ok = true;
|
|
}
|
|
});
|
|
if (!ok) {
|
|
// no checkbox selected
|
|
e.preventDefault();
|
|
}
|
|
}, '#studentsform');
|
|
|
|
Y.on('click', function(e) {
|
|
Y.all('input.usercheckbox').each(function() {
|
|
this.set('checked', 'checked');
|
|
});
|
|
}, '#checkall');
|
|
|
|
Y.on('click', function(e) {
|
|
Y.all('input.usercheckbox').each(function() {
|
|
this.set('checked', '');
|
|
});
|
|
}, '#checknone');
|
|
|
|
Y.on('click', function(e) {
|
|
Y.all('input.usercheckbox').each(function() {
|
|
if (this.get('value') == 0) {
|
|
this.set('checked', 'checked');
|
|
}
|
|
});
|
|
}, '#checknos');
|
|
}; |