This code only ever prints “This answer is correct.”. Any ideas?
%begin_response_371443_q1%
%begin_question_error_371443_q1^charcount:gt:0:1%
<p>This answer is incorrect.</p>
%else_question%
<p>This answer is correct.</p>
%end_question%
%end_response%
Using %begin_question_error_371443_q1^charcount:gt:0:1% outside of this block works but inside it doesn’t. I mean, it’s working but only ever branches to ‘This answer is correct’.
Unfortunately, that hasn’t worked. I’ve even added ‘1’ to the end of ‘^charcount^gt:0’ to ensure it returns true if there’s an error message but the form still only ever prints ‘This answer is correct’.
Weird - it’s evaluating the outer IF, THEN, ELSE and it’s kinda evaluating the inner one too but not to the point where the %being_question_error_371443_q1_charcount^gt:0% is returning anything other than false every time.
This came about because of W3C’s recommendation that both form errors and correct answers should be relayed to the user inline with accessibility.
Hi @np81. I’ve got a memory like a sieve but I think I tried this approach. I don’t think I had much luck with it though. Have you tried it in Squiz? What version are you on?