Closed (duplicate)
Project:
Quiz
Version:
7.x-4.x-dev
Component:
Code - Quiz core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Mar 2013 at 11:44 UTC
Updated:
24 May 2016 at 19:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sokrplare commentedRealized I need to check if the time_end is still zero or not, otherwise I get access denied every time.
Also noticed the
$queryvariable was never used :)Here is the patch with the changes made.
Comment #2
michaelk commentedThe current patch is fundamentally broken. It incorrectly blocks uses from taking a quiz when they have 1 attempt remaining.
Comment #3
michaelk commentedI was using the incorrect patch file. The patch in http://drupal.org/node/1937226#comment-7175824 works well.
Comment #4
sivaji_ganesh_jojodae commentedI reviewed your patch. Thanks for sharing it.
Actually these set of lines are already there in quiz_start_check(), not sure if redundant check and redundant lines are needed. Perhaps those lines need to be removed from quiz_start_check() and should be retained in quiz_availability(). Because in quiz_take_quiz(), call to quiz_availability() is made a few lines after quiz_start_check(). I would need some more time to test this. In the meantime would like to hear early feedback.
Comment #5
michaelk commentedI did notice one small issue with the patch from https://drupal.org/node/1937226#comment-7175824
$user_is_admin is not defined until after it is checked in the new patched code, and the admin case is denying access instead of displaying the message and giving access when the admin has taken the quiz.
I have attached a patch that addresses these issues.
Comment #6
bohemier commentedThis patch needs to be redone against current dev version. But essentially, it works fine.
We should consider committing it as the current version is broken for quizzes that cannot be taken anymore - It shows the Take button as well as the Take menu when it should not.
thanks!
Comment #7
bohemier commentedIt also fixes this issue since the take quiz links are correctly hidden when not available: https://drupal.org/node/2152295
Comment #8
czigor commentedHere's my go at the problem.
The uncommented line was commented out in 693a36cd59401c0745fe0c9de8571c406a3af28b the commit message of which says:"Fixed php notices in take page when no questions added to quiz." Removing the comment slashes did not induce any php notices for a quiz without questions so I guess it should be OK.
Comment #9
czigor commentedThe patch also solves #2152295: Undefined index :quiz_26.
Comment #10
czigor commentedPatch is not good. If the line is not commented out, one cannot take quizzes with unlimited number of views.
Comment #11
czigor commentedDigging deeper into the logic of the beginning of quiz_take_quiz(). Although there are two points I don't really understand I came up with a patch.
These points are:
quiz_start_check($quiz, $rid) && (_quiz_take_quiz_init($quiz) === FALSE)condition was meant to do.Comment #12
djdevin@czigor, are you still using your patch? There's no automated tests on 4.x so if you can verify it works, I'll add it to 4.x and mark it as a todo for 5.x.
Comment #13
czigor commentedYes, I am using the patch.
Comment #14
falcon commentedSeems we need a patch here that merges all the patches and makes sure that it doesn't produce redundant code.
Comment #15
yce commentedHi! I've recreated the patch for the latest dev version.
Comment #16
djdevin#2281825: quiz_start_check and quiz_availability are near duplicates