diff --git a/frontend/src/lib/editor.svelte b/frontend/src/lib/editor.svelte
index 3c3fd5a..77c2c6f 100644
--- a/frontend/src/lib/editor.svelte
+++ b/frontend/src/lib/editor.svelte
@@ -5,6 +5,7 @@
import type { EditorData, Question, Answer } from './quiz_types';
import Sidebar from '$lib/editor/sidebar.svelte';
import SettingsCard from '$lib/editor/settings-card.svelte';
+ import QuizCard from '$lib/editor/card.svelte';
const { t } = getLocalization();
@@ -68,9 +69,38 @@
-
- {#if selected_question === -1}
-
- {/if}
+
+
+ {#if schemaInvalid}
+
{yupErrorMessage}
+ {/if}
+
+
+
+ {#if selected_question === -1}
+
+ {:else}
+
+ {/if}
+
diff --git a/frontend/src/lib/editor/card.svelte b/frontend/src/lib/editor/card.svelte
new file mode 100644
index 0000000..011a2e9
--- /dev/null
+++ b/frontend/src/lib/editor/card.svelte
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+ {#each question.answers as answer, index}
+
{
+ question.answers.splice(index, 1);
+ question.answers = question.answers;
+ }}
+ class="p-4 rounded-lg flex justify-center w-full"
+ class:bg-red-500={!answer.right}
+ class:bg-green-500={answer.right}
+ class:bg-yellow-500={!reach(
+ dataSchema,
+ 'questions[].answers[].answer'
+ ).isValidSync(answer.answer)}
+ >
+
+
+
+ {/each}
+ {#if question.answers.length < 4}
+
+ {/if}
+
+
+
Right-click on an answer to delete it!
+
+
+
diff --git a/frontend/src/lib/editor/checker-bg.svg b/frontend/src/lib/editor/checker-bg.svg
new file mode 100644
index 0000000..2996684
--- /dev/null
+++ b/frontend/src/lib/editor/checker-bg.svg
@@ -0,0 +1,3 @@
+
diff --git a/frontend/src/lib/editor/settings-card.svelte b/frontend/src/lib/editor/settings-card.svelte
index 9707d8d..4f47e91 100644
--- a/frontend/src/lib/editor/settings-card.svelte
+++ b/frontend/src/lib/editor/settings-card.svelte
@@ -4,7 +4,7 @@
export let data: EditorData;
-
+
@@ -24,9 +24,59 @@
+
+
+
+
+
+
diff --git a/frontend/src/lib/editor/sidebar.svelte b/frontend/src/lib/editor/sidebar.svelte
index 205f54c..fa9cea8 100644
--- a/frontend/src/lib/editor/sidebar.svelte
+++ b/frontend/src/lib/editor/sidebar.svelte
@@ -59,7 +59,7 @@
>
@@ -130,7 +130,12 @@
use:tippy={{ content: question.question === '' ? 'No title' : question.question }}
class="m-1 border border-gray-500 rounded-lg p-0.5"
>
-
+
{#if question.question === ''}
No title...
{:else}
@@ -157,7 +162,16 @@
class="whitespace-nowrap truncate rounded-lg p-0.5 text-sm text-center"
class:bg-green-500={answer.right}
class:bg-red-500={!answer.right}
- use:tippy={{ content: answer.answer }}>{answer.answer}{#if answer.answer === ''}
+ Empty...
+ {:else}
+ {answer.answer}
+ {/if}
{/each}
diff --git a/frontend/src/lib/yupSchemas.ts b/frontend/src/lib/yupSchemas.ts
index da53d68..8d95ec4 100644
--- a/frontend/src/lib/yupSchemas.ts
+++ b/frontend/src/lib/yupSchemas.ts
@@ -9,14 +9,14 @@ export const dataSchema = yup.object({
.max(300, 'The title has to be shorter than 300 characters'),
description: yup
.string()
- .required()
- .min(3, 'The title has to be longer than 3 characters')
- .max(300, 'The title has to be shorter than 300 characters'),
+ .required('The description is required!')
+ .min(3, 'The description has to be longer than 3 characters')
+ .max(500, 'The description has to be shorter than 500 characters'),
questions: yup
.array()
.of(
yup.object({
- question: yup.string().required('A question is required').max(299),
+ question: yup.string().required('A question-title is required').max(299),
time: yup.number().required().positive('The time has to be positive'),
image: yup
.string()
diff --git a/frontend/src/routes/__layout.svelte b/frontend/src/routes/__layout.svelte
index 38c6dd9..c9a1a5b 100644
--- a/frontend/src/routes/__layout.svelte
+++ b/frontend/src/routes/__layout.svelte
@@ -82,6 +82,7 @@
// height: 100%;
// width: 100%;
+ // bg-gradient-to-r from-[#009444] via-[#39b54a] to-[#8dc63f]
background: linear-gradient(to right, #009444, #39b54a, #8dc63f) repeat-y;
background-size: cover;
/*background: linear-gradient(-225deg, #231557 0%, #44107A 29%, #FF1361 67%, #FFF800 100%); */