Does a course have a unique contextid?
if so is it easy locate?
help would be apprecaited
Yes. There is a unique context for each course, activity, block, course category and user.
You can find them in the mdl_context table. There, the contextlevel tells you what type of context it is. So, for example, 50 = course and 70 = activity. (The full list of types is defined at the top of lib/accesslib.php.)
Then, depending on the type of context, the instanceid column links to the appropriate database table. So, if contextlevel = 50, then instanceid matches an id from the mdl_course table. And for contextlevel = 70, instanceid refers to mdl_course_modules.id.
You can find them in the mdl_context table. There, the contextlevel tells you what type of context it is. So, for example, 50 = course and 70 = activity. (The full list of types is defined at the top of lib/accesslib.php.)
Then, depending on the type of context, the instanceid column links to the appropriate database table. So, if contextlevel = 50, then instanceid matches an id from the mdl_course table. And for contextlevel = 70, instanceid refers to mdl_course_modules.id.
My Dog 'Named booley' is not here right now and he is the boolean expert.
I see where contextlevel of '50' is for a course but what does the corresponding number '160' mean in my mdl_role_assignments table.
John Wyatt