This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans.
See our page on recommended deployment patterns for more information.
Feature Types
This article outlines the different Feature Types which are available in the Questions API. These are generally used as stimulus for questions.
We also provide a simpler html format for features, with reduced functionality.
Audio player
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "audioplayer" |
Use the value 'audioplayer' for this field. |
metadata | object | undefined |
Additional data for the audio player |
metadata.transcript | string | undefined |
The transcript for the audio being played |
simplefeature_id | string | "" |
|
src | string | undefined |
Embed an audio clip as an additional feature to the current content. You can use your own audio or audio hosted on the Internet. |
player | string | "block" |
Specify the type of audio player between the options: block, button, minimal, bar. |
playback_limit | number | 0 |
Number of play attempts the user has, with 0 being unlimited. |
waveform | string | undefined |
URI of the waveform to display. |
format | string | undefined |
Allows specifying the audio format instead of relying on the file extension on src. If format is not defined and src does not have a file extension, the format is assumed to be "mp3". |
Audio player example
{
"feature_id": "7002",
"type": "audioplayer",
"player": "block",
"src": "https://s3.amazonaws.com/assets.learnosity.com/questiontypes/content/audiofeaturedemo.mp3",
"waveform": "http://assets.learnosity.com/questiontypes/content/waveform.png"
}
Calculator example
{
"feature_id": "7007",
"type": "calculator",
"mode": "basic"
}
Custom Feature Draft
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "customfeature" |
|
custom_type | string | undefined |
A key that identifies this custom feature type. |
js | string | undefined |
A URL to a JavaScript file which defines an AMD module for the feature. See this knowledgebase article for more information. |
css | string | undefined |
A URL to a CSS file containing styles for the feature. |
version | string | undefined |
A number that identifies the version of the feature e.g. v0.1.0. |
Custom Feature Draft example
{
"feature_id": "70010",
"type": "customfeature",
"js": "//docs.learnosity.com/demos/products/questionsapi/customfeatures/textinput/index.js",
"css": "//docs.learnosity.com/demos/products/questionsapi/customfeatures/textinput/index.css",
"placeholder": "Placeholder text"
}
Formula input Deprecated
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "formulainput" |
Use the value 'formulainput' for this field. |
simplefeature_id | string | "" |
|
handwriting_recognises | string | "standard" |
A string with the name of one of the available math grammar sets. |
showHints | boolean | true |
Whether to show hints or not |
value | string | undefined |
LaTeX math to display when rendered. |
symbols | array | [] |
An array containing either strings or a nested objects of symbol definitions. |
container | object | undefined |
Object that defines styles for the input container. |
container.height | string | undefined |
The height of the input containers including units. Example: "100px" |
container.width | string | undefined |
The width of the input containers including units. Example: "100px" |
ui_style | object | undefined |
Object used to control different aspects of the UI |
ui_style.type | string | "floating-keyboard" |
Keyboard style. See the knowledgebase article on formula keyboard types for more information. |
ui_style.min_width | string | "" |
Controls the minimum width of the input area, e.g. 550px |
input | string | undefined |
CSS selector for input elements which will receive the entered LaTeX math. |
Formula input Deprecated example
{
"feature_id": "7005",
"type": "formulainput",
"value": "xyz"
}
Imagetool
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "imagetool" |
Use the value 'imagetool' for this field. |
simplefeature_id | string | "" |
|
image | string | "//assets.learnosity.com/questiontypes/content/b98a75cc-7010-4736-9957-b1b6759cb796.png" |
Supports a protractor, ruler (options below) or a URI to an image. Ruler options:
DPI refers to dots per inch and is a setting you can choose when exporting images from many graphics design software applications. Make sure to test the ruler against the image you upload to make sure the ruler matches your image. |
rotate | boolean | true |
Renders a rotate icon that is draggable and allows the image rotate. |
width | string | undefined |
Width of the image in pixels. Can only be used with custom URI image. |
height | string | undefined |
Height of the image in pixels. Can only be used with custom URI image. |
button | boolean | undefined |
Renders a button for toggling the image tool. |
buttonicon | string | "Generic" |
Supports a protractor, ruler, generic or a URI to an image. |
label | string | undefined |
Toggle button label text to display. |
visible | boolean | undefined |
Overrides the default visibility of the Image Tool when specified. |
Imagetool example
{
"feature_id": "7006",
"type": "imagetool",
"image": "protractor"
}
Line Reader
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "linereader" |
Use the value 'linereader' for this field. |
simplefeature_id | string | "" |
|
button | boolean | true |
A button to toggle the Line Reader is displayed when this value is true. |
visible | boolean | false |
This value determines the initial visibility of the Line Reader. |
Line Reader example
{
"feature_id": "7008",
"type": "linereader",
"visible": true
}
Video player
Attributes
Key | Type | Default | Description |
---|---|---|---|
type | string | "videoplayer" |
Use the value 'videoplayer' for this field. |
metadata | object | undefined |
Additional data for the video player |
metadata.transcript | string | undefined |
The transcript for the video being played |
simplefeature_id | string | "" |
|
player_type | string | undefined |
Defines the type of video player you want to create. |
heading | string | undefined |
Heading of the video |
caption | string | undefined |
Description of the video being played |
crossorigin | string | "anonymous" |
Defines the crossorigin attribute for the video player. Values must be either "use-credentials" , "anonymous" or "no-cors" . To remove the attribute, "no-cors" must be used. Not setting a value, or setting an invalid value will result in "anonymous" for backwards compatibility. |
Video player example
{
"feature_id": "7003",
"type": "videoplayer",
"src": "https://www.youtube.com/watch?feature=player_detailpage&v=StPjbJc8Lcc"
}