Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Question Engine Changes in Moodle 1.9.

Question Engine Changes in Moodle 1.9: Difference between revisions

From MoodleDocs
(create a role 'Shared question user' / 'Shared Question Creator')
No edit summary
 
(32 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Questions}}
{{Moodle 1.9}}
==General Clean Up of UI and Code==
==General Clean Up of UI and Code==


* Many parts of the question code have been cleaned up. The Quiz / Question UI has some improvements - the category editing page's table has been replaced by unordered lists and the controls for editing categories have been improved.
* Many parts of the question code have been cleaned up. The Quiz / Question UI has some improvements - the category editing page's table has been replaced by unordered lists and the controls for editing categories have been improved.
* Question code no longer relies on browser sessions. Before if you had more than one browser window open for editing a quiz / questions navigation would have been unpredictable now you can have several independent browser windows open at once to edit quizzes and questions.
* Question code no longer relies on browser sessions. Before if you had more than one browser window open for editing a quiz / questions navigation would have been unpredictable now you can have several independent browser windows open at once to edit quizzes and questions.
* Further work has been done on separating the question bank code from the quiz module to make it possible to access questions in the question bank from other modules.


==Seperated Questions into Different Category Hierarchies in Different Context Levels==
==Better Management of Files Linked to In Questions==


Before 1.9 questions were always associated with one course. You could 'share' a question to allow it to be visible in another course. Now questions can be shared in an activity, a course, a course category or with the whole system. These different levels of sharing are Moodle 'contexts'. (Think of a context as a conceptual space in your Moodle system. Notice an activity is contained in a course, which is contained in a course category, which is contained in the system.) The question editing UI can be accessed from within the course questions area or when setting up an activity. When editing questions in a course you have access to all the containing contexts' questions also. And when editing a quiz / questions in a module you have access to all the containing contexts questions including the courses context. So from the course questions editing area you can access questions available in the course area, possibly several course category areas  containing the course (remember Course Categories can contain each other).
[[Questions linking to files|Since Moodle 1.9 we have some automatic handling of files linked to from questions. When you '''move questions between sharing contexts''' and when you '''back up''' courses with questions in them, Moodle will now help you manage files linked to in your questions.]]


==More Granular Capabilities==
==Separated Questions into Different Category Hierarchies in Different Context Levels==


Bear in mind that each of these capabilities can be set for any of the contexts mentioned above. If you someone has a role with a capability set at the :
Before 1.9 questions were always associated with one course. You could 'share' a question to allow it to be visible in another course. Now questions can be shared in an activity, a course, a course category or with the whole system. These different levels of sharing are Moodle 'contexts'. More info here [[Question contexts]]


* system level then it is normally inherited in the course category, course and activity contexts.
Upon upgrade :
* course category level then it is normally inherited in all the contained course categories, in the course and activity contexts.
* a category that was shared will now be in the System context and it will have the course name from which it has been taken appended to the category name in brackets.
* course level then it is normally inherited in all activity contexts for activities in that course.
* Questions that were not shared will be put in the course context upon upgrade.
* The only exception to this is the special case outlined below in [[#Random Questions Selecting from Subcategories]]


This means that if you have a role with the add capability assigned to you at the system level then you have the add capability all over the site (unless their is an override set for a role you belong to at a lower level). If you have it assigned at the course level that means you have the capability for questions in that course and for questions in all activities in that course.
==More Granular Capabilities==


Since Moodle 1.9 we have more granular capabilities for access and use of questions see [[Question permissions]] for more info. Question permissions are now tested in the context in which the questions are shared see [[Question contexts]] for more info.


====moodle/question:managecategory====
====Upgrade====


Allows the management of category hierarchies ie. creating, editing and moving categories. (The Categories editing page would be shown if the user has permission to edit the hierarchy in the current context or any parent context.)
On upgrade from an older version of Moodle question capabilities are automatically assigned.


Roles that previously had the moodle/question:manage capability will have :


* [[Capabilities/moodle/question:add|moodle/question:add]]
* [[Capabilities/moodle/question:editmine|moodle/question:editmine]] / [[Capabilities/moodle/question:editall|editall]]
* [[Capabilities/moodle/question:viewmine|moodle/question:viewmine]] / [[Capabilities/moodle/question:viewall|viewall]]
* [[Capabilities/moodle/question:usemine|moodle/question:usemine]] / [[Capabilities/moodle/question:useall|useall]]
* [[Capabilities/moodle/question:movemine|moodle/question:movemine]] / [[Capabilities/moodle/question:moveall|moveall]]


====moodle/question:add====
This will give all users effectively the same permissions as they had previously for questions shared at the course level.


Controls :
==Potential Issues on Upgrade==


* the adding of questions to a category.
===Access to question categories shared outside a course===
* the moving of a question to a category.
* the import of questions.


This capability would be tested at the module / course / course category / system level depending on the where the user is attempting to create a question.
Questions that are shared above the course level may not be available to course teachers. Normally the teacher role is assigned at the course level so the teacher's capabilities will only cover the course in which they are assigned the teacher role. You must define a new role and assign all users that you want to be able to share questions above the course level that role. You do this by :
====mine / all====


All other capabilities are split into two types mine or all. So the permissions for what you can do with a question depend on whether the question was created by you or someone else.
* log in as an admin
* go to Administration > Users > Permissions > Define roles
* click on Add New Role button
* define a new Role Shared Question Creator
* give the role these question permissions :
** [[Capabilities/moodle/question:add|moodle/question:add]]
** [[Capabilities/moodle/question:editall|moodle/question:editall]]
** [[Capabilities/moodle/question:viewall|moodle/question:viewall]]
** [[Capabilities/moodle/question:moveall|moodle/question:moveall]]
** [[Capabilities/moodle/question:managecategory|moodle/question:managecategory]]
* and probably also :
** [[Capabilities/moodle/question:useall|moodle/question:useall]]


* 'all' means the capability allows you to act on all questions, your own questions included (so 'mine' is not tested if you have 'all').
You can also create a role 'Shared question user':
* 'mine' means only questions created by you.


=====moodle/question:editmine / editall=====
* log in as an admin
* go to Administration > Users > Permissions > Define roles
* click on Add New Role button
* define a new Role Shared question user
* give the role these question permissions :
** [[Capabilities/moodle/question:viewall|moodle/question:viewall]]
** [[Capabilities/moodle/question:useall|moodle/question:useall]]


Controls whether a user can :
Assign the role at the system level to give the user the 'Shared question user' /  'Shared Question Creator' permissions in the System context and in all the Course Categories. The user will also have the same permissions in all courses and activities unless you override the permissions at these levels for any of the roles the user has (eg. Teacher / Student etc) a 'prevent' at a lower context level will override an allow at the system or course category level. You assign a role at the system level by going to Administration > Users > Permissions > Assign global roles.


* edit their own / someone else's question.
You can also assign a role at the course category level by going to Administration > Courses > Add/edit courses and clicking on one of the course category names and then clicking on the Assign Roles link to the top right of the screen. The role will apply to all contained course categories and also to all courses / activities contained.
* delete their own / someone else's question.


=====moodle/question:viewmine / viewall=====
===Random Questions Selecting from Subcategories===


Controls whether a user can see all of their own / someone else's question. This is different to 'use' which only allows you to preview a question. If you can 'view' that means you can see all the questions answers and it means you can :
[[Image:randomquestionenvironmentcheck.jpg|thumb|Screen shot of problems reported in environment check upgrading to 1.9]]


* save as new question
* export questions in the category


=====moodle/question:usemine / useall=====


Controls whether a user can :
Normally upon upgrade questions that are shared are moved to a category in the system context. Questions that are not shared are kept in the course context.


* include their own / someone else's question in an activity (currently only the quiz activity).
In the following special case this is not true and the sharing status of some questions may have been changed :
* preview a question


* You have some random questions in your quizzes which are selected from sub categories.
* AND the sub categories the random questions are selected from have a different 'shared' status to any of the sub categories. Eg. you have a random question in a category that is not shared and some of the sub categories you are selecting from are not shared. OR you have a random question in a category that is shared and some of the sub categories you are selecting from are shared.


=====moodle/question:movemine / moveall=====
There is a special check for this case in the environment check code and a special admin report for checking this.


Controls moving of questions to another category. You must have permission to do this both in the context you are moving the question from and you must have the 'add' capability in the context you are moving the question to.
When a random question as above is found in the question bank then :


====Upgrade====
* all sub categories below the random question are set to the same 'shared' status as the category the random question is in.
* if there is another random question in one of the sub categories it is ignored, all sub categories are set to the same status.


On upgrade from an older version of Moodle question capabilities are automatically assigned.
Questions already included in quizzes will continue to work as before.


Roles that previously had the moodle/question:manage capability will have :
There is an environment check to check for possible problems with 'Random Questions Selecting from Subcategories'. See screen shot.


* moodle/question:add
[[Image:randomquestionadminreport.jpg|thumb|Screen shot of questions admin report reporting problems with random questions.]]
* moodle/question:editmine / editall
* moodle/question:viewmine / viewall
* moodle/question:usemine / useall
* moodle/question:movemine / moveall


This will give them effectively the same permissions as they had previously for questions shared at the course level.
More information about the issue on your system is available in Admin / Reports / Question, this is linked to from the environment check message when a problem is detected. Environment checks and the question admin report have been backported to the latest version of MOODLE_18_STABLE.


====Potential Issues on Upgrade====
==More info about changes in Moodle 1.9 can be found on these pages==
 
Questions that are shared above the course level may not be available to course teachers. Normally the teacher role is assigned at the course level so the teacher's capabilities will only cover the course in which they are assigned the teacher role. You must define a new role and assign all users that you want to be able to share questions above the course level that role. You do this by :


* log in as an admin
* [[Question permissions explained with diagrams]]
* go to Administration > Users > Permissions > Define roles
* [[How to let teachers share questions between courses]]
* click on Add New Role button
* [[Question bank]]
* define a new Role Shared Question Creator
* [[Question categories]]
* give the role these question permissions :
* [[Question contexts]]
** moodle/question:add
* [[Question permissions]]
** moodle/question:editmine / editall
* [[Question reports]]
** moodle/question:viewmine / viewall
* [[Questions linking to files]]
** moodle/question:movemine / moveall
* [[Quiz submission email notification]]
* and probably also :
** moodle/question:usemine / useall


You can also create a role 'Shared question user':
The following permissions are new in Moodle 1.9 (they replace moodle/question:manage, giving more control over exactly what someone can do) :


* log in as an admin
* [[Capabilities/moodle/question:add|moodle/question:add]]
* go to Administration > Users > Permissions > Define roles
* [[Capabilities/moodle/question:editmine|moodle/question:editmine]] / [[Capabilities/moodle/question:editall|editall]]
* click on Add New Role button
* [[Capabilities/moodle/question:viewmine|moodle/question:viewmine]] / [[Capabilities/moodle/question:viewall|viewall]]
* define a new Role Shared question user
* [[Capabilities/moodle/question:usemine|moodle/question:usemine]] / [[Capabilities/moodle/question:useall|useall]]
* give the role these question permissions :
* [[Capabilities/moodle/question:movemine|moodle/question:movemine]] / [[Capabilities/moodle/question:moveall|moveall]]
** moodle/question:add
** moodle/question:editmine / editall
** moodle/question:viewmine / viewall
** moodle/question:movemine / moveall
* and probably also :
** moodle/question:usemine / useall


Assign the role at the system level to give the user the 'Shared question user' /  'Shared Question Creator' permissions in the System context and in all the Course Categories. The user will also have the same permissions in all courses and activities unless you override the permissions at these levels for any of the roles the user has (eg. Teacher / Student etc) a 'prevent' at a lower context level will override an allow at the system or course category level. You assign a role at the system level by going to Administration > Users > Permissions > Assign global roles.
And the following no longer exist :


You can also assign a role at the course category level by going to Administration > Courses > Add/edit courses and clicking on one of the course category names and then clicking on the Assign Roles link to the top right of the screen. The role will apply to all contained course categories and also to all courses / activities contained.
* [[Capabilities/moodle/question:manage|moodle/question:manage]]
* [[Capabilities/moodle/question:import|moodle/question:import]]
* [[Capabilities/moodle/question:export|moodle/question:export]]


=====Random Questions Selecting from Subcategories=====
[[de:Änderungen in Bezug auf Fragen in Moodle 1.9]]
[[ja:Moodle 1.9における問題エンジンの変更]]

Latest revision as of 12:06, 23 December 2008


Moodle1.9


General Clean Up of UI and Code

  • Many parts of the question code have been cleaned up. The Quiz / Question UI has some improvements - the category editing page's table has been replaced by unordered lists and the controls for editing categories have been improved.
  • Question code no longer relies on browser sessions. Before if you had more than one browser window open for editing a quiz / questions navigation would have been unpredictable now you can have several independent browser windows open at once to edit quizzes and questions.
  • Further work has been done on separating the question bank code from the quiz module to make it possible to access questions in the question bank from other modules.

Better Management of Files Linked to In Questions

Since Moodle 1.9 we have some automatic handling of files linked to from questions. When you move questions between sharing contexts and when you back up courses with questions in them, Moodle will now help you manage files linked to in your questions.

Separated Questions into Different Category Hierarchies in Different Context Levels

Before 1.9 questions were always associated with one course. You could 'share' a question to allow it to be visible in another course. Now questions can be shared in an activity, a course, a course category or with the whole system. These different levels of sharing are Moodle 'contexts'. More info here Question contexts

Upon upgrade :

  • a category that was shared will now be in the System context and it will have the course name from which it has been taken appended to the category name in brackets.
  • Questions that were not shared will be put in the course context upon upgrade.
  • The only exception to this is the special case outlined below in #Random Questions Selecting from Subcategories

More Granular Capabilities

Since Moodle 1.9 we have more granular capabilities for access and use of questions see Question permissions for more info. Question permissions are now tested in the context in which the questions are shared see Question contexts for more info.

Upgrade

On upgrade from an older version of Moodle question capabilities are automatically assigned.

Roles that previously had the moodle/question:manage capability will have :

This will give all users effectively the same permissions as they had previously for questions shared at the course level.

Potential Issues on Upgrade

Access to question categories shared outside a course

Questions that are shared above the course level may not be available to course teachers. Normally the teacher role is assigned at the course level so the teacher's capabilities will only cover the course in which they are assigned the teacher role. You must define a new role and assign all users that you want to be able to share questions above the course level that role. You do this by :

You can also create a role 'Shared question user':

  • log in as an admin
  • go to Administration > Users > Permissions > Define roles
  • click on Add New Role button
  • define a new Role Shared question user
  • give the role these question permissions :

Assign the role at the system level to give the user the 'Shared question user' / 'Shared Question Creator' permissions in the System context and in all the Course Categories. The user will also have the same permissions in all courses and activities unless you override the permissions at these levels for any of the roles the user has (eg. Teacher / Student etc) a 'prevent' at a lower context level will override an allow at the system or course category level. You assign a role at the system level by going to Administration > Users > Permissions > Assign global roles.

You can also assign a role at the course category level by going to Administration > Courses > Add/edit courses and clicking on one of the course category names and then clicking on the Assign Roles link to the top right of the screen. The role will apply to all contained course categories and also to all courses / activities contained.

Random Questions Selecting from Subcategories

Screen shot of problems reported in environment check upgrading to 1.9


Normally upon upgrade questions that are shared are moved to a category in the system context. Questions that are not shared are kept in the course context.

In the following special case this is not true and the sharing status of some questions may have been changed :

  • You have some random questions in your quizzes which are selected from sub categories.
  • AND the sub categories the random questions are selected from have a different 'shared' status to any of the sub categories. Eg. you have a random question in a category that is not shared and some of the sub categories you are selecting from are not shared. OR you have a random question in a category that is shared and some of the sub categories you are selecting from are shared.

There is a special check for this case in the environment check code and a special admin report for checking this.

When a random question as above is found in the question bank then :

  • all sub categories below the random question are set to the same 'shared' status as the category the random question is in.
  • if there is another random question in one of the sub categories it is ignored, all sub categories are set to the same status.

Questions already included in quizzes will continue to work as before.

There is an environment check to check for possible problems with 'Random Questions Selecting from Subcategories'. See screen shot.

Screen shot of questions admin report reporting problems with random questions.

More information about the issue on your system is available in Admin / Reports / Question, this is linked to from the environment check message when a problem is detected. Environment checks and the question admin report have been backported to the latest version of MOODLE_18_STABLE.

More info about changes in Moodle 1.9 can be found on these pages

The following permissions are new in Moodle 1.9 (they replace moodle/question:manage, giving more control over exactly what someone can do) :

And the following no longer exist :