Hi Moodlers,
In my query below I have put a condition (in bold) so that I can get to match an item and the badge it sits in as part of the criteria.
However, it would not show other items that are not added to the badges.
I f i remove that condition they all display, however, they don't match the completion dates of their respective badges.
Does anyone know where i would be doing wrong?
Any thought of the workaround for that is highly appreciated
Cheers
FROM
mdl_course_modules_completion cmc
LEFT JOIN mdl_course_modules cm
ON (cmc.coursemoduleid =cm.id)
LEFT JOIN mdl_course_sections cs
ON (cs.id = cm .section)
LEFT JOIN mdl_modules m
ON (m.id= cm.module )
LEFT JOIN mdl_course c
ON c.id = cm.course
LEFT JOIN mdl_user u
ON u.id = cmc.userid
LEFT JOIN mdl_badge_issued bgi
ON bgi.userid = cmc.userid
LEFT JOIN mdl_badge bg
ON bg.id = bgi.badgeid
LEFT JOIN mdl_badge_criteria bc
ON bc.badgeid = bg.id
LEFT JOIN mdl_badge_criteria_param bcp
ON bcp.critid = bc.id AND (bcp.value = cm.id)
WHERE bcp.value = cm.id
GROUP BY u.firstname