Skip to main content
Authoring Fill-in-the-blank Items

Writing fill in the blank assessment items

Martine Holland avatar
Written by Martine Holland
Updated over a year ago
  • From the "Add Item" menu select “Blanks”

The Context and Stem

  • In “Context” you should write the context and stem

  • You can use markdown to write the context and stem

    • Names of data, functions, columns, numeric values etc. should use code format

    • Never use bold/underline/italic

    • Use R/Python output to format short tables (no more than 5 lines)

    • Use schema diagrams to explain SQL data structures

  • Start a new sentence on a new line, with a blank line between (see example below)

Pre-challenge code

Include any code that is needed to set up your item, but does not need to be seen by the test taker.

  • Importing/creating data

  • Defining the database (SQL)

  • Pre-cleaning

  • Model fitting (e.g. for modeling items focused on metrics)

Code 1

This is what the user will see.

  • Keep this short and related to the point being tested

  • Only include code that is relevant (e.g. include package loading but don't include data prep)

  • Use tags where you want to leave a space for the user to complete. The tags need to follow the pattern:

{{_expr1}}

  • We use expr1, expr2 etc. in the tags so we don't accidentally use reserved words and break the build

  • You need to follow the tag pattern exactly for the blank to appear correctly

  • You can have more than one blank in an item

Variables

This is where we define what the correct answer is.

  • Use the label inside each tag to identify the blank

  • Leave a space before and after the bullet "-"

  • Write the answer inside single quotes

    • Use double quotes to define strings in the code

  • You won't be able to preview your item until you define what goes in the blank

Distractors

  • Use the label inside the tag to identify the blank

  • Leave a space before and after the bullet "-"

  • Write the answer inside single quotes

    • Use double quotes to define strings in the code

  • Provide two or three plausible distractors as a list

  • Distractors do not need to be code that runs

  • Distractors can be provided in any order

Before saving:

  • Add a descriptive title - summarise what you are testing e.g. "Sort data in ascending order"

  • Add your Item Writer ID (we will tell you what your ID is)

  • Preview the item to make sure it looks as expected

Common Problems

If the preview or build fails there are a few common issues that may be the cause.

  • Have you defined a variable that will be the blank in the code?

  • Does the code run in your local environment? If it does, what is the difference?

    • Have you missed out loading a package?

    • Is the data the same?

Did this answer your question?