diff --git a/src/components/QuizHeader.svelte b/src/components/QuizHeader.svelte new file mode 100644 index 0000000..2e334d0 --- /dev/null +++ b/src/components/QuizHeader.svelte @@ -0,0 +1,41 @@ + + +
+ {#if quizInfo.icon} +
+ +
+ {/if} + {#if quizInfo.title} +

{quizInfo.title}

+ {/if} + {#if quizInfo.description} +

{quizInfo.description}

+ {/if} +
+ + diff --git a/src/components/QuizInfo.svelte b/src/components/QuizInfo.svelte new file mode 100644 index 0000000..70d3b25 --- /dev/null +++ b/src/components/QuizInfo.svelte @@ -0,0 +1,109 @@ + + +
+ + {#if showSessionResults && sessionStats} + + {:else if hasPlayedBefore} + + {:else} + + {/if} +
+ + diff --git a/src/components/QuizStats.svelte b/src/components/QuizStats.svelte new file mode 100644 index 0000000..dac0143 --- /dev/null +++ b/src/components/QuizStats.svelte @@ -0,0 +1,208 @@ + + +
+

{showSession ? "Session Statistics" : "Your Statistics"}

+
+ {#if showSession} +
+ {sessionGrade?.letter} +
+
+
{sessionPercentage}%
+
{sessionGrade?.description}
+
+ {:else} +
+ +
+
+
{accuracy}%
+
Accuracy
+
+ {/if} +
+
+
+
+ +
+
{gameStats.correct}
+
Correct
+
+
+
+ +
+
{gameStats.wrong}
+
Wrong
+
+
+
+ +
+
{gameStats.skipped}
+
Skipped
+
+
+ {#if showSession} +
+
+
+
+

+ You answered {gameStats.correct} out of {gameStats.total} + questions correctly + {#if gameStats.skipped > 0} + and skipped {gameStats.skipped} question{gameStats.skipped > 1 ? "s" : ""} + {/if}. +

+
+ {:else} +
+

Total Questions Answered: {totalQuestions}

+
+ {/if} +
+ + diff --git a/src/components/QuizWelcome.svelte b/src/components/QuizWelcome.svelte new file mode 100644 index 0000000..f5e100c --- /dev/null +++ b/src/components/QuizWelcome.svelte @@ -0,0 +1,70 @@ + + +
+ {#if quizInfo.title} +

Welcome to {quizInfo.title}!

+ {/if} + {#if quizInfo.description} +

{quizInfo.description}

+ {/if} + {#if quizInfo.features} +
+ {#each quizInfo.features as feature} +
+ {#if feature.icon} + + {/if} + {feature.text} +
+ {/each} +
+ {/if} +
+ + diff --git a/src/components/WelcomeStats.svelte b/src/components/WelcomeStats.svelte deleted file mode 100644 index c249c27..0000000 --- a/src/components/WelcomeStats.svelte +++ /dev/null @@ -1,502 +0,0 @@ - - -
- {#if showSessionResults && sessionStats} - -
- {#if quizInfo} -
- {#if quizInfo.icon} -
- Quiz icon -
- {/if} - {#if quizInfo.title} -
{quizInfo.title}
- {/if} - {#if quizInfo.description} -
{quizInfo.description}
- {/if} - {#if quizInfo.features} -
    - {#each quizInfo.features as feature} -
  • - {#if feature.icon} - - {/if} - {feature.text} -
  • - {/each} -
- {/if} -
- {/if} -
-
-
{sessionPercentage}%
-
{sessionGrade.description}
-
- -
-
-
- -
-
{sessionStats.correct}
-
Correct
-
- -
-
- -
-
{sessionStats.wrong}
-
Wrong
-
- -
-
- -
-
{sessionStats.skipped}
-
Skipped
-
-
- -
-
-
- -
-

- You answered {sessionStats.correct} out of {sessionStats.total} - questions correctly - {#if sessionStats.skipped > 0} - and skipped {sessionStats.skipped} question{sessionStats.skipped > - 1 - ? "s" - : ""} - {/if}. -

-
- - {:else} - - {#if quizInfo} -
- {#if quizInfo.icon} -
- -
- {/if} - {#if quizInfo.title} -

{quizInfo.title}

- {/if} - {#if quizInfo.description} -

{quizInfo.description}

- {/if} -
- - {#if hasPlayedBefore} -
-

Your Statistics

- -
-
- -
-
-
{accuracy}%
-
Accuracy
-
-
- -
-
-
- -
-
{gameStats.correct}
-
Correct
-
- -
-
- -
-
{gameStats.wrong}
-
Wrong
-
- -
-
- -
-
{gameStats.skipped}
-
Skipped
-
-
- -
-

Total Questions Answered: {totalQuestions}

-
-
- {:else} -
- {#if quizInfo.title} -

Welcome to {quizInfo.title}!

- {/if} - {#if quizInfo.description} -

{quizInfo.description}

- {/if} - {#if quizInfo.features} -
- {#each quizInfo.features as feature} - {#if feature.icon && feature.text} -
- - {feature.text} -
- {:else} -
{feature}
- {/if} - {/each} -
- {/if} -
- {/if} - {/if} - {/if} -
- -