When selecting Random Questions for a quiz and then starting the quiz you get the following error, seems like the db_query_range isn't updated for D7.

•    Warning: Missing argument 3 for db_query_range(), called in /Users/cjelger/Sites/ne.cj/public_html/sites/all/modules/contrib/quiz/quiz.module on line 3322 and defined i db_query_range() (rad 2345 av /Users/cjelger/Sites/ne.cj/public_html/includes/database/database.inc).
•    Notice: Undefined variable: count i db_query_range() (rad 2350 av /Users/cjelger/Sites/ne.cj/public_html/includes/database/database.inc).
•    PDOException: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound: SELECT child_nid as nid, child_vid as vid FROM {quiz_node_relationship} WHERE parent_vid = :parent_vid AND parent_nid = :parent_nid AND question_status = :question_status ORDER BY RAND() LIMIT 1, 0; Array ( ) i _quiz_get_random_questions() (rad 3322 av /Users/cjelger/Sites/ne.cj/public_html/sites/all/modules/contrib/quiz/quiz.module).
CommentFileSizeAuthor
#2 quiz-randomquestion-1480132-2.patch1.16 KBNoe_
#1 quiz.patch1.15 KBNoe_
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Noe_’s picture

FileSize
1.15 KB

I don't know if this works, however I did get promising results.

The thing is that I haven't really figured the quiz module out entirely (as in I haven't made a quiz yet).

Noe_’s picture

This one should be better.

falcon’s picture

Status: Active » Fixed

Thanks! Patch commited with some readability changes

Sivaji_Ganesh_Jojodae’s picture

Status: Fixed » Needs work

+ while ($question_node = $result->db_fetch_array()) {

This line needs fix.

  • Commit 64c5edf on 7.x-4.x, 7.x-5.x by falcon:
    #1480132 by Noe_ and falcon: Make quiz work with random questions
    
    

  • Commit 64c5edf on 7.x-4.x, 7.x-5.x, quiz-pages by falcon:
    #1480132 by Noe_ and falcon: Make quiz work with random questions
    
    

  • Commit 64c5edf on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 by falcon:
    #1480132 by Noe_ and falcon: Make quiz work with random questions
    
    

  • Commit 64c5edf on 7.x-4.x, 7.x-5.x, 2269219 by falcon:
    #1480132 by Noe_ and falcon: Make quiz work with random questions
    
    

  • falcon committed 64c5edf on 7.x-6.x
    #1480132 by Noe_ and falcon: Make quiz work with random questions
    
    
djdevin’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)