Skip to content

Commit

Permalink
making the input value required
Browse files Browse the repository at this point in the history
  • Loading branch information
kgeri committed May 14, 2023
1 parent b2d8f70 commit a18d0f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/ArtihmeticChallenge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
onMount(next);
export function evaluate() {
if (!response) return;
const expected = [a, b, c];
const actual: any[] = [a, b, c];
actual[questionIndex] = response == null ? i18n.skipped : response;
actual[questionIndex] = response;
const result = <Result>{
correct: expected.every((v, i) => actual[i] === v),
Expand Down
2 changes: 1 addition & 1 deletion src/ChallengeInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
});
</script>

<input bind:this={responseInput} bind:value={response} type="number" min="0" max={settings.maxValue} />
<input bind:this={responseInput} bind:value={response} type="number" min="0" max={settings.maxValue} required />

<style>
input {
Expand Down
1 change: 0 additions & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default {
rating4: "Négyes 😊",
rating5: "Ötös 🥰",
submit: "Mehet!",
skipped: "<nem válaszolt>",
operations: {
"a": "összeadás",
"s": "kivonás",
Expand Down

0 comments on commit a18d0f0

Please sign in to comment.