The discriminant "fill_in_the_blank"
is used to distinguish FITB specifications.
The content specification of the FITB response. May include markdown and placeholders for blanks/boxes.
A sample solution, which may not be blank or invalid.
A default grader, used to evaluate submissions for this response.
A submission for an FITB response is an array of strings that specify the content submitted for each blank. The submission may also be the symbol BLANK_SUBMISSION.
Generated using TypeDoc
Fill-In-The-Blank (FITB) Response Element Specification
An FITB response includes markdown-formatted content containing "blanks" and "boxes" that students fill in to compose their response.
The
FITBSpecification
type alias represents the information needed to specify an FITB response as part of a question.Here's an example of a question with an FITB response. The content is specified as a backtick-quoted multi-string literal in typescript. (Note there are also escaped backticks around a markdown code block).
Blanks and Boxes
To specify a blank, use a pattern like
____BLANK____
. Blanks are rendered as an HTML text input. The number of underscores controls thesize
andmaxlength
of that text input - students may not enter more content than will "fit" in the box. A blank may occur in the middle of a line or on its own.To specify a box, use a pattern like
[[____BOX____\n\n\n]]
. Boxes are rendered as an HTML textarea input. The number of underscores controls the width of the textarea, and the number of newlines controls the height. There must be at least one newline (otherwise use a blank). If there are no underscores, the box will take up the full available width. A box may occur in the middle of a line or on its own. Those are real newlines, though if you're writing in code you'd use the escape sequence\n
. Or, if you use backtick-quoted multi-line string literals, those can just contain natural newlines.Markdown Formatting
The content specification for an FITB response element may contain markdown formatting. In particular, blank/box placeholders may be included inside code boxes.
FITB Submissions
A submission for an FITB response is an array of strings that specify the content submitted for each blank/box. See FITBSubmission for details.