diff --git a/course/completion.js b/course/completion.js index 3be2c38c6fa54..4d9542a2c993e 100644 --- a/course/completion.js +++ b/course/completion.js @@ -18,17 +18,21 @@ M.core_completion.init = function(Y) { } else { var current = args.state.get('value'); - + var modulename = args.modulename.get('value'); if (current == 1) { + var altstr = M.str.completion['completion-alt-manual-y'].replace('{$a}', modulename); + var titlestr = M.str.completion['completion-title-manual-y'].replace('{$a}', modulename); args.state.set('value', 0); args.image.set('src', M.util.image_url('i/completion-manual-y', 'moodle')); - args.image.set('alt', M.str.completion['completion-alt-manual-y']); - args.image.set('title', M.str.completion['completion-title-manual-y']); + args.image.set('alt', altstr); + args.image.set('title', titlestr); } else { + var altstr = M.str.completion['completion-alt-manual-n'].replace('{$a}', modulename); + var titlestr = M.str.completion['completion-title-manual-n'].replace('{$a}', modulename); args.state.set('value', 1); args.image.set('src', M.util.image_url('i/completion-manual-n', 'moodle')); - args.image.set('alt', M.str.completion['completion-alt-manual-n']); - args.image.set('title', M.str.completion['completion-title-manual-n']); + args.image.set('alt', altstr); + args.image.set('title', titlestr); } } @@ -48,6 +52,7 @@ M.core_completion.init = function(Y) { var completionstate = 0; var state = null; var image = null; + var modulename = null; var inputs = Y.Node.getDOMNode(form).getElementsByTagName('input'); for (var i=0; ipix_url('i/completion-'.$completionicon); - $imgalt = s(get_string('completion-alt-'.$completionicon, 'completion')); + $imgalt = s(get_string('completion-alt-'.$completionicon, 'completion', $mod->name)); if ($completion == COMPLETION_TRACKING_MANUAL && !$isediting) { - $imgtitle = s(get_string('completion-title-'.$completionicon, 'completion')); + $imgtitle = s(get_string('completion-title-'.$completionicon, 'completion', $mod->name)); $newstate = $completiondata->completionstate==COMPLETION_COMPLETE ? COMPLETION_INCOMPLETE @@ -1754,6 +1754,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, echo "
+ diff --git a/lang/en/completion.php b/lang/en/completion.php index 66fc44d06810d..c55779e23dc67 100644 --- a/lang/en/completion.php +++ b/lang/en/completion.php @@ -36,12 +36,12 @@ $string['completion_link'] = 'activity/completion'; $string['completion-alt-auto-enabled'] = 'The system marks this item complete according to conditions'; $string['completion-alt-auto-fail'] = 'Completed (did not achieve pass grade)'; -$string['completion-alt-auto-n'] = 'Not completed'; +$string['completion-alt-auto-n'] = 'Not completed: {$a}'; $string['completion-alt-auto-pass'] = 'Completed (achieved pass grade)'; -$string['completion-alt-auto-y'] = 'Completed'; +$string['completion-alt-auto-y'] = 'Completed: {$a}'; $string['completion-alt-manual-enabled'] = 'Students can manually mark this item complete'; -$string['completion-alt-manual-n'] = 'Not completed; select to mark as complete'; -$string['completion-alt-manual-y'] = 'Completed; select to mark as not complete'; +$string['completion-alt-manual-n'] = 'Not completed: {$a}. Select to mark as complete.'; +$string['completion-alt-manual-y'] = 'Completed: {$a}. Select to mark as not complete.'; $string['completion_automatic'] = 'Show activity as complete when conditions are met'; $string['completiondisabled'] = 'Disabled, not shown in activity settings'; $string['completionexpected'] = 'Expect completed on'; @@ -54,8 +54,8 @@ If a blank tick box is shown, a tick will appear automatically when you have completed the activity according to conditions set by the teacher.'; $string['completion_manual'] = 'Students can manually mark the activity as completed'; $string['completion_none'] = 'Do not indicate activity completion'; -$string['completion-title-manual-n'] = 'Mark as complete'; -$string['completion-title-manual-y'] = 'Mark as not complete'; +$string['completion-title-manual-n'] = 'Mark as complete: {$a}'; +$string['completion-title-manual-y'] = 'Mark as not complete: {$a}'; $string['completionnotenabled'] = 'Completion is not enabled'; $string['completionnotenabledforcourse'] = 'Completion is not enabled for this course'; $string['completionnotenabledforsite'] = 'Completion is not enabled for this site';