Moodle

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

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: DEV backlog
  • Component/s: Quiz
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE

Issue Links

Activity

Hide
Oleg Sychev added a comment -

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).

Show
Oleg Sychev added a comment - 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).
Hide
Oleg Sychev added a comment -

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.

Show
Oleg Sychev added a comment - 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.
Hide
Tim Hunt added a comment -

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.

Show
Tim Hunt added a comment - 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.
Hide
Oleg Sychev added a comment -

"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.

Show
Oleg Sychev added a comment - "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.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: