Step 2: Create a question
This file will contain the yaml code for the question. To know which fields we can set for a question, you can look at the Reference for question page. For now we will show the fields that can be set for a question:
QuestionFileType
Internal tag named type.
One of the following items:
tag-value | datatype of value | description |
---|---|---|
template | TemplateFile | A question that uses a template |
normal | Question | A normal question |
For now we will just look at the 'normal' question type.
Question
field | type | description |
---|---|---|
statement | Translation | The statement is a content area which appears at the top of the question, before any input boxes. Use the statement to set up the question and provide any information the student needs to answer it. |
advice | Translation | Advice is a content area which is shown when the student presses the Reveal button to reveal the question’s answers, or at the end of the exam. The advice area is normally used to present a worked solution to the question. |
parts | Array of QuestionPart | A question consists of one or more parts. Each part can have a different type to create elaborate questions. |
builtin_constants | BuiltinConstants | Specifies which constants are enabled. You might want to disable the constant e so it can be used as a variable in the questions. |
custom_constants | Array of CustomConstant | Custom constants that are used in your question. |
variables | Map from String to VariableRepresentation | The (ungrouped) variables that are used in this question. |
grouped_variables | "none" or Map from String to Map from String to VariableRepresentation | The (grouped) variables that are used in this question. This is a map from a group name to a map of variables. Should mainly be used to make it easier to template multiple variables at once. |
variables_test | VariablesTest | The test to which your variables should comply. Sometimes it’s hard to define randomised question variables so they’re guaranteed to produce a usable set of values. In these cases, it’s easier to state the condition you want the variables to satisfy, Variable values are generated until this condition passes.While this tool allows you to pick sets of variables that would be hard to generate constructively, it’s a random process so you must be aware that there’s a chance no suitable set of values will ever be found. |
functions | Map from String to Function | The functions that are used in this question |
preamble | Preamble | Specify custom javascript and css code that should be loaded. |
navigation | QuestionNavigation | Specify some navigation options for the question. |
extensions | Extensions | Use this to enable the extensions that are used in the question |
diagnostic_topic_names | Array of Translation | The names of the topics used in diagnostic exams that this question belongs to |
resources | Array of ResourcePath | The paths to the resources |
custom_part_types | Array of CustomPartTypeDefinitionPath | The custom part types used in this exam |
rulesets | Map from String to JMERulesetItem | The rulesets defined in this question. A “ruleset” defines a list of named simplification rules used to manipulate mathematical expressions. https://numbas-editor.readthedocs.io/en/latest/question/reference.html#rulesets |
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 'Question' are set on the samen level
statement: How much is 9 * 3?
advice: You could calculate 10 * 3 and then subtract 3. This yields 3 * 10 - 3 = 30 - 3 = 27
# Add one part
parts:
- type: number_entry
prompt: Enter your answer in the inputbox
marks: 5 # Give 5 points for a correct answer
answer: 27 # Set the correct answer
show_correct_answer: true
show_feedback_icon: true
display_correct_as_fraction: false
allow_fractions: false
fractions_must_be_reduced: false
fractions_must_be_reduced_hint: false
partial_credit_if_fraction_not_reduced: 0
display_correct_in_style: &style english-plain
allowed_notation_styles:
- *style
custom_marking: none
steps: []
steps_penalty: 0
adaptive_marking: none
part_name: none
# All fields below are not imporant yet, but need to be specified. Rumbas doesn't use any internal default values.
builtin_constants: # all constants will be disabled
e: false
pi: false
i: false
custom_constants: []
variables: {}
grouped_variables: none
variables_test:
condition: ""
max_runs: 1
functions: {}
preamble:
css: ""
js: ""
navigation:
can_regenerate: false
show_title_page: false
confirm_when_leaving: false
extensions:
jsx_graph: false
stats: false
geogebra: false
eukleides: false
chemistry: false
download_text_file: false
graphs: false
linear_algebra: false
linear_codes: false
optimisation: false
permutations: false
polynomials: false
quantities: false
random_person: false
written_number: false
sqlite: false
text: false
diagnostic_topic_names: []
resources: []
custom_part_types: []
rulesets: {}