Quiz with Letters for Answer Values

Create a quiz with letter-based scoring in ChronoForms.

Overview

The user needs a quiz where answers are tracked by letters (A, B, C, etc.) to generate a result summary, rather than just right/wrong validation.
Set up the quiz fields with a specific naming convention, then use a PHP block on form submission to count the occurrences of each letter and display the summary result.

Answered
ChronoForms v6
ka karae 03 Jun, 2019
I'm looking to create a quiz with radio buttons that has letters assigned to the answer values and at the end of the quiz the result would be something like "you answered mostly A's..." or "mostly C's". Most of the quiz examples I've seen have only has right/wrong answers.

Is this possible in Chronoforms?

Thanks
he healyhatman 03 Jun, 2019
Answer
Yes it is, easily.

1. Set up your quiz options
2. Name your quiz fields quiz[xxxx] replacing xxx with whatever you want (as long as it's unique. A number is fine)
3. On submit, use PHP to loop through $this->data("quiz") and count how many of each there are and return whatever you need to return, like a "you answered blahblah" string
4. Use {var:phpblockname} to show the returned value wherever you want it.
This topic is locked and no more replies can be posted.