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
Line 143: Line 143:
[[Image:randomquestionenvironmentcheck.jpg]]
[[Image:randomquestionenvironmentcheck.jpg]]


====Questions admin report reports problems with random questions.====
====Screen shot of questions admin report reporting problems with random questions.====


[[Image:randomquestionadminreport.jpg]]
[[Image:randomquestionadminreport.jpg]]

Revision as of 03:15, 22 August 2007

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.

Seperated 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'. (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).

More Granular Capabilities

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 :

  • system level then it is normally inherited in the course category, course and activity contexts.
  • course category level then it is normally inherited in all the contained course categories, in the course and activity contexts.
  • course level then it is normally inherited in all activity contexts for activities in that course.

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.


moodle/question:managecategory

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.)


moodle/question:add

Controls :

  • the adding of questions to a category.
  • 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.

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.

  • 'all' means the capability allows you to act on all questions, your own questions included (so 'mine' is not tested if you have 'all').
  • 'mine' means only questions created by you.
moodle/question:editmine / editall

Controls whether a user can :

  • edit their own / someone else's question.
  • delete their own / someone else's question.
moodle/question:viewmine / viewall

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 :

  • save as new question
  • export questions in the category
moodle/question:usemine / useall

Controls whether a user can :

  • include their own / someone else's question in an activity (currently only the quiz activity).
  • preview a question


moodle/question:movemine / moveall

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.

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 :

  • moodle/question:add
  • 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.

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 :

  • 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 :
    • moodle/question:add
    • moodle/question:editmine / editall
    • moodle/question:viewmine / viewall
    • moodle/question:movemine / moveall
  • and probably also :
    • moodle/question:usemine / useall

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 :
    • 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.

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

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'. Below is a screen shot.

More information about the issue is available in Admin / Reports / Question. Environment checks will be backported soon and the question admin report has been backported to the latest version of MOODLE_18_STABLE.

Screen shot of problems reported in environment check upgrading to 1.9

randomquestionenvironmentcheck.jpg

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

randomquestionadminreport.jpg