DXLessonClient
This class is responsible for requests to the lesson API.
You will need to enable the "Training" scope for your app in the developer dashboard before using the lesson API.
Properties
Singleton instance of DXLessonClient
. You will access all the available DXLessonClient
methods through this instance.
Methods
getLesson
Retrieves a single lesson by ID.
Parameter | Type | Description |
lessonId |
| The ID of the requested lesson. |
completion |
| The closure invoked when the request finishes. Called with an |
getLessonsInCourse
Request all lessons belonging to a course.
Parameter | Type | Description |
courseId |
| ID of the course. |
limit |
| Page size. |
page |
| Results page to return. |
completion |
| The closure invoked when the request finishes. Called with an |
getAppLessons
Returns all lessons that belong to the app the user is currently authenticated into, filtered by a provided class.
Parameter | Type | Description |
classId |
| Class to which the requested lessons are assigned. |
completion |
| The closure invoked when the request finishes. Called with an |
startLesson
Indicates a student has started taking a lesson, updating the start
date in the lesson's progress. If the user has previously started the lesson but not completed it, this request will fail.
Parameter | Type | Description |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to retrieve progress in this lesson for. |
lessonId |
| ID of the lesson. |
studentId |
| Specify which student to return progress for. If not provided, will return the progress of the currently authenticated user. |
completion |
| The closure invoked when the request finishes. Called with an |
getStudentsProgress
Returns the current (or latest) progress for the specified lesson either for the currently authenticated user or a specified user.
Parameter | Type | Description |
classId |
| Lesson is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to retrieve progress in this lesson for. |
lessonId |
| ID of the lesson. |
studentId |
| Specify which student to return progress for. If not provided, will return the progress of the currently authenticated user. |
completion |
| The closure invoked when the request finishes. Called with an |
getStudentsProgressHistory
Returns all the attempts for the specified lesson either for the currently authenticated user or a specified user.
Parameter | Type | Description |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to retrieve progress in this lesson for. |
lessonId |
| ID of the lesson. |
studentId |
| Specify which student to return progress for. If not provided, will return the progress of the currently authenticated user. |
completion |
| The closure invoked when the request finishes. Called with an |
updateStudentsProgress
Updates a student's progress for a lesson in a class with a score, answers, and a pass/fail result.
Parameter | Type | Description |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to retrieve progress in this lesson for. |
lessonId |
| ID of the lesson. |
pass |
| A boolean pass/fail flag. |
studentId |
| Specify which student to return progress for. If not provided, will return the progress of the currently authenticated user. |
complete |
| If true, the lesson's |
score |
| A numeric score for the lesson. |
startTime |
| A parseable date to mark the start of the student's session. Suggested format is ISO date, eg. 2020-01-07T21:45:35.649Z. |
endTime |
| A parseable date to mark the end of the student's session. Suggested format is ISO date, eg. 2020-01-07T21:45:35.649Z. |
completion |
| The closure invoked when the request finishes. Called with an |
getLessonsLockStatus
Checks whether or not the specified lesson is currently locked or unlocked.
Parameter | Type | Description |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to retrieve progress in this lesson for. |
completion |
| Closure invoked when the request finishes. Called with an |
pauseLesson
Indicates that a student has paused progress on a lesson.
The "progressIntervals" attribute will be updated with the previous start time and an end time of the current time.
Parameter | Type | Description |
lessonId |
| ID of the lesson. |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to update the student's progress. |
completion |
| Closure invoked when the request finishes. Called with an |
resumeLesson
Indicates that a student has resumed progress on a paused lesson.
Parameter | Type | Description |
lessonId |
| ID of the lesson. |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to update the student's progress. |
completion |
| Closure invoked when the request finishes. Called with an |
startIdleTimeForLesson
Indicates that the student's progress is temporarily paused. The "idleIntervals" attribute will be updated with the previous start time and an end time of the current time.
Parameter | Type | Description |
lessonId |
| ID of the lesson. |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to update the student's progress. |
completion |
| Closure invoked when the request finishes. Called with an |
endIdleTimeForLesson
Indicates that a student has ended idle time.
Parameter | Type | Description |
lessonId |
| ID of the lesson. |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to update the student's progress. |
completion |
| Closure invoked when the request finishes. Called with an |
updateStudentsObjectiveScore
Updates a student's objective score for a lesson, if the objective score is different than the student's overall lesson score.
Note that a student must have a lesson attempt started (or completed) before objective scores can be recorded for any objectives linked to that lesson.
Parameter | Type | Description |
lessonId |
| ID of the lesson. |
classId |
| Lesson progress is tracked on a class-by-class basis. This parameter is the ID of the student's class for which you would like to update the student's progress. |
objectiveId |
| The objective's ID. |
score |
| A numeric score from 0-100. |
completion |
| Closure invoked when the request finishes. Called with an |
Last updated