Managers should have the capability "mod/customcert:manage" which should provide them with this ability.
mod/customcert:manage is allowed for teachers but when a teacher clicks on the download icon they just get a white screen and nothing downloads.
The download works for managers but I need it to work for teachers.
The download works for managers but I need it to work for teachers.
Do they have that capability? Also, it shouldnt show the link to download it at all, so the fact you are getting a blank PDF seems funny. Possibly a bug in the code. What happens when you turn debugging on?
Wait, I am getting confused. Is this on the my_certificate page when trying to view another student's certificate? Either way please turn on debugging and see if it says anything.
When the teacher clicks on the certificate activity in the course it lists all the students that have have a certificate. This is the page where teachers are having the problem downloading the PDF.
Unfortunately when I turn on debugging it does not show any errors. Please let me know if you have any other suggestions.
Unfortunately when I turn on debugging it does not show any errors. Please let me know if you have any other suggestions.
Just figured out the teacher needs to be assigned both as a "Teacher" and as a "Student" to be able to download the student's certificate PDF. Is there a way to code this to where the teacher role has this ability without needing to be a student as well?
It doesn't make sense that they need to be a student as well. I just tried on my test site.
1. Logged in as admin.
2. Went to the course.
3. Added custom certificate.
4. Enrolled students.
5. Logged in as those students and viewed the certificate.
6. Logged back in as Admin and viewed the Custom certificate activity and could see the list of recipients.
1. Logged in as admin.
2. Went to the course.
3. Added custom certificate.
4. Enrolled students.
5. Logged in as those students and viewed the certificate.
6. Logged back in as Admin and viewed the Custom certificate activity and could see the list of recipients.
So, in moodle there are manager, teacher, non-editing teacher, and student roles within the course. My issue is with the "Teacher" role. Are you referring to the teacher role when you say "admin"?
The manager role and student role all work correctly - the teacher role does not and needs to be also assigned as a student to download the certificates on the "/mod/customcert/view.php?id=" page.
For the teacher role this page (/mod/customcert/view.php?id=) lists all the students that have completed the course with an icon to download the certificate pdf. The teacher role cannot download the pdf unless they are also assigned the student role.