Options can be set globally, per quiz or per question. Options on the quiz level overwrite global options. Options on the question level overwrite quiz options.
Currently, the following options are supported. Shown are the default settings:
let config = {
startOnLoad: true, // detect and convert all div html elements with class quizdown
shuffleAnswers: true, // shuffle answers for each question
shuffleQuestions: false, // shuffle questions for each quiz
nQuestions: undefined // display n questions at random, if shuffleQuestions is true
primaryColor: 'steelblue', // primary CSS color
secondaryColor: '#f2f2f2', // secondary CSS color
textColor: 'black', // text color of some elements
locale: null // language of the user interface (auto-detect per default)
};
quizdown.init(config);
If locale: null
the language is fetched from the browser's settings.
Otherwise locale can be set globally to en
, fr
, es
or de
.
- Quiz and question specific options can be set inside the quizdown using YAML headers.
- Only the option
shuffleAnswers
can be used on a question level. - The answers for sequence questions are always shuffled.
Setting shuffleQuestions: true
will shuffle questions on every page reload. When clicking the reload button in the quiz app no shuffling is applied.
If shuffling is enabled, nQuestions
can be set to a positive number. It can be used to select
a random sample from the pool of questions. Sampling will only be applied on every page reload.
Here is an example (🚀 editor):
---
primaryColor: '#FF851B'
secondaryColor: '#DDDDDD'
textColor: black
locale: de
shuffleQuestions: true
nQuestions: 2
---
#### What's the value of $x$?
This is what i mean:
$$
x=\sqrt{\frac{9}{16}}
$$
> Also check out $\sqrt{x+2}$!
1. [x] Try out: $x=0.75$
1. [ ] $x=0.5$ could also *be correct*!
1. [ ] perhaps $x=1$?
1. [ ] $x=1.5$
#### What's the value of `x[3]`?
---
shuffleAnsers: false
---
```python
# a python list
x = [1, 2, 3, 4]
- 1
- 2
- 3
- 4
In 1990, he published the worlds first website.
- Tim Berners-Lee
- Alan Turing
- Barbara Liskov
- Larry Page
- Atari 2600
- NES
- Sega Genesis
- Play Station
- Nintendo 64
- Xbox
- Wii