activities/text/TextActivityDocument. TextActivityDocument

This is the HTML DOM element used in text activities like FillInBlanks,
IdentifyText, OrderText and Complete. It contains the main document of
the activity, usually with some elements marked as "targets". In FillInBlanks, this
targets are encapsulated in TextTarget objects.

Constructor

new TextActivityDocument()

TextActivityDocument constructor

Members

lastBoxId :number

Index of the last ActiveBox activated.

Type:
  • number

numTargets :number

Number of targets

Type:
  • number

p :object

The main document, represented as a collection of DOM objects

Type:
  • object

style :object

Collection of named styles of the document

Type:
  • object

tabSpc :number

Number of blank spaces between tabulators.

Type:
  • number

targetType :string

Type of targets used in this activity. Possible values are: TT_FREE, TT_CHAR, TT_WORD
and TT_PARAGRAPH.

Type:
  • string

tmb :object

A bag of TargetMarker objects

Type:
  • object

(static) DEFAULT_DOC_STYLE

Default style

Methods

getAttributes() → {object}

Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.

Returns:
  • The resulting object, with minimal attrributes
Type: 
object

getFullStyle(name) → {object}

Gets a style object filled with default attributes plus attributes present in the
requested style name.

Parameters:
NameTypeDescription
namestring

The requested style name

Returns:
  • The result of combining default with the requested style
Type: 
object

getRawText() → {string}

Gets the full text of this document in raw format

Returns:
  • The text of the document.
Type: 
string

readDocAttributes($xml) → {object}

Reads sets of text attributes, sometimes in form of named styles

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The XML element to parse

Returns:
Type: 
object

setAttributes(data) → {module:activities/text/TextActivityDocument.TextActivityDocument}

Reads the properties of this TextActivityDocument from a data object

Parameters:
NameTypeDescription
dataobject

The data object to be parsed, or just the text content

setProperties($xml, mediaBag)

Loads the document settings from a specific JQuery XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The XML element to parse

mediaBagmodule:bags/MediaBag.MediaBag

The media bag used to load images and media content