diff --git a/frontend/src/routes/tests/[id]/+page.svelte b/frontend/src/routes/tests/[id]/+page.svelte index 17b5ba34ad3c4f3ba0a7bbe6a52b6fe43851f7f1..4c0f09943f9a4aeeec00ff3f2622275965d63a75 100644 --- a/frontend/src/routes/tests/[id]/+page.svelte +++ b/frontend/src/routes/tests/[id]/+page.svelte @@ -165,7 +165,7 @@ return; } - step = 2; + step += 1; } function checkUUID() { @@ -217,23 +217,8 @@ </script> {#if step == 0} - <div class="max-w-screen-md mx-auto p-5"> - <Consent - introText={$t('register.consent.intro')} - participation={$t('register.consent.participation')} - participationD={$t('register.consent.participationD')} - privacy={$t('register.consent.privacy')} - privacyD={$t('register.consent.privacyD')} - rights={$t('register.consent.rights')} - /> - <div class="form-control"> - <button class="button mt-4" on:click={() => step++}> - {$t('register.consent.ok')} - </button> - </div> - </div> -{:else if step == 1} - <div class="max-w-screen-md mx-auto p-28 flex flex-col items-center min-h-screen"> + <div class="max-w-screen-md mx-auto p-20 flex flex-col items-center min-h-screen"> + <h2 class="mb-10 text-xl text-center">{survey.title}</h2> <p class="mb-4 text-lg font-semibold">{$t('surveys.code')}</p> <p class="mb-6 text-sm text-gray-600 text-center">{$t('surveys.codeIndication')}</p> <input @@ -251,6 +236,22 @@ {$t('button.next')} </button> </div> +{:else if step == 1} + <div class="max-w-screen-md mx-auto p-5"> + <Consent + introText={$t('register.consent.intro')} + participation={$t('register.consent.participation')} + participationD={$t('register.consent.participationD')} + privacy={$t('register.consent.privacy')} + privacyD={$t('register.consent.privacyD')} + rights={$t('register.consent.rights')} + /> + <div class="form-control"> + <button class="button mt-4" on:click={() => step++}> + {$t('register.consent.ok')} + </button> + </div> + </div> {:else if step == 2} {#if type == 'gap'} <div class="mx-auto mt-16 center flex flex-col"> diff --git a/scripts/surveys/README.md b/scripts/surveys/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1066a07bb15ddb35b6970b3f9a0a3059ae8a1d6d --- /dev/null +++ b/scripts/surveys/README.md @@ -0,0 +1,36 @@ +## Create surveys + +Surveys are composed of questions, referred to as items, grouped into groups. Surveys are then created by combining these groups. + +### CSV structure + +The data required to create surveys is divided into three CSV files: + +1. `items.csv` to create items. +2. `groups.csv` to create groups, where items are just appended at the end of each line. +3. `surveys.csv` to create surveys, where groups are appended at the end of each line. + +Even if the script do some checks, it's important to double-check that there is no duplicates in ID for each field, or it will fail (or not provide the expected output). +It's also important to know that running again a script on the same survey/group/item, will first **delete** it, before recreating it. So, be cautious! + +In `items.csv`, blanks fields are replaced by files from [static/surveys/items](../../frontend/static/surveys/items), with the structure `<item_id>/<option_id|q>.<jpeg|mp3>`. + +### Sample questions + +In `groups.csv` there is a column `demo` that need to be set to `true` or `false`. +A group with demo set to `true` will be defined as a group needed to be shown at the beginning of the test. +The responses to these questions are not recorded in the final score. + +### Special Group IDs +Groups with IDs >= 1100 are reserved for question with no correct answer that will be shown only if the user is not connected. +Those special groups needs to be present in the source code. + +To add a special group to the survey it needs to be added at the **end** of list of groups in `surveys.csv`. + +#### Special Group: 1100 +Items present in the special group 1100: +- The year of birth +- The gender +- First language +- The education level +