Package | impression.persistence |
Class | public class Lesson |
Inheritance | Lesson ![]() |
Typically, a Lesson object is created from an XML file (using the fromXML
constructor) generated by the Impression Content Creation Tool (CCT). The lesson XML file should
contain all the data needed to successfully initialize and display the courseware.
Property | Defined By | ||
---|---|---|---|
classification : String
The classification level of the lesson. | Lesson | ||
documentID : String [read-only]
Uniquely identifies a given release of a lesson. | Lesson | ||
identifier : String
The human-readable identification code for the object. | Lesson | ||
lessonID : String [read-only]
The unique identifier of the object. | Lesson | ||
maps : LessonMapCollection [read-only]
The object's lesson map collection. | Lesson | ||
properties : PersistedPropertiesCollection [read-only]
The object's properties collection. | Lesson | ||
storyboards : StoryboardCollection [read-only]
The object's storyboard collection. | Lesson | ||
title : String = New Lesson
The title of the lesson. | Lesson |
Method | Defined By | ||
---|---|---|---|
Lesson(title:String = null, identifier:String = null, lessonID:String = null, documentID:String = null, createDefaultMap:Boolean = true)
Creates a new instance of the Lesson class. | Lesson | ||
Returns a copy of the object. | Lesson | ||
[static]
Returns a new instance of the Lesson class based on the data contained in the XML object. | Lesson | ||
isImpressionXML(root:XML):Boolean [static]
Returns true if the XML node is a valid Impression lesson node. | Lesson | ||
toString():String
Returns the string representation of the specified object. | Lesson | ||
toXML(preserveDocumentID:Boolean = false):XML
Returns an Impression-format XML object containing all the data from the object. | Lesson |
classification | property |
public var classification:String
The classification level of the lesson.
The classification level is typically set to the highest classification level of any Storyboard
object within
the lesson. If the classification
property is not the empty string (""), the toXML()
method
will include XML comments identifying the classification level of the lesson.
The default value is the empty string ("")
.
See also
documentID | property |
documentID:String
[read-only] Uniquely identifies a given release of a lesson.
The documentID
property value is typically a GUID string but can be any value. The Impression
CCT automatically generates a new documented GUID each time an XML file is created.
The default value is A String generated by the
.newGUID
method of the impression.utilities.GUID
class
public function get documentID():String
See also
identifier | property |
public var identifier:String
The human-readable identification code for the object.
The identifier is typically used as a human-readable code to uniquely identify the lesson within a course when the title
property is not sufficiently unique.
The default value is the empty string ("")
.
lessonID | property |
lessonID:String
[read-only] The unique identifier of the object.
The lessonID
property value is typically a GUID string, but can be any value.
The default value is A String generated by the
.newGUID
method of the impression.utilities.GUID
class
public function get lessonID():String
See also
maps | property |
maps:LessonMapCollection
[read-only] The object's lesson map collection.
The object is read-only; the data contained in the collection is read-write.
public function get maps():LessonMapCollection
properties | property |
properties:PersistedPropertiesCollection
[read-only] The object's properties collection.
The object is read-only; the data contained in the collection is read-write.
public function get properties():PersistedPropertiesCollection
storyboards | property |
storyboards:StoryboardCollection
[read-only] The object's storyboard collection.
The object is read-only; the data contained in the collection is read-write.
public function get storyboards():StoryboardCollection
title | property |
public var title:String = New Lesson
The title of the lesson.
The default value is New Lesson
.
Lesson | () | Constructor |
public function Lesson(title:String = null, identifier:String = null, lessonID:String = null, documentID:String = null, createDefaultMap:Boolean = true)
Creates a new instance of the Lesson class.
If any parameter value is null
, the default value will be used.
title:String (default = null ) — A String specifying the title of the object.
| |
identifier:String (default = null ) — A String specifying the human-readable identification code of the object.
| |
lessonID:String (default = null ) — A String specifying a unique identifier for the object.
| |
documentID:String (default = null ) — A String specifying a unique identifier for this version of the object.
| |
createDefaultMap:Boolean (default = true ) — A Boolean value specifying whether or not a default map should be created for the object.
|
clone | () | method |
public function clone(lessonID:String = null, documentID:String = null, deep:Boolean = true):Lesson
Returns a copy of the object.
If the lessonID
parameter is null
, the current lessonID
property value is
used. If the lessonID
parameter is not null
, the parameter value is used. If the
documentID
parameter is null
, the current documentID
property value is
used. If the documentID
parameter is not null
, the parameter value is used.
If the deep
parameter is true
, the current object's maps
and
storyboards
collections are cloned with their deep
parameter set to true
,
creating copies of the contained maps and storyboards. If the deep
parameter is false
,
the maps
and storyboards
collections are cloned with their deep
parameter
set to false
, creating references to the current object's contained maps and storyboards.
Parameters
lessonID:String (default = null ) — The value of the lessonID property of the copied object.
| |
documentID:String (default = null ) — The value of the documentID property of the copied object.
| |
deep:Boolean (default = true ) — Specifies how the contained Storyboard and LessonMap objects should be added to the copy.
|
Lesson — A copy of the object.
|
See also
fromXML | () | method |
public static function fromXML(source:XML):Lesson
Returns a new instance of the Lesson class based on the data contained in the XML object.
If source
is null
, an empty Lesson object is returned.
If the source.name
property is not "lesson", an error is thrown.
The XML format of a Lesson object is:
If any of the expected child XML nodes is not found, the returned lesson will have an empty properties
, maps
,
or storyboards
collection. If more than one XML node of the expected type is found, the returned lesson will use the last one
found. Additional XML nodes are ignored.
Parameters
source:XML — The object containing the data to use.
|
Lesson — A Lesson object containing the data from the source XML object.
|
ArgumentError — node is not a <lesson> element (ArgumentError).
|
See also
isImpressionXML | () | method |
public static function isImpressionXML(root:XML):Boolean
Returns true if the XML node is a valid Impression lesson node.
This routine returns true
if the name
property of the root
parameter is "lesson", and there are nodes named maps
and storyboards
that
are direct children of root
.
Parameters
root:XML — A LessonMap object to find.
|
Boolean — A Boolean value indicating whether or not root is a valid Impression lesson node.
|
See also
toString | () | method |
public function toString():String
Returns the string representation of the specified object.
ReturnsString — The string representation of the specified object.
|
toXML | () | method |
public function toXML(preserveDocumentID:Boolean = false):XML
Returns an Impression-format XML object containing all the data from the object.
If preserveDocumentID
is true
, the documentid
attribute in the root node of the return value will be the same as the current instance's
documentID
property value. If preserveDocumentID
is false
,
this method will create a new documentID
value to use by invoking the
newGUID
method of the impression.utilities.GUID
class.
If the classification
property of the lesson is not the empty string(""),
comments will be inserted into the XML object identifying the classification level of the lesson.
Parameters
preserveDocumentID:Boolean (default = false ) — A Boolean expression specifying how the value of the documentid should be set.
|
XML — An XML object containing all the data from the object.
|
See also