Essay with rich text (longtextV2)
Allows the learner to submit an essay response to a Question, of up to 10,000 words.
The essay with rich text Question is referenced by its type in the code, which is "longtextV2"
.
- Read the authoring documentation for a description of what this Question does.
Examples
{
"type": "longtextV2",
"response_id": "60043-a",
"stimulus": "Write about their hobbies in no more than 400 words.",
"max_length": 400,
"character_map": true
}
Attributes
-
type string
Defines the Question type to be rendered.
Must be set to
"longtextV2"
in this case. -
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. -
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.min_height string
The minimum height of the text entry box in pixels.
Example:
50px
-
ui_style.max_height string
The maximum height of the text entry box in pixels. By default, the text box will automatically expand vertically.
Entering a maximum height will render a scrollbar within the text box.
Example:
200px
-
validation object
In this section, configure the correct answer(s) for the question.
-
validation.max_score number
The highest score a marker can award to this question response.
-
validation.min_score_if_attempted number
Positive value indicating the minimum score if a student attempted the question.
Default: 0
-
validation.unscored boolean
When enabled, this option will remove all scoring from the question. This is useful for creating practice questions.
Default: false
-
description string
Deprecated See stimulus_review.
Description of the question and its context to be displayed. It supports HTML entities. -
formatting_options array[string]
An array of text formatting options to make available to the learner.
Default:
["bold", "italic", "underline", "|", "unorderedList", "orderedList"]
Possible values
-
alignCenter
- distributes the text near the center of the text box. -
alignJustify
- spreads the text to fill the width of the text box. -
alignLeft
- aligns text to the left hand side of the text box. -
alignRight
- aligns text to the right hand side of the text box. -
bold
- applies bold formatting to the selected text. -
charactermap
- opens a selection panel to insert special characters. -
codeEditor
- adds a gray shaded area with line numbers and monospaced font. -
codeInline
- formats the selected text as inline code with a gray background and monospaced font. -
image
- inserts an image into the text box. -
indentDecrease
- decreases the leading space of a paragraph. -
indentIncrease
- increases the leading space of a paragraph. -
insertHorizontalRule
- inserts a horizontal line across the text box. -
italic
- applies italic formatting to the selected text. -
orderedList
- creates an ordered (numbered) list. -
redo
- re-applies the last undone action. -
removeFormat
- removes all formatting from the selected text. -
subscript
- formats text as subscript, lowering it slightly below the existing text. -
superscript
- formats text as superscript, raising it slightly above the existing text. -
table
- inserts a table into the text box. -
textDirectionLtr
- sets the text direction from left to right. -
textDirectionRtl
- sets the text direction from right to left. -
underline
- underlines the selected text. -
undo
- reverses the last action. -
unorderedList
- creates an unordered (bullet) list. -
|
- visual separator between toolbar buttons.
-
-
max_length number
The maximum number of words that can be entered in the text box.
Default:
10000
-
character_map array[string]
Defines a list of special characters to be shown when the learner clicks on the character map button in the toolbar. When authoring with Learnosity, this option appears as the "Special characters" field.
Important The host webpage must use UTF-8 format by including the HTML header tag:
<meta charset="utf-8">
Default: A preset list of special characters.
-
spellcheck boolean
Controls whether to use the browsers built-in spellcheck functionality. This can include spellcheck, autocapitalize, autocomplete, and autocorrect if it is available on the learner's device.
See the browser standards documentation for spellcheck on MDN, autocapitalize on MDN, autocomplete on MDN, and autocorrect on Safari.
Note These are browser features and may not always be available on the learner's device.
Default:
true
-
disable_auto_link boolean
Controls whether URLs entered by the learner should automatically become hyperlinks.
Default:
false
-
submit_over_limit boolean
Controls whether the learner is able to save or submit when the word limit has been exceeded.
Default:
false
-
placeholder string
Placeholder text which disappears when the learner starts typing in the text box.
Default:
""
-
show_word_limit string
Controls how the word limit user interface will display.
Default:
"always"
Possible values
-
"always"
- word limit is always shown and updated as the learner types. -
"on-limit"
- word limit is only shown when the word limit is exceeded. -
"off"
- word limit is not shown.
-
-
text_blocks array[string]
In the formula keypad, this allows certain characters to be rendered as text instead of LaTeX. For example, you might want to treat the characters for
cm
(centimeters) as a text string instead of being treated as two mathematical variables, i.e.c × m
.Note Each text block has a maximum length of 9 characters.
See Using the Text Blocks Option for more information.
Default:
[]
-
show_word_count boolean
Controls whether to show the current word count underneath the text box.
Default:
true
-
showHints boolean
In the formula keypad, hovering the mouse over any button will show the button's title and keyboard shortcut. This option controls whether this tooltip should be shown.
Default:
true
-
horizontal_layout boolean
For the formula keypad, controls whether to use a simplified horizontal keypad with two rows of buttons, instead of the standard keypad layout.
Default:
false
Response format
The data returned in the response format for this Question is the essay text, the response that the learner entered with text formatting, and a word count.
Response format examples
{
"value": "<p>But how had the mystic thing been caught? Whisper it not, and I will tell; with a treacherous hook and line, as the fowl floated on the sea. At last the Captain made a postman of it; tying a lettered, leathern tally round its neck, with the ship’s time and place; and then letting it escape.</p>",
"wordCount": 56,
"type": "string",
"apiVersion": "v2.173.0",
"revision": 1
}
Response attributes
-
value string
The essay text, the response that the learner entered, with HTML text formatting.
-
wordCount number
A value indicating how much text was written in the learner response.
-
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
"string"
. -
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.