Core model attributes

Matt Leathes edited this page Feb 19, 2018 · 19 revisions

The following extend the Backbone model:

  • configModel (configModel.js)
  • lockingModel (lockingModel.js)
  • notifyModel (notifyModel.js)
  • routerModel (routerModel.js)
  • adaptModel (adaptModel.js)

All core models extend adaptModel (adaptModel.js), and so contain its attributes:

  • courseModel (courseModel.js)
  • contentObjectsModel (contentObjectsModel.js)
  • articleModel (articleModel.js)
  • blockModel (blockModel.js)
  • componentModel (componentModel.js)

In addition, questionModel (questionModel.js) extends componentModel (componentModel.js).

An asterisk denotes that an attribute is required.

Adapt Model Attributes

Attribute Description Default value
_canShowFeedback true
_classes ""
_canReset false
_isComplete Whether the item has been completed. false
_isInteractionComplete false
_requireCompletionOf -1
_isEnabled Controls the availability of the item. If _isEnabled is false, the item is disabled. true
_isResetOnRevisit false
_isAvailable true
_isHidden Controls the display of the item. If _isHidden is false, the item will not be displayed false
_isOptional If set to true, the user will not be required to complete the component in order to complete the course. The completion of the component will still be tracked, but it will be ignored during any completion calculations. false
_isVisible true
_isLocked Menus and other plug-ins can set its value using “_lockType”. Reference Locking objects with '_isLocked' and '_lockType' false
_questionWeight The weight of a particular question, which is used when calculating the score. 1
_buttons An object to store the label values for template buttons. Buttons can then be referenced in templates using {{{_buttons.submit}}} See fig.1.

Figure 1

"_buttons": { 
   "submit":"Submit", 
   "reset":"Reset", 
   "showCorrectAnswer":"ModelAnswer", 
   "hideCorrectAnswer":"My Answer" 
}

Course Model Attributes

Attribute Description Default value
_id* A unique identifier. In the authoring tool, this is randomly generated.
_type* The type of the particular item. Examples include block and component.
title* Used in document title.
_children "contentObjects"
_start
_isReady This is used to determine if the current item is ready (i.e. has been initialised). This needs to be set manually for custom components. For instance, this may be set to true post-render. false

ContentObjects Model Attributes

Attribute Description Default value
_parent "course"
_siblings "contentObjects"
_children "contentObjects"
_ariaLevel If you need to override the default contentObject ARIA level (as set in config.json), set this to any number greater than 0 0

Article Model Attributes

Attribute Description Default value
_parent "contentObjects"
_siblings "articles"
_children "blocks"
_ariaLevel If you need to override the default article ARIA level (as set in config.json), set this to any number greater than 0 0

Block Model Attributes

Attribute Description Default value
_parent "articles"
_siblings "blocks"
_children "components"
_sortComponents true
_ariaLevel If you need to override the default block ARIA level (as set in config.json), set this to any number greater than 0 0

Component Model Attributes

Attribute Description Default value
_parent "blocks"
_siblings "components"
_ariaLevel If you need to override the default component ARIA level (as set in config.json), set this to any number greater than 0 0
_disableAccessibilityState Disables the hidden label that describes the state of the component to screenreader users. Useful if the component is of no interest to a screenreader user - such as an optional decorative graphic component. false

Question Model Attributes

Attribute Description Default value
_isQuestionType true
_shouldDisplayAttempts false
_canShowModelAnswer true
_canShowFeedback true
_canShowMarking true
_questionWeight
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.