Guys, I've several fixes in this patch, can you please review

  1. True/False Question bug accessing undefined array index
  2. Use of incorrect permissions in multiple places
  3. a rare case when a user creates question with max score of zero, which cause a division by zero then an error
  4. quiz_update_quiz_question_relationship database calls needed fix, all questions were deattached from module when module updates to new revision
  5. Quiz with random questions from a set were giving an error

I'm building a site the relies heavily on Quiz Module, I'll be going live in a couple of weeks and expecting a high traffic, i will be submitting all my patches

please let me know if there is a better way to help you guy with this port

CommentFileSizeAuthor
#14 quiz_1467754_2.patch6.07 KBzoo33
quiz.patch5.63 KBamagdy

Comments

amagdy’s picture

How can i bring the maintainers attention to my post ?

Sabareesh’s picture

Hi amagdy,

The best way to grab the attention of the maintainers is to visit http://drupal.org/project/quiz and on the right side 'Maintainers for Quiz' section you can see a list of developers. You can view their personal details and send them a mail about extending your help for module development.
According to me you have done enough to get the attention from the maintainers. By the way your patch works fine once again:)

joemaine’s picture

...will this patch resolve the issue in http://drupal.org/node/1480128

amagdy’s picture

Yes, it should fix the issue at http://drupal.org/node/1480128
but the patch may be out of data, as there is new dev release out...

joemaine’s picture

The patches appeared to be against the most recent dev release on the site (2012-Mar-03). I applied them and they seem to be working...at least I'm not receiving the PDOException. I hope the code/patch is in the next release.

Special Thanks amagdy!

zuernbernhard’s picture

there is a small mistake in the patchfile (git complains on patching because one header is missing) but as a far s i only use the multiplechoice question type it works anyway afterwards

jaroslaw.kaminski’s picture

Same problem:

 patch -p1 < quiz.patch
patching file question_types/multichoice/multichoice.classes.inc
patching file question_types/quiz_question/quiz_question.module
Hunk #1 FAILED at 97.
1 out of 1 hunk FAILED -- saving rejects to file question_types/quiz_question/quiz_question.module.rej
patching file quiz.module
amagdy’s picture

The patch failed due to the difference between the release you have and the dev release that patch was coded against.

I don't have time to generate a new patch; sorry.

ludo.r’s picture

So this patch doesn't work with current dev version? (7.x-4.x-dev 2012-Mar-03)

Anonymous’s picture

It should work against the dev version of march 3rd 2012, but the GIT version has changes that conflict with the patch.
Solution would be to patch that file manually or wait for the next release.

@amagdy: thanks for sharing!

ludo.r’s picture

Actually when I patch the module through Netbeans, it only applies to one file, but the others are skipped.

I don't know if I can patch them manually, since I don't know what changes have been made since the previous dev release.

Anonymous’s picture

If you apply the patch from the commandline it should patch the first, reject the second and continue with the rest of the patches.
Since I'm currently working on some other minor bugfixes for my local version I can't create a patch for you.

I must say that the patch isn't extremely big you should be able to get the patches implemented by opening the patch file and searching for the changed lines (notice the minus sign in front of the line) and updating the with lines (plus signs in front of those lines).

JoDa’s picture

Hi there,
please look here for manual patching. It works, if you are careful.

zoo33’s picture

StatusFileSize
new6.07 KB

I've rerolled the patch against the latest -dev. It definitely makes a couple of errors go away. Haven't looked closely at the changes, but it seems like it should probably be committed.

klausi’s picture

Status: Needs review » Needs work
+++ question_types/quiz_question/quiz_question.module
@@ -97,15 +97,16 @@ function quiz_question_node_access($node, $op, $account) {
-      if (user_access('edit any quiz', $account) || (user_access('edit own quiz', $account) && ($account->uid == $node->uid))) {
+      if (user_access('edit any quiz content', $account) ¶

trailing white space

+++ quiz.module
@@ -3048,7 +3046,8 @@ function _quiz_resume_existing_quiz($quiz, $uid, $rid) {
-        if (!in_array($question['vid'], $already_answered) && $question['random'] === TRUE) {
+      	// checks if question[random] is set
+      	if (!in_array($question['vid'], $already_answered) && isset($question['random']) && $question['random'] === TRUE) {

use spaces for indentation.

Sherbet’s picture

Can you create a working patch out of it then klausi ? Current patch (#14) gives errors...

amagdy’s picture

I'll be updating my live to use the latest dev release this week, I'll generate a new patch and share it with you guys

p.s. I'm the author of the original patch

ludo.r’s picture

Ok, thank you for sharing. I look forward for this patch.

Sherbet’s picture

As am I, Quiz is quite a crucial part of my website as well.

falcon’s picture

Status: Needs work » Fixed

Patch has been commited. Thanks!

ludo.r’s picture

Great!

Thanks to all of you!

amagdy’s picture

Fixes are includes in the latest Dev release ...

i recommend you use it

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 9c4397e on 7.x-4.x, 7.x-5.x by falcon:
    #1467754 by amagdy: Multiple fixes
    
    

  • Commit 9c4397e on 7.x-4.x, 7.x-5.x, quiz-pages by falcon:
    #1467754 by amagdy: Multiple fixes
    
    

  • Commit 9c4397e on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by falcon:
    #1467754 by amagdy: Multiple fixes
    
    

  • Commit 9c4397e on 7.x-4.x, 7.x-5.x, 2269219 by falcon:
    #1467754 by amagdy: Multiple fixes