API: Content
Methods for working with courseware content.
Methods for working with courseware content.
Returns an XML object containing information about the structure of the items in the entire content database.
None.
An <courseDescription>
-format XML object containing content database information.
None.
getCourseDescription
<courseDescription title="Connect Sample">
<ppc name="properties" />
<courseMap name="Connect Sample">
<item lessonid="F86024CB-226C-42EA-BFEA-675514D185E8">
<item lessonid="F61B870D-429B-425F-B004-7084AB502198" />
<item lessonid="80A2F5A0-4955-47CC-97C3-A9B3BB4AD92D" />
</item>
<item lessonid="A0995CD5-BE51-4986-B58F-A85695CDAADF" />
</courseMap>
<lessonDescriptions>
<lessonDescription
lessonid="A0995CD5-BE51-4986-B58F-A85695CDAADF"
title="Scratch Lesson"
identifier="SCRATCH"
lessonType="Lesson">
</lessonDescription>
<lessonDescription
lessonid="F86024CB-226C-42EA-BFEA-675514D185E8"
title="Samples"
identifier="SAMPLES"
lessonType="Group">
</lessonDescription>
...
</lessonDescriptions>
</courseDescription>
Returns an XML object containing configuration information for the content database.
None.
An <ppc>
-format XML object containing configuration information.
None.
getProjectProperties
<ppc name="ProjectProperties">
<ppcProp name="export">
<ppc name="export">
<stringProp name="DataPath"></stringProp>
<stringProp name="LessonFilename">lesson.xml</stringProp>
<intProp name="LessonOptimizeFlags" value="23" />
<intProp name="LessonXMLOutputFlags" value="704" />
...
<ppcProp name="media">
<ppc name="media">
<stringProp name="AssetImportRights">users</stringProp>
<colorProp name="AssetPickerBackgroundColor" value="#C0C0C0" />
<stringProp name="MediaPath">%PROJECT_ROOT%\media</stringProp>
<stringProp name="ProjectReportPath">%PROJECT_ROOT%\reports</stringProp>
...
</ppc>
</ppcProp>
...
</ppc>
Returns an XML object containing information (but not data) for a lesson.
lessonid |
(identifier, required) The lesson to retrieve information for. |
An <lessonDescription>
-format XML object containing configuration information.
400 | lessonid parameter is not specified. |
404 | lessonid not found in the database. |
getLessonDescription?lessonid=F61B870D-429B-425F-B004-7084AB502198
<lessonDescription
lessonid="F61B870D-429B-425F-B004-7084AB502198"
title="Content and Structure"
identifier="CONTENT_AND_STRUCTURE"
lessonType="Lesson">
<ppc name="properties">
<stringProp name="LessonModifiedBy">f.bar</stringProp>
<stringProp name="LessonModifiedDate">3/12/2014 2:51:48 PM</stringProp>
<intProp name="StoryboardCount" value="137" />
</ppc>
</lessonDescription>
Returns a JSON object containing non-content information about a lesson.
lessonid |
(identifier, required) The lesson to retrieve information for. |
A JSON object containing lesson information.
400 | lessonid parameter is not specified. |
404 | lessonid not found in the database. |
getLessonInfo?lessonid=F61B870D-429B-425F-B004-7084AB502198
{
"lessonid": "F61B870D-429B-425F-B004-7084AB502198",
"exists": true,
"mediaid": "media-F61B870D-429B-425F-B004-7084AB502198",
"mediapath": "C:\\Users\\foo\\Desktop\\sample\\media",
"sbid": "",
"tokens": {
"%ADDITIONAL_SOURCE_PATH%": "",
...
},
"haswritelock": true,
"hasreadlock": false,
"sessionlocks": "EditLesson"
}
Returns a JSON object containing non-content information about the active lesson.
None.
A JSON object containing information about the active lesson.
None.
Returns an XML object containing the data for a lesson.
lessonid |
(identifier, required) The lesson to retrieve information for. |
optimize |
(boolean, optional. default true) Specifies whether or not to optimize the returned lesson XML. |
format |
(boolean, optional. default true) Specifies whether or not to format the returned lesson XML. |
optimize
or the
format
flags are set to true, the optimizing and formatting options specified
in the Export section of the database's project properties are used to modify the lesson
before returning it.A <lesson>
-format XML object containing the lesson data.
400 | lessonid parameter is not specified. |
404 | lessonid not found in the database. |
getLesson?lessonid=F61B870D-429B-425F-B004-7084AB502198
<lesson
lessonid="F61B870D-429B-425F-B004-7084AB502198"
title="Content and Structure"
identifier="CONTENT_AND_STRUCTURE"
documentid="3802b2c3-3290-437a-b728-cc11db97e494">
<ppc name="properties">
<stringProp name="ExportedBy">user</stringProp>
<stringProp name="ExportedDate">3/11/2014 11:47:15 AM</stringProp>
<intProp name="StoryboardCount" value="137" />
...
</ppc>
<maps default="primary">
<map name="primary">
<item sbid="e98e9403-ef9e-4aa0-8118-33dc7373a4ee" />
<item sbid="8BE114F1-1019-4A42-B588-01CF0FB4FF14" />
<item sbid="82442A77-D6C9-47D8-8449-DDAEA85225D6">
<item sbid="D6A46981-7F3C-4D3A-B132-279ACBCAFBB9" />
<item sbid="995D1C27-8BA3-4B1F-9BB3-36B43D7F03DC" />
...
</item>
</map>
</maps>
<storyboards>
<storyboard sbid="8BE114F1-1019-4A42-B588-01CF0FB4FF14"
title="Multiple-Choice Text Sample Storyboard"
identifier="CONTENT_AND_STRUCTURE:01351"
type="multiple-choice text"
shortid="136">
<ppc name="properties">
<stringProp name="BackButtonEnabled">always;</stringProp>
<stringProp name="CompleteWhen">answerCorrect;</stringProp>
<stringProp name="NextButtonEnabled">whenComplete;</stringProp>
<stringProp name="Question">What is the first metasyntactic variable?</stringProp>
<encProp>PHN0cmluZ1Byb3AgbmFtZT0iQW5zd2VyIj5mb288L3N0cmluZ1Byb3A+</encProp>
<encProp>PHN0cmluZ1Byb3AgbmFtZT0iRGlzdHJhY3RvcjEiPmJhcjwvc3RyaW5nUHJvcD4=</encProp>
<encProp>PHN0cmluZ1Byb3AgbmFtZT0iRGlzdHJhY3RvcjIiPmJhejwvc3RyaW5nUHJvcD4=</encProp>
<encProp>PHN0cmluZ1Byb3AgbmFtZT0iRGlzdHJhY3RvcjMiPmJhdDwvc3RyaW5nUHJvcD4=</encProp>
</ppc>
</storyboard>
...
</storyboards>
</lesson>
Returns an XML object containing the data for a storyboard.
lessonid |
(identifier, required) The unique identifier of the lesson containing the storyboard. |
sbid |
(identifier, required) The unique identifier of the storyboard to retrieve the data of. |
A <storyboard>
-format XML object containing the
storyboard data.
400 | lessonid parameter is not specified. |
404 | lessonid not found in the database. |
getStoryboard?lessonid=123&sbid=456
<storyboard
sbid="456"
title="Overview"
identifier="CONTENT_AND_STRUCTURE:00559"
type="placeholder"
shortid="12">
<ppc name="properties">
<stringProp name="BackButtonEnabled">always;</stringProp>
<stringProp name="CompleteWhen">always;</stringProp>
<stringProp name="NextButtonEnabled">whenComplete;</stringProp>
<stringProp name="PlaceholderType">Topic/Subtopic</stringProp>
</ppc>
</storyboard>
Returns a string containing a new storyboard identifier.
lessonid |
(identifier, required) The unique identifier of the lesson to base the result on. |
sbid |
(identifier, optional) The unique identifier of the storyboard to base the result on. |
A string containing the new identifier.
This function returns a new value
for a storyboard's identifier
property. The identifier is a
human-readable code designed to assist in identifying specific
storyboards during the production process. The value returned is
based on the identifier template specified in the project properties,
and can use information from the lesson and/or the sbid.
The identifier
is not the sbid
, and is not
guaranteed to be unique. To generate a new sbid, use the
newGuid
method or another mechanism for generating unique
identifiers.
400 | lessonid parameter is not specified. |
404 | lessonid not found in the database. |
newSBIdentifier?lessonid=F61B870D-429B-425F-B004-7084AB502198
"CONTENT_AND_STRUCTURE:01360"
Replaces the data for the lesson currently being edited in the CCT with the data passed to the method.
[postdata] |
(string, required) A <lesson> -format XML
string containing the lesson data. |
tokens
persisted properties collection from the lesson's properties
collection. Do not stick
any data you wish to preserve in the tokens
ppc.Nothing.
400 | [postdata] is empty or is not a<lesson> -format
XML string. |
400 | The lessonid value of the [postdata]
string is not the unique identifier of the active lesson. |
404 | The lessonid value of the [postdata]
string was not found in the database. |
409 | The active lesson is not open with write privileges. |
updateLesson
<lesson
lessonid="123"
title="Sample Lesson"
identifier="LESSON_123"
...
</lesson>
""
Replaces the data for one of the storyboards of the lesson currently being edited in the CCT with the data passed to the method.
[postdata] |
(string, required) A <storyboard> -format XML
string containing the storyboard data. |
lessonid |
(identifier, required) The unique identifier of the lesson containing the storyboard. |
Nothing.
400 | [postdata] is empty or is not a<storyboard> -format
XML string. |
400 | The lessonid parameter is not the unique identifier of the active lesson. |
404 | The lessonid parameter value was not found in the database. |
409 | The active lesson is not open with write privileges. |
updateStoryboard?lessonid=123
<storyboard
sbid="456"
title="Overview"
identifier="LESSON_123:00559"
type="placeholder"
...
</storyboard>
""
Instructs the CCT to select a specific storyboard within the active lesson.
sbid |
(identifier, required) The unique identifier of the storyboard to select. |
sbid
, the CCT will select the map root
node of the first map in the lesson.Nothing.
400 | The sbid parameter was not specified. |
selectSBID?sbid=456
""
Receive CCT change notifications.
The Connect API includes a mechanism to allow Connect applications to receive notifications when the user performs certain actions within the CCT. This allows application developers to react appropriately when the underlying environment changes.
To receive notifications, Connect applications will issue a subscribe
call to the server. When a notifiable action occurs, the call will return
and provide specific information about the action.
The C# managed wrapper uses the HttpWebRequest
object’s
BeginGetResponse()
method to asynchronously handle subscriber
notifications. The subscriber.html
sample illustrates how to
handle notifications in an HTML/Javascript environment.
Returns a value when certain actions are performed within the CCT.
[unique identifier] |
(identifier, required) A unique identifier for the subscribe request. |
Either a string or a JSON object containing information about the action.
400 | subscribe request is insufficiently unique. |
IMPORTANT:
The ‘long poll’ approach
used by the Connect server requires that each simultaneous
subscribe
method request have a unique identifier. If a
subscribe
request is issued by a client without a unique
idenfier, the request will not be processed by the server until the
previous request's TCP sock times out; this occurs approximately 20
seconds after the request has been received.
The subscribe method supports unique identifiers in one of two ways:
subscribe
request as a child of the
instance root../subscribe
/subscribe?instanceid=123
/subscribe?uniquevalue=[unique value]
The subscribe call can return one of the following values:
Returned when the CCT closes the current database.
String.
"shutdown"
The shutdown message is sent whenever the current database is closed in the CCT. This can occur:
Returned when the active lesson is changed.
JSON string.
{
"type": "activelessonchanged",
"lessonid": "F61B870D-429B-425F-B004-7084AB502198"
"sbid": "4CDA10BB-5EDA-489E-9121-7D5AB560C6BA"
"mediaid": "media-F61B870D-429B-425F-B004-7084AB502198"
}
The active lesson is the lesson
currently open in the lesson editor of the CCT. If the lesson
editor is closed, the value of the lessonid
element will be
the empty string ("").
When a lesson is opened, the CCT attempts to select the last
storyboard edited. If a storyboard was selected, the value of the
sbid
element will contain its value. If the lesson
editor is closed, or no storyboard is selected, the value of the
sbid
element will be
the empty string ("").
Note that the active lesson may be opened with either read-write or read-only permissions. Use the lesson information object to determine the access rights.
Returned when the active storyboard is changed.
JSON string.
{
"type": "activestoryboardchanged",
"sbid": "4CDA10BB-5EDA-489E-9121-7D5AB560C6BA"
}
sbid
element
will be the empty string ("").Returned when a change is made in the CCT to the active lesson that affects the entire lesson.
JSON string.
{
"type": "lessonupdated",
"lessonid": "F61B870D-429B-425F-B004-7084AB502198"
}
Not all changes made to a lesson affect the entire lesson. Most changes made by a user affect only the active storyboard. Some changes that affect the entire lesson include:
Returned when a change is made in the CCT to the active lesson that affects only the active storyboard.
JSON string.
{
"type": "storyboardupdated",
"sbid": "4CDA10BB-5EDA-489E-9121-7D5AB560C6BA"
}