How can i get Get courses for a teacher

Re: How can i get Get courses for a teacher

by Michael Milette -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Take a look at the following page. It gives many examples of SQL reports. I didn't see one specifically for your requirement but it should be possible to put what you need together.

Essentially what you want to do is to:
  1. Get a list of all the courses in which a user is enrolled.
  2. Loop through each of these courses to see if they have a teacher role. If not, remove the course from the list.
  3. Display the list.
There are examples of code in Moodle on how to do all of these, just perhaps not a together in one place.

As for displaying it when the user logs in, put the report in a block on your home page or dashboard.