diff --git a/apps/web/cypress/integration/chips.feature b/apps/web/cypress/integration/chips.feature index 100f942e0d23..b58152e9f10a 100644 --- a/apps/web/cypress/integration/chips.feature +++ b/apps/web/cypress/integration/chips.feature @@ -53,3 +53,15 @@ Feature: Chips challenge And I see a "Continue" button Given I click "Continue" Then I see a panel with only a skip and a finish early button + + Scenario: Submitting an alternative correct solution with uncapitalized chips + Given I open "/course/test/skill/chips-test-0?testChallenge=59cd9b603be9" + And I click "como" + And I click "estás" + And I click "hoy" + Given I click "Submit" + Then I see the challenge panel with no skip button + And I read "Correct solution" + And I see a "Continue" button + Given I click "Continue" + Then I see a panel with only a skip and a finish early button diff --git a/apps/web/src/components/ChipsChallenge/index.svelte b/apps/web/src/components/ChipsChallenge/index.svelte index f27d047d5bf6..93c27e0d8711 100644 --- a/apps/web/src/components/ChipsChallenge/index.svelte +++ b/apps/web/src/components/ChipsChallenge/index.svelte @@ -27,9 +27,9 @@ if (!$answer) return if (submitted) return correct = false - const answerForm = $answer.join(" ") + const answerForm = $answer.join(" ").toLowerCase() challenge.solutions.map((solution: string[]) => { - correct = correct || answerForm === solution.join(" ") + correct = correct || answerForm === solution.join(" ").toLowerCase() }) registerResult(correct) submitted = true diff --git a/apps/web/src/courses/test/challenges/chips-test-0.json b/apps/web/src/courses/test/challenges/chips-test-0.json index 363dcfc8d898..05dfd884d424 100644 --- a/apps/web/src/courses/test/challenges/chips-test-0.json +++ b/apps/web/src/courses/test/challenges/chips-test-0.json @@ -156,6 +156,11 @@ "como", "estás", "hoy" + ], + [ + "Como", + "estás", + "hoy" ] ], "formattedSolution": "Tu como estás hoy?", diff --git a/courses/test/basics/skills/chips-test-0.yaml b/courses/test/basics/skills/chips-test-0.yaml index f7454c112619..841eb4f144b0 100644 --- a/courses/test/basics/skills/chips-test-0.yaml +++ b/courses/test/basics/skills/chips-test-0.yaml @@ -10,6 +10,8 @@ Phrases: - Translation: How are you today? Phrase: Tu como estás hoy? + Alternative versions: + - Como estás hoy? New words: []