Problem Description
On a Moodle-enabled site, I want to give users some coupons.
I made it to check if the user is logged in, but I also want to check if the current logged in user is enroled in specific course (an array of 3 course IDs).
So far I tried with `$USER->currentcourseaccess` or `$USER-> lastcourseaccess`, but they don't do the trick.
So, how can I check if the current logged in user is enrolled in specific Moodle course?
---
**Edit:** The site uses _Moodle 2_.
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?