Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have noticed that the 'My Results' tab on a user's account page only show results for the most recent revision of a quiz. It seems that this tab should show results all results for quizzes taken regardless of the quiz revision.
Comment | File | Size | Author |
---|---|---|---|
#3 | quizresultsallrevisions-1233526-2.patch | 1.1 KB | fuzzy76 |
Comments
Comment #1
pearson.gn CreditAttribution: pearson.gn commentedI agree. I'd like it to show all results for each user in their My Results section, not just the latest revision.
I want users to be able to retain a record of safety quizzes they complete. The quizzes get updated occasionally, but older results still remain valid. It's a nuisance when the old results disappear.
I'll dig around the code a bit, but if anyone has a quick fix, much appreciated.
Comment #2
regi.bradley CreditAttribution: regi.bradley commentedI ended up changing the query in quiz.pages.inc for function quiz_get_user_results($user_id) - line 232.
$sql = "SELECT n.nid, n.title, qnp.pass_rate, qnrs.result_id, qnrs.time_start, qnrs.time_end, qnrs.score, qnrs.is_evaluated
FROM {node} n
INNER JOIN {quiz_node_properties} qnp ON n.nid = qnp.nid
INNER JOIN {quiz_node_results} qnrs ON qnrs.vid = qnp.vid
INNER JOIN {users} u ON u.uid = qnrs.uid
WHERE n.type = 'quiz'
AND u.uid = %d
AND qnrs.time_end > 0
ORDER BY qnrs.result_id ASC"
This seems to have done the trick for me.
Comment #3
fuzzy76 CreditAttribution: fuzzy76 commentedRolled as a patch against the 4.x branch. Hopefully someone can get this in before the next update. This is regi.bradley's code, so he should be credited. :)
Comment #4
fuzzy76 CreditAttribution: fuzzy76 commentedComment #5
fuzzy76 CreditAttribution: fuzzy76 commentedI guess not. The last update reverted my patch, and I got support requests on this again. Is 2 testers enough for RTBC? :)
Comment #6
falcon CreditAttribution: falcon commentedThanks!
Comment #9
1websitedesigner CreditAttribution: 1websitedesigner commentedIn Drupal 6 on the Results page I'm still only showing the most recent results.
Most of my users are Anonymous and I was hoping to see a range of results for anonymous users, however I'm only seeing one value for me (admin) and one value for 'Anonymous', even though lots of different people have taken the test.
It's not a show stopper, but any help would be appreciated!