chore: rename test course to test-1 (#2802)

* chore: rename test course to test-1

* chore: ignore course files again
This commit is contained in:
Daniel Kantor 2023-04-06 08:52:29 +02:00 committed by GitHub
parent 819d8374dd
commit 21a1ecc47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 206 additions and 207 deletions

View File

@ -7,18 +7,18 @@ from librelingo_yaml_loader.yaml_loader import load_course
from librelingo_fakes import fakes
def test_exported_test_course_matches_snapshot(tmpdir):
def test_exported_test_course_matches_snapshot_1(tmpdir):
root = os.path.abspath(__file__)
root = os.path.dirname(root)
root = os.path.dirname(root)
root = os.path.dirname(root)
root = os.path.dirname(root)
path_to_course = os.path.join(root, "courses", "test")
path_to_course = os.path.join(root, "courses", "test-1")
course = load_course(path_to_course)
settings = fakes.settings_not_dry_run()
output_path = str(tmpdir)
expected_path = os.path.join(root, "apps", "web", "src", "courses", "test")
expected_path = os.path.join(root, "apps", "web", "src", "courses", "test-1")
export_course(output_path, course, settings)
assert_folders_are_identical(expected_path, output_path)

View File

@ -1,8 +1,8 @@
Feature: Cancel button in a practice session
Scenario: Getting a short text input challenge
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I click "Cancel"
Then I should be on "/course/test"
Then I should be on "/course/test-1"
# Test that the progress has been recorded
# Later add a window to confirm the user wants to cancel and if s/he wants to save the progress or not.
# Later add a window to confirm the user wants to cancel and if s/he wants to save the progress or not.

View File

@ -3,7 +3,7 @@ Feature: Cards challenge
A challenge type where the user has to select the correct card
Scenario: Getting a cards challenge
Given I open "course/test/skill/cards-test"
Given I open "course/test-1/skill/cards-test"
Then cards challenge looks correct
And I read "Which of these is"
And I see 3 cards
@ -13,11 +13,11 @@ Feature: Cards challenge
Scenario: Getting a cards challenge in an iPhone
Given that I have an iPhone 6
And I open "course/test/skill/cards-test"
And I open "course/test-1/skill/cards-test"
Then I see 4 cards
Scenario: Clicking a card
Given I open "course/test/skill/cards-test"
Given I open "course/test-1/skill/cards-test"
And I click a card
And I see a "Submit" button
And the highlighted card looks correct
@ -26,14 +26,14 @@ Feature: Cards challenge
And I see a "Skip" button
Scenario: Submitting the correct answer
Given I open "course/test/skill/cards-test"
Given I open "course/test-1/skill/cards-test"
And I click the correct card
And I click "Submit"
Then I read "Correct solution"
And I see a "Continue" button
Scenario: Submitting the incorrect answer
Given I open "course/test/skill/cards-test"
Given I open "course/test-1/skill/cards-test"
And I click an incorrect card
And I click "Submit"
Then I read "Incorrect solution"

View File

@ -3,7 +3,7 @@ Feature: Chips challenge
A challenge type where the user has to reorder chips to form a correct sentence
Scenario: Getting a chips challenge
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
Then I read "Translate"
And I read "How"
And I read "are"
@ -15,11 +15,11 @@ Feature: Chips challenge
And I see a "Feedback" link in the navbar
Scenario: Using the mini-dictionary
Given I open "/course/test/skill/chips-test-0?testChallenge=c3f7fcb9c86c"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=c3f7fcb9c86c"
Then words with definitions have tooltips
Scenario: Submitting an incorrect solution
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
And I click "estás"
And I click "hoy"
And I click "Como"
@ -31,7 +31,7 @@ Feature: Chips challenge
Then I see a panel with only a Skip and a Cancel button
Scenario: Submitting a correct solution
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
And I click "Como"
And I click "estás"
And I click "hoy"
@ -44,7 +44,7 @@ Feature: Chips challenge
Then I see a panel with only a Skip and a Cancel button
Scenario: Submitting an alternative correct solution
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
And I click "Hoy"
And I click "como"
And I click "estás"
@ -56,7 +56,7 @@ Feature: Chips challenge
Then I see a panel with only a Skip and a Cancel button
Scenario: Submitting an alternative correct solution with uncapitalized chips
Given I open "/course/test/skill/chips-test-0?testChallenge=59cd9b603be9"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=59cd9b603be9"
And I click "como"
And I click "estás"
And I click "hoy"

View File

@ -4,7 +4,7 @@ Feature: Course page
Scenario: Opening course page
Given I enable the feature "auth"
And I open "/course/test"
And I open "/course/test-1"
Then course page looks correct
And I read "Animals"
And I see 10 skills that are not started
@ -13,7 +13,7 @@ Feature: Course page
And I see a "Feedback" link in the navbar
Scenario: Opening course page with a stale skill
Given I open "/course/test"
Given I open "/course/test-1"
And I have a stale skill
Then I see a stale skill
And course page with a stale skill looks correct
@ -43,8 +43,8 @@ Feature: Course page
And I don't read "pan, leche"
Scenario: Strengthening stale skill
Given I open "/course/test"
Given I open "/course/test"
Given I open "/course/test-1"
Given I open "/course/test-1"
And I have a stale skill
Then I see a stale skill
Given I complete a lesson

View File

@ -2,7 +2,7 @@ import dayjs from "dayjs"
import settings from "../../../src/settings"
import { Before, Then, Given, And } from "cypress-cucumber-preprocessor/steps"
const COURSE_PAGE_URL = "/course/test"
const COURSE_PAGE_URL = "/course/test-1"
const SKILL_PAGE_URL = `${COURSE_PAGE_URL}/skill/short-input-test-0?testChallenge=14fc2ae4fb35`
Before(() => {

View File

@ -3,7 +3,7 @@ Feature: Fanfare screen
A screen to display to the user when a practice session is successfully completed
Scenario: Getting to the fanfare screen
Given I open "/course/test/skill/continuous"
Given I open "/course/test-1/skill/continuous"
Then fanfare screen looks correct
And fanfare screen looks cute
And I read "Lesson completed!"
@ -12,11 +12,11 @@ Feature: Fanfare screen
And I see a twitter icon
Scenario: Going to course page using the button
Given I open "/course/test/skill/continuous"
Given I open "/course/test-1/skill/continuous"
And I click "Continue to course page"
Then I should be on "/course/test"
Then I should be on "/course/test-1"
Scenario: Going to course page using the keyboard
Given I open "/course/test/skill/continuous"
Given I open "/course/test-1/skill/continuous"
And I hit the enter key
Then I should be on "/course/test"
Then I should be on "/course/test-1"

View File

@ -1,5 +1,5 @@
Feature: Feedback button
Scenario: Clicking the feedback button leads to the GitHub repo
Given I open "/course/test"
Given I open "/course/test-1"
Then the "Feedback" button opens the course repository page in a new tab

View File

@ -1,16 +1,16 @@
Feature: Homepage button
Scenario: I'm on course page
When I open "/course/test/"
When I open "/course/test-1/"
And I click on link "logo"
Then I should be on "/course/test/"
Then I should be on "/course/test-1/"
Scenario: I'm on skill introduction page
When I open "/course/test/skill/animals/introduction"
When I open "/course/test-1/skill/animals/introduction"
And I click on link "logo"
Then I should be on "/course/test/"
Then I should be on "/course/test-1/"
Scenario: I'm on skill page
When I open "/course/test/skill/animals"
When I open "/course/test-1/skill/animals"
And I click on link "logo"
Then I should be on "/course/test/"
Then I should be on "/course/test-1/"

View File

@ -4,15 +4,15 @@ Feature: Skill introduction page
markdown file, which explains the grammar in the skill.
Scenario: Opening the introduction page
When I open "/course/test"
When I open "/course/test-1"
And I click "Practice"
Then I should be on "/course/test/skill/animals/introduction"
Then I should be on "/course/test-1/skill/animals/introduction"
Then I read "Introduction to animals"
Scenario: Practicing the skill from the introduction page
When I open "/course/test/skill/animals/introduction"
When I open "/course/test-1/skill/animals/introduction"
Then I read "Introduction to animals"
When I click "Practice Animals"
Then I should be on "/course/test/skill/animals"
Then I should be on "/course/test-1/skill/animals"

View File

@ -3,7 +3,7 @@ Feature: Listening exercise
A challenge type where the user has to type the phrase they hear on an audio recording
Scenario: Getting a listening challenge
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
Then listening challenge looks correct
And I read "Type what you hear"
And I see a panel with only a Skip, a Cancel, and a Can't listen now button
@ -14,11 +14,11 @@ Feature: Listening exercise
And the input field has a "Type your answer" placeholder
Scenario: Virtual keyboard for special characters
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
Then I see a virtual keyboard with 16 keys
Scenario: Typing into the input field
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "asdfg"
Then I see the challenge panel
And I see a "Skip" button
@ -26,7 +26,7 @@ Feature: Listening exercise
And I see a "Can't listen now" button
Scenario: Submitting incorrect answer
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "asdfg"
And I click "Submit"
Then I read "Incorrect solution"
@ -34,28 +34,28 @@ Feature: Listening exercise
And I see a "Continue" button
Scenario: Submitting correct answer
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "perro"
And I click "Submit"
Then I read "Correct solution"
And I see a "Continue" button
Scenario: Submitting correct answer with a small typo
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type " pierro "
And I click "Submit"
Then I read "You have a typo!"
And I read "Correct spelling: perro"
Scenario: Submitting correct answer with a small casing error
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "PerRo"
And I click "Submit"
Then I read "Correct solution!"
And I don't read "Correct spelling: perro"
Scenario: Going to the next challenge
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "perro"
And I click "Submit"
Then I don't see a "Skip" button
@ -63,14 +63,14 @@ Feature: Listening exercise
Then I see a panel with only a Skip and a Cancel button
Scenario: Going to the next challenge with keyboard only
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I type "perro"
And I hit the enter key
And I hit the enter key
Then I see a panel with only a Skip and a Cancel button
Scenario: Skipping all listening excercises
Given I open "/course/test/skill/listening-test-0?testChallenge=cd183d15d4d1"
Given I open "/course/test-1/skill/listening-test-0?testChallenge=cd183d15d4d1"
And I see a "Skip" button
And I see a "Can't listen now" button
And I click "Can't listen now"

View File

@ -7,7 +7,7 @@ Feature: Login form
Given I enable the feature "auth"
Scenario: Opening the login form
When I open "/course/test/"
When I open "/course/test-1/"
Given I am logged out
When I click "Log in"
Then login form looks correct
@ -33,6 +33,6 @@ Feature: Login form
And I introduce "baz" as "password"
Given my credentials are correct
When I click the "Log in" button
And I open "/course/test"
And I open "/course/test-1"
Then I read "Log out"
And I am on "/"

View File

@ -3,7 +3,7 @@ Feature: Option selection challenge
A challenge type where the user has to choose from multiple possible answers
Scenario: Getting an option selection challenge
Given I open "course/test/skill/options-test-0?testChallenge=5075bbb5a7df"
Given I open "course/test-1/skill/options-test-0?testChallenge=5075bbb5a7df"
Then I read "Which of these is"
And I see 3 options
And every option is inactive
@ -12,21 +12,21 @@ Feature: Option selection challenge
And option selection challenge looks correct
Scenario: clicking an option
Given I open "course/test/skill/options-test-0?testChallenge=5075bbb5a7df"
Given I open "course/test-1/skill/options-test-0?testChallenge=5075bbb5a7df"
And I select an option
Then I see 2 inactive options
And I see 1 active option
And option selection challenge with first option selected looks correct
Scenario: Submitting correct answer
Given I open "course/test/skill/options-test-0?testChallenge=5075bbb5a7df"
Given I open "course/test-1/skill/options-test-0?testChallenge=5075bbb5a7df"
And I select the correct option
And I click "Submit"
Then I read "Correct solution"
And I see a "Continue" button
Scenario: Submitting incorrect answer
Given I open "course/test/skill/options-test-0?testChallenge=5075bbb5a7df"
Given I open "course/test-1/skill/options-test-0?testChallenge=5075bbb5a7df"
And I select an incorrect option
And I click "Submit"
Then I read "Incorrect solution"

View File

@ -3,12 +3,12 @@ Feature: Short text input challange
A challange type where the user has to translate a short phrase
Scenario: Getting a short text input challenge
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Then short text input challenge looks correct
And I read "Type"
And I read "dog"
And I read "in Test Language!"
Given I open "/course/test/skill/short-input-test-1?testChallenge=fc0a3426d589"
Given I open "/course/test-1/skill/short-input-test-1?testChallenge=fc0a3426d589"
Then I see a tooltip that says "foo"
And I see a panel with only a Skip and a Cancel button
And I'm not able to submit
@ -19,7 +19,7 @@ Feature: Short text input challange
And the input field has a "Type your answer" placeholder
Scenario: Virtual keyboard for special characters
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Then I see a virtual keyboard with 16 keys
And the keys on the virtual keyboard have proper labels
And clicking on a key types into the input field
@ -27,14 +27,14 @@ Feature: Short text input challange
Then I don't see a virtual keyboard anymore
Scenario: Typing into the input field
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "el perro"
Then I see the challenge panel
And I see a "Skip" button
And I see a "Submit" button
Scenario: Submitting incorrect answer
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "asdfg"
And I click "Submit"
Then I read "Incorrect solution"
@ -42,53 +42,53 @@ Feature: Short text input challange
And I see a "Continue" button
Scenario: Submitting correct answer
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "perro"
And I click "Submit"
Then I read "Correct solution"
And I see a "Continue" button
Scenario: Submitting alternative correct answer
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "can"
And I click "Submit"
Then I read "Correct solution"
And I see a "Continue" button
Scenario: Submitting alternative correct answer
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "el perro"
And I click "Submit"
Then I read "Correct solution"
Scenario: Submitting correct answer with a small typo
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type " el pierro "
And I click "Submit"
Then I read "You have a typo!"
And I read "Correct spelling: el perro"
Scenario: Submitting correct answer with a small casing error
Given I open "/course/test/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
Given I open "/course/test-1/skill/short-input-test-0?testChallenge=14fc2ae4fb35"
And I type "PerRo"
And I click "Submit"
Then I read "Correct solution!"
And I don't read "Correct spelling: perro"
Scenario: Going to the next challenge
Given I open "/course/test/skill/short-input-test-2?testChallenge=aa171956aefe"
Given I open "/course/test-1/skill/short-input-test-2?testChallenge=aa171956aefe"
And I type "agua"
And I click "Submit"
And I click "Continue"
Then I see a panel with only a Skip and a Cancel button
Scenario: Going to the next challenge with keyboard only
Given I open "/course/test/skill/short-input-test-2?testChallenge=aa171956aefe"
Given I open "/course/test-1/skill/short-input-test-2?testChallenge=aa171956aefe"
And I type "agua"
And I hit the enter key
And I hit the enter key
Then I see a panel with only a Skip and a Cancel button
Scenario: using the hover-over dictionary
Given I open "/course/test/skill/short-input-test-3?testChallenge=86665e4f61fa"
Given I open "/course/test-1/skill/short-input-test-3?testChallenge=86665e4f61fa"
Then I see a tooltip that says "tu"

View File

@ -5,7 +5,7 @@ Feature: Sign up form
Background:
Given I enable the feature "auth"
When I open "/course/test/"
When I open "/course/test-1/"
Given I am logged out
Scenario: Opening the sign up form

View File

@ -3,12 +3,12 @@ Feature: Skipping a challenge
Each challenge should come with a skip button. Pressing the skip button postpones the challenge for later.
Scenario: Skip button is visible
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
Then I should not have progressed
Then I see a "Skip" button
Scenario: Skipping a challenge
Given I open "/course/test/skill/chips-test-0?testChallenge=5000997897bb"
Given I open "/course/test-1/skill/chips-test-0?testChallenge=5000997897bb"
When I click "Skip"
Then I should have progressed

View File

@ -14,7 +14,6 @@
import db from "../db/db"
import isBrowser from "../utils/isBrowser"
export let rawChallenges
export let languageName
export let languageCode
@ -62,163 +61,164 @@
| ChipsChallengeType
let challenges: Array<ChallengeType> = sortChallengeGroups(
shuffle(rawChallenges),
expectedNumberOfChallenges
shuffle(rawChallenges),
expectedNumberOfChallenges
)
let remainingChallenges = testChallenge
? [
...[...challenges].filter(
(challenge) => challenge.id === testChallenge
),
...[...challenges].filter(
(challenge) => challenge.id !== testChallenge
),
? [
...[...challenges].filter(
(challenge) => challenge.id === testChallenge
),
...[...challenges].filter(
(challenge) => challenge.id !== testChallenge
),
]
: [...challenges]
: [...challenges]
let currentChallenge = remainingChallenges.shift()
let solvedChallenges = []
let progress = 0
let stats = {
correct: 0,
incorrect: 0,
skipped: 0,
correct: 0,
incorrect: 0,
skipped: 0,
}
const preloadImage = (imageName: string) => {
if (typeof Image === "undefined") return
new Image().src = `images/${imageName}`
if (typeof Image === "undefined") return
new Image().src = `images/${imageName}`
}
challenges
.filter(({ type }) => type === "cards")
.map(({ pictures }: CardChallengeType) => pictures.map(preloadImage))
.filter(({ type }) => type === "cards")
.map(({ pictures }: CardChallengeType) => pictures.map(preloadImage))
$: alternativeChallenges =
currentChallenge &&
rawChallenges.filter(({ id }) => id !== currentChallenge.id)
$: registerResult = (isCorrect: boolean) => {
if (isCorrect) {
stats.correct++
sound.correct.play()
solvedChallenges.push(currentChallenge)
} else {
stats.incorrect++
sound.wrong.play()
remainingChallenges.push(currentChallenge)
}
if (isCorrect) {
stats.correct++
sound.correct.play()
solvedChallenges.push(currentChallenge)
} else {
stats.incorrect++
sound.wrong.play()
remainingChallenges.push(currentChallenge)
}
}
$: progress = (solvedChallenges.length + stats.skipped) / challenges.length
$: resolveChallenge = () => {
if (remainingChallenges) {
currentChallenge = remainingChallenges.shift()
}
if (remainingChallenges) {
currentChallenge = remainingChallenges.shift()
}
}
$: skipChallenge = () => {
stats.skipped++
resolveChallenge()
stats.skipped++
resolveChallenge()
}
$: skipAllChallenges = async () => {
if (solvedChallenges.length == 0) {
window.location.replace("/course/test")
return
}
stats.skipped++
remainingChallenges.forEach(() => stats.skipped++)
remainingChallenges = []
currentChallenge = undefined
if (solvedChallenges.length == 0) {
// TODO: fix bug #2799
window.location.replace("/course/test-1")
return
}
stats.skipped++
remainingChallenges.forEach(() => stats.skipped++)
remainingChallenges = []
currentChallenge = undefined
}
$: skipAllVoice = () => {
let filteredRemainingChallenges = remainingChallenges.filter(
(challenge) => {
if (challenge.type === "listeningExercise") {
stats.skipped++
return false
} else {
return true
}
}
)
let filteredRemainingChallenges = remainingChallenges.filter(
(challenge) => {
if (challenge.type === "listeningExercise") {
stats.skipped++
return false
} else {
return true
}
}
)
remainingChallenges.splice(
0,
remainingChallenges.length,
...filteredRemainingChallenges
)
stats.skipped++
resolveChallenge()
remainingChallenges.splice(
0,
remainingChallenges.length,
...filteredRemainingChallenges
)
stats.skipped++
resolveChallenge()
}
</script>
{#if currentChallenge}
<div class="container" in:scale>
<section class="section">
<ProgressBar value="{progress}" />
<ProgressBar value={progress} />
{#each challenges as challenge, i (challenge.id)}
{#if challenge.id === currentChallenge.id}
<div
class="challenge"
in:fade|local="{{ duration: 300, delay: 350 }}"
out:fade|local="{{ duration: 300 }}"
in:fade|local={{ duration: 300, delay: 350 }}
out:fade|local={{ duration: 300 }}
>
{#if challenge.type === "cards"}
<DeckChallenge
skipChallenge="{skipChallenge}"
currentChallenge="{currentChallenge}"
alternativeChallenges="{alternativeChallenges}"
resolveChallenge="{resolveChallenge}"
registerResult="{registerResult}"
skipAllChallenges="{skipAllChallenges}"
{skipChallenge}
{currentChallenge}
{alternativeChallenges}
{resolveChallenge}
{registerResult}
{skipAllChallenges}
/>
{/if}
{#if challenge.type === "options"}
<OptionChallenge
skipChallenge="{skipChallenge}"
currentChallenge="{currentChallenge}"
alternativeChallenges="{alternativeChallenges}"
resolveChallenge="{resolveChallenge}"
registerResult="{registerResult}"
skipAllChallenges="{skipAllChallenges}"
{skipChallenge}
{currentChallenge}
{alternativeChallenges}
{resolveChallenge}
{registerResult}
{skipAllChallenges}
/>
{/if}
{#if challenge.type === "shortInput"}
<ShortInputChallenge
skipChallenge="{skipChallenge}"
languageName="{languageName}"
languageCode="{languageCode}"
specialCharacters="{specialCharacters}"
registerResult="{registerResult}"
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipAllChallenges="{skipAllChallenges}"
{skipChallenge}
{languageName}
{languageCode}
{specialCharacters}
{registerResult}
{resolveChallenge}
{challenge}
{skipAllChallenges}
/>
{/if}
{#if challenge.type === "listeningExercise"}
<ListeningChallenge
skipChallenge="{skipChallenge}"
languageCode="{languageCode}"
specialCharacters="{specialCharacters}"
registerResult="{registerResult}"
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipAllChallenges="{skipAllChallenges}"
skipAllVoice="{skipAllVoice}"
{skipChallenge}
{languageCode}
{specialCharacters}
{registerResult}
{resolveChallenge}
{challenge}
{skipAllChallenges}
{skipAllVoice}
/>
{/if}
{#if challenge.type === "chips"}
<ChipsChallenge
registerResult="{registerResult}"
resolveChallenge="{resolveChallenge}"
challenge="{challenge}"
skipChallenge="{skipChallenge}"
skipAllChallenges="{skipAllChallenges}"
{registerResult}
{resolveChallenge}
{challenge}
{skipChallenge}
{skipAllChallenges}
/>
{/if}
</div>
@ -230,11 +230,7 @@
{#if !currentChallenge}
<div class="container">
<FanfareScreen
courseURL="{courseURL}"
skillId="{skillId}"
stats="{stats}"
/>
<FanfareScreen {courseURL} {skillId} {stats} />
</div>
{/if}

View File

@ -1,5 +1,5 @@
<script lang="ts">
// Manual test: http://localhost:3000/course/test/skill/short-input-test-3?testChallenge=86665e4f61fa
// Manual test: http://localhost:3000/course/test-1/skill/short-input-test-3?testChallenge=86665e4f61fa
import Button from "../../../../lluis/DeprecatedButton.svelte"
import HorizontalScroller from "../../../../lluis/HorizontalScroller.svelte"

View File

@ -2,22 +2,12 @@
exports[`get_course returns correct course data: test course data 1`] = `
{
"courseName": "test",
"courseName": "test-1",
"languageCode": "test",
"languageName": "Test Language",
"modules": [
{
"skills": [
{
"id": "e70976d68b28",
"levels": 1,
"practiceHref": "short-input-test-0",
"summary": [
"perro",
"perro",
],
"title": "Short Input Test 0",
},
{
"id": "38c2ea1c36d2",
"imageSet": [
@ -47,6 +37,16 @@ exports[`get_course returns correct course data: test course data 1`] = `
],
"title": "Animals",
},
{
"id": "e70976d68b28",
"levels": 1,
"practiceHref": "short-input-test-0",
"summary": [
"perro",
"perro",
],
"title": "Short Input Test 0",
},
{
"id": "a3eb592daaf6",
"levels": 1,
@ -154,7 +154,7 @@ exports[`get_course returns correct course data: test course data 1`] = `
exports[`get_skill_data returns correct course data 1`] = `
{
"challengesPerLevel": 16,
"courseURL": "/course/test",
"courseURL": "/course/test-1",
"languageCode": "test",
"languageName": "Test Language",
"rawChallenges": [

View File

@ -2,7 +2,7 @@ import { get_course, get_skill_data, get_skill_introduction } from "../index"
describe("get_course", () => {
it("returns correct course data", async () => {
expect(await get_course({ courseName: "test" })).toMatchSnapshot(
expect(await get_course({ courseName: "test-1" })).toMatchSnapshot(
"test course data"
)
})
@ -10,7 +10,7 @@ describe("get_course", () => {
it("returns error when non-existent github gist is used", async () => {
expect(
get_course({
courseName: "test",
courseName: "test-1",
gistId:
"db0545fc1ace67dd8c67d3bcae571b4442161060cd3cfc3890c55e351ec79245",
})
@ -21,25 +21,25 @@ describe("get_course", () => {
it("returns correct data when existing gist id is supplied", async () => {
const courseData = await get_course({
courseName: "test",
courseName: "test-1",
gistId: "2428349a05d81f96b2311c2749ea5c6d",
})
expect(courseData).toEqual(await get_course({ courseName: "test" }))
expect(courseData).toEqual(await get_course({ courseName: "test-1" }))
})
})
describe("get_skill_data", () => {
it("returns correct course data", async () => {
expect(
await get_skill_data({ courseName: "test", skillName: "animals" })
await get_skill_data({ courseName: "test-1", skillName: "animals" })
).toMatchSnapshot()
})
it("returns error when non-existent github gist is used", async () => {
expect(
get_skill_data({
courseName: "test",
courseName: "test-1",
skillName: "animals",
gistId:
"db0545fc1ace67dd8c67d3bcae571b4442161060cd3cfc3890c55e351ec79245",
@ -58,7 +58,7 @@ describe("get_skill_data", () => {
})
).toEqual({
...(await get_skill_data({
courseName: "test",
courseName: "test-1",
skillName: "animals",
})),
courseURL: "/course/testGist",
@ -69,10 +69,13 @@ describe("get_skill_data", () => {
describe("get_skill_introduction", () => {
it("returns correct course data", async () => {
expect(
await get_skill_introduction({ courseName: "test", skillName: "animals" })
await get_skill_introduction({
courseName: "test-1",
skillName: "animals",
})
).toMatchInlineSnapshot(`
{
"courseName": "test",
"courseName": "test-1",
"practiceHref": "animals",
"readmeHTML": undefined,
"skillName": "animals",
@ -90,7 +93,7 @@ describe("get_skill_introduction", () => {
})
).toEqual({
...(await get_skill_introduction({
courseName: "test",
courseName: "test-1",
skillName: "animals",
})),
readmeHTML: "<p>hello world</p>",

View File

@ -31,16 +31,6 @@
{
"title": "Basics",
"skills": [
{
"summary": [
"perro",
"perro"
],
"practiceHref": "short-input-test-0",
"id": "e70976d68b28",
"title": "Short Input Test 0",
"levels": 1
},
{
"imageSet": [
"dog1",
@ -70,6 +60,16 @@
"title": "Animals",
"levels": 3
},
{
"summary": [
"perro",
"perro"
],
"practiceHref": "short-input-test-0",
"id": "e70976d68b28",
"title": "Short Input Test 0",
"levels": 1
},
{
"summary": [
"foo"

View File

@ -1,6 +1,6 @@
import ExampleGistResponse from "./__fixtures__/example-gist-response.json"
import { default as ExampleCourseDataFile } from "../courses/test/courseData.json"
import { default as TestCourseAnimalsSkillFile } from "../courses/test/challenges/animals.json"
import { default as ExampleCourseDataFile } from "../courses/test-1/courseData.json"
import { default as TestCourseAnimalsSkillFile } from "../courses/test-1/challenges/animals.json"
import gistsConfig from "../../../../config/gists.json"
const FAKE_GIST_FILE = {

View File

@ -37,12 +37,12 @@
<h1 class="is-size-1">Development tools</h1>
<h2 class="is-size-2">Test pages</h2>
<ul>
<li><a href="/course/test">Test course</a></li>
<li><a href="/course/test-1">Test course</a></li>
{#each testSkills as testSkill}
<li>
<a
target="_blank"
href="/course/test/skill/{testSkill}"
href="/course/test-1/skill/{testSkill}"
rel="noreferrer"
>
Test skill:

View File

@ -2,8 +2,8 @@ Module:
Name: "Basics"
Skills:
- short-input-test0.yaml
- animals.yaml
- short-input-test0.yaml
- short-input-test1.yaml
- short-input-test2.yaml
- short-input-test3.yaml

View File

@ -2,7 +2,7 @@
set -euo pipefail
yarn exportCourse test
yarn exportCourse test-1
if git diff --exit-code --name-only; then
echo "🎉 Amazing, test course JSON files are up to date"