zce
zce copied to clipboard
Green indicators seem wrong for answers
I tried the following code here https://sandbox.onlinephpfunctions.com/
<?php
//Enter your code here, enjoy!
$string = "14302";
$string[$string[2]] = "4";
print $string;
The output was 14342.
The attached screenshow shows 14342 in red, although my selected answer was wrong (I got it wrong at that time), your red/green indicates wrong. Also the green should indicate only one right answer.
Hi,
First of all thank you for the feedback.
the correct answer to the question is indeed 14342 (variant B)
the logic behinde the color display is:
(isQuestionVariantCorrect === IsCheckedByUser ) ? GREEN : RED;
VAR | isQuestionVariantCorrect | IsCheckedByUser | isQuestionVariantCorrect === IsCheckedByUser | COLOR DISPLAYED | COLOR EXPECTED |
---|---|---|---|---|---|
A | false | true | false | RED | RED |
B | true | false | false | RED | RED |
C | false | false | true | GREEN | GREEN |
D | false | false | true | GREEN | GREEN |
will be fixit in v4.0.0
I find the colouring confusing, I would expect the colouring to be as follows:
- Correct answer(s) highlighted in green.
- If the user's answer is incorrect, highlight their incorrect answer in red.
- Otherwise no colour
Hi @alceanicu. First thanks for the excellent work with this. It's fantastic.
Just adding to this as I have noticed the same with marking the correct answers if you get a question incorrect. It always seems to mark two questions green on single choice questions. So it's hard to tell what the correct answer is (unless one of them is obviously not it). Seems to be the same behaviour on both the github preview and chrome extension.
Otherwise, love this educational tool! Awesome contribution to the PHP community.