#3536 - Comcode output conflict in QUIZ_DONE_SCREEN.tpl
| Identifier | #3536 |
|---|---|
| Issue type | Feature request or suggestion |
| Title | Comcode output conflict in QUIZ_DONE_SCREEN.tpl |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | quizzes |
| Description | When creating or editing a quiz, the "Questions" field supports Comcode.
Comcode is displayed as expected on QUIZ_SCREEN.tpl (when taking the test) However, on the completion page (QUIZ_DONE_SCREEN.tpl), output ignores all Comcode and displays as normal text. |
| Steps to reproduce | |
| Related to | #3539 - Tests should not score questions with no defined correct answer |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
I used Comcode in both the question and the explanation. On QUIZ_DONE_SCREEN.tpl where it lists the explanation as to why the answer was incorrect, this is when the output issue occurs.
I'm also not entirely clear what I'm looking at. The issue says "Comcode is displayed as expected on QUIZ_SCREEN.tpl" [implying it's on the question and/or answer text] but also said "On QUIZ_DONE_SCREEN.tpl where it lists the explanation as to why the answer was incorrect, this is when the output issue occur" [implying it's on the explanation test]. I think you probably mean the question and/or answer (as that's all that shows on both), but I'm not 100% on that.
A screenshot would help. It may not even quite by the Comcode not parsing, it could be something like auto-escaping of HTML happening due to a code override, so escaped-parsed-Comcode might be shown.
(Click to enlarge)
(Click to enlarge)
(Click to enlarge)
From:
{CORRECTIONS}{AFFIRMATIONS}
To:
{$COMCODE,{CORRECTIONS}{AFFIRMATIONS}}
But this has no positive impact on the output.
I think you edited some of the language strings, e.g. QUIZ_MISTAKE_EXPLAINED_COMCODE, to not show the answer. I've made the same edit myself, as I didn't consider it correct to show the answer when reveal answers was off, only the explanation.
I tweaked a few other things, mainly commenting my code better, as it was a bit muddled.
https://github.com/ocproducts/composr/commit/2ae99510febf19de99cbb861723cce94768bcb91
Not sure if this is supposed to happen, but here's a scenario:
1. I'm taking a 'Test' and have one or more fields that require input (such as [SHORT])
2. This field doesn't have a correct or incorrect answer
3. Entering a value in this field always results in failing the test (assuming I set a passing score of 100%)
Users should only be SCORED on questions that have a correct answer (otherwise marked with [*]). Not all tests will have a correct answer, and it would be nice to ask questions (like "how are you today?") without penalizing the test taker.