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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that, this is latest version of library. It may provide compatibility issues in the future. For more information
about serving specific version see: https://www.jsdelivr.com/features
Supported commands:
init() - initialize the communication. If the communication is not initialized it is not possible to send messages
into mCourser. Returns promise. As promise response returns boolean, which tells if user is authenticated
destroy() - destroy initialized communication. All listeners are removed. If mCourser returns data after destroy,
response is not managed by communication. Does not have response.
updateIframeHeight(newHeight) - Set new height for embeded iframe. Does not have response.
requestCollectionsData() - Get all available collections for current user. Requires authenticated user. Returns a
response. As the promise response returns:
Id of the lesson. WARNING! This id may be changed (It is not const). Do not use it to match lessons!
name
Name of the lesson.
type
Type of the lesson. Available types: mauthor_lesson, mauthor_ebook, minstructor_lesson, demo_lesson, url_link, file
chapter
Id of the chapter where the lesson is assigned. If null, the lesson is without any chapter
icon
Icon URL of the lesson. Warning! The icon URL is in format: "/file/serve/[id]"
description
Description of the lesson extracted from the lesson definition.
definedId
The defined ID of the lesson. This id is defined on mAuthor side in a metadata definition. It's preferred way to match specific lesson.
errors
Number of errors which have been received by the user.
extendedMetadata
Lesson's metadata containing i.e. lesson_category.
tags
String with comma separated tags associated with specific lesson, i.e. school_grade, subject
time
How long the user spent in the lesson.
score
The score which have been received by the user.
Chapter description:
Property name
Description
id
Id of the chapter. This id may be changed.
parent
Parent chapter for this chapter. If empty, chapter do not have parent.
title
The title of the chapter.
description
The description of the chapter.
User description:
Property name
Description
userId
Logged in user id
userName
Logged in user name
requestCollectionDataWithFlags(collectionId) - Get information about specific collection. Returned data is extended with additional flags related do adaptive scripts. Returns promise. As the promise
response returns:
Parameter indicating whether the collection is adaptive or not.
Lesson description:
Property name
Description
id
Id of the lesson. WARNING! This id may be changed (It is not const). Do not use it to match lessons!
name
Name of the lesson.
type
Type of the lesson. Available types: mauthor_lesson, mauthor_ebook, minstructor_lesson, demo_lesson, url_link, file
chapter
Id of the chapter where the lesson is assigned. If null, the lesson is without any chapter
icon
Icon URL of the lesson. Warning! The icon URL is in format: "/file/serve/[id]"
description
Description of the lesson extracted from the lesson definition.
definedId
The defined ID of the lesson. This id is defined on mAuthor side in a metadata definition. It's preferred way to match specific lesson.
errors
Number of errors which have been received by the user.
extendedMetadata
Lesson's metadata containing i.e. lesson_category.
tags
String with comma separated tags associated with specific lesson, i.e. school_grade, subject
time
How long the user spent in the lesson.
score
The score which have been received by the user.
isUnlocked
Boolean parameter indicating whether the lesson is unlocked or not in relation to the course adaptive script
Chapter description:
Property name
Description
id
Id of the chapter. This id may be changed.
parent
Parent chapter for this chapter. If empty, chapter do not have parent.
title
The title of the chapter.
description
The description of the chapter.
User description:
Property name
Description
userId
Logged in user id
userName
Logged in user name
requestCollectionDataByURL(publisherURL, collectionURL) - Get public information about collection by collection and
publisher URLs. Returns promise.
publisherURL - URL of the publisher defined on mCourser. Publisher URL is available in mCourser publisher panel,
in publisher configuration (URL address input).
collectionURL - URL of the collection. This address is available in collections management. In specific course
management there is available adress URL input.
External resources associated with specific collection. See External resource.
External resource description:
Property name
Description
course
Id of the collection.
course_external_id
External id of the course.
cover
External resource's cover (in form of an URL).
external_id
External resource's external id.
label
External resource's label.
url
External resource's URL.
requestCrossResource(resourceId, definedId, mAuthorCourseId, pageId, lessonType) - Open new lesson from different or
the same course.
Resource id is any lesson id in selected publisher. It means that you need to retrieve at least one lesson from
the API in case of cross lesson request. If course ID is set, this parameter is also required, additionally lesson
publisher == course publisher. Remember, course id is const, but lesson id may be changed when course is
re-imported.
definedId is id defined on mAuthor for specific lesson. See Lessons description.
mAuthorCourseId is id of course on mAuthor. This argument is optional.
See Collection description:
pageId is page id visible in mAuthor lesson editor. This argument is optional.
lessonType - lesson can be 'ebook' type or 'lesson' type. 'lesson' is set as default.
This method does not return data. User may not have access to selected lesson. If courseId is not set, lesson is
selected relative to resourceId.
requestLoginView() - Open login view in mCourser Application.
requestOpenLesson(lessonId) - open lesson by lesson id field. This method does not return data. Remember, lesson id
may be changed for example when the course is re-imported.
requestCollectionCustomTOCFirstVisitDate(collectionId) - Get specific collection's custom TOC first visit date.
Returns promise. As the promise response returns:
Collection's custom TOC first visit date description:
Property name
Description
id
Id of the collection.
collectionCustomTOCFirstVisitDate
Date of collection's custom TOC first visit by the logged-in user.
postCollectionCustomTOCFirstVisitDate(collectionId) - Post and return specific collection's custom TOC first visit
date. Returns promise. As the promise response returns:
requestCollectionCustomTOCAndAnyLessonLastVisitsDates(collectionId) - Get specific collection's custom TOC and
specific collection's any lesson last visits dates. Returns promise. As the promise response returns:
Collection's custom TOC and any lesson last visits dates description:
Property name
Description
id
Id of the collection.
collectionCustomTOCLastVisitDate
Date of collection's custom TOC last visit by the logged-in user.
collectionAnyLessonLastVisitDate
Date of collection's any lesson last visit by the logged-in user.
postCollectionCustomTOCLastVisitDate(collectionId) - Post specific collection's custom TOC and return specific
collection's custom TOC and any lesson last visits dates. Returns promise. As the promise response returns:
For parameters description
see [Collection's custom TOC and any lesson last visits dates description](#Collection's custom TOC and any lesson last visits dates description:)
.
requestCollectionCustomTOCState(collectionId) - Get specific collection's custom TOC state. Returns promise. As the
promise response returns:
State of collection's custom TOC associated with the logged-in user.
requestCollectionCodeActionAndMarketData(collectionId) - Get information about specific collection's code action and
market (publisher). These parameters are obtained from P3 data-stream. As the promise response returns:
List of collection's code actions obtained from P3 data-stream.
collectionMarket
Collection's market (publisher) obtained from P3 data-stream.
requestCollectionLessonsPaginatedResults(collectionId) - Get information about specific collection's lessons'
paginated results. Returns promise. As the promise response returns: