A system that generates HTML slide show pubquizzes from YAML files. Multiple types of questions are supported, i.e.,
- simple text questions,
- image questions,
- audio questions and
- video questions.
Question categories with sub-questions also supported.
Media questions can be specified by a URL and are automatically downloaded and cached. For audio and video questions, links to, e.g., YouTube can be specified. Synquiz will download the video, extract audio, if needed, and cut to the specified length.
A quiz is specified by a YAML file, quiz.yaml
.
title: Funquiz
subtitle: Example pubquiz
quiz:
# Simple text question
- type: text
text: What does the acronym VIM stand for?
answer: Vi IMproved
# If no type is specified, text is assumed
- text: What killed the cat?
answer: Frank Underwood
# Image question. Image is saved to data directory.
- type: image
text: What is the Italian name for this type of pasta?
url: https://image.freepik.com/free-photo/close-up-dry-fusilli_23-2147749537.jpg
answer: Fusilli
# Audio question. YouTube video is downloaded and audio extracted.
- type: audio
url: https://www.youtube.com/watch?v=1mpWuJ8plhU
len: 7
text: From which movie does this quote originate?
answer: Sneakers
# Video question. YouTube video is downloaded.
- type: video
url: https://www.youtube.com/watch?v=SiXNUaSjXRY
text: What was Roger Murtaugh's response?
start: 0
len: 12
answer:
# Video answer. YouTube video is downloaded.
type: video
url: https://www.youtube.com/watch?v=SiXNUaSjXRY
text: It's just been revoked
hide_question: true
- type: audio
url: https://www.youtube.com/watch?v=L7ZrWOGIbIE
text: Which TV show features this theme song?
start: 0
len: 24
answer:
type: image
url: https://m.media-amazon.com/images/M/MV5BNTExZDVkM2YtZTJkMS00NmU4LTk4YmQtZDZkOTJjMzZlYWFiXkEyXkFqcGdeQXVyNTA4NzY1MzY@._V1_.jpg
# Super questions. A category of questions with multiple sub-questions.
- type: super
text: What do these logos represent?
questions:
- type: image
url: https://upload.wikimedia.org/wikipedia/commons/2/2a/Rebel_Alliance_logo.svg
answer: The Rebel Alliance
- type: image
url: https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Aperture_Science.svg/1024px-Aperture_Science.svg.png
answer: Aperture Laboratories
- type: image
url: https://1000logos.net/wp-content/uploads/2020/02/Marmot-symbol.jpg
answer: Marmot
- type: image
url: https://vuejs.org/images/logo.png
answer: Vue.js
- Demo: The quiz generated by Synquiz with the file above.
- Answer demo: The answer version of the quiz generated by Synquiz.
Synquiz requires the following to be installed
git
npm
yt-dlp
https://github.com/yt-dlp/yt-dlp (optional, only needed for audio/video questions)ffmpeg
(optional, only needed for audio/video questions)
Synquiz can be installed via pip
:
pip3 install git+https://github.com/hjalti/synquiz@master
After installation, Synquiz must be initialized
synquiz manage init
# Initialize a quiz
synquiz init my_quiz
# Start a watcher and server
synquiz watch my_quiz
Now you can open my_quiz/quiz.yaml
and open aim your browser at
http://localhost:8000. When the file is edited, the quiz slide show will
automatically update.
- Find a less bulky slideshow framework