I want to know to which course a file that is stored in the datebase belongs.
I have the contextid of the module where the file belongs to. How can I get the courseid or the coursecontext of this file?
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