Report that shows what courses students have NOT earned a badge in?

Re: Report that shows what courses students have NOT earned a badge in?

av Luis de Vasconcelos -
Antal svar: 0
Bild av Particularly helpful Moodlers
I haven't used badges before so I'm not familiar with that part of Moodle, but I see that you are only checking for course completions in your query. However, you want to know which students don't have a BADGE, regardless of whether or not they are enrolled in a course, so checking course completions isn't going to give you the information you want. You should be looking at the info in the mdl_badge_issued and mdl_badge tables. Presumably, any mdl_user.id who does not have a record in the mdl_badge_issued table should show in your report. So you could do something like:

SELECT id, firstname, lastname
FROM mdl_user
WHERE mdl_user.id NOT IN (SELECT userid FROM mdl_badge_issued)
And maybe include the mdl_badge_issued.dateexpire column in the WHERE clause to give you just the badges that have not expired.
Medeltalet av utvärderingarna: -