Update Quiz Syntax authored by Armin Bernstetter's avatar Armin Bernstetter
--- [[_TOC_]]
author: Armin Bernstetter
date: "21.04.2020"
---
# Quiz Syntax ## Quizzes
## Class definition ### Class definition
For each question type you can use either of the three tags to create quizzes For each question type you can use either of the three tags to create
quizzes
```
.quiz-match-items, .quiz-mi, .qmi .quiz-match-items, .quiz-mi, .qmi
.quiz-multiple-choice, .quiz-mc, .qmc .quiz-multiple-choice, .quiz-mc, .qmc
...@@ -17,45 +14,53 @@ For each question type you can use either of the three tags to create quizzes ...@@ -17,45 +14,53 @@ For each question type you can use either of the three tags to create quizzes
.quiz-insert-choices, .quiz-ic, .qic .quiz-insert-choices, .quiz-ic, .qic
.quiz-free-text, .quiz-ft, .qft .quiz-free-text, .quiz-ft, .qft
```
## Basic syntax ### Basic syntax
The quiz syntax is based on the markdown task list syntax. A markdown task list looks like this The quiz syntax is based on the markdown task list syntax. A markdown
task list looks like this
```
- [ ] This box is not checked - [ ] This box is not checked
- [X] This box is checked - [X] This box is checked
- [ ] Another unchecked box - [ ] Another unchecked box
```
Questions are defined by level 2 headers. That means creating a question **needs** Questions are defined by level 2 headers. That means creating a question
**needs**
```
## Question title {.qmc} ## Question title {.qmc}
```
(where `.qmc` can be replaced by any of the other quiz classes) (where `.qmc` can be replaced by any of the other quiz classes)
You can add tooltips by creating a nested list e.g. You can add tooltips by creating a nested list e.g.
```
- [ ] A - [ ] A
- tooltip A - tooltip A
- [X] B - [X] B
- tooltip B - tooltip B
```
### Fenced Divs Syntax
# Matching Questions Alternatively, quizzes can be defined using the **fenced divs** syntax:
These questions generate quizzes where a user can drag and drop items to sort them into "buckets". ::: qmc
- [ ] A
- tooltip A
- [X] B
- tooltip B
:::
This uses the Pandoc [definition list syntax](https://pandoc.org/MANUAL.html#definition-lists). ## Matching Questions
You can provide distractor items (items not belonging to any bucket) or empty buckets (no item belonging in those empty buckets) by using the exclamation mark "!". These questions generate quizzes where a user can drag and drop items to
sort them into "buckets".
This uses the Pandoc [definition list
syntax](https://pandoc.org/MANUAL.html#definition-lists).
You can provide distractor items (items not belonging to any bucket) or
empty buckets (no item belonging in those empty buckets) by using the
exclamation mark "!".
```
## Matching Question {.qmi} ## Matching Question {.qmi}
Question text Question text
...@@ -72,13 +77,11 @@ BucketB ...@@ -72,13 +77,11 @@ BucketB
Empty Bucket Empty Bucket
: ! : !
```
# Multiple Choice Questions ## Multiple Choice Questions
Classic multiple choice questions Classic multiple choice questions
```
## Multiple Choice Question {.qmc} ## Multiple Choice Question {.qmc}
Question text Question text
...@@ -87,16 +90,13 @@ Question text ...@@ -87,16 +90,13 @@ Question text
- nope - nope
- [X] B - [X] B
- yes - yes
```
# InsertChoices Questions
This will create a sort of blank text questions. ## InsertChoices Questions
If multiple items are provided in the task list, they will be rendered as a drop down menu where the user can click answers.
If only one item/solution is provided it will be rendered as a blank. This will create a sort of blank text questions. If multiple items are
provided in the task list, they will be rendered as a drop down menu
where the user can click answers.
```
## Insert Choices Question {.qic} ## Insert Choices Question {.qic}
- [X] A - [X] A
...@@ -109,13 +109,11 @@ is the first letter in the ABC. The second one is ...@@ -109,13 +109,11 @@ is the first letter in the ABC. The second one is
- [ ] B - [ ] B
- yep - yep
``` ## FreeText questions
# FreeText questions
This will create a simple input field/text box where the user can write their answer. This will create a simple input field/text box where the user can write
their answer.
```
## FreeText Question TL {.qft} ## FreeText Question TL {.qft}
What's the first letter in the alphabet? What's the first letter in the alphabet?
...@@ -132,18 +130,29 @@ What's the fourth letter? ...@@ -132,18 +130,29 @@ What's the fourth letter?
- [ ] C - [ ] C
- [X] D - [X] D
## Quiz Styling
The default style of quizzes includes decorative and interactive features. To switch to a plain style, specify in YAML metadata, or use the `.plain` tag in the question header.
```.yaml
quiz:
style: plain
``` ```
# Quiz Meta ```
# Question 1
## {.qmc .plain}
```
### Quiz Meta
Add a `YAML` code block to a question to provide meta information on the specific question. Add a `YAML` code block to a question to provide meta information on the specific question.
This is work in progress. Currently it does not do anything. (17. Apr 2020) This is work in progress. Currently this can only be used to specify the language and style of a question
````
``` {.yaml} ``` {.yaml}
score: 5 lang: de
category: FP quiz:
lectureId: fp1 style: plain
topic: Functional Programming Introduction
``` ```
\ No newline at end of file
````