Question Upload Format - rw-moore/SciLO GitHub Wiki

Format of Uploadable JSON object

Key Type Info Example
version string Version of the application when the question was downloaded. "0.1.1"
timestamp integer Unix timestamp of when the question was downloaded. 1618422122226
questions Array Array of Question Objects. []

Format of Question JSON object

Key Type Info Example
id integer id of the question (will be replaced by the backend) 1
title string string of the question title "Decaying Energy of a Pendulum"
text string string of the question's text "A simple pendulum is observed to oscillate with a slowly decaying amplitude..."
create_date string String representation of when the question was created "2021-04-08T23:04:00Z"
last_modify_date string String representation of when the question was last modified "2021-04-13T17:56:43Z"
author string String representation of the question's author "instructor email: [email protected]"
grade_policy GradePolicy JSON object containing onformation about how the question will be graded {}
course integer Course id of the course the question belongs to (will be overwritten by the backend 1
quizzes Array Array of quizzes the question is currently in []
mark integer total mark for the question (will be overwritten by the backend and the tree) 0
tags Array Array of tag JSON objects containing the tags of the question []
variables Variable Variable object containing information about the question script {}
responses Array Array of response JSON objects containing information about the fields for the question []
tree QuestionTree QuestionTree object containing information about how to grade the question {}

Format of GradePolicy object

Key Type Info Example
max_tries integer The maximum number of tries the student could have on the question 3
free_tries integer The number of tries the student gets before a penalty is applied 1
penalty_per_try integer The percentage that should be deducted for each try beyond the number of free_tries 20

Format of Tag object

Key Type Info Example
id integer id of the tag object in the database (will be overwritten by the backend) 1
name string string of the tag name (what the instructor will see) "integration"

Format of Variable object

Key Type Info Example
type string Encodes information about what this object contains (in current system it should always be "script") "script"
value string The string representation of the script for the question. ""
language string The language the script is written in "sage"

Format of Response object

Key Type Info Example
id integer id for the response object in the backend (will be overwritten by the backend) 1
answers Array Array of answer JSON objects, only used for multiple choice questions []
index integer position of this field within the question 1
text string String that will be displayed beside the response field in the question ""
identifier string string to represent the field within the question script and tree "_value"
mark integer Mark for the question (only used by multiple choice) 5
patterntype string One of ("Custom", "Positive Integer", "Integer" "Positive Real" or "Real") controlling the feedback given to the student while answering the question (only used by input fields) "Custom"
pattern string The regex pattern to compare with for giving feedback to the student ""
patternflag string regex flags used for the comparison ""
patternfeedback string feedback shown to the student if their response doesn't match the regex of the pattern ""
question integer The question this response field belongs to (will be filled by the backend) 1
type Type Type JSON object containing additional information about the response {}

Format of Answer objects

Key Type Info Example
text string Text of the multiple choice option "Red"
grade number Grade given if the student selects this option 1.5
comment string feedback given if the student selects this option ""

Format of Type object

Key Type Info Example
name string Type of the response field ("tree" or "multiple") "tree"
label string Label that shows up beside the input box (only used for input fields) "Answer"
single boolean Whether the multiple choice field should allow selecting multiple answers true
dropdown boolean Whether the multiple choice field should display as a dropdown or separate checkboxes true
shuffle boolean Whether the multiple choice field should shuffle the options false

Format of QuestionTree object. This is the data present in all nodes, each node may have additional properties detailed below.

Key Type Info Example
name string Only present in root. "tree"
type integer What type of node this is (-1:root, 1:decision, 2:score, 3:score mult choice) -1
policy string How to combine the scores for this node's children ("sum", "max", "min") "sum"
children Array Array of QuestionTree objects []
bool boolean Which parent branch leads to this node (ignored by direct children of the root) true

Format of Score Nodes.

Key Type Info Example
title string Shown in the question tree to help instructors understand their tree. "Correct answer"
score Number The score to give the student if they reach this node 100
feedback string Feedback to give the student if they reach this node "Congrats"

Format of Decision Nodes.

Key Type Info Example
title string The criteria by which this node decides which children to evaluate. "_value == 3"
feedback Object what feedback should the node return if the title results in "true", "false", or "error" {}

Format of Score Multiple Choice Nodes.

Key Type Info Example
title string Shown in the question tree to help instructors understand their tree. "Score dropdown"
identifier string identifier of the multiple choice response field to grade "_multChoice"
feedback string Feedback to give the student if they evaluate this node ""