mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
89 stars 157 forks source link

Teacher(s) not displayed correctly when using groups #536

Open zozo1977 opened 1 year ago

zozo1977 commented 1 year ago

Short description: when using groups, certificate allways shows the same teacher's name, regardless his and student's group memebrship.

Steps to reproduce:

  1. create course with group options set to separate or visible groups
  2. create custom certificate activity with group options set to separate or visible groups
  3. edit certificate, add teacher name filed, set the with of the field (for example 20), position the filed so it is visible on the certificate
  4. create 4 users: user1, user2, user3 and user4
  5. enroll user1 and user2 to the course with role student
  6. enroll user3 and user4 to the course with role teacher or editing-teacher
  7. create two groups: group1 and group2
  8. assign user1 and user 3 to group1
  9. assign user2 and user 4 to group2
  10. login as user2 and, open the custom certificate activity and view the certificate. Notice that teacher name on the certificate is the name of the user3 although user2 is a member of the group2 and user3 is the member of the group1.

Suggestions on how to solve it: if using groups (visible or separate), teacher name should be the name of the teacher that is a member of the same group in which the student that views certificate is member of. If there are more than 1 teachers in the student's group, teacher field should display all teacher one under the other. Things could get a little bit more complicated if a student belongs to more than one group. That could be solved by implementing dropdown menu for choosing a group on the form where the View Certificate button is displayed to the student. This dropdown menu should be visible only if group mode is set in certificate activity. It should show only groups that a student belongs to. Teacher name field should display the name(s) of the teacher(s) that belong to chosen group.