examining present capabilities for questions

examining present capabilities for questions

by Jamie Pratt -
Number of replies: 23
Am reviewing the use of capabilities for questions. Will propose some new capabilities later in this thread.

I hope this is the correct place to post about the questions code. Maybe we should have a separate forum for this code at some point.

I was thinking I could redirect the stub pages on Moodle docs for these capabilities to one overview page of all question capabilities with links to anchors for each capability and a short description of the capability. What do people think? The current pages that the moodle code links to are not very helpful.

So we now have the following capabilities in the question code :

moodle/question:managecategory

This is a capability that presently controls :
  • adding, editing and moving of categories.
  • moving questions between categories from the Question Bank front page using the 'Move to' button. But doesn't control changing categories from the individual edit question pages.
  • it controls display of the drop down box for adding questions to the question bank. But if you enter the url directly to add a question to the question bank then you can still add a question.
Maybe it would be better to just make this capability just about adding / editing categories.

I'll post further in this thread with info on other capabilities.
Average of ratings: -
In reply to Jamie Pratt

Re: examining present capabilities for questions

by Jamie Pratt -

moodle/question:manage


  • Controls who can preview a question.
  • Controls editing of question in individual question editing pages.
  • Controls access and management of list of rqp question types (capability must be available at system level).

In reply to Jamie Pratt

Re: examining present capabilities for questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Adding and moving question to/between a category you have access to should be controlled by question:manage always, not by question:managecategory.

Preview should become controlled by the proposed question:usequestion.

RQP is getting replaced. Don't worry about it.


And I normally discuss question stuff in the quiz forum, which is a historical thing. I suppose questions might be better in theri own forum one day.
In reply to Jamie Pratt

Re: examining present capabilities for questions

by Jamie Pratt -

moodle/question:import


Controls import of questions.

I found in the import script display of what categories questions can be imported into is controlled again by question:managecategory. But this is just the displayed categories. You could get the import script to import questions anywhere with some web skills, possibly even in another course than the one you have permissions for.

In reply to Jamie Pratt

Re: examining present capabilities for questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't think question:managecategory should be involved at all. It should just be: do you have question:import for the context that the question category is attached to.
In reply to Tim Hunt

Re: examining present capabilities for questions

by Jamie Pratt -
I agree about managecategory. I think it makes sense for it to be only about editing / moving categories not category contents.
In reply to Jamie Pratt

Re: examining present capabilities for questions

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That's just a programming error surely? If you impose some check on the display of a form, then you need to impose exactly the same check on the user's response.

Sorry for the Grandmother/Sucking Eggs reference smile
In reply to Jamie Pratt

Re: examining present capabilities for questions

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jamie,

Regarding an overview page of all question capabilities, please see docs.moodle.org/en/Question_permissions. It's just a start and is awaiting further contributions. wink
In reply to Helen Foster

Re: examining present capabilities for questions

by Jamie Pratt -
Hi Helen,

Thanks for your response.

Do you think it would be a good idea to add descriptions of capabilities to :

docs.moodle.org/en/Question_permissions.

and redirect pages like this :

http://docs.moodle.org/en/Capabilities/moodle/question:export

To the overview page.

From mediawiki help :

A redirect is a page with no content other than:

#REDIRECT pagename

Jamie

In reply to Jamie Pratt

Re: examining present capabilities for questions

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Jamie,

If question capabilities pages are redirected, then the page docs.moodle.org/en/Category:Capabilities would no longer be a complete listing of all capabilities. mixed

Please feel free to add descriptions of capabilities wherever you wish, as the information can always be moved/re-organised later. wink

PS. Moving this discussion to the Quiz module forum, as suggested by Tim...
In reply to Jamie Pratt

Re: examining present capabilities for questions

by Pierre Pichet -
About moving question to another category.
This should not be done by only changing the category parameter in the question database table but by asking each questiontype to do the moving as always the calculated questiontype illustrates the needs of complex questions (present and future...)
There is a need to a can_be_moved_to_category() and move_to_category() functions in question_type to handle moving correctly.

Pierre


In reply to Jamie Pratt

new capabilities for questions

by Jamie Pratt -
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.
In reply to Jamie Pratt

Re: new capabilities for questions - groups

by Jamie Pratt -
I'm not sure how groups should work here but I imagine it would be nice to have a group activity where students are put in groups and asked to work on some questions together. This might work in tandem with a forum activity where the students have their own group forum to discuss the questions they are creating.

The group stuff could be left till later unless we can think of a nice way of having it work now.


In reply to Jamie Pratt

Re: new capabilities for questions - simplified UI

by Jamie Pratt -
Although there are plans underway to simplify roles and permissions settings I imagine that many teachers are going to stay away from the 'roles' tab altogether when setting up activities. I think it might be good in the 'update activity' form to have a fieldset with a few simple options in it of permissions to assign to students for this assignment. If the teacher does use the 'roles' tab for more detailled set up then the simpler options could be greyed out (disabled) in the activity set up form with a checkbox letting the user turn back on the simpler interface and override the roles settings.
In reply to Jamie Pratt

Re: new capabilities for questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That looks brilliant to me. You've clearly thought about this carefully, and I have nothing to add to your conclusions.

However, do message Martin D, and make sure he sees this. I know that when they were inventing the roles, they decided to go for a single manage capability, rather than separate add/edit/delete. I think that was a tradeoff of simpler configuration that is good enough for most people, instead of maximum flexibility. I'm not sure that I would have made the same decision, but it was not up to me, and as I said, it is a trade-off. However, for the question bank, I think we need that flexibility.

The stuff with groups is unprecidented in Moodle, but with obvious parallels with Unix file systems. Again, I think we want that flexibility, although we have to remember that people can be in more than one group, and can be in different groups in different contexts.
In reply to Jamie Pratt

Re: new capabilities for questions

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
They look good to me too, but yes as Tim mentioned, we thought the difference between edit / delete is minimal enough to ignore. I think separating them only makes sense to programmers, not teachers.

If you can edit something you can change it completely, so you've effectively deleted it and added a new one. And does it ever make sense to be allowed to add something and then not edit or delete it? Or to delete things and not be able to add or edit?

In the interests of keeping the GUI shorter and consistent I'd recommend "manage" to cover all three cases, unless there are some serious scenarios that need them separate. It's easy to "split" them later, that's the beauty of capabilities.
In reply to Martin Dougiamas

Re: new capabilities for questions - usage scenarios

by Jamie Pratt -
I think you have a good point about the seperate edit / delete capability. They could certainly be combined.

But I'm not sure whether the benefits of keeping the capabilities simple outweigh the benefits of the increased flexibility of the other capabilities proposed. I'm thinking mainly of the Question Creation as a Student Activity module. Then for example questions in a context only accessible to that module could :

  • have control over whether a student can preview other students attempts and / or can save as new to base a question upon a question another student created. A teacher might want to allow that but would never probably want to allow a student to edit/delete another students questions.
  • have some question be created by a teacher but have students be able to 'save as new' these seed questions by the teacher and questions their co-students have written to create similar questions.
  • have students be able to add questions to the context but not edit or delete their questions. You might want to control whether students can redraft questions. This way you can also comment and grade questions as you go along instead of waiting to freeze question editing and then comment and grade.
To simplify the setting up of capabilities for the activity for the teacher I'm thinking that we would have a fieldset in the update activity form with possibly the following options :
  • Student access to others questions :
    • none
    • preview
    • saveasnew
  • Student acccess to own questions :
    • none
    • preview
    • saveasnew
    • edit/delete
But also we probably want :

  • Students to always have access to add questions in the modules context.
  • teachers to be able to do anything.


These options would be disabled if the teacher has been into the roles tab and the roles and capabilities set do not correspond to any combination of these two options. The options would be set to some suitable default when an activity is first created and might be hidden by the setadvanced button.

I'm thinking also we could have another set of capabilities outside the open times of the activity which the module context questions will have set by cron when the activity is no longer open.

Let's see what the reaction is to this post. Maybe I'm making things too complicated.
In reply to Jamie Pratt

Re: new capabilities for questions - usage scenarios

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
My only wish is to keep things as simple as possible (I don't want to restrict functionality if people really want it). I trust you, Tim and others interested in quizzes to flesh out the capabilities here appropriately.

However, just as a thought-point, there probably needs to be a distinction made between the mod/question:xxx capabilities and the moodle/question:xxx capabilities.

I don't have a very deep understanding of the module yet, but I assume the activity module would have special capabilities directly related to the workflows planned there (like you are describing above) ... whereas the question database itself would be basic capabilities related to editing and categorising the questions.
In reply to Martin Dougiamas

Re: new capabilities for questions - usage scenarios

by Jamie Pratt -
These capabilities I'm discussing would all be moodle/question capabilities. I think that this is the way to control what users can do with the questions database.

The student question creation module would give the student an interface to the question bank similar to the interface in the quiz. Instead of listing the questions in the quiz on the left side of the screen the student creation module would list questions created by a student. The module would be responsible for recording the teachers comments and grades.


In reply to Jamie Pratt

Re: new capabilities for questions - usage scenarios

by Jamie Pratt -
There has been some discussion of these kind of issues by some keen Moodle users here.