This template allows for the IE weekly quiz to be quickly written by simply editing the quiz.json file in src/assets
.
The presentation itself is rendered using svelte and uses reveal.js to power the slides. This sits inside a vite environment. Vitest is used for unit testing.
An example quiz.json file has been provided. This is my quiz from week 4 and has been ported over to this template to illustrate how the JSON file should be structured. For more details on all the available/valid JSON properties, please see the following documentation.
Property | Type | Description |
---|---|---|
title |
String | The title for your quiz, to be displayed on the first slide |
rounds |
Array<Round> | An array of round objects, documented below. These are fed into each round (question + answer) |
Property | Type | Description |
---|---|---|
question |
Question | A Question Object, documented below. This contains the information for each question slide |
answer |
Answer | An Answer Object, documented below. This contains the information for each answer slide |
points |
Number | A number indicating how many points are available by answering this question correctly |
Property | Type | Description |
---|---|---|
type |
String | One of "normal", "inline-image" or "bg-image". If inline image or BG image types are selected, an image property must also be provided |
text |
String | The text of the question |
image |
String | (Optional) A valid URL to an image/gif |
Property | Type | Description |
---|---|---|
type |
String | One of "normal", "inline-image" or "bg-image". If inline image or BG image types are selected, an image property must also be provided |
text |
String | (Optional) The text of the answer. If no text is provided, then an image field must be provided. |
image |
String | (Optional) A valid URL to an image/gif |
detail |
String | (Optional) A string containing any extra context/detail you want to provide to the answer |
If you are not familiar with Vite, running this solution is fairly simple.
Ensure you have installed the required modules by running npm i
first.
To serve the quiz, you can either:
npm run dev
npm run build
and then serve the build with npm run preview
.Also provided are some vitest-powered unit tests which will validate your quiz.json
to make sure it is a valid quiz. You can run these tests by running npm run test
.
The source code for these unit tests can be viewed here.