Testing a quiz configurad as randomization = 3 (Randomize Questions= Categorized random questions) found that no score calculation was done and the "score" column on Results tab showed always 0%.
The error is apparently on the following lines:

This is the original code, line 2367:
$scale = db_query("SELECT (max_score / (
SELECT max_score
FROM {quiz_question_properties}
WHERE nid = :nid AND vid = :vid
)) as scale
FROM {quiz_terms}
WHERE vid = :vid
AND tid = :tid
", array(':nid' => $result->nid, ':vid' => $result->vid, ':vid' => $quiz->vid, ':tid' => $result->tid))->fetchField();
}

Note that :vid is assigned twice, so I replaced with:

$scale = db_query("SELECT (max_score / (
SELECT max_score
FROM {quiz_question_properties}
WHERE nid = :nid AND vid = :vid
)) as scale
FROM {quiz_terms}
WHERE vid = :vid1
AND tid = :tid
", array(':nid' => $result->nid, ':vid' => $result->vid, ':vid1' => $quiz->vid, ':tid' => $result->tid))->fetchField();
}

And everything worked fine. Could you please validate and add to code. Thanks.

Comments

djdevin’s picture

Status: Active » Closed (outdated)

This issue is being closed because it was filed against a Beta version of Quiz 4 that is no longer supported.

Quiz 4 is now in RC status.

If the issue still persists in the latest RC of Quiz 4, please open a new issue.