Leaving T/F blank results in report always listing answer as true

Created on 29 April 2021, almost 4 years ago
Updated 2 November 2024, 5 months ago

The end of quiz report will always show the correct answer as "True" when the question is left blank. This is because this line does not function correctly if the user answer is null:

$correct_answer = $answer['is_correct'] ? $answer['answer'] : !$answer['answer'];

Since the actual correct answer is already available, I am replacing it with this:

$correct_answer = $this->question->correct_answer;

This is a 4.x issue only as this area of code has changed in 5.x.

πŸ› Bug report
Status

Closed: outdated

Version

4.0

Component

Code - True/false

Created by

πŸ‡ΊπŸ‡ΈUnited States michelle Wisconsin, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Issue doesn't seem relevant to current D7 branch of quiz and with D7 in general EOL soon, going to say this missed the boat.

    Thanks

Production build 0.71.5 2024