Lesson

In MOTAR, a "lesson" is the individual education model that students interact with. A lesson can either be standalone or part of a course.

Read a Lesson

GET https://api.motar.io/edu/v1/lesson

Retrieves a single lesson by ID.

Query Parameters

NameTypeDescription

lessonId

string

The ID of the requested lesson.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{
  "lessonId": "ac5f1ba630fe00c39a1c938a22e80a8ba402e1e98b67597a7d4b66a670c510075639ebca09d275cd700f615f956512718ad53c561bb1ec697c5896386c31a850aafc865c1352981453e1d0e45a5ccbba13$0992712e1be6dfe76c4b32368531c523",
  "courseId": "ac5f1ba630fe00c39a1c938a22e80a8ba402e1e98b6758297d4b66a670c510075639ebca09d275cd700f615f956512718ad53c561bb1ec697c5896386c31a850aafc865c1352981453e1d0e45a5ccbba13$0992712e1be6dfe76c4b32368531c523",
  "name": "Test Lesson",
  "description": "A test lesson",
  "profilePic": "5dc48016a104378253bb1afe",
  "coverPhoto": "5dc48016a104378253bb1aff",
  "media": "http://www.google.com",
  "isAssessment": false,
  "expectedCompletionTime": 120,
  "instructorGraded": false,
  "childLessons": [],
  "public": true,
  "launchParameters": ["extLessonId=sp101"],
  "locked": false
}

Lists Lessons in a Course

GET https://api.motar.io/edu/v1/lesson/course

Lists all lessons belonging to a course.

Query Parameters

NameTypeDescription

courseId

string

ID of the course.

limit

number

Page size.

page

number

Results page to return.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{
  "docs": [
    {
      "lessonId": "ac5f1ba630fe00c29a1c938a22e80a8ba402e1e98b675c7c7d4b66a670c51007566eed9855d125cb270a6b5e963e447688da39561ab4bd3d200c903e3b67fb00afa8dd5a10569c490ab387b75f04c9b217$0992712e1be6dfe76c4b32368531c523",
      "courseId": "ac5f1ba630fe00c29a1c938a22e80a8ba402e1e98b675c787d4b66a670c51007566eed9855d125cb270a6b5e963e447688da39561ab4bd3d200c903e3b67fb00afa8dd5a10569c490ab387b75f04c9b217$0992712e1be6dfe76c4b32368531c523",
      "name": "Test Lesson",
      "description": "A test lesson",
      "profilePic": "5dc48017a104378253bb1b34",
      "coverPhoto": "5dc48017a104378253bb1b35",
      "media": "http://www.google.com",
      "expectedCompletionTime": 120,
      "instructorGraded": false,
      "childLessons": [],
      "public": true,
      "launchParameters": ["extLessonId=sp101"],
      "locked": false
    },
    {
      "lessonId": "ac5f1ba630fe00c29a1c938a22e80a8ba402e1e98b675c7d7d4b66a670c51007566eed9855d125cb270a6b5e963e447688da39561ab4bd3d200c903e3b67fb00afa8dd5a10569c490ab387b75f04c9b217$0992712e1be6dfe76c4b32368531c523",
      "courseId": "ac5f1ba630fe00c29a1c938a22e80a8ba402e1e98b675c787d4b66a670c51007566eed9855d125cb270a6b5e963e447688da39561ab4bd3d200c903e3b67fb00afa8dd5a10569c490ab387b75f04c9b217$0992712e1be6dfe76c4b32368531c523",
      "name": "Another Test Lesson",
      "description": "Another test lesson",
      "profilePic": "5dc48017a104378253bb1b34",
      "coverPhoto": "5dc48017a104378253bb1b35",
      "media": "5dc48017a104378253bb1b5c",
      "expectedCompletionTime": 240,
      "instructorGraded": true,
      "childLessons": [],
      "public": true,,
      "launchParameters": ["extLessonId=sp102"],
      "locked": false
    }
  ],
  "total": 2,
  "limit": 10,
  "page": 1,
  "pages": 1
}

Read App Lessons

GET https://api.motar.io/edu/v1/lesson/app

Returns all lessons that belong to the app the user is currently logged into, filtered by a provided class.

Query Parameters

NameTypeDescription

classId

string

Class to which the requested lessons are assigned.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

[ {"lessonId": "43c82706de8d3391a1c1e4cd2a1b9660176fdc9afd3d18103be3befb57b913328d4005f800f0696db8e2b35523b37bebef1ac0c36bc7a96ace56922583ec0b999149b234db0aad5253e7ee31cb777c426f$f6a8b1e4ff02ca6332582dc16ece8ad2",
  "courseId": "43c82706de8d3391a1c1e4cd2a1b9660176fdc9afd3d18173be3befb57b913328d4005f800f0696db8e2b35523b37bebef1ac0c36bc7a96ace56922583ec0b999149b234db0aad5253e7ee31cb777c426f$f6a8b1e4ff02ca6332582dc16ece8ad2",
  "name": "Another Test Lesson",
  "description": "Another test lesson",
  "profilePic": "5dc47fbf0145ce8246b2a4b3",
  "coverPhoto": "5dc47fbf0145ce8246b2a4b4",
  "media": "5dc47fbf0145ce8246b2a4db",
  "expectedCompletionTime": 240,
  "instructorGraded": true,
  "childLessons": [],
  "public": true,
  "launchParameters": ["extLessonId=sp102"],
  "locked": true } ]

Read Student's Progress

GET https://api.motar.io/edu/v1/lesson/progress

Returns the current (or latest) progress for the specified lesson either for the logged in user or a specified user.

Query Parameters

NameTypeDescription

classId

string

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

string

ID of the lesson.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [{"start": "2019-11-07T16:45:34.273Z", "end": null}],
  "idleIntervals": [] }

Read Student's Progress History

GET https://api.motar.io/edu/v1/lesson/progress/history

Returns the all attempts for the specified lesson either for the logged in user or a specified user.

Query Parameters

NameTypeDescription

classId

string

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

string

ID of the lesson.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

[{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": null}
  ],
  "idleIntervals": [] },
  { "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585c",
  "pass": false,
  "score": 0,
  "answers": [{ "question": "What is Batman's secret identity?", "studentAnswer": "Clark Kent"}],
  "started": "2019-11-06T12:21:54.185Z",
  "completed": "2019-11-06T17:42:32.221Z",
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"},
    {"start": "2019-11-07T16:55:42.287Z", "end": "2019-11-06T17:42:32.221Z"}
  ],
  "idleIntervals": [
    {"start": "2019-11-07T17:01:11.107Z", "end": "2019-11-07T17:12:32.091Z"}
  ]
}]

Read Lesson's Lock Status

GET https://api.motar.io/edu/v1/lesson/progress/lock

Checks whether or not the specified lesson is currently locked or unlocked.

Query Parameters

NameTypeDescription

classId

string

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.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

[{
    "lessonId": "",
    "locked": false,
    "childLessons": []
}, {
    "lessonId": "",
    "locked": false,
    "childLessons": [{
        "lessonId": "",
        "locked": false
    }, {
        "lessonId": "",
        "locked": true
    }]
}, {
    "lessonId": "",
    "locked": true,
    "childLessons": []
}]

Start a Lesson

POST https://api.motar.io/edu/v1/lesson/progress/start

Indicates a student has started taking a lesson, updating the "start" date in the lesson's progress. If the user has previous started the lesson but not completed it, this method with throw an error. Note that all query parameters in this request can optionally be included in the POST body rather than the query if so desired. Body parameters must be in the body, they cannot be included in the query string.

Query Parameters

NameTypeDescription

classId

string

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 progress.

lessonId

string

ID of the lesson.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [{"start": "2019-11-07T16:45:34.273Z", "end": null}],
  "idleIntervals": [] }

Pause a Lesson

POST https://api.motar.io/edu/v1/lesson/progress/pause

Indicates that a student has paused progress on a lesson.

Query Parameters

NameTypeDescription

lessonId

string

ID of the lesson.

classId

string

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.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"}
  ],
  "idleIntervals": [] }

Resume a Lesson

POST https://api.motar.io/edu/v1/lesson/progress/resume

Indicates that a student has resumed progress on a paused lesson.

Query Parameters

NameTypeDescription

lessonId

string

ID of the lesson.

classId

string

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.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"}, 
    {"start": "2019-11-07T16:55:42.287Z", "end": null}
  ],
  "idleIntervals": [] }

Start Idle Time for a Lesson

POST https://api.motar.io/edu/v1/lesson/progress/idle

Indicates that a student has become idle during lesson progress.

Query Parameters

NameTypeDescription

lessonId

string

ID of the lesson.

classId

string

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.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"},
    {"start": "2019-11-07T16:55:42.287Z", "end": null}
  ],
  "idleIntervals": [
    {"start": "2019-11-07T17:01:11.107Z", "end": null}
  ] }

End Idle Time for a Lesson

POST https://api.motar/edu/v1/lesson/progress/active

Indicates that a student has ended idle time.

Query Parameters

NameTypeDescription

lessonId

string

ID of the lesson.

classId

string

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.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": null,
  "answers": null,
  "started": "2019-11-07T16:45:34.273Z",
  "completed": null,
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"},
    {"start": "2019-11-07T16:55:42.287Z", "end": null}
  ],
  "idleIntervals": [
    {"start": "2019-11-07T17:01:11.107Z", "end": "2019-11-07T17:12:32.091Z"}
  ] }

Update Student's Lesson Progress

POST https://api.motar.io/edu/v1/lesson/progress

Updates a student's progress for a lesson in a class with a score, answers, and a pass/fail result. Note that all query parameters in this request can optionally be included in the POST body rather than the query if so desired. Body parameters must be in the body, they cannot be included in the query string.

Query Parameters

NameTypeDescription

classId

string

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

string

ID of the lesson.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

Request Body

NameTypeDescription

startTime

string

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

string

A parseable date to mark the end of the student's session. Suggested format is ISO date, eg. 2020-01-07T21:45:35.649Z.

complete

boolean

If true, the lesson's "complete" attribute will be set to the current date/time, indicating the student has finished the lesson.

score

number

A numeric score for the lesson. If using Point-based scoring, send in the number correct, eg. Point-based score pass = 40/50, then 'score' is a number 0-50. Not required for Pass/Fail scored lessons.

pass

boolean

A boolean pass/fail flag.

{ "studentId": "793278a6e6449530a8c46cf98463945965212801cf38051a8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585a",
  "lessonResultId": "793278a6e6449537a8c46cf98463945965212801cf38074e8e3d8493dc470658291be1b88d884feafe79db39515a85e9bc5c02e9c68e8dff2012bc0e11bdb474098b5b33d04b0fb55aa661abf59573919d$e1e08bd810b80f6993588ff1089a585b",
  "pass": false,
  "score": 0,
  "answers": [{ "question": "What is Batman's secret identity?", "studentAnswer": "Clark Kent"}],
  "started": "2019-11-06T12:21:54.185Z",
  "completed": "2019-11-06T17:42:32.221Z",
  "progressIntervals": [
    {"start": "2019-11-07T16:45:34.273Z", "end": "2019-11-07T16:45:39.146Z"},
    {"start": "2019-11-07T16:55:42.287Z", "end": "2019-11-06T17:42:32.221Z"}
  ],
  "idleIntervals": [
    {"start": "2019-11-07T17:01:11.107Z", "end": "2019-11-07T17:12:32.091Z"}
  ]  }

There are two types of scoring for lessons: Pass/Fail and Point-based Score.

Point-based Score lessons: To show PASS on the dashboard, it needs to have the lesson set to complete, a passing score, AND have pass=true. To show FAIL, it needs to be complete, pass=false, and have a score reported lower than the threshold.

Pass/Fail lessons: To show PASS on the dashboard, it needs to have the lesson set to complete AND pass=true. To show FAIL, it needs to be complete and have pass=false.

Update Student's Objective Score

POST https://api.motar.io/edu/v1/lesson/progress/objective

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.

This endpoint can be used by instructors or students. If used by an instructor, you must include a studentId parameter and the instructor must be assigned to the class in question. You may omit the classId parameter in this case.

Query Parameters

NameTypeDescription

classId

string

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. If the reporting user is the student, this parameter is required.

lessonId*

string

ID of the lesson.

studentId

string

The ID of the student whose progress is being reported. If the reporting user is an instructor, this parameter is required.

Headers

NameTypeDescription

Authorization

string

Auth token generated by user login.

Request Body

NameTypeDescription

objectiveId

string

The objective's ID.

score

number

A numeric score from 0-100.

{"success":true}

Last updated