I have update to this version of the module but it seems that every time someone take a quiz for the first time it brings extra answers, i was checking the code and the problem seems to be on function "_quiz_get_answers" on module file, exactly on the query:

                  SELECT question_nid, question_vid, type, rs.max_score, qt.max_score as term_max_score
                   FROM quiz_node_results_answers ra
                   LEFT JOIN node n ON (ra.question_nid = n.nid)
                   LEFT JOIN quiz_node_results r ON (ra.result_id = r.result_id)
                 LEFT OUTER JOIN quiz_node_relationship rs ON (ra.question_vid = rs.child_vid) AND rs.parent_vid = r.vid
                   LEFT OUTER JOIN quiz_terms qt ON (qt.vid = 2423 AND qt.tid = ra.tid)
                   WHERE ra.result_id = 7

basically the query brings the answers for my quiz, but also brings other answers that has the max_score field null.

I change it by this

                  SELECT question_nid, question_vid, type, rs.max_score, qt.max_score as term_max_score
                   FROM quiz_node_results_answers ra
                   LEFT JOIN node n ON (ra.question_nid = n.nid)
                   LEFT JOIN quiz_node_results r ON (ra.result_id = r.result_id)
                 INNER JOIN quiz_node_relationship rs ON (ra.question_vid = rs.child_vid) AND rs.parent_vid = r.vid
                   LEFT OUTER JOIN quiz_terms qt ON (qt.vid = 2423 AND qt.tid = ra.tid)
                   WHERE ra.result_id = 7

and it seems to be working, but i don't think that be a valid change.

not sure if is a bug, but i'm working on figure out, any thoughts on this ?

thanks in advance.

Comments

Brolag’s picture

Status: Active » Needs review
StatusFileSize
new881 bytes

I had to deal with the same issue and didn't find a solution until now. Your change in the LEFT OUTER JOIN works for me. Here is the patch, it would be awesome if someone else test it :)

Brolag’s picture

I realized that it also should be changed in this function: "quiz_calculate_score".

Brolag’s picture

Issue summary: View changes

changing the second query misstype

djdevin’s picture

Status: Needs review » Closed (outdated)