How to send certificate A or certificate B using php?

How to send certificate A or certificate B using php?

von Robin de Rooy -
Anzahl Antworten: 5
Is there a possibility to call a function in php to send a certificate?

So if an event is triggered, I check some conditions myself and issue a specific certificate.

Reason: we have a practical course. Sometimes teacher A takes it, sometimes teacher B.
I need the certificate to have the correct signature in the certificate.
I a new_user_profile_field I can put the teacher: A or B.

Functionality is: if in new_profile_field is teacher A then grant certificate A, if teacher B then grant certificate B.

Kind regards,
Robin de Rooy
Als Antwort auf Robin de Rooy

Re: How to send certificate A or certificate B using php?

von Mark Nelson -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers Nutzerbild von Testers
Well, it's possible to do whatever you want as long as you know how to code it. lächelnd

This would require a developer to work on and can't be done out of the box. Sorry!
Als Antwort auf Mark Nelson

Re: How to send certificate A or certificate B using php?

von Robin de Rooy -
Thanks for the reply Mark. I am a user and developer, but propably have to dig a little deeper. I just added some pseudo code, or even less, to trigger a larger audience.


Do you have, by chance, a summary of funtions to call? Or a reference to this? Thanks for the input and pointing me in the direction.

Als Antwort auf Robin de Rooy

Re: How to send certificate A or certificate B using php?

von Mark Nelson -
Nutzerbild von Core developers Nutzerbild von Documentation writers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers Nutzerbild von Testers
https://github.com/mdjnelson/moodle-mod_customcert/blob/MOODLE_402_STABLE/classes/task/email_certificate_task.php#L192 is where the certificate is generated for emails but I suspect that may not help with choosing how it looks. Perhaps if you change the logic in https://github.com/mdjnelson/moodle-mod_customcert/blob/MOODLE_402_STABLE/element/userfield/classes/element.php#L132 you can get the field to work like you want.
Als Antwort auf Mark Nelson

Re: How to send certificate A or certificate B using php?

von Robin de Rooy -
Thanks, I will have a look.


My plan is to select a different certificate template, not a single field.

Something like, after 'exam_X_finished' event (cron):

Select case profile_field_examinator

 case examinator_A

  Use_cert_template(cert_template_A)

 case examinator_B

  Use_cert_template(cert_template_B)

case examinator_C

 Use_cert_template(cert_template_C)

End select