Deleting previous Certificates

Deleting previous Certificates

by gerard van rooy -
Number of replies: 5

Hi there

At the moment I am using Moodle 2.6 if the certificate plugin. I love the certificate plugin, but I like to know is how do I clean / delete previous certificates that has been issued.

If i log in as an administrator and I go to where the  "summary of previously received certificates" are then I click on the "view 3 issued certificate" i can see the certificates that have been issued to the students.

How do I clear this list??? is it even possible to do??

Please help. any help will be really appreciated.


Average of ratings: -
In reply to gerard van rooy

Re: Deleting previous Certificates

by Gary Lyon -

Hi Gerard, 

I am having the same issue and to my knowledge there is not function built into the module to allow deletion of previously issued certificates. The only thing I have tried (in my test environment) is to delete the contents of the mdl_certificate_issues table in the database. Unfortunately I am not SQL/PHP savvy to the level of being able to know what ramifications there may be outside of deleting the record entries, or how to automate that process if you want it cleared on a regular basis. 

Hope this gets you a bit closer to your answer.

In reply to Gary Lyon

Re: Deleting previous Certificates

by gerard van rooy -

I am in the same boat as you. Wish there was an easier way to remove these records of the certificates being issued.  because let say you have a 1000 students doing your course, just imagine how that will full up your database.

In reply to Gary Lyon

Re: Deleting previous Certificates

by Jean-Michel Védrine -

To automate something in the certificate module, you need 2 changes

First in the mod/certificate/lib.php

you need to change the function

/**
 * Function to be run periodically according to the moodle cron
 * TODO:This needs to be done
 */
function certificate_cron () {
    return true;
}

As you see currently this function simply return true, you need to change it so that it does what you want.

You also need to edit the mod/certificate/version.php

change the line:

$module->cron      = 0; // Period for cron to check this module (secs)

for instance if you put

$module->cron      = 180;

your cron function will be executed each 3 minutes

But you also need to change the version number because if you don't do that your other changes will not be taken into account by Moodle, for instance you can just add 1 to the version number

$module->version   = 2014041801;

changed to

$module->version   = 2014041802;

Note: before putting this on a production server, ensure that your certificate_cron function is well coded and don't contain any programming error !


In reply to gerard van rooy

Re: Deleting previous Certificates

by Patricia Ramsey -

I will be installing the certificate plugin tomorrow and will have the same problem.  Right now, we manually issue certificates (very labor intensive and our students want instant gratification).  But some of our courses must be re-taken each year and I will need to know how to remove the old certificates from the system.

Thanks for any help you can offer.


In reply to gerard van rooy

Re: Deleting previous Certificates

by Gary Lyon -

Another thought has occurred. Use the 'Reset' function under Administration>Course Administration and only select the certificates for deletion. Haven't tried it in my test environment  yet but will soon and let all know. Meanwhile, please post any results from your own testing...would also be great to be able to run it under CRON for specific courses I have that would require a daily flush of certificate issues - calling any developers!