MDL-84833 course: completion feedback messages

This commit is contained in:
ferran 2025-03-25 12:34:36 +01:00
parent bf164840d9
commit d92e7a32c8
4 changed files with 10 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -502,8 +502,10 @@ export default class {
* @param {array} cmIds the list of course modules ids
* @param {bool} complete the new completion value
*/
cmCompletion(stateManager, cmIds, complete) {
async cmCompletion(stateManager, cmIds, complete) {
const newState = (complete) ? 1 : 0;
const action = (newState == 1) ? 'cm_complete' : 'cm_uncomplete';
const logEntry = this._getLoggerEntry(stateManager, action, cmIds);
stateManager.setReadOnly(false);
cmIds.forEach((id) => {
const element = stateManager.get('cm', id);
@ -513,6 +515,7 @@ export default class {
}
});
stateManager.setReadOnly(true);
stateManager.addLoggerEntry(await logEntry);
}
/**

View File

@ -34,6 +34,8 @@ $string['bulkeditingcourse'] = 'Bulk edit course: {$a}';
$string['bulkcancel'] = 'Close bulk actions';
$string['bulkselection'] = '{$a} selected';
$string['bulkselection_plural'] = '{$a} selected';
$string['cm_complete_feedback'] = '{$a->name} marked as completed.';
$string['cm_complete_feedback_batch'] = 'Selected {$a->count} activities marked as completed.';
$string['cm_delete_feedback'] = '{$a->name} deleted.';
$string['cm_delete_feedback_batch'] = 'Selected {$a->count} activities deleted.';
$string['cm_duplicate_feedback'] = '{$a->name} duplicated.';
@ -48,6 +50,8 @@ $string['cm_show_feedback'] = '{$a->name} is now shown.';
$string['cm_show_feedback_batch'] = 'The selected {$a->count} activities are now shown.';
$string['cm_stealth_feedback'] = '{$a->name} is now available but not shown on the course page.';
$string['cm_stealth_feedback_batch'] = 'The selected {$a->count} activities are now available but not shown on the course page.';
$string['cm_uncomplete_feedback'] = '{$a->name} marked as uncompleted.';
$string['cm_uncomplete_feedback_batch'] = 'Selected {$a->count} activities marked as uncompleted.';
$string['cm_visiblegroups_feedback'] = '{$a->name} group mode changed to Visible groups.';
$string['cmavailability'] = 'Activity availability';
$string['cmdelete_info'] = 'This will delete {$a->name} and any user data it contains.';