Initial commit
This commit is contained in:
commit
6d849e9549
109 files changed
+40227
No files matched your search
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: Quiz
|
||||
description: How to add interactive quizzes to your site.
|
||||
---
|
||||
|
||||
# Quizzes
|
||||
|
||||
As of version 0.0.12, docsy-jekyll has support for basic quizzes! These are
|
||||
intended to help educate your users about the content of your documentation.
|
||||
For a quiz, you can add a new file to the folder `_data/quizzes`, and write a
|
||||
questions file based on the format shown in `_data/quizzes/example-quiz.yml`.
|
||||
Here is a simple example of a multiple choice question (which can also serve as
|
||||
True/False):
|
||||
|
||||
```yaml
|
||||
title: This is the Quiz Title
|
||||
randomized: false
|
||||
questions:
|
||||
|
||||
- type: "multiple-choice"
|
||||
question: "True or False, Pittsburgh is West of Philadelphia"
|
||||
items:
|
||||
- choice: True
|
||||
correct: true
|
||||
- choice: False
|
||||
correct: false
|
||||
followup: |
|
||||
The answer is True! Pittsburgh is 304.9 miles West of
|
||||
Philadelphia, or approximately a car ride of
|
||||
4 hours and 52 minutes. Buckle up!
|
||||
```
|
||||
|
||||
The quiz is rendered with a "Show Answer" button below each question, and when
|
||||
the user clicks it, any questions that are flagged with `correct: true` will be
|
||||
bolded, and if a followup section is included, it will be displayed.
|
||||
See the live example at the end of this page.
|
||||
|
||||
## Options
|
||||
|
||||
#### Title
|
||||
|
||||
If you include a title, it will be rendered at the top of the quiz. This is
|
||||
optional - you can leave it out and add it before the include on the page.
|
||||
|
||||
#### Random
|
||||
|
||||
If you want your questions to be presented randomly, just add randomized: true
|
||||
to the data.
|
||||
|
||||
|
||||
## Example Quiz
|
||||
|
||||
If I want to include the quiz located at `_data/quizzes/example-quiz.yml`, I
|
||||
can do so like this:
|
||||
|
||||
```
|
||||
{% raw %}{% include quiz.html file='example-quiz' %}{% endraw %}
|
||||
```
|
||||
|
||||
The rendered quiz is shown here:
|
||||
|
||||
|
||||
{% include quiz.html file='example-quiz' %}
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Extras
|
||||
description: Extras, including quizzes.
|
||||
tags:
|
||||
- survey
|
||||
---
|
||||
|
||||
# Extras
|
||||
|
||||
Extras include other integrations that aren't relevant to style or customization,
|
||||
but can further enhance your documentation pages. Currently, we have support
|
||||
for adding interactive quizzes.
|
||||
|
||||
- [Quizzes](example-quiz)
|
||||
- [Tags]({{ site.baseurl }}/tags/)
|
||||
|
||||
Would you like to see another question type, or another kind of extra? Please [open an issue]({{ site.repo }}/issues/new).
|
||||
Reference in new issue
Block a user