Image annotation upload (imageupload)
The image annotation upload Question is referenced by its Question type in the code, which is imageupload
. This Question allows students to upload and annotate an image. The Question can be used in two ways. One way is using the annotation tool to add response boxes and label an image that has been uploaded by the author. This can be auto-scored. Another way is asking the students to upload an image themselves, directly from their machine and then use the annotation tool to place and label the response areas. In this case, the Question cannot be auto scored.
- Read the authoring documentation for a description of what this Question does.
- Read the developer reference documentation to see configuration options for this Question type.
Examples
{
"response_id": "60008",
"type": "imageupload",
"stimulus": "[Some stimulus text here]"
}
Attributes
-
is_math boolean
Set to true to have LaTeX or MathML contents to be rendered with mathjax.
Default: false
-
metadata object
Object containing additional information about the question.
-
metadata.distractor_rationale string
Used to display individual response feedback/rationale to the student.
-
metadata.rubric_reference string
A unique identifier for the rubric to be used with the question - defaults to course rubric if assigned in activity
-
metadata.sample_answer string
A sample answer to be displayed on the Learnosity Reports API. HTML is supported.
-
metadata.acknowledgements string
References for any text passages, documents, images etc. used in the question.
-
stimulus string
The question stimulus. This can include text, tables, images, resources and LaTeX entered via the Math Editor.
-
stimulus_review string
HTML/Text content displayed only in review state rendered above the response area. Supports embedded Feature <span> tags. Will override stimulus in review state.
-
instructor_stimulus string
HTML/Text content displayed when
showInstructorStimulus
is set totrue
on the activity. Supports embedded Feature <span> tags. -
type string
Type of question being asked, e.g. 'association'
Default: "imageupload"
-
ui_style object
Object used to control different aspects of the UI
-
ui_style.fontsize string
Controls the size of base font for this question. Options are among 'small', 'normal', 'large', 'xlarge' and 'xxlarge'.
Default: "normal"
-
ui_style.validation_stem_numeration string
Numeration character to be displayed to the left of the validation label.
Default: "number"
-
feedback_attempts number
If instant_feedback is true, this field determines how many times the user can click on the 'Check Answer' button. 0 means unlimited.
Default: 0
-
instant_feedback boolean
Flag to determine whether to display a 'Check Answer' button to provide instant feedback to the user.
Default: false
-
validation object
In this section, configure the correct answer(s) for the question.
-
validation.allow_negative_scores boolean
Negative scores will be normalised to zero by default. Allowing negative scores, on the other hand, means that the score can drop below zero when penalties are applied.
Default: false
-
validation.penalty number
Value indicating the marks deducted for an incorrect response.
Default: 0
-
validation.min_score_if_attempted number
Positive value indicating the minimum score if a student attempted the question.
Default: 0
-
validation.scoring_type string
The way in which marks are distributed for the question. Possible options:
Exact Match - All parts of the question must be answered correctly to receive a mark.
Partial Match - Each correct response element will be scored individually, and the overall question score will be divided between responses.
Partial Match per Response - Each correct response element will be awarded an individual score.Default: "exactMatch"
-
validation.unscored boolean
When enabled, this option will remove all scoring from the question. This is useful for creating practice questions.
Default: false
-
validation.valid_response object
An object containing the valid response score and value.
-
validation.valid_response.score number
Score awarded for the correct response(s).
Default: 1
-
validation.valid_response.value array
An array containing the valid response for each validation area, in corresponding order.
-
validation.automarkable boolean
Defines whether the question will be marked automatically, or must be marked manually.
Default: true
-
validation.enable_fullwidth_scoring boolean
For languages such as Japanese, where full-width and half-width characters are used, validate responses with either type of character width. For example, in this question: What do we call '犬' in English? And you have set 'Dog' (full-width) as the correct answer, if the learner enters 'Dog' (full-width) or 'Dog' (half-width) these will both be marked as correct responses when this option is enabled.
Default: false
-
image imageObject
Define an image to be annotated.
-
image.source string
The image that should be displayed.
-
image.alt textarea
The alternative text of the image.
Default: ""
-
image.width number
Enter a numeric value for the width of the image. This value should be a pixel (px) value, but you do not need to type px into the field.
-
image.height number
Enter a numeric value for the height of the image. This value should be a pixel (px) value, but you do not need to type px into the field.
-
image.preview hidden
Preview of the chosen image
-
imageValidationAreas array
Highlight the areas you want the student to place the text boxes inside of, using the hotspot tool.
-
imageValidationAreas[ ][ ].x number
-
imageValidationAreas[ ][ ].y number
-
imageValidationAreas[ ][ ][ ].x number
-
imageValidationAreas[ ][ ][ ].y number
-
max_width stringUnits
Max width of response area. Default units are "px" and will be appended if no units provided. For units other than "px", provide them in the field. E.g. "10em", or set to 'none' to stretch to full width of container.
-
spellcheck boolean
Enable or disable browser spellcheck, autocapitalize, autocomplete and autocorrect attributes on the user response area.
Default: true
-
case_sensitive boolean
If true, responses will be compared against valid_responses considering the letters' case.
Default: false
Response format
The data returned in the response format for this Question describes the annotations, which are the text entries that the student added on top of the image.
Response format examples
{
"value": {
"annotations": [
{
"id": "2224",
"content": "Annotation on uploaded image.",
"offset": {
"top": 46.15384615384615,
"left": 27.09030100334448,
"leftOffsetRatio": 0.25418060200668896,
"topOffsetRatio": 0.4280936454849498
}
}
]
},
"type": "object",
"apiVersion": "v2.173.0",
"revision": 1,
"feedbackAttemptsCount": 2
}
Response attributes
-
value object
The content from the student response.
-
value.annotations array
The information about annotations created by the student.
-
value.annotations.id string
A unique id used to identify each annotation.
-
value.annotations.content string
The text content entered by the student.
-
value.annotations.offset object
Contains coordinates and offset information used to place the annotation on the image.
-
type string
Informs the scoring engine about what kind of data to expect in the values entered by the student. For this Question type, you must always supply a string for this attribute with the value
"object"
. -
apiVersion string
The version of the Questions API that returned this response.
-
revision numeric
Keeps track of the number of Question attempt submissions, i.e. how many times the student answered the Question and submitted it.
-
feedbackAttemptsCount numeric
Keeps track of the number of feedback attempts.