Moodle

preview question capability wrongly denied to student who has moodle/question:manage capability

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4
  • Fix Version/s: 1.7.5, 1.8.5
  • Component/s: Questions
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE

Description

Using Moodle 1.8.4
In one of my courses I need to give students moodle/question:manage capability so they can author their own questions.
They can indeed access Questions from the Admin block, they can create and edit questions, but they are denied access to Preview questions, which is not logical.
Diagnostic: wrong test in file /question/preview.php lines 44 & seq.
// this might break things in the future
if (!isteacherinanycourse()) { error('This page is for teachers only'); }
Whoever wrote that comment was right: it does break things for me!
I urgently need this to be fixed (simply remove the obnoxious lines) and committed to 1.8 STABLE, as I need it to work for my next class on Friday, Feb. 22nd. (our Admin accepts updating but is very reluctant to hack anything on our university moodle site).
Thanks,
Joseph

Activity

Hide
Tim Hunt added a comment -

I'm pleased to say this is already fixed in Moodle 1.9.

The difficulty for 1.8 is that if you are not previewing in a course, you don't know which course you are in. So in order to fix this, you would have to change every place where preview.php is linked to (4 places) to pass in the course id. Actually, that is not so bad, and since it is you Joseph, I'll do it.

Show
Tim Hunt added a comment - I'm pleased to say this is already fixed in Moodle 1.9. The difficulty for 1.8 is that if you are not previewing in a course, you don't know which course you are in. So in order to fix this, you would have to change every place where preview.php is linked to (4 places) to pass in the course id. Actually, that is not so bad, and since it is you Joseph, I'll do it.
Hide
Joseph Rézeau added a comment -

Tim > since it is you Joseph, I'll do it.
I'm glad I'm me! Thanks in advance, Tim! PLease keep me posted when it's done.
Joseph

Show
Joseph Rézeau added a comment - Tim > since it is you Joseph, I'll do it. I'm glad I'm me! Thanks in advance, Tim! PLease keep me posted when it's done. Joseph
Hide
Tim Hunt added a comment -

Arrgh! I nearly thought I had fixed this when I realised that I was not taking into account the stupid publish question sharing thing. And I have to go out now. I really hope I get time to work on this later. Sorry, I have been busy.

Show
Tim Hunt added a comment - Arrgh! I nearly thought I had fixed this when I realised that I was not taking into account the stupid publish question sharing thing. And I have to go out now. I really hope I get time to work on this later. Sorry, I have been busy.
Hide
Tim Hunt added a comment -

Fixed now. Still has to use isteacherinany course to cope with the published case, but it does not stop students with question:manage from previewing non-published questions within a course. Hopefully this is good enough. It is all that is possible in 1.8.

Show
Tim Hunt added a comment - Fixed now. Still has to use isteacherinany course to cope with the published case, but it does not stop students with question:manage from previewing non-published questions within a course. Hopefully this is good enough. It is all that is possible in 1.8.
Hide
Joseph Rézeau added a comment -

Great! Just in time for me to persuade my Admin to update tomorrow morning so I can have my students author questions in my class in the afternoon. Many thanks, Tim,
Joseph

Show
Joseph Rézeau added a comment - Great! Just in time for me to persuade my Admin to update tomorrow morning so I can have my students author questions in my class in the afternoon. Many thanks, Tim, Joseph

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: