Unenrol and clear all course data

Unenrol and clear all course data

by Hal MacLean -
Number of replies: 6

Moodle has a lovely function that restores data when a user is re-enrolled into a course so their previous grades and scores are returned. It's very useful.

I want to have the option to NOT restore that data so that the user can reattempt the same course a second time the following year - this is all about re-certification... it's not a school based system. I know there is a checkbox to restore data or not, but it doesn't do what I need - specifically, a quiz cannot be re-attempted if all attempts were already used. That checkbox would be ideal if it truly cleared all data.

The problem is that if we re-enrol a user all of the last year's data is restored, and without doing a thing they access the certificate. I need to prevent this, push the user through the same activities (or at last updated ones) and re-issue a subsequent certificate. 

In effect, I want the ability to re-enrol as if it is a new user... but also keep access to the history so I can see if a user completed each year - I need to see a completion history.

One thought I had was to use a date based completion report - the activities in a course have completion criteria but also record the date of the attempt. If a date based completion report looked only at the attempts within a specific year, we could construct a completion report for that year.

However, I cannot then see how activity restrictions would work - not without getting down and dirty with core code!

Any thoughts?


Average of ratings: Useful (2)
In reply to Hal MacLean

Re: Unenrol and clear all course data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I find it cleaner to just create a new instance of the course for each year.  This has multiple benefits - the previous data is saved for records.  The new instance can be adjusted as needed with updates without affecting the previous one.

You cannot reset a single user as far as I can tell.

In reply to Emma Richardson

Re: Unenrol and clear all course data

by Hal MacLean -

Yes, it's certainly an option, but has some overheads I'm looking to avoid. Perhaps the best thing is to focus on how the completion reports are generated and think about adding a date filter in there so that multiple completions over time can be seen.

I do understand the benefit of the 'clean course', but in a very busy site it can be difficult to manage multiple versions.

Average of ratings: Useful (1)
In reply to Hal MacLean

Re: Unenrol and clear all course data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

But you cannot have multiple completions within the same course so that is not really an option...you could allow multiple attempts but the certificate is always going to be available so that will not work unless you manually create certificates (which in my mind would be a lot harder to manage than an additional course!!).

In reply to Emma Richardson

Re: Unenrol and clear all course data

by Hal MacLean -

Yes, that's kinda the point - I want to find a way to allow multiple completions and manage the certificates ;)

If there was a 12 month window to complete a course, and the completion report was able to be filtered by that period it might help - of course I realise this is not standard Moodle behaviour, and so would probably be looking to build that functionality as a new module - call it 'completion +' or something. It would be in addition to the existing completion report, and would need to show completions per 'year' or whatever period the admin defines.

To get this working I'll need to find a way to check the activities that build towards completion and only look at the attempts dated within the 'range' defined. For example, if a course contains a single scorm object that defines course completion, but itself has unlimited attempts, it should be possible to look at the most recent attempt and score, check it is within the date range required and set the completion for that date range accordingly. 

The bigger issues are where quizzes are limited to three attempts, and the user completes those in year 1, for example. 

Also access restrictions for things like certificates and other activities would need to be thought about too.

All in all I think a new course would just be easier... however if such a 'completion module' could be built would it be useful?

Average of ratings: Useful (1)
In reply to Hal MacLean

Re: Unenrol and clear all course data

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Actually it would be really useful.  I see a lot of people wanting to do exactly this - have people take the same course multiple times.  Maybe you could create a certificate for each year and then be able to base it on a timeframe of attempts.  

In reply to Hal MacLean

Re: Unenrol and clear all course data

by Kyle Hale -

Hello, I am needing the same option. Have you figured out how to do this yet?