From 9a5a069450d7b7a1fa642fe3bf6a7d025783ee97 Mon Sep 17 00:00:00 2001 From: sam_marshall Date: Tue, 18 Nov 2008 14:45:13 +0000 Subject: [PATCH] MDL-17275: Completion system - needs reload if you use Back button to return to page after changing ticks --- course/completion.js | 11 ++++++++++- course/view.php | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/course/completion.js b/course/completion.js index 6748048258..6a46d06fe2 100644 --- a/course/completion.js +++ b/course/completion.js @@ -2,7 +2,15 @@ var completion_strsaved, completion_strtitley, completion_strtitlen, completion_stralty, completion_straltn; var completion_wwwroot; -function completion_init() { +function completion_init() { + // Check the reload-forcing + var changeDetector=document.getElementById('completion_dynamic_change'); + if(changeDetector.value==1) { + changeDetector.value=0; + window.location.reload(); + return; + } + var toggles=YAHOO.util.Dom.getElementsByClassName('togglecompletion', 'form'); for(var i=0;i get_string('completion-alt-manual-y','completion'), 'completion_straltn' => get_string('completion-alt-manual-n','completion'), )); + // This value tracks whether there has been a dynamic change to the page. + // It is used so that if a user does this - (a) set some tickmarks, (b) + // go to another page, (c) clicks Back button - the page will + // automatically reload. Otherwise it would start with the wrong tick + // values. + print '
'; } // Course wrapper start. -- 2.39.5