Posted by nirvanajyothi on December 8, 2008 at 7:52am
5 followers
| 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!)
| Attachment | Size |
|---|---|
| quiz results.JPG | 40.81 KB |
| own results.JPG | 38.9 KB |
Comments
#1
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 .)
#3
This needs re-testing in Quiz 3
#4
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> </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> </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
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)
#7
Tested against quiz 3.x-beta1, drupal 6.12. It works fine for me. See the snapshot.
#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 > 0as 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
Thanks #9 helped me to fix this. committed to quiz 3.x branch.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.