Issue Details (XML | Word | Printable)

Key: MDL-13551
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Joseph Rézeau
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

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

Created: 20/Feb/08 11:18 PM   Updated: 22/Feb/08 07:45 AM
Return to search
Component/s: Questions
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

Participants: Joseph Rézeau and Tim Hunt
Security Level: None
Resolved date: 22/Feb/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_17_STABLE, MOODLE_18_STABLE


 Description  « Hide
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

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt added a comment - 21/Feb/08 02:59 AM
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.


Joseph Rézeau added a comment - 21/Feb/08 03:13 AM
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

Tim Hunt added a comment - 22/Feb/08 05:17 AM
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.

Tim Hunt added a comment - 22/Feb/08 07:36 AM
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.

Joseph Rézeau added a comment - 22/Feb/08 07:45 AM
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