This gist can partially implement a feature sorely needed in Sensei: The ability to indicate correct and incorrect answers, and a way to show feedback for both.
This has been a requested feature for years: http://ideas.woocommerce.com/forums/191508-sensei/suggestions/3582122-show-wrong-answers
By adding some HTML to the feedback, and using this gist, you can show different text when an answer is correct, or incorrect. This is extremely useful with the autograde feature. Without it there is no indication what answers are right or wrong, or why.
There is one shortcoming. Both correct and incorrect feedback will be in the HTML source. We're simply using css to display the appropriate one. If a clever user knew this they could view the source and see all the feedback, helping them pass the quiz. If you detect someone doing this, hire them immediately because they're going places.
Ok there may be another shortcoming. If you give a specific user feedback for a specific question, it might not show up. I don't use that feature so I didn't test.
In your child theme (you are using a child-theme, right?), copy the question-type-multiple-choice.php
file to:
/wp-content/themes/{CHILD-THEME-NAME}/sensei/single-quiz/
Add the styles to your child theme's style.css
file, located in the root of your child theme.
Add the "sensei_question_show_answers" filter to you child theme's functions.php
file.
In the multiple-choice question's feedback add the following to show for correct answers:
<div class="correct">Flowers, puppies, chocolate chip cookies</div>
and the following to show for incorrect answers:
<div class="incorrect">Fire, death, raisin cookies</div>
Any text not in one of those two divs will show for both correct and incorrect answers.
With this you can finally give an explanation of why the correct answer is right, and hints on why the incorrect answer is wrong. And even if you do not use the feedback, the user will still be notified which answers are correct and incorrect.
This is based on an excellent idea by Diogenes Oliveira Junior, located here.