Step 4: Try compiling the first question again
Now we can try compiling the question again.
This time we will get a different error. This error is because we are missing another crucial file in our rumbas project. This file is the exams/questions_preview.yaml
file.
Because this file makes use a feature of rumbas that we will explain later (templating), we will create an exam that uses our question and compile that exam.
Create the exams
folder in the project folder and add a first_exam.yaml
file in this new exams
folder.
To know which fields we can set for a question, you can look at the Reference for exam page. For now we will show the fields that can be set for a question.
ExamFileType
Internal tag named type.
One of the following items:
tag-value | datatype of value | description |
---|---|---|
template | TemplateFile | An exam that uses a template. |
normal | NormalExam | A normal exam. |
diagnostic | DiagnosticExam | An exam in diagnostic mode. |
For now we will just look at the normal
exam type. This is the exam type that we will use for our first exam.
NormalExam
field | type | description |
---|---|---|
name | Translation | The name of the exam |
locales | Array of Locale | All locales for which the exam should be generated |
navigation | NormalNavigation | The navigation settings for this exam |
timing | Timing | The timing settings for this exam |
feedback | Feedback | The feedback settings for this exam |
question_groups | Array of QuestionGroup | The questions groups for this exam |
numbas_settings | NumbasSettings | The settings to set for numbas |
We can set a value for each of these fields.
---
type: normal # set the type to normal
# type has to be set as an 'internal tag' so all fields of 'NormalExam' are set on the samen level
name: First Exam
question_groups:
- name: Group 1
picking_strategy:
type: all_ordered
questions:
- first_question.yaml
navigation:
mode: sequential
start_password: none
can_regenerate: true
show_steps: false
show_title_page: false
confirm_when_leaving: false
show_names_of_question_groups: true
allow_printing: false
can_move_to_previous: true
browsing_enabled: true
show_results_page: never
on_leave:
action: none
feedback:
percentage_needed_to_pass: 50
show_name_of_student: false
show_current_marks: true # whether the current score is shown
show_maximum_marks: true
show_answer_state: true
allow_reveal_answer: true
review:
show_score: true
show_feedback: true
show_expected_answer: true
show_advice: true
advice: "Please practice more"
intro: "An introductory text"
feedback_messages: []
timing:
duration_in_seconds: none # no time limit
allow_pause: true
on_timeout:
action: none
timed_warning:
action: none
locales: # this can be used to localize your exams (have it available in multiple languages)
- name: en # custom name
numbas_locale: en-GB # English (United Kingdom)
numbas_settings:
theme: default # use the default numbas theme