project/JClicProject. JClicProject

JClicProject contains all the components of a JClic project: activities, sequences, media
files, descriptors and metadata.

This encapsulation is achieved by three auxiliary objects:

  • ProjectSettings: stores metadata like full title, description, authors, languages,
    educational topics...
  • ActivitySequence: defines the order in which the activities must be shown.
  • MediaBag: contains the list of all media files used by the activities

Constructor

new JClicProject()

JClicProject constructor

Members

activitySequence :module:bags/ActivitySequence.ActivitySequence

Object containing the order in which the activities should be played

basePath :string

Relative path or absolute URL to be used as a base to access files, usually in conjunction
with module:JClicPlayer.JClicPlayer#basePath

Type:
  • string

code :string

Optional property that can be used by reporting systems

Type:
  • string

mediaBag :module:bags/MediaBag.MediaBag

The collection of all media elements used in this project

name :string

The project's name

Type:
  • string

path :string

Full path of this project

Type:
  • string

reportableActs :number

Number of activities suitable to be included reports

Type:
  • number

settings :module:project/ProjectSettings.ProjectSettings

Object containing the project settings

skin :module:skins/Skin.Skin

The object that builds and manages the visual interface presented to users

type :string

Optional property that can be used by reporting systems

Type:
  • string

version :string

The version of the XML file format used to save the project (currently 0.1.3)

Type:
  • string

zip :external:JSZip

The JSZip object where this project is stored (can be null)

Methods

end()

Run finalizers on realized objects

getActivity(name) → {module:Activity.Activity}

Finds activities by name and builds the corresponding Activity object.

Parameters:
NameTypeDescription
namestring

The name of the requested activity

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

getJSON(spaceopt) → {string}

Gets a JSON string representing the content of this project. This string can be transformed later into a data
object suitable for setAttributes.

Parameters:
NameTypeAttributesDefaultDescription
spacenumber<optional>
0

The number of white spaces to place between items. Defaults to zero (meaning all the JSON rendered in one single line)

Returns:
  • The JSON text
Type: 
string

realize(ps)

Builds the Skin, EventSounds and MediaBag fonts associated to this project.

Parameters:
NameTypeDescription
psmodule:JClicPlayer.JClicPlayer

The PlayStation (usually a JClicPlayer) linked to this project.

setAttributes(data, path, zipopt, optionsopt) → {module:project/JClicProject.JClicProject}

Loads the project settings from a data object

Parameters:
NameTypeAttributesDescription
dataobject

The data object

pathstring

The full path of this project

zipexternal:JSZip<optional>

An optional JSZip object where this project is encapsulated

optionsobject<optional>

An object with miscellaneous options

setProperties($xml, path, zipopt, optionsopt) → {module:project/JClicProject.JClicProject}

Loads the project settings from a main jQuery XML element

Parameters:
NameTypeAttributesDescription
$xmlexternal:jQuery

The XML element

pathstring

The full path of this project

zipexternal:JSZip<optional>

An optional JSZip object where this project is encapsulated

optionsobject<optional>

An object with miscellaneous options