Restrict adding / editing of questions of a specific type to selected Moodle users

Restrict adding / editing of questions of a specific type to selected Moodle users

by Przemek Kaszubski -
Number of replies: 5
Picture of Particularly helpful Moodlers Picture of Testers

Hello,

We're seeking a way to limit the possibility to create / add / edit questions of a specific type (actually the "CodeRunner" type) only to some users - e.g. as grouped by cohort or a system role - or perhaps to restrict such access only to courses in a specific course category.

Is any of this possible? Any advice or suggestions?

Thanks in advance,

Przemek

Average of ratings: -
In reply to Przemek Kaszubski

Re: Restrict adding / editing of questions of a specific type to selected Moodle users

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There is not currently a way to do this.

What you can do is go to Admin -> Plugins -> Question types -> Manage question types, and enable and disable question types for everyone.

When I implemented that (many years ago), I did think: "should we make this be controlled by a capability, so you can give permission for some people to use a question type, but not others." But then I thought "No, that would be too complicated". But subsequently, we have seen capabilities like mod/quiz:addinstance, and block/html:addinstance introduced for exactly this sort of purpose for other plugin types. So, we could re-consider whether to use this pattern for question types too, but someone would have to implement it.

So, there is not currently a way to do this. Sorry.
In reply to Tim Hunt

Re: Restrict adding / editing of questions of a specific type to selected Moodle users

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
Thank you, Tim.
Yes, capabilities would be ideal. Maybe one day someone will take the challenge. I might add an improvement tracker for that.

In my case I might yet try to fidget with CSS to get this question type to hide conditionally – as a workaround hack. We’ll see.
In reply to Przemek Kaszubski

Re: Restrict adding / editing of questions of a specific type to selected Moodle users

by James Pearce -
Hi, was anything added to the improvement tracker for this? I have almsot the exact same issue so would like to see if any development is happening for this.

Thanks
In reply to James Pearce

Re: Restrict adding / editing of questions of a specific type to selected Moodle users

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I am fairly sure that such a ticket does not exist. It is a nice idea.
In reply to Marcus Green

Re: Restrict adding / editing of questions of a specific type to selected Moodle users

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
No, sorry, I have not yet managed to add an immprovement ticket for this.