Esto está basado en el quiz del SotM 2020.
This is a simple static single-player trivia quiz game, made for a nice look and easy question replacement. Thanks to Vue.js authors which made making this game very quick, and to State of the Map 2020 organizers that made me do a quiz and then asked for it to be re-playable.
You can reuse the code and the template to do your own quiz! The license permits anything, so go ahead. This is what you need to do:
- Clone the repo, or better download
index.htmlandquiz.js. - If needed, translate text in
index.htmlinto your language. - Change the title in
index.htmlto yours. - Prepare the questions file (see below) and replace
sotm2020.jsinindex.htmlwith its name. - To add images, create
imagesdirectory and put all jpeg and pngs there. - Upload all these files into a new github repo (or commit your changes to a fork).
- Go to repo settings, enable github pages on the master branch, share the URL with your players.
A questions file is a JavaScript file that has a single JSON object inside, in form quiz = {...}.
This object has two mandatory fields: "title" and "questions". Here is what fields mean:
- title: title for the quiz, will be displayed as headers on the first and last card.
- picture: title image for the quiz.
- intro: introductionary text for the quiz. Few markdown features supported: paragraphs, links, images, bold and italic text, inline code.
- afterword: markdown text to be printed after the quiz is complete.
- ranks: list of titles for a person who completed the quiz, depending on number of correct answers. Ordered from least to greatest. E.g. ["beginner", "student", "professor"].
- questions: list of questions, see below.
Each question is an object with three mandatory fields (text, answers, correct) and some optional fields:
- text: question, markdown supported.
- picture: optional image for the question.
- answers: list of answer, each a short string.
- correct: list of 1-based indices of correct answers. E.g. [1] means the first answer only is correct.
- stats: list of number of people who chose the relevant answer. E.g. [3, 1, 8] means that 3 players chose the first answer, 1 player chose the second one.
- explanation: markdown-supported explanation for the answers that appears after a player chooses an answer.
See the sotm2020.js file for an example.
This script was primarily written to make a stand-alone single-player version of a MyQuiz quiz. To import yours, do this:
- Open the "Archive" tab and find your quiz. If it isn't there, make you you've played through it at least once.
- Click on the "Settings" button near the proper game and choose "Quiz Report → Export to csv".
- Run the script
tools/myquiz_to_json.py QuizReport.csv questions.js(adjust the file names as needed). - If you don't need answer statistics, edit the resulting js file and replace
"stats"to e.g."stat". - Make sure the js file name in
index.htmlis correct.
All of this was published by Ilya Zverev under MIT License.