Course listing showing for Suspended Users

Course listing showing for Suspended Users

by Brad Nielsen -
Number of replies: 2

Ok so Im trying to show only courses for users who are not suspended.

I thought this would work:

if ($mycourses = enrol_get_my_courses(['enddate'], 'visible DESC, '.$sortorder.' ASC', $courses_limit))

However, for some reason students cant see courses they are suspended in - which is what I want, but teachers can see courses they are suspended in.

And some reason, as the Administrator, if I suspend myself as a teacher in a course, it no longer shows the course, which is what I want.

any help would be great.

Cheers,

Brad

Average of ratings: -
In reply to Brad Nielsen

Re: Course listing showing for Suspended Users

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Brad,

I'm not able to replicate this. Are you suspending the enrolment or using timed enrolments?
In reply to Andrew Lyons

Re: Course listing showing for Suspended Users

by Brad Nielsen -

Hi Andrew, thanks for looking at that - to be honest - I just tested again and it seems to be working perfectly now, so I'm not sure what was happening. Maybe I wasn't suspending the teacher properly??

Anyway, thanks again - sorry for the false alarm.