Diference between course context and user, module etc

Diference between course context and user, module etc

by Johnny America -
Number of replies: 2

Hello guys smile, How to diferentiate in the mdl_context table if it is a course context or a module, user etc. I want to manually insert a user into the course, using SQL instead of the Moodle API.

 

Thanks in advance!

Average of ratings: -
In reply to Johnny America

Re: Diference between course context and user, module etc

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

the contextlevel field. 50 = course, 70 = module, etc.

In reply to Johnny America

Re: Diference between course context and user, module etc

by tony chesney -

These values are constants defined in lib/accesslib.php.

I'd like that added as a Comment attached to the contextlevel field.  That way, for those using mysql, it would display as a tooltip when hovering over the fieldname when browsing the table in phpMyAdmin.