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. Click here to render example features on this page.

We also provide a simpler html format for features, with reduced functionality.

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"
}

Attributes

Key Type Default Description
type string "calculator" Use the value 'calculator' for this field.
simplefeature_id string ""
mode string "basic" Mode of calculator to render. Values: basic, scientific

Calculator example

{
    "feature_id": "7007",
    "type": "calculator",
    "mode": "basic"
}

Attributes

Key Type Default Description
type string "counter" Use the value 'counter' for this field.
length number 30 Counter length in seconds
direction string "down" Direction for the counter to count, options: 'up', 'down'
title string undefined Title visible on the counter UI
template string "Beginning in {num} seconds..." Counter text content, {num} denotes the location of the counter number
show_minutes boolean false Determines the display format for the counter. If true then the format is mm:ss, if false only the seconds are displayed.

Counter example

{
    "feature_id": "7001",
    "type": "counter",
    "length": 61,
    "direction": "down",
    "title": "Audio Stimulus",
    "template": "Playing in {num} secs!"
}

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"
}

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"
    
}

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:
  • ruler-15cm-72dpi
  • ruler-30cm-72dpi
  • ruler-6in-72dpi
  • ruler-12in-72dpi
  • ruler-6in-15cm-72dpi
  • ruler-12in-30cm-72dpi

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"
}

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
}

Attributes

Key Type Default Description
type string "sharedpassage" Use the value 'sharedpassage' for this field.
metadata object undefined Additional data for the Passage
metadata.lexile string undefined The Lexile framework for reading is an educational tool that uses a measure called a Lexile to match readers with books, articles and other leveled reading resources.
metadata.flesch_kincaid string undefined A grade level, making it easier for teachers, parents, librarians, and others to judge the readability level of various books and texts.
heading string undefined Heading of the Passage
paginated_content boolean false Enabling this option will allow you to set up multiple pages in your passage, that you can click through using arrow buttons, like pages in a book.
is_math boolean false Set to true to have LaTeX or MathML to be rendered with mathjax.
instructor_stimulus string undefined It will be displayed above the sharedpassage's heading.

Passage example

{
    "feature_id": "7004",
    "type": "sharedpassage",
    "content": "<div style='border:1px solid red;padding:1em;'><h2>Example HTML</h2><p>Paragraph text.</p>"
}

Attributes

Key Type Default Description
data-type string "scrollablepassage" Use the value 'scrollablepassage' for this field.
data-width string "100%" Width of the scrollable passage container in pixels or percentage.
data-height string "300px" Height of the scrollable passage container in pixels or percentage.
data-border boolean false Whether to display a wrapper around the scrollable passage container.
data-subtract-height string "0px" A value which reduces the height of the passage container.

Scrollable Passage example

<div class="learnosity-feature" data-type="scrollablepassage" data-border="true" data-height="150px"><p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eget mauris libero. Nulla sit amet felis in sem posuere laoreet ut quis elit. Aenean mauris massa, pretium non bibendum eget, elementum sed nibh. Nulla ac felis et purus adipiscing rutrum. Pellentesque a bibendum sapien. Vivamus erat quam, gravida sed ultricies ac, scelerisque sed velit. Integer mollis urna sit amet ligula aliquam ac sodales arcu euismod. Fusce fermentum augue in nulla cursus non fermentum lorem semper. Quisque eu auctor lacus. Donec justo justo, mollis vel tempor vitae, consequat eget velit.</p><p>Vivamus sed tellus quis orci dignissim scelerisque nec vitae est. Duis et elit ipsum. Aliquam pharetra auctor felis tempus tempor. Vivamus turpis dui, sollicitudin eget rhoncus in, luctus vel felis. Curabitur ultricies dictum justo at luctus. Nullam et quam et massa eleifend sollicitudin. Nulla mauris purus, sagittis id egestas eu, pellentesque et mi. Donec bibendum cursus nisi eget consequat. Nunc sit amet commodo metus. Integer consectetur lacus ac libero adipiscing ut tristique est viverra. Maecenas quam nibh, molestie nec pretium interdum, porta vitae magna. Maecenas at ligula eget neque imperdiet faucibus malesuada sed ipsum. Nulla auctor ligula sed nisl adipiscing vulputate. Curabitur ut ligula sed velit pharetra fringilla. Cras eu luctus est. Aliquam ac urna dui, eu rhoncus nibh. Nam id leo nisi, vel viverra nunc. Duis egestas pellentesque lectus, a placerat dolor egestas in. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec vitae ipsum non est iaculis suscipit.</p></div>

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

Video player example

{
    "feature_id": "7003",
    "type": "videoplayer",
    "src": "https://www.youtube.com/watch?feature=player_detailpage&amp;v=StPjbJc8Lcc"
}