Numbas exam schema v6.2

Numbas .exam files are JSON objects, with an additional comment line at the start describing the version of the format used.

The line for the current version should look like this:

// Numbas version: exam_results_page_options

The rest of the file should consist of a single JSON object, matching the following schema.

Download the schema in JSON-Schema format

Numbas Exam

object
  • allowPrinting
    boolean
    Allow students to print question content?
  • contributors
  • custom_part_types
    array
    Custom part types used in this exam

    Items:

    object
    • can_be_gap
      boolean
      Can this part type be a gap?
    • can_be_step
      boolean
      Can this part type be a step?
    • title
      Description
    • extensions
      array
      Extensions required by this part type

      Items:

      string
      The name of an extension
    • help_url
      string
      URL of a help page
    • input_options
      object
      Options for the input widget
    • input_widget
      string
      The input widget used by this part type
    • marking_notes
      array
      Marking notes
    • marking_script
      Marking script
    • name
      string
      Name
    • settings
      array
      Definitions of settings for the part type
    • short_name
      string
      A globally unique short name
    • source
      object
      Information about the source of this custom part type
      • author
        object
        Author
        • name
          string
          Name
        • pk
          number
          ID
      • edit_page
        string
        URL of the page to edit the custom part type
      • pk
        number
        ID
  • diagnostic
    object
    Diagnostic mode settings
    • customScript
      Custom diagnostic algorithm
    • knowledge_graph
      object
      Knowledge graph
      • learning_objectives
        array
        Learning objectives

        Items:

        object
        • title
          Description
        • name
          string
          Name
      • topics
        array
        Topics

        Items:

        object
        • depends_on
          array
          Names of topics this topic depends on

          Items:

          string
        • title
          Description
        • learning_objectives
          array
          Names of learning objectives this topic belongs to

          Items:

          string
        • name
          string
          Name
    • script
      string
      Diagnostic algorithm

      Must be one of:

      • "diagnosys"
      • "mastery"
      • "custom"
  • duration
    number
    The duration of the exam, in seconds
  • extensions
    array
    Extensions required by this exam

    Items:

    string
    The name of an extension
  • feedback
    object
    Feedback settings
    • allowrevealanswer
      boolean
      Allow reveal answer?
    • feedbackmessages
      array
      Feedback messages

      Items:

      object
      • message
        string
        Message
      • threshold
        number
        Percentage score (0-100) above which this message is shown.
    • intro
      string
      Introduction
    • reviewshowadvice
      boolean
      Show question advice in review mode?
    • reviewshowexpectedanswer
      boolean
      Show expected answers in review mode?
    • reviewshowfeedback
      boolean
      Show part feedback messages in review mode?
    • reviewshowscore
      boolean
      Show score in review mode?
    • showactualmark
      boolean
      Show current score?
    • showanswerstate
      boolean
      Show answer state?
    • showtotalmark
      boolean
      Show maximum score?
  • metadata
  • name
    string
    The name of the exam
  • navigation
    object
    Navigation settings
    • allowregen
      boolean
      Allow user to regenerate questions?
    • allowsteps
      boolean
      Enable steps?
    • browse
      boolean
      Allow jump to any question?
    • navigatemode
      string
      Question navigation mode

      Must be one of:

      • "sequence"
      • "menu"
      • "diagnostic"
    • onleave
      object
      On leaving a question
      • action
        string
        Action

        Must be one of:

        • "none"
        • "warnifunattempted"
        • "preventifunattempted"
      • message
        string
        Message
    • preventleave
      boolean
      Confirm before leaving the exam while it's running?
    • reverse
      boolean
      Allow move to previous question?
    • showfrontpage
      boolean
      Show front page?
    • showresultspage
      string
      Reveal answers to all questions

      Must be one of:

      • "oncompletion"
      • "review"
      • "never"
    • startpassword
      string
      Password to begin the exam
  • percentPass
    The pass/fail threshold for the student's total score, as a percentage of the available marks.
  • question_groups
    array
    Question groups

    Items:

    object
    • name
      string
      Name
    • pickQuestions
      Number of questions to choose
    • pickingStrategy
      string
      Questions to use

      Must be one of:

      • "all-ordered"
      • "all-shuffled"
      • "random-subset"
    • questionNames
      array
      Override question names

      Items:

      string
    • questions
      array
      Question definitions

      Items:

    • variable_overrides
      array
      Variable overrides. One item for each question in the group.

      Items:

      object
      • definition
        Variable definition
      • name
        string
        The name of the variable to override
  • resources
    array
    Resource files associated with the exam

    Items:

    array

    A tuple:

    1. string
      Name
    2. string
      Path
  • showQuestionGroupNames
    boolean
    Should the names of question groups be shown to the student?
  • showstudentname
    boolean
    Show the student's name?
  • shuffleQuestionGroups
    boolean
    If true, the question groups appear in random order.
  • timing
    object
    Timing settings
    • allowPause
      boolean
      Allow pausing?
    • timedwarning
      object
      5 minutes before timeout
      • action
        string
        Action

        Must be one of:

        • "none"
        • "warn"
      • message
        string
        Message
    • timeout
      object
      On timeout
      • action
        string
        Action

        Must be one of:

        • "none"
        • "warn"
      • message
        string
        Message

Subschemas