Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Green indicators seem wrong for answers #3

Open
PhilAndrew opened this issue Feb 2, 2021 · 4 comments
Open

Green indicators seem wrong for answers #3

PhilAndrew opened this issue Feb 2, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@PhilAndrew
Copy link

PhilAndrew commented Feb 2, 2021

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 PhilAndrew changed the title Wrong answer in question Green indicators seem wrong for answers Feb 2, 2021
@alceanicu
Copy link
Owner

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 alceanicu self-assigned this Feb 3, 2021
@alceanicu alceanicu added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 3, 2021
@alceanicu
Copy link
Owner

will be fixit in v4.0.0

@sambwest
Copy link
Contributor

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

@muppsy007
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants