Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: Context.

Context: Difference between revisions

From MoodleDocs
 
(42 intermediate revisions by 11 users not shown)
Line 1: Line 1:
A context is a "space" in Moodle. Together, they define the navigational structure of a Moodle site. A course can be a context, so can an activity, resource or block.
{{Main page}}
A context is a space in Moodle where [[Roles_and_capabilities|roles]] can be assigned. For example, a Moodle site is one context and that contains a number of other contexts within it. A category is a context, within a site context, that contains courses and sub-categories that have a context of their own.  


==Role contexts==
A [[Courses|course]] may hold, within its own context, an activity, or a [[Question bank]]'s question category, which are also contexts. A context might contain other contexts and Roles can be assigned to each context.  
The context is combined with [[Role permissions]] to define a user's [[Roles and capabilities|capabilities]] on any page in Moodle. In the context of a specific course, some users have the permissions of a student and others of a teacher.  While in another course, the same users may be assigned different roles because they are in a different context.


In Moodle 1.7 and onward, a permission context can include an activity module or a block. Thus a course can have many contexts in its space.  These might include lesson, assignment, forum and quiz modules and blocks.
There is a hierarchy of contexts which helps locate and define a specific space. A course can have many contexts in its space.  These might include lesson, assignment, forum and quiz modules and blocks.  


It is possible to assign a user different permissions based upon a specific context. For example, a user might be given the role of "student" for a course but be given a teacher's role in the context of one specific forum. Or a user can be a teacher of one course and a student in another course.
Generally speaking, this hierarchy allows a lower context to receive information from a higher context. Thus a student in the context of Course A, will initially be considered a student in a Quiz context that is located in Course A. Or when a theme has been set for the Biology course categories, that is passed on to Biology 101.  


What this means is that '''different [[Roles | Roles]]''' can apply depending on the '''page''' the User is in.
==Roles  and contexts==
A context is combined with role permissions to define a User's [[Roles and capabilities|capabilities]] on any page in Moodle.  Typically contexts have their own organization structure which allow a User's role to be passed along to the context "below" but not to the one above it.[[Image:context.png|right|thumb|150px|Each context can have a different role assigned to a User]] 


'''Before anyone logs in''' to the Moodle, sitting at the log in page, or public front page, depending how you have set your Moodle up, they should have the role of '''"Guest"'''. It is possible to change this but be careful.
It is possible to assign a user different permissions based upon a specific context. For example, a user might be given the role of "student" for a course but be given a teacher's role in the context of one specific forum. Or a user can be a teacher of one course and a student in another course.


In Moodle, '''when anyone''' with a user name and password logs into the Moodle, they become an "'''Authenticated User'''". How they are authenticated is different from their Role.  
Many Moodle contexts have a place to grant exceptions to specific roles within that context. Those exceptions are non-transferable from that context. That is, an exception can be applied to the next context downward, but cannot applied sideways nor upward from that context.


For [[Beginning_Administration_FAQ#All students are enrolling in every course|any number of reasons]], you may want a Users to become "'''Students'''" while in the '''Front Page''' context. (Be careful here, read on below before assigning roles.)


When they click to go to a Category context, they revert to an "'''Authenticated User'''". Once there, their User Name is scanned and their permissions are calculated and if they have permissions, they can have sufficient rights to be a "'''Teacher'''" or a "'''Course Creator'''" or even an "'''Administrator'''" in that context.
== Graphic showing contexts within contexts ==


Alternatively, they may not have those rights but when they click to go to a Course, they may have the rights to be an "'''Administrator'''", a "'''Course Creator'''", a "'''Teacher'''" or a "'''Student'''" in that Course '''context'''.
The image below shows a few contexts and their relationships.  The "System" or Moodle site is the overall context.  The user is defined initially in this context. 
*The System context has 2 contexts under it, with other context under them
**The Front page context has
*** An activity module context and
*** A block context within it
**The Course Category context has
***A Course context within it. The course context has
**** An activity module context and
****A block context within it


This does not mean they have any of those rights in any other page or Course as they will no longer be in the same '''context'''.
[[Image:Moodle-contexts-1.8.png]]
 
(Source: [[Development:Roles#Context]])
 
==Another graphic of hierarchy==
[[File:Hierarchycategories.png|thumb|center|Showing the Site > Category > Course contexts but not activities]]


== See also ==
== See also ==


* [[Beginning_Administration_FAQ | Beginning Administration FAQ]]
* [[Roles FAQ]]
* [[Roles FAQ]]
* [[Development:Roles]]
*[[Course_categories|Course categories context]]
* [[Roles and capabilities]]
* [[Role permissions]]


[[Category:Roles]]
[[es:Contexto]]
[[fr:Contextes]]
[[ja:コンテクスト]]

Latest revision as of 20:42, 23 November 2014

A context is a space in Moodle where roles can be assigned. For example, a Moodle site is one context and that contains a number of other contexts within it. A category is a context, within a site context, that contains courses and sub-categories that have a context of their own.

A course may hold, within its own context, an activity, or a Question bank's question category, which are also contexts. A context might contain other contexts and Roles can be assigned to each context.

There is a hierarchy of contexts which helps locate and define a specific space. A course can have many contexts in its space. These might include lesson, assignment, forum and quiz modules and blocks.

Generally speaking, this hierarchy allows a lower context to receive information from a higher context. Thus a student in the context of Course A, will initially be considered a student in a Quiz context that is located in Course A. Or when a theme has been set for the Biology course categories, that is passed on to Biology 101.

Roles and contexts

A context is combined with role permissions to define a User's capabilities on any page in Moodle. Typically contexts have their own organization structure which allow a User's role to be passed along to the context "below" but not to the one above it.

Each context can have a different role assigned to a User

It is possible to assign a user different permissions based upon a specific context. For example, a user might be given the role of "student" for a course but be given a teacher's role in the context of one specific forum. Or a user can be a teacher of one course and a student in another course.

Many Moodle contexts have a place to grant exceptions to specific roles within that context. Those exceptions are non-transferable from that context. That is, an exception can be applied to the next context downward, but cannot applied sideways nor upward from that context.


Graphic showing contexts within contexts

The image below shows a few contexts and their relationships. The "System" or Moodle site is the overall context. The user is defined initially in this context.

  • The System context has 2 contexts under it, with other context under them
    • The Front page context has
      • An activity module context and
      • A block context within it
    • The Course Category context has
      • A Course context within it. The course context has
        • An activity module context and
        • A block context within it

Moodle-contexts-1.8.png

(Source: Development:Roles#Context)

Another graphic of hierarchy

Showing the Site > Category > Course contexts but not activities

See also