Skip to content
Extraits de code Groupes Projets
typingtest.svelte 3,99 Kio
<script lang="ts">
	import { t } from '$lib/services/i18n';
	import Typingbox from '$lib/components/tests/typingbox.svelte';
	import type User from '$lib/types/user';
	import { toastWarning } from '$lib/utils/toasts';
	import { get } from 'svelte/store';
	import { createTestTypingAPI } from '$lib/api/studies';

	let { user, onFinish }: { user: User | null; onFinish: Function } = $props();

	let data: typingEntry[] = $state([]);

	let inProgress = $state(false);

	let exercices = [
		{
			duration: 30,
			explications: 'Répétez la phrase suivante autant de fois que possible en 30 secondes.',
			text: 'une femme folle tenait un verre dans sa main\n'.repeat(12) + '...'
		},
		{
			duration: 30,
			explications: 'Répétez la phrase suivante autant de fois que possible en 30 secondes.',
			text: 'the cat was sleeping under the apple tree\n'.repeat(12) + '...'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'trois heures raisonnables\n'.repeat(6) + 'trois heures raisonnables'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'huit histoires profondes\n'.repeat(6) + 'huit histoires profondes'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'deux besoins fantastiques\n'.repeat(6) + 'deux besoins fantastiques'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'six bijoux bizarres\n'.repeat(6) + 'six bijoux bizarres'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'four interesting questions\n'.repeat(6) + 'four interesting questions'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'seven wonderful surprises\n'.repeat(6) + 'seven wonderful surprises'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'five important behaviours\n'.repeat(6) + 'five important behaviours'
		},
		{
			duration: -1,
			explications: 'Écrivez 7 fois la phrase suivante.',
			text: 'some awkward zigzags\n'.repeat(6) + 'some awkward zigzags'
		},
		{
			duration: -1,
			explications: 'Finalement, écrivez une fois les caractères suivant.',
			text: 'tjxgfl pgkfkq dtdrgt npwdvf'
		}