Blocks: Reset Completion

block_resetcompletion
Maintained by Picture of Andrew PAndrew 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.
65 sites
24 downloads
5 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

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

Comments RSS

Show comments
  • Picture of John Okely
    Tue, Nov 8, 2016, 4:32 PM
    If you add scorm, quiz and choice as dependencies for this plugin, this will be accepted into the plugins DB. See https://docs.moodle.org/dev/version.php for info on how to do that.

    For a later time, if you can move towards using more and more of our APIs rather than manual DB deletion, although I understand that may not always be possible/existant
  • Picture of David Mudrák
    Tue, Nov 8, 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, Nov 8, 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
  • Picture of Andrew P
    Wed, Nov 9, 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, Nov 9, 2016, 7:09 AM
    Hi,

    Instalation via web OK!!!

    Ricardo
  • Picture of Deependra Singh
    Thu, Nov 10, 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
  • Picture of Andrew P
    Fri, Nov 11, 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.
  • Picture of Andrew P
    Fri, Nov 11, 2016, 2:52 AM
    And now that I'm aware of this issue.. I will change the minimum supported version to 2.9
  • Picture of Andrew P
    Tue, Nov 15, 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, Jun 23, 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
  • Picture of W Roes
    Thu, Jul 6, 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
  • Picture of Michael Milette
    Wed, Mar 28, 2018, 1:24 AM
    Has anyone tried this plugin with Moodle 3.4?
  • Picture of MAG II
    Fri, Sep 21, 2018, 12:34 AM
    Does anyone know if this plugin will work for Moodle 3.5?
  • Picture of Lee Bannister
    Sat, Feb 2, 2019, 6:31 AM
    version 3.5 3.6 3.7 please (going to 3.7 in april)
  • Picture of Andrew P
    Sat, Feb 23, 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.
1 2
Please login to post comments