A unique ID for the question. Must be distinct from all other question IDs.
Also used as part of the composite seed for UUID generation
by an ExamGenerator using the "plain"
or "uuidv5" strategies.
The number of points the question is worth overall.
Markdown-formatted question description.
The response for this question, which is the part of the question students interact with to enter their answer. Depending on the kind of response, this may also contain a significant amount of content as well.
An optional question title.
Tags for this question that may be used to pick it out of a question bank.
A skin for this question, or a "chooser" that selects a skin from a set of possible skins. A question's skin is used in rendering its description and response.
An absolute path to a directory containing assets for this question. Assets will be
available to the frontend at {{frontend_assets_dir}}/question/{{question_id}}/ where
{{frontend_assets_dir}} is configured by the exam generator (defaults to "assets").
Tip: Use __dirname
to get an absolute path to an assets folder located in the
same directory as the file in which you define your specification. For example,
__dirname + "/assets"
.
A unique ID for the section. Must be distinct from all other section IDs.
Also used as part of the composite seed for UUID generation
by an ExamGenerator using the "plain"
or "uuidv5" strategies.
The section title.
Markdown-formatted section description, shown before its questions.
Specifies the sequence of questions in this section. Each entry in the array may either specify a particular question or a "chooser" that selects one (or more) from a set of possible questions that an individual student might be assigned.
Markdown-formatted section reference material, shown to the side of its description and questions.
A skin for this section, or a "chooser" that selects a skin from a set of possible skins. A section's skin is used in rendering its description and response, and also affects the rendering of its questions (each question uses a compound skin created by layering its own skin on top of the section skin).
The initial width, in percent 0-100, of the reference material for this section.
An absolute path to a directory containing assets for this section. Assets will be
available to the frontend at {{frontend_assets_dir}}/section/{{section_id}}/ where
{{frontend_assets_dir}} is configured by the exam generator (defaults to "assets").
Tip: Use __dirname
to get an absolute path to an assets folder located in the
same directory as the file in which you define your specification. For example,
__dirname + "/assets"
.
A unique ID for the exam. Also used as part of the composite seed for UUID generation
by an ExamGenerator using the "plain"
or "uuidv5" strategies.
Title shown at the top of the exam.
Markdown-formatted exam instructions, shown at the top of the exam.
Specifies the sequence of sections on this exam. Each entry in the array may either specify a particular section or a "chooser" that selects one (or more) from a set of possible sections that an individual student might be assigned.
Markdown-formatted announcements that will be shown in an "alert" style box at the top of the exam, right below the main instructions. These are intended to stand out from the regular instructions.
A markdown-formatted message that appears at the bottom left of the page, right above the "Answers File" button. A suggested use is to specify how students can ask questions during the exam, perhaps including a link to e.g. a course forum or video meeting with proctors.
A markdown-formatted message that appears at the bottom left of the page, right below the "Answers File" button. A suggested use is to remind students why to click the "Answers File" button, e.g. "Download an answers file to submit to Canvas".
A markdown-formatted message that appears when students open the "Answers File" modal. A suggested use is to give students instructions for downloading and turning in their answers file.
A markdown-formatted message that appears at the bottom of the exam. A suggested use is to confirm that students have reached the bottom of the exam and remind them to download the answers file and turn it in elsewhere (e.g. to Canvas or some other LMS).
Defaults to MK_DEFAULT_DOWNLOAD_MESSAGE
TODO this will probably be moved elsewhere.
An absolute path to a directory containing assets for this exam. Assets will be
available to the frontend at {{frontend_assets_dir}}/exam/{{exam_id}}/ where
{{frontend_assets_dir}} is configured by the exam generator (defaults to "assets").
Tip: Use __dirname
to get an absolute path to an assets folder located in the
same directory as the file in which you define your specification. For example,
__dirname + "/assets"
.
This factory function returns a QuestionChooser that will randomly select a set of n questions matching the given tag. If there are not enough questions matching that tag, the chooser will throw an exception.
Choose only questions with this tag
The number of questions to choose
This factory function returns a QuestionChooser that will randomly select a set of n questions from the given set of questions or question bank. If there are not enough to choose n of them, the chooser will throw an exception.
This factory function returns a chooser that simply selects all its choices. The intended use is to ensure they are grouped together when nested within other randomization constructs.
This factory function returns a chooser that simply selects all its choices. The intended use is to ensure they are grouped together when nested within other randomization constructs.
Generated using TypeDoc
Exam Specification
The general structure of an exam specification is:
IDs
Question, section, and exam specifications require unique IDs. (They must be unique within their individual component specification category - e.g. it would be ok to have a question and section with the same ID.)
Valid IDs must start with a letter and may contain letters, numbers, underscores, and dashes (i.e. they must match the regex
/^[a-zA-Z][a-zA-Z0-9_\-]*$/
). The isValidID function tests this.Student "uniqnames" are also required to meet these same criteria.
When a question/section/exam is assigned to a student, it is given a UUID, with these original IDs used as part of the seed (assuming one of the deterministic UUID generation policies is used). So, don't change the IDs after you've started giving/grading an exam (or ideally don't change them EVER once a question is put into some use).
Specifying Question/Section Choosers
Questions within a SectionSpecification are given as a list of specific questions or QuestionChoosers that assign a (potentially different) subset of questions to each individual student. You may create custom question choosers or use predefined factory functions to create them:
Sections within an ExamSpecification are given as a list of specific sections or SectionChoosers that assign a (potentially different) subset of sections to each individual student. You may create custom section choosers or use predefined factory functions to create them:
Randomizing Question/Section Ordering
Use SHUFFLE to randomize the ordering (on a per-student basis) of a list of questions or sections.
Customizing Existing Specifications
Use the CUSTOMIZE function if you've got an existing specification (e.g. from a question bank) that you just need to tweak slightly.
Student information
Presently, the only information needed for students are names and "uniqnames", which are a unique identifier for each student. These must satisfy the same