Issue Details (XML | Word | Printable)

Key: MDL-20764
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Tim Hunt
Reporter: Tim Hunt
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

In quiz attempt.php, call to $accessmanager->prevent_access() shoud pass arguments

Created: 06/Nov/09 08:02 PM   Updated: Saturday 08:35 PM
Return to search
Component/s: Quiz
Affects Version/s: 2.0
Fix Version/s: 2.0

Issue Links:
Blockers
 

Participants: Oleg Sychev and Tim Hunt
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Oleg Sychev added a comment - 09/Nov/09 03:37 AM
It seems that current Moodle 2.0 quiz structure preventing sort of optimisation for MDL-6340 where we get list of attempts and number of attempts in one db query.

The reason is that number of attempts is recieved by a free quiz_get_latest_attempt_by_user() function, which is unrelated with quiz class, and cannot add a list of attempts to it (to become $cmoptions member later, in get_question_states call).


Oleg Sychev added a comment - 21/Nov/09 02:29 AM
There are another problem with access control in the HEAD: when teacher trying to start preview using button IP restrictions are applied (while starting preview using tab works). Old politics was that preview ins't restricted by IP.

Tim Hunt added a comment - 21/Nov/09 04:07 PM
I intentionally changed the preview button, so the way it worked for teachers is closer to how it works for students. As you say, the tab is still there.

Feel free to change the $accessmanager->prevent_access() API in the patch for MDL-6340, if that makes things easier.


Oleg Sychev added a comment - 21/Nov/09 08:35 PM
"Feel free to change the $accessmanager->prevent_access() API in the patch for MDL-6340, if that makes things easier."

I'm afraid what really need to change is a call to quiz_get_latest_attempt_by_user(), which should be replaced by a call of new function (probably should be member of quiz class), something like get_previous_attempts_by_user(). Is this OK?

We still waiting for you approval of random question code in patch for MDL-6340, before creating a patch for 2.0. This part is more complex and significant.