Installation and Update
There are two options to install Asciidoctor Question. The first is to use gem install
on the command line:
$ gem install asciidoctor-moodle --pre
The second is to add the following entry to your project’s Gemfile.
gem 'asciidoctor-moodle', '~> 1.0.0.dev'
and execute bundle
in the command line.
$ bundle
To update asciidoctor-moodle
type
$ gem update asciidoctor-moodle
Generating a Question Document from a Terminal
You can load Asciidoctor question in a terminal using the -r (require) and -b (backend) flags.
asciidoctor -r asciidoctor-moodle -b moodle sample.adoc
Creating a Question
Tip
|
The next documentation is more readable on https://asciidoc.univ-nantes.io/ |
A question is written inside a literal block, which needs at least two attributes.
[question, question-type] // (1) (2) .... // (3) Question in appropriate syntax ....
-
The first positional attribute in the attribute list specifies that this block is a question.
-
The second positional attribute defines the type of this question (mc or gap)
-
Place the attribute list directly on top of the delimited literal block (....). You can also use an example (====) or open block (
--
) as an alternative.
The following question types are available:
I used HTML <p> to format the output in Moodle to fit the tabular’s case.
Question type | Input | Output |
---|---|---|
mc |
|
![]() |
gap |
|
![]() |
tf |
|
![]() |
matching |
|
![]() |
cmc |
|
![]() |
ordering |
|
![]() |
ddt |
|
![]() |
short |
|
![]() |
num |
|
![]() |
mw |
|
![]() |
Details format
MC (multiple choice question) :
[question, mc|MC, shuffle=shuffle] //Used of the named attributes.
[question, mc|MC, shuffle] //Or just set the third attribute.
If you want the answers to be shuffle for each try. You can either use 'MC' or 'mc'.
- [X] correct1
- [*] correct2
- [ ] false
You can either tick the correct(s) answer(s) with X or *.
The question is on 1 point, the point you receive for a good answer is 1/nbCorrectAnswersPossibles.
Warning
|
You need space bewteen [ ] if it’s false. |
Gap (gap fill question)
You gap your text with :
The gap is __here__
You gain 1 point for each gap correctly fill.
TF (true or false question)
You can only write one question by question’s block. One point for each question’s block.
Good | Bad |
---|---|
|
|
Matching (matching question)
The matching question is based on a pool of questions/text and a pool of answers.
The pool of answers is shared by all the questions/text.
Each questions is linked to a correct answer.
It’s represented as a dropdown menu in-line in the text.
[question, matching, Answer1, Answer2, Answer3]
....
General text need.
- Sentence1 :
- Sentence2 :
....
In this exemple the first sentence (Sentence1) match the first argument (Answer1) after 'matching'.
The second second sentence (Sentence2) match the second argument (Answer2) after 'matching'.
Answer3 isn’t linked to any sentence but it will still be part of the pool of possible answers.
Tip
|
You can use either * or - for listing the sentences. |
Warning
|
Depending on your Moodle’s version you will need at least 2 questions and 3 answers or one answer for each question if there is more than 2 questions, to be imported correctly. |
CMC (cloze mutliple choice)
Unlike matching questions, each CMC question has it own pool of answers.
Each questions is linked to a correct answer.
It’s represented as a dropdown menu in-line in the text.
You can use either a delimiter or a block list format to write the possible answers.
List | Delimiter |
---|---|
|
|
Tip
|
You can use either * or - to enumerate the answers, whether you are using a List or a delimiter. |
Warning
|
For delimiter of a list you can only use ---- or ====, — won’t work. |
Warning
|
If you don’t have a correct answer for each question, Moodle won’t accept your file. |
Ordering
You need to list the items in the same order as the correct answer. Moodle will shuffle them.
Tip
|
You can use either * or - for listing the sentences. |
Warning
|
Depending on your version of Moodle, you will need at least 2 or 3 items in the list for it to be imported correctly. |
DDT (drag and drop into text) and MW (missing Words)
Simply enclose the portion of the text you with to label with asterisks (*).
You can’t have more draggable texts (possible answers) than gaps.
Warning
|
The text you enclose needs to be on the same line to be imported correctly. |
Good | Bad |
---|---|
|
|
Short (answer)
You can either tag with "Short" or "short".
Num (Numerical)
You can either tag with "num" or "Num".
If the tolerance is 1 and the answer is 4, then [3, 5] is an interval for a possible answer.
If a student writes the correct answer without the correct unit, they will lose half of the marks.
Warning
|
Use coma (,) to separate units, and the dot (.) for decimal. |