Download & Extend

Correct answer not seen when user views any result under 'My Results'

Project:Quiz
Version:6.x-3.0-beta1
Component:Code - Quiz module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The user is shown the correct answer and the answer he chose after taking the quiz.So this works well.(Image :quiz results.)

But when he views the result from 'My Results' the correct answer is not shown.(Image :own results)

Is this by design? (to avoid user seeing the answers and taking the Quiz again!)

AttachmentSize
quiz results.JPG40.81 KB
own results.JPG38.9 KB

Comments

#1

Category:support request» bug report

As far as I can tell, this is not by design (unless my predecessor knew something I don't). I am changing it to a bug.

#2

ok.
Have attached the same image twice.am attaching the Quiz results image again ( ie.,thats shown after the user takes the quiz with both user answer and correct answer .)

AttachmentSize
quiz result.JPG 22.48 KB

#3

Version:6.x-2.1» 6.x-3.0-alpha1
Status:active» postponed (maintainer needs more info)

This needs re-testing in Quiz 3

#4

Version:6.x-3.0-alpha1» 6.x-3.0-beta1
Status:postponed (maintainer needs more info)» needs work

Bug is present in 3.0-beta-1

The results that load for a user directly after finishing the test are correct.

The table header for each question looks like:

<thead><tr><th>Answers</th><th>Correct Answer</th><th>User Answer</th><th>&nbsp;</th> </tr></thead>

And the correct/incorrect icon is displayed in the 'quiz_summary_qcell' class of cells.

Using the /user/quiz/X/userresults URL sent in the confirmation email produces a page that contains question tables that lack the 'Correct Answer' column.

<thead><tr><th>Answers</th><th>User Answer</th><th>&nbsp;</th> </tr></thead>

These tables also lack the 'quiz_summary_qcell' cells altogether, making it impossible to decide which questions one missed.

Hope this helps.

#5

Status:needs work» postponed (maintainer needs more info)

Need more info

1. Can you please attach a snapshot ?
a. after finishing the test
b. for /user/quiz/X/userresults

2. Which question type has this type of behavior matching, true/false or multichoice ?

#6

1. Of course.

2. Multi-choice (with single correct answer)

AttachmentSize
immediate_results.png 33.92 KB
accessed_via_link.png 27.39 KB

#7

Tested against quiz 3.x-beta1, drupal 6.12. It works fine for me. See the snapshot.

AttachmentSize
sample_quiz_1.png 99.01 KB
sample_quiz_2.png 113.1 KB

#8

The warning messages and other known bugs in matching modules has been fixed 3.x dev branch.

#9

I played with this some more and discovered that the results display correctly via the admin/ links, and also immediately after the test.

file: quiz.pages.inc
function: theme_quiz_user_summary
line: 465

$output .= theme('quiz_feedback', $questions, FALSE, TRUE);

This sets the $showpoints variable to false for a user visiting the result from the /user/quiz/X/userresults URL

$showpoints then suppresses both the 'Correct answer' column and the correct/incorrect icon indicator in the theme functions.

compare this to
file: quiz.pages.inc
function: theme_quiz_admin_summary
line: 824

$output .= theme('quiz_feedback', $questions, TRUE, TRUE);

visiting the report via /admin/quiz/reports/X/results in the correct display.

Unless there is a reason I'm missing to set $showpoints to FALSE for anyone accessing the results from the /user/quiz URL, it should be changed to TRUE in theme_quiz_user_summary. The other option would be to set it to

$quiz->pass_rate > 0

as it is in the theme_quiz_take_summary function to check if it's a pass/fail test. If that's the case though, then the other two functions (quiz_admin and quiz_user) should probably match it.

file: quiz.pages.inc
function: theme_quiz_user_summary
line: 465

-    $output .= theme('quiz_feedback', $questions, FALSE, TRUE);

+    $output .= theme('quiz_feedback', $questions, TRUE, TRUE);

Works for me anyway.

#10

Status:postponed (maintainer needs more info)» fixed

Thanks #9 helped me to fix this. committed to quiz 3.x branch.

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.