These are my initial thoughts on new capabilities I'd like to add to the question code :
moodle/question:managecategory
Works as it should work now. Allows the management of category hierarchies ie. creating, editing and moving categories.
This capability would be tested at the module / course / course category / system level depending on the where the user is attempting to create/ edit and move 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 import of questions. I propose getting rid of the seperate import capability. I think the capabilities should be about what you can do with questions and import is just one way to add a question/questions to a question bank.
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 / group / all
All other capabilities are split into three types mine / group or all. So the permissions for what you can do with a question depend on whether the question was created by you, someone in a group you belong to or someone else.
- All means the capability allows you to act on all questions.
- Group means only questions created by people in the same group as you.
- Mine means only questions created by you.
If you have permission all then group and mine would not be tested. Similarly if you have permission group then mine is not needed.
moodle/question:editmine / editgroup / editall
Controls whether a user can edit their own / a member of one of their groups / someone else's question.
moodle/question:viewmine / viewgroup / viewall
Controls whether a user can see all of their own / a member of one of their groups / 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:deletemine / deletegroup / deleteall
Controls whether a user can delete their own / a member of one of their groups / someone else's question.
moodle/question:usemine / usegroup / useall
Controls whether a user can :
- include their own / a member of one of their groups / someone else's question in an activity (currently only the quiz activity).
- preview a question
moodle/question:movemine / movegroup / 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 the context you are moving the question to.