zce icon indicating copy to clipboard operation
zce copied to clipboard

Green indicators seem wrong for answers

Open PhilAndrew opened this issue 4 years ago • 4 comments

image

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.

PhilAndrew avatar Feb 02 '21 00:02 PhilAndrew

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

alceanicu avatar Feb 02 '21 13:02 alceanicu

will be fixit in v4.0.0

alceanicu avatar Feb 19 '21 12:02 alceanicu

I find the colouring confusing, I would expect the colouring to be as follows:

  1. Correct answer(s) highlighted in green.
  2. If the user's answer is incorrect, highlight their incorrect answer in red.
  3. Otherwise no colour

sambwest avatar Oct 13 '21 12:10 sambwest

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.

muppsy007 avatar Feb 02 '22 04:02 muppsy007