Skip to content

Commit

Permalink
feat: display the correct answer on options challenges (#1481)
Browse files Browse the repository at this point in the history
* Display the correct answer on options challenges

Brings the options challenges in line with other challenge types by giving
the user feedback on the correct choice when they select an incorrect
answer.

* Add correct answer to options feature test
  • Loading branch information
zmbc authored Jul 30, 2021
1 parent 8a023cc commit 2812718
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/web/cypress/integration/optionSelection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ Feature: Option selection challenge
And I select an incorrect option
And I click "Submit"
Then I read "Incorrect solution"
And I read "Correct answer: perro"
And I see a "Continue" button
1 change: 1 addition & 0 deletions apps/web/src/components/OptionChallenge/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
{#if !options[selectedOption].correct}
<ChallengePanel
message="Incorrect solution!"
messageDetail="{`Correct answer: ${currentChallenge.formInTargetLanguage}`}"
buttonText="Continue"
incorrect
buttonAction="{finishChallenge}" />
Expand Down

1 comment on commit 2812718

@vercel
Copy link

@vercel vercel bot commented on 2812718 Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.