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.
Hello, All
I am looking to accomplish the same as http://drupal.org/node/375140 (do not show correct answers - just the score at the end of quiz), but am lost as to how to implement this in template.php.
Could anyone point me in the right direction (syntax, variables)?
Thanks so much!
Comments
Comment #1
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedYour question has been already answered in that link. Here the things you need to do
(I assume that you are using a custom theme say foobar)
Go to site/all/themes/foobar
Copy this code to your template.php
you need to change foobar_quiz_feedback to
_quiz_feedback.
Comment #2
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commented@mbutcher
It seems to be a frequently asked feature in the issue queue, what do you think about adding this feature to quiz todo list ?
I would like to see the following feedback options
1. no feedback
2. feedback only for wrong answers
3. feedback only for right answers
4. feedback for both right and wrong answers.
If you think that it is worth to have this feature, please add "ToDo" tag to this.
Comment #3
jimbonyny CreditAttribution: jimbonyny commentedBeautiful! Short and sweet and does the trick. I was getting confused in the previous url when it was mentioned :
"You would want: - theme_quiz_take_summary : displayed after a user takes the test, - theme_quiz_user_summary : displayed from summary page etc", thinking I had to make calls to each of these.
Thanks for your help and prompt reply!
Comment #4
sonlinemedia CreditAttribution: sonlinemedia commentedHow would you customize the report at the end of the test to NOT show the correct answers but still show everything else. (eg. still show question and answer the user selected + if the question was answered incorrectly but DO NOT show them the correct answer).
Is this possible?
Comment #5
mbutcher CreditAttribution: mbutcher commented@sivaji: Good idea. We should definitely add this to the feature list.
Comment #6
sonlinemedia CreditAttribution: sonlinemedia commentedI would love to see a feature added where it would only display the answer feedback after the amount of times noted for allowed takes have been obtained. This would give a lot more control.
I needed a way to display only the answers the user selected at the end of the test and NOT the correct ones. So I have been going through the code and adjusted this on the quiz.pages.inc line #429
OLD CODE $output .= theme('quiz_feedback', $questions, ($quiz->pass_rate > 0), TRUE);
ADJUSTED CODE $output .= theme('quiz_feedback', $questions, ($quiz->pass_rate = 0), TRUE);
By changing the > to == allows the user to ONLY see the answers they selected and not the correct ones. However, since this is on the user page then the admin can still login and see the ones they actually missed if need be.
I am still testing this so I will let you know how it turns out;) So far it seems to be working without error.
Comment #7
djdevin5.x has plans for more complex feedback display options.