Alexa.Education.Coursework Interface
Implement the Alexa.Education.Coursework
interface in your Alexa education skill to provide a list of coursework for a given student or course. For more information about education skills, see About Alexa Education Skills.
For the list of languages that the Coursework
interface supports, see List of Alexa Interfaces and Supported Languages.
Utterances
When you use the Alexa.Education.Coursework
interface, the voice interaction model is already built for you. The following examples show some user utterances:
Alexa, what assignments do the kids have coming up?
Alexa, what homework is due tomorrow?
Alexa, do I have anything due on Monday?
Alexa, when is my history paper due?
Alexa, does Jack have any homework?
Alexa, what homework does Noah have this week?
Alexa, what do I have coming up in chemistry?
Integration with Alexa reminders
The Coursework
interface integrates with Alexa reminders automatically. After you implement the Coursework
interface in your skill, whenever you return an assignment with a due date to the user, Alexa automatically asks the user if they want to set a reminder for the assignment. For more information, see Integration with Alexa reminders.
If the user requests a reminder from Alexa, Alexa doesn't send information about the reminder back to your skill.
Request
The Get
request queries a list of coursework for a given student or course. This request has query parameters to filter for studentId
(required), dueTime
(required), courseworkType
(optional), and courseId
(optional). The dueTime
parameter indicates when the coursework is due. The courseId
filter provides specific course-related coursework that is due for that student.
If there's more than one student associated with the account and the user doesn't specify the student, Alexa asks the user for clarification, and then includes the appropriate studentId
in the request to your skill. In other words, your skill doesn't need to discern whether there's more than one student associated with the account, it just needs to return the results for the specified studentId
.
The payload of the Get
request contains the following fields.
Field | Description | Type |
---|---|---|
|
Pagination information |
|
|
Match-all query parameters to filter for |
Object |
|
Locale that identifies the user's language |
|
The following is an example of a Get
request.
{
"request": {
"header": {
"namespace": "Alexa.Education.Coursework",
"name": "Get",
"messageId": "ExampleMessageID",
"interfaceVersion": "1.0"
},
"authorization": {
"type": "BearerToken",
"token": "ExampleBearerToken"
},
"payload": {
"paginationContext": {
"maxResults": 5,
"nextToken": "ExampleNextToken"
},
"query": {
"matchAll": {
"studentId": "1184",
"courseId": "course_001",
"courseworkType": "ASSIGNMENT",
"dueTime": {
"start": "2019-04-02T00:00:000Z",
"end": "2019-04-05T00:00:000Z"
}
}
},
"locale": "en-US"
}
}
}
Requests to return coursework always have a dueTime
filter in the query parameters. The response must include the coursework that has a dueTime
within the start and end range (inclusive).
The following are example utterances that show how the dueTime
filter of the request is based on the user's time zone.
Utterance | Current User Local Time | Filter Range for dueTime | Description |
---|---|---|---|
"Alexa, is there any homework due today?" |
Thursday, October 17, 2019 05:50:36 PM PDT (UTC/GMT-07:00) |
|
Queries for coursework that is due today. The user's time zone is PDT. |
"Alexa, is there any homework due today?" |
Thursday, October 17, 2019 10:30:00 PM EDT (UTC/GMT-04:00) |
|
Queries for coursework that is due today. The user's time zone is EDT. |
"Alexa, is there any homework due tomorrow?" |
Thursday, October 17, 2019 05:50:36 PM PDT (UTC/GMT-07:00) |
|
Queries for coursework that is due tomorrow. The user's time zone is PDT. |
"Alexa, is there any homework due tomorrow?" |
Thursday, October 17, 2019 05:50:36 PM EDT (UTC/GMT-04:00) |
|
Queries for coursework that is due tomorrow. The user's time zone is EDT. |
"Alexa, is there any homework due this week?" |
Thursday, October 17, 2019 11:50:36 PM PDT (UTC/GMT-07:00) |
|
Queries for coursework that is due in the next seven days. This query is based on the user's time zone, starting from the day the user made the request. The user's time zone is PDT. |
"Alexa, is there any homework due this week?" |
Thursday, October 17, 2019 02:15:23 AM EDT (UTC/GMT-04:00) |
|
Queries for coursework that is due in the next seven days. This query is based on the user's time zone, starting from the day the user made the request. The user's time zone is EDT. |
Response
If you handle a Get
request successfully, respond with a GetResponse
object.
The payload of a GetResponse
object contains the following fields.
Field | Description | Type | Required |
---|---|---|---|
|
Pagination information |
|
No |
|
The results of the query |
Array of |
Yes |
The following is an example of GetResponse
.
{
"response": {
"header": {
"namespace": "Alexa.Education.Coursework",
"name": "GetResponse",
"messageId": "ExampleMessageID",
"interfaceVersion": "1.0"
},
"payload": {
"paginationContext": {
"totalCount": 1
},
"coursework": [
{
"id": "coursework_001",
"courseId": "course_001",
"courseName": "UFO 101",
"title": "Homework 1",
"description": "Homework 1 is now available. It's due by the 30th of April.",
"type": "ASSIGNMENT",
"submissionState": "MISSING",
"dueTime": "2019-04-12T00:00:00Z",
"publishedTime": "2019-04-12T00:00:00Z"
},
{
"id": "quiz_001",
"courseId": "course_001",
"courseName": "UFO 101",
"title": "Quiz 1",
"description": "",
"type": "ASSESSMENT",
"submissionState": "NOT_SUBMITTED",
"dueTime": "2019-04-12T00:00:00Z",
"publishedTime": "2019-04-12T00:00:00Z"
}
]
}
}
}