Which capability should control access to the quiz Manual grading 'report'

Which capability should control access to the quiz Manual grading 'report'

by Tim Hunt -
Number of replies: 10
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There are two plausible answers to that question

  1. mod/quiz:viewreports
  2. mod/quiz:grade

Which do you think makes most sense?

I think it should be mod/quiz:grade. Indeed I just confidently told one of my colleagues that is how it works, and we tried it, and found that I was wrong.

At the moment:

  • If you have both capabilities, then everything works fine. You can access all the three quiz reports Grade, Responses and Manual grading.
  • If you have mod/quiz:viewreports, but not mod/quiz:grade, the you see Grade, Responses. You can see the Manual grading link in the Navigation, but when you click it you get a fatal error. (Oops!)
  • If you have mod/quiz:grade, but not mod/quiz:viewreports then you don't see any of the three report links in the navigation.
  • If you have neither mod/quiz:grade, nor mod/quiz:viewreports then you don't see any of the three report links in the navigation.

(In case you are wondering, there is a separate capability 'quiz/statistics:view' for accessing the statistics report.)

So, I think the way it should work is

  • mod/quiz:viewreports controls access to the Grade and Responses reports.
  • mod/quiz:grade controls access to the Manual grading report.

In addition, I think the current behaviour should be considered a bug, and so we should fix this on stable branches. MDL-38557

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Which capability should control access to the quiz Manual grading 'report'

by Stephan Goeldi -

Hi Tim,

I'm not sure, if there is a link between this Question and my problem. Since we updated to 2.4.3 I miss the point "manually grade" in the navigation, even I logged in as administrator (see screenshot).

Greetings

Stephan

Attachment image_2013_3_28_0.jpg
In reply to Stephan Goeldi

Re: Which capability should control access to the quiz Manual grading 'report'

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 should not happen.

Possible causes:

  • When you upgraded, some files did not copy to the server. Check that the mod/quiz/reports folder on the server contains 4 subfolders grading, overview, responses and statistics.
  • Use phpMyAdmin (or similar tool) to check that the mdl_quiz_reports table lists all the reports.
  • Use Check permissions in the settings block the check that the right uses have all the relevant capabilities. (But since you see the problem as admin, that can't be it in your case.)
In reply to Tim Hunt

Re: Which capability should control access to the quiz Manual grading 'report'

by Stephan Goeldi -

Thanks for your reply...

I can see this issue also in my test instance, were I updated yesterday to moodle 2.4.3+.

The directory mod/quiz/report contain all four folders grading, overview, responses and statistics (and there are not emptysmile ).

If I manipulate the URL to: /mod/quiz/report.php?id=1271&mode=grading the manual grading is avaiable. And in this case the Manual Grading is visible in the navigation menu.

Navigation

 

So it seems, that it only not showing up in the navigation. In the table (I use PostgreSQL) mdl_quiz_reports I can see:

Table mdl_quiz_reports

I 've also tried to exchange the NULL with e. g. quiz/statistics:view, but with no reaction.

 

In reply to Stephan Goeldi

Re: Which capability should control access to the quiz Manual grading 'report'

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 all looks right, so I don't know why it is not working.

I just checked on my 2.4.x install, and it is right there, so it must be something specific to your server.

In reply to Tim Hunt

Re: Which capability should control access to the quiz Manual grading 'report'

by Stephan Goeldi -

Hi Tim,

hmm. Thank you for the test, but I think it is a Moodle problem, because I've the same issue on totally different moodle servers.

1. our Moodle in the School, with own theme, different plugins and ...

2. a test moodle, really plain without any plugins and standard themes.

both run on a debian server with postgreSQL and both are updated several times (1. from 1.8 ... and 2. was first a 2.2), This issue starts with the update to 2.4.3

any idea, where I can dig deeper?

In reply to Tim Hunt

Re: Which capability should control access to the quiz Manual grading 'report'

by Joshua Bragg -

@Tim

Isn't this the same thing as MDL-38442 and MDL-38458?

If you look at his first screenshot, it looks like Stephan has the navigation block set to generate navigation for Categories and Courses.

I have the some problem in my 2.4.3+ installation.

In reply to Joshua Bragg

Re: Which capability should control access to the quiz Manual grading 'report'

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes. Well found Joshua.

In reply to Joshua Bragg

Re: Which capability should control access to the quiz Manual grading 'report'

by Stephan Goeldi -

Wow, yes it the same thing! I just put the code from MDL-38442 in mod/quiz/lib.php and lib/navigationlib.php and now it works until the fix is ready through an update.

Thanks Tim and Joshua for your help. I was searching the forum and the moodle-tracker, but I didn't found the right issue...

In reply to Tim Hunt

Re: Which capability should control access to the quiz Manual grading 'report'

by Douglas Broad -

Tim: Since it doesn't appear you've got an answer yet, I guess it would depend on the levels of access you want.  I agree with your initial thought that mod/quiz:grade should be enough.  That setting should allow viewing and grading.  Who would use the mod/quiz:viewreports?  Would that be auditors?  I would assume supervisors and site administrators would have grade change ability.

In reply to Douglas Broad

Re: Which capability should control access to the quiz Manual grading 'report'

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Actually, I do think I got an answer, that the proposed change was a good one, and should be integrated. It has been. MDL-38557 is fixed.