Moodle Plugins directory: Reset Completion | Moodle.org
Reset Completion
Blocks ::: block_resetcompletion
Maintained by
Andrew P
This block allows students to reset their module and completion status of a course by themselves, in case they want to be recertified after a certain period of time after initial completion, or they want to retake the course from scratch.
Latest release:
83 sites
41 downloads
7 fans
Current versions available: 1
This block allows students to reset their module and completion status of a course by themselves, in case they want to be recertified after a certain period of time after initial completion, or they want to retake the course from scratch.
Once used, the block will reset quiz, scorm, and choice data as well as any course completion data.
Useful links
Contributors
Andrew P (Lead maintainer)
Please login to view contributors details and/or to contact them
Thanks Andrew for sharing the plugin with the community, and thanks John for a good detailed peer-review.
It was me who should be blamed for the suggestion to add explicit dependency on SCORM, Quiz and Choice as the block directly relies on the presence of these plugins. But I admit this is really a grey zone as these plugins are standard plugins. So requiring a given Moodle version kind of implicitly contains a requirement for all its plugins, too. I still think it will be clearer if the dependency on other plugins is declared explicitly as it will help to avoid accidental uninstallation of a required plugin. But after some more thinking about it, I no longer consider it as an approval blocker.
I am happy to approve this now. You are cleared to land, welcome to the plugins directory.
Got this error messagem when trying to install from web:
----------------------------
Downloading block_resetcompletion ... OK
Validating block_resetcompletion ... Error
[Error] Extracted file not found [{"file":"resetcompletion\/.git\/branches\/"}]
Installation aborted due to validation failure
----------------------------
Any ideas?
Ricardo
I've addressed the issues again.
Ricardo, I added a new version of the plugin without the .git/ directory that seems to be causing that issue.
Please try installing again with the new version and let me know if there are any more issues.
Instalation via web OK!!!
Ricardo
There got an error with the moodle 2.8.5 version during the reset of course completion.
error message{
Coding error detected, it must be fixed by a programmer: The requested cache definition does not exist.core/completion
}
i got this error message during the reset of course completion. its remove all the data from table but it can't unchecked the Activity completion checkbox.
Deependra
I found out that Moodle versions < 2.9 don't have the 'completion' cache definition defined here: https://github.com/moodle/moodle/blob/MOODLE_29_STABLE/lib/db/caches.php
Which is why line 78 in resetcompletion/reset_user_completion.php: cache::make('core', 'completion')->purge(); is throwing an error.
There may be another way to purge the completion cache for versions < 2.9, but for now:
Can you try purging your site cache by going to Administration > Site administration > Development > Purge all caches.
After that go to the course and see if the checkmarks are gone. Please let me know if you get a chance to try. In the meantime I'll look for a solution for versions < 2.9.
Replace the line cache::make('core', 'completion')->purge(); in reset_user_completion.php with the following code:
global $SESSION;
if (isset($SESSION->completioncache) &&
array_key_exists($courseid, $SESSION->completioncache)) {
unset($SESSION->completioncache[$courseid]);
}
I could potentially modify user roles so that an Admin/Teacher when logged in as a 'student' can use the course reset, but normal student role cannot see/use the reset block.
I will be looking at changing this plugin for my circumstances.
So, in essence I need a 'reset student completion' feature that teachers and admins can use to reset any student's completion data.
Thanks
I am not sure if you noticed this as well but the course completion is not properly purged from cache. In Moodle core they are using cache::make('core', 'completion')->purge() as are you I think.
However if you check /cache/admin.php you can see that the zone is actually named 'coursecompletion'. So I changed the purging to cache::make('core', 'coursecompletion')->purge() which seems to work properly.
Willem
Thank you for this plugin, made a few tweaks to adjust to my SQL prefix and it works on 4.3. I do however see on the users Courses page that it does not reset to 0% until caches are purged and cron.php has run. Did those and all working.
Thank you for your plugin