Step 4: Try compiling the first question again

Now we can try compiling the question again.

Task

Recompile the question.

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.

Info

The exams/questions_preview.yaml file is used to create a preview exam for a question.

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.

Task

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.

Reference

ExamFileType

Internal tag named type.

One of the following items:

tag-valuedatatype of valuedescription
templateTemplateFileAn exam that uses a template.
normalNormalExamA normal exam.
diagnosticDiagnosticExamAn 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.

Reference

NormalExam

fieldtypedescription
nameTranslationThe name of the exam
localesArray of LocaleAll locales for which the exam should be generated
navigationNormalNavigationThe navigation settings for this exam
timingTimingThe timing settings for this exam
feedbackFeedbackThe feedback settings for this exam
question_groupsArray of QuestionGroupThe questions groups for this exam
numbas_settingsNumbasSettingsThe 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

Task

Place this yaml in the first_exam.yaml file.