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:
91 sites
164 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.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Andrew P (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • David Mudrák
    Tue, 8 Nov 2016, 7:11 PM

    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.

  • Ricardo Caiado
    Tue, 8 Nov 2016, 7:24 PM
    Hi,

    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
  • Andrew P
    Wed, 9 Nov 2016, 7:01 AM
    Thank you John again, for your detailed review and thank you David for approving the plugin.
    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.
  • Ricardo Caiado
    Wed, 9 Nov 2016, 7:09 AM
    Hi,

    Instalation via web OK!!!

    Ricardo
  • Deependra Singh
    Thu, 10 Nov 2016, 3:17 PM
    Hello,

    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
  • Andrew P
    Fri, 11 Nov 2016, 2:09 AM
    Thanks for reporting this issue.

    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.
  • Andrew P
    Fri, 11 Nov 2016, 2:52 AM
    And now that I'm aware of this issue.. I will change the minimum supported version to 2.9
  • Andrew P
    Tue, 15 Nov 2016, 8:33 AM
    Following may be the solution to the problem (please try with your Moodle version and let me know if it works):

    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]);
    }
  • Health & Safety Training Ninja
    Fri, 23 June 2017, 10:11 PM
    Is it possible to change the block so that only Admins can reset user completion data; and regardless of current progress, i.e. student does not have to completed the course in order for the 'reset' to be triggered.

    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
  • W Roes
    Thu, 6 July 2017, 8:13 PM
    Hi Andrew,

    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
  • Michael Milette
    Wed, 28 Mar 2018, 1:24 AM
    Has anyone tried this plugin with Moodle 3.4?
  • MAG II
    Fri, 21 Sept 2018, 12:34 AM
    Does anyone know if this plugin will work for Moodle 3.5?
  • Lee Bannister
    Sat, 2 Feb 2019, 6:31 AM
    version 3.5 3.6 3.7 please (going to 3.7 in april)
  • Andrew P
    Sat, 23 Feb 2019, 4:52 AM
    Hi, I have not used or maintained at this plugin since Nov. 2016, since I've left the organization that uses Moodle. If you are interested in becoming the lead maintainer, please let me know.
  • Vincent Griessel
    Tue, 20 Feb 2024, 4:08 PM
    Hi
    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
Please login to post comments