Added report-link

This commit is contained in:
Mawoka
2022-04-14 17:30:07 +02:00
parent 1f3ec08a2b
commit b9687a92cd
4 changed files with 32 additions and 23 deletions
+2 -1
View File
@@ -84,7 +84,8 @@
"image": "Bild", "image": "Bild",
"settings": "Einstellungen", "settings": "Einstellungen",
"repeat_password": "Passwort wiederholen", "repeat_password": "Passwort wiederholen",
"overview": "Übersicht" "overview": "Übersicht",
"report": "Melden"
}, },
"editor": { "editor": {
"time_in_seconds": "Zeit in Sekunden", "time_in_seconds": "Zeit in Sekunden",
+2 -1
View File
@@ -84,7 +84,8 @@
"image": "Image", "image": "Image",
"settings": "Settings", "settings": "Settings",
"repeat_password": "Repeat password", "repeat_password": "Repeat password",
"overview": "Overview" "overview": "Overview",
"report": "Report"
}, },
"editor": { "editor": {
"time_in_seconds": "Time in seconds", "time_in_seconds": "Time in seconds",
+2 -1
View File
@@ -53,7 +53,8 @@
"title": "titre", "title": "titre",
"settings": "Paramètres", "settings": "Paramètres",
"repeat_password": "Répéter le mot de passe", "repeat_password": "Répéter le mot de passe",
"overview": "Vue d'ensemble" "overview": "Vue d'ensemble",
"report": ""
}, },
"index_page": { "index_page": {
"slogan": "La plateforme de quiz open-source !", "slogan": "La plateforme de quiz open-source !",
+26 -20
View File
@@ -1,4 +1,4 @@
<script lang="ts" context="module"> <script lang='ts' context='module'>
export async function load({ params, fetch, session }) { export async function load({ params, fetch, session }) {
const { quiz_id } = params; const { quiz_id } = params;
const res = await fetch(`/api/v1/quiz/get/public/${quiz_id}`); const res = await fetch(`/api/v1/quiz/get/public/${quiz_id}`);
@@ -22,7 +22,7 @@
} }
</script> </script>
<script lang="ts"> <script lang='ts'>
import { getLocalization } from '$lib/i18n'; import { getLocalization } from '$lib/i18n';
import CollapsSection from '$lib/collapsible.svelte'; import CollapsSection from '$lib/collapsible.svelte';
import { createTippy } from 'svelte-tippy'; import { createTippy } from 'svelte-tippy';
@@ -81,15 +81,15 @@
</script> </script>
<div> <div>
<h1 class="text-4xl text-center">{quiz.title}</h1> <h1 class='text-4xl text-center'>{quiz.title}</h1>
<div class="text-center"> <div class='text-center'>
<p>{quiz.description}</p> <p>{quiz.description}</p>
</div> </div>
<div class="flex justify-center m-8"> <div class='flex justify-center m-8'>
{#if logged_in} {#if logged_in}
<button <button
class="px-4 py-2 leading-5 text-white transition-colors duration-200 transform bg-gray-700 rounded text-center hover:bg-gray-600 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50" class='px-4 py-2 leading-5 text-white transition-colors duration-200 transform bg-gray-700 rounded text-center hover:bg-gray-600 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50'
on:click={() => { on:click={() => {
startGame(quiz.id); startGame(quiz.id);
}} }}
@@ -98,40 +98,46 @@
</button> </button>
{:else} {:else}
<button <button
class="px-4 py-2 leading-5 text-white transition-colors duration-200 transform bg-gray-700 rounded text-center hover:bg-gray-600 focus:outline-none cursor-not-allowed opacity-50" class='px-4 py-2 leading-5 text-white transition-colors duration-200 transform bg-gray-700 rounded text-center hover:bg-gray-600 focus:outline-none cursor-not-allowed opacity-50'
use:tippy={{ content: 'You need to be logged in to start a game' }} use:tippy={{ content: 'You need to be logged in to start a game' }}
> >
{$t('words.start')} {$t('words.start')}
</button> </button>
{/if} {/if}
</div>
<div class='flex justify-center'>
<a href='mailto:report@mawoka.eu?subject=Report quiz {quiz.id}' class='text-sm underline'>
{$t('words.report')}
</a>
</div> </div>
{#each quiz.questions as question, index_question} {#each quiz.questions as question, index_question}
<div class="px-4 py-1"> <div class='px-4 py-1'>
<CollapsSection headerText={question.question}> <CollapsSection headerText={question.question}>
<div class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2"> <div class='ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2'>
<h1 class="text-3xl m-1">{$t('words.question')} {index_question + 1}</h1> <h1 class='text-3xl m-1'>{$t('words.question')} {index_question + 1}</h1>
<!-- <label class='m-1 flex flex-row gap-2 w-3/5'>--> <!-- <label class='m-1 flex flex-row gap-2 w-3/5'>-->
<p class="text-black w-full bg-inherit"> <p class='text-black w-full bg-inherit'>
{$t('words.question')}: {question.question} {$t('words.question')}: {question.question}
</p> </p>
<!-- </label>--> <!-- </label>-->
{#if question.image} {#if question.image}
<span> <span>
{$t('words.image')}: {$t('words.image')}:
<img class="pl-8" src={question.image} alt="Not provided" /> <img class='pl-8' src={question.image} alt='Not provided' />
</span> </span>
{/if} {/if}
<span class="m-1 flex flex-row gap-2 w-3/5 flex-nowrap whitespace-nowrap"> <span class='m-1 flex flex-row gap-2 w-3/5 flex-nowrap whitespace-nowrap'>
{$t('editor.time_in_seconds')}: {$t('editor.time_in_seconds')}:
<p>{question.time}</p> <p>{question.time}</p>
</span> </span>
{#each question.answers as answer, index_answer} {#each question.answers as answer, index_answer}
<div <div
class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2 m-1" class='ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2 m-1'
> >
<h1 class="text-3xl m-1">{$t('words.answer')} {index_answer + 1}</h1> <h1 class='text-3xl m-1'>{$t('words.answer')} {index_answer + 1}</h1>
<p class="m-1"> <p class='m-1'>
{$t('words.answer')}: {index_answer + 1} {$t('words.answer')}: {index_answer + 1}
{$t('words.question')}: {index_question + 1} {$t('words.question')}: {index_question + 1}
</p> </p>
@@ -140,15 +146,15 @@
: {quiz.questions[index_question].answers[index_answer].answer} : {quiz.questions[index_question].answers[index_answer].answer}
</p> </p>
<label <label
class="m-1 flex flex-row gap-2 w-2/6 flex-nowrap whitespace-nowrap" class='m-1 flex flex-row gap-2 w-2/6 flex-nowrap whitespace-nowrap'
> >
<input <input
type="checkbox" type='checkbox'
bind:checked={answer.right} bind:checked={answer.right}
class="text-black w-fit" class='text-black w-fit'
disabled disabled
/> />
<span class="w-fit">{$t('editor.right_or_true?')}</span> <span class='w-fit'>{$t('editor.right_or_true?')}</span>
</label> </label>
</div> </div>
{/each} {/each}