How to get context of a course if i know contextid and component?

Re: How to get context of a course if i know contextid and component?

by Andreas Grabs -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Andreas,

a course module always belong to a course even if it is on the frontpage.

So if you have the context of a course module you could just call its method "get_parent_context()".

Best regards
Andreas

Average of ratings: Useful (1)