From 3f7e48e9eb0754ef7aeec5a400b9bc0cf99399f6 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois <git@bhasher.com> Date: Thu, 24 Apr 2025 09:22:08 +0200 Subject: [PATCH] Buttons to return to homepage and start study --- frontend/src/lang/fr.json | 6 ++++-- .../src/routes/register/[[studyId]]/+page.svelte | 7 ++++--- frontend/src/routes/studies/[[id]]/+page.svelte | 13 ++++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/frontend/src/lang/fr.json b/frontend/src/lang/fr.json index 54bdee72..b0a40ba3 100644 --- a/frontend/src/lang/fr.json +++ b/frontend/src/lang/fr.json @@ -253,7 +253,8 @@ "start": "Continue", "study": "Étude", "study.note": "Nom de l'étude à laquelle vous participez", - "study.placeholder": "Nom de l'étude" + "study.placeholder": "Nom de l'étude", + "testText": "Vous allez passer un test de vocabulaire. Cliquez sur le bouton suivent pour commencer." }, "timeslots": { "cesttime": "Heure CET (Bruxelles)", @@ -394,7 +395,8 @@ "title": "Résultat moyen: ", "loading": "Calcul en cours...", "error": "Erreur lors du calcul du score" - } + }, + "backToHomePage": "Retour à la page d'accueil" }, "tests": { "taskTests": "Tests de langue", diff --git a/frontend/src/routes/register/[[studyId]]/+page.svelte b/frontend/src/routes/register/[[studyId]]/+page.svelte index e02d78a2..b1c4344c 100644 --- a/frontend/src/routes/register/[[studyId]]/+page.svelte +++ b/frontend/src/routes/register/[[studyId]]/+page.svelte @@ -596,12 +596,13 @@ </div> {:else if current_step == 7} <div class="text-center"> + <p>{$t('register.testText')}</p> <a class="button mt-4 w-full" href="/studies/{study?.id || user?.studies_id[0]}"> {$t('register.continueButton')} </a> - <button class="button mt-4 w-full" onclick={() => (document.location.href = '/')}> - {$t('register.startFastButton')} - </button> + <!-- <button class="button mt-4 w-full" onclick={() => (document.location.href = '/')}> --> + <!-- {$t('register.startFastButton')} --> + <!-- </button> --> </div> {:else if current_step == 8}{:else if current_step == 9} <div class="text-center"> diff --git a/frontend/src/routes/studies/[[id]]/+page.svelte b/frontend/src/routes/studies/[[id]]/+page.svelte index 35895493..3bf19614 100644 --- a/frontend/src/routes/studies/[[id]]/+page.svelte +++ b/frontend/src/routes/studies/[[id]]/+page.svelte @@ -161,16 +161,16 @@ </div> {/if} {/key} + <!-- {:else if current_step == study.tests.length + 2} --> + <!-- <div class="flex flex-col h-full"> --> + <!-- <EndQuestions study_id={study.id} {rid} onFinish={() => current_step++} /> --> + <!-- </div> --> {:else if current_step == study.tests.length + 2} - <div class="flex flex-col h-full"> - <EndQuestions study_id={study.id} {rid} onFinish={() => current_step++} /> - </div> - {:else if current_step == study.tests.length + 3} <div class="flex flex-col h-full"> <div class="flex-grow text-center mt-16"> <span>{$t('studies.complete')}</span> - <div class="mt-4"> + <div class="my-4"> {$t('studies.score.title')} {#await getTestEntriesScoreAPI(fetch, rid)} {$t('studies.score.loading')} @@ -182,6 +182,9 @@ {/if} {/await} </div> + + <!-- TODO: Only if registration was required --> + <a class="btn btn-primary" href="/">{$t('studies.backToHomePage')}</a> </div> <dl class="text-sm"> -- GitLab