Merge branch 'wip-mdl-30817-m22' of git://github.com/rajeshtaneja/moodle into MOODLE_22_STABLE
This commit is contained in:
+14
-6
@@ -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; i<inputs.length; i++) {
|
||||
@@ -59,6 +64,9 @@ M.core_completion.init = function(Y) {
|
||||
completionstate = inputs[i].value;
|
||||
state = Y.one(inputs[i]);
|
||||
break;
|
||||
case 'modulename':
|
||||
modulename = Y.one(inputs[i]);
|
||||
break;
|
||||
}
|
||||
if (inputs[i].type == 'image') {
|
||||
image = Y.one(inputs[i]);
|
||||
@@ -76,7 +84,7 @@ M.core_completion.init = function(Y) {
|
||||
success: handle_success,
|
||||
failure: handle_failure
|
||||
},
|
||||
arguments: {state: state, image: image, ajax: ajax}
|
||||
arguments: {state: state, image: image, ajax: ajax, modulename: modulename}
|
||||
};
|
||||
|
||||
Y.use('io-base', function(Y) {
|
||||
|
||||
+3
-2
@@ -1733,9 +1733,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
}
|
||||
if ($completionicon) {
|
||||
$imgsrc = $OUTPUT->pix_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 "
|
||||
<form class='togglecompletion$extraclass' method='post' action='".$CFG->wwwroot."/course/togglecompletion.php'><div>
|
||||
<input type='hidden' name='id' value='{$mod->id}' />
|
||||
<input type='hidden' name='modulename' value='".s($mod->name)."' />
|
||||
<input type='hidden' name='sesskey' value='".sesskey()."' />
|
||||
<input type='hidden' name='completionstate' value='$newstate' />
|
||||
<input type='image' src='$imgsrc' alt='$imgalt' title='$imgtitle' />
|
||||
|
||||
@@ -36,12 +36,12 @@ A tick next to the activity name on the course page indicates when the activity
|
||||
$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 dotted tick is shown, you can click it to tick the box when you think you h
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user