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

Sivaji_Ganesh_Jojodae’s picture

Your 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

function foobar_quiz_feedback($questions, $showpoints = TRUE, $showfeedback = FALSE) {
  return '';
}

you need to change foobar_quiz_feedback to
_quiz_feedback.

Sivaji_Ganesh_Jojodae’s picture

@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.

jimbonyny’s picture

Beautiful! 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!

sonlinemedia’s picture

How 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?

mbutcher’s picture

Issue tags: +ToDo

@sivaji: Good idea. We should definitely add this to the feature list.

sonlinemedia’s picture

I 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.

djdevin’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

5.x has plans for more complex feedback display options.