When grading a long answer question that has had a new revision since the answer was given, an error shows, saying "A quiz question could not be scored: No scoring info is available". This is because in the sql statement in the quiz_calculate_score() function, the node table is joined with the quiz_node_results_answers table on both nid and vid. If the vid in the quiz_node_results_answers table is not that of the most recent version, a match is never found. The only information being retrieved from the node table is the question's node type, which isn't supposed to change at all between revisions.

Joining the node table on only the nid (and not the vid) removes the error, and allows scoring information to be correctly generated, since the node type is needed in order to find the hook function that scores the question.

Comments

darktygur-1’s picture

I found a similar problem in the _quiz_get_answers() function too. It returns null for each question that has had a new revision since it's been answered, and there's really no reason to match up the vid when getting the node type. As far as I can tell, node types aren't saved per-revision, and the node table will only ever contain one row per node, regardless of how many revisions might exist (it has a unique primary key index on the nid).

Should I post a new issue for that, or is this good enough?

falcon’s picture

Status: Active » Closed (fixed)

This has been fixed in quiz 4.