Moodle Plugins directory: Download Certificates (NOW ARCHIVED - SEE NOTES) | Moodle.org

Download Certificates (NOW ARCHIVED - SEE NOTES)
NOTE: This block has now been replaced with a new one. For detailed information on the changes and download links please visit here - https://moodle.org/plugins/block_download_certificates
This block displays all the previously issued certificates without having to go into each course to view them. You will also be able to download the certificates directly without having to go into the course themselves. It will also work for courses that needs to be archived or hidden but still want students to be download the issued certificates.
The block displays the course name, grades, unique codes and issue date. The report page will also display the direct download link to each of the certificates.
Requirement:
The certificate module is required for this plugin to work - https://moodle.org/plugins/view/mod_certificate.
In order for this plugin to work you need to make sure the "save certificates" is set to Yes under the certificate issue options.
you can see the screenshots in https://moodle.org/mod/forum/discuss.php?d=311795&parent=1259682
Greetings.
Alex.
I'd like to use your plugin in Moodle 2.8.3, but it's not working. I wish I had more useful information for you, but I turned on debugging and I couldn't find any errors anywhere. The block says "You do not have any certificates issued to you." But I do have certificates. I can see them in the database. I created a new certificate and made sure it was set to save, then issued it to a test user, waited for the cron to run, and the block for the test user still says that there are no certificates. Do you know why this might not be working?
Thanks,
-Elisabeth
Thank you for reporting this. I am planning to release the updates for 2.8 and 2.9 soon. I just haven't had the chance to work on this due to work and personal commitments. I will be looking to start working on this in the next few weeks and hopefully the fix for 2.8 and 2.9 shouldn't be that bigger change.
I will update this page as soon as I have the updated version. In the meantime if you find any obvious errors or fixes please do let me know.
Thanks,
M
I have just updated the codes and tested on my moodle 2.8.3. It works fine now. Had to change the course module and date format. For some reason I had to uninstall my previous install and reinstall the plugin again. I haven't submitted the final code here but wanted to check if it would work for both of you.
Please download the zip from here - https://github.com/manieer/moodle-block_report_certificates/tree/For-Moodle-2.8
You will need to do a manual install of the plugin. Also this plugin is really aimed for the 'My home page' where you can place it on the main content pane.
Please let me know if you encounter any problems.
Thanks,
M
I just installed the block and everything is correct during installation, but when activating the block following error message:
Error reading the database
Debug info: ERROR: la columna «ci.id» debe aparecer en la cláusula GROUP BY o ser usada en una función de agregación
LINE 1: SELECT DISTINCT ci.id AS certificateid, ci.userid, ci.code A...
^
SELECT DISTINCT ci.id AS certificateid, ci.userid, ci.code AS code,
ci.timecreated AS citimecreated,
crt.name AS certificatename, crt.*,
cm.id AS coursemoduleid, cm.course, cm.module,
c.id AS id, c.fullname AS fullname, c.*,
ctx.id AS contextid, ctx.instanceid AS instanceid,
f.itemid AS itemid, f.filename AS filename
FROM mdl_certificate_issues ci
INNER JOIN mdl_certificate crt
ON crt.id = ci.certificateid
INNER JOIN mdl_course_modules cm
ON cm.course = crt.course
INNER JOIN mdl_course c
ON c.id = cm.course
INNER JOIN mdl_context ctx
ON ctx.instanceid = cm.id
INNER JOIN mdl_files f
ON f.contextid = ctx.id
WHERE ctx.contextlevel = 70 AND
f.mimetype = 'application/pdf' AND
ci.userid = f.userid AND
ci.userid = $1
GROUP BY ci.code
ORDER BY ci.timecreated ASC LIMIT 5
[array (
0 => '2',
)]
Error code: dmlreadexception
Stack trace:
line 443 of \lib\dml\moodle_database.php: dml_read_exception thrown
line 244 of \lib\dml\pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 764 of \lib\dml\pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 115 of \blocks\report_certificates\block_report_certificates.php: call to pgsql_native_moodle_database->get_records_sql()
line 288 of \blocks\moodleblock.class.php: call to block_report_certificates->get_content()
line 230 of \blocks\moodleblock.class.php: call to block_base->formatted_contents()
line 971 of \lib\blocklib.php: call to block_base->get_content_for_output()
line 1023 of \lib\blocklib.php: call to block_manager->create_block_contents()
line 392 of \lib\outputrenderers.php: call to block_manager->ensure_content_created()
line 34 of \theme\uikit\layout\frontpage1.php: call to core_renderer->standard_head_html()
line 27 of \theme\uikit\layout\frontpage.php: call to require_once()
line 915 of \lib\outputrenderers.php: call to include()
line 845 of \lib\outputrenderers.php: call to core_renderer->render_page_layout()
line 101 of \index.php: call to core_renderer->header()
I remind you that I'm using the version 2.8.6+
Greetings
I am trying to install it on Moodle 2.8.6 but facing a white blank page when trying to update the database. Does it require a specific version of the certificate module? I am currently using 2013021200.
Thanks for you help.
I can see that the minimum requirement is 2014051203.
Thanks
Error reading from database
Debug: ERROR: column "ci.id" must appear in the GROUP BY clause or be used in an aggregate function at character 17
SELECT DISTINCT ci.id AS certificateid, ci.userid, ci.code AS code,
ci.timecreated AS citimecreated,
crt.name AS certificatename, crt.*,
cm.id AS coursemoduleid, cm.course, cm.module,
c.id AS id, c.fullname AS fullname, c.*,
ctx.id AS contextid, ctx.instanceid AS instanceid,
f.itemid AS itemid, f.filename AS filename
FROM mdl_certificate_issues ci
INNER JOIN mdl_certificate crt
ON crt.id = ci.certificateid
INNER JOIN mdl_course_modules cm
ON cm.course = crt.course
INNER JOIN mdl_course c
ON c.id = cm.course
INNER JOIN mdl_context ctx
ON ctx.instanceid = cm.id
INNER JOIN mdl_files f
ON f.contextid = ctx.id
WHERE ctx.contextlevel = 70 AND
f.mimetype = 'application/pdf' AND
ci.userid = f.userid AND
ci.userid = $1
GROUP BY ci.code
ORDER BY ci.timecreated ASC LIMIT 5
[array (\n 0 => '2',
)]
Error code: dmlreadexception
* line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
[...]
I think this is to do with PostgreSQL as I use MySQL on my test server. I will test this and report back.
Hi Blue Kearsley,
Not sure what you are really trying to achieve but the full list of issued certificates are already available at course level. Your teachers should be able to go in and view them if they have permissions to do so. I wouldn't want to replicate that feature here as if you have huge list of courses then there could be tons of certificates to display!
Hi Janette Dimitrova,
Thanks and I am currently testing this on Moodle 3. Will upload it here once its ready and tested at my end.
Thank you everyone for your feedback and am glad this has been a helpful plugin.
Regards,
M