Skip to content

Latest commit

 

History

History
106 lines (76 loc) · 3.17 KB

options.md

File metadata and controls

106 lines (76 loc) · 3.17 KB

Options

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.

Setting global 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);

Language settings

If locale: null the language is fetched from the browser's settings. Otherwise locale can be set globally to en, fr, es or de.

Setting quiz and question specific options

  • 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.

Shuffling

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

Who is the person in the picture?

In 1990, he published the worlds first website.

  1. Tim Berners-Lee
  2. Alan Turing
  3. Barbara Liskov
  4. Larry Page

Which console appeared first, witch last?

  1. Atari 2600
  2. NES
  3. Sega Genesis
  4. Play Station
  5. Nintendo 64
  6. Xbox
  7. Wii