Members
-
<static> commonHeaders
-
Description
Common headers used for Canvas web requests. This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.Details
-
<static> teacherCache
-
Description
List of teachers from dtpsLMS.fetchClasses for use in other methods This variable is specific to Canvas LMS integration in DTPS and is not required for other LMS integrations.Details
-
<static> fetchQueue
-
Description
A queue for API requestsDetails
Methods
-
<static> fetchWrapper()
-
Description
A function that behaves the same way as fetch, although it adds the request to the queue for spacingDetails
-
<static> fetchUser() → {Promise.<User>}
-
Description
[REQUIRED] Fetches data for the current user from the LMS. If the user is not signed in, reject with an object that looks like {action: "login", redirectURL: "..."} to login the user.Returns
Details
-
<static> fetchUnreadMessageCount() → {Promise.<string>}
-
Description
[OPTIONAL] Fetches the unread message count for the current userReturns
Details
-
<static> fetchClasses( userID ) → {Promise.<Array.<Class>>}
-
Description
[REQUIRED] Fetches class data from the LMSParameters
Name Type Description userID
string The user ID to fetch classes for Returns
Details
-
<static> fetchAssignments( userID, classID ) → {Promise.<Array.<Assignment>>}
-
Description
[REQUIRED] Fetches assignment data for a course from the LMSParameters
Name Type Description userID
string The user ID to fetch assignments for classID
string The class ID to fetch assignments for Returns
Details
-
<static> fetchModules( userID, classID ) → {Promise.<Array.<Module>>}
-
Description
[OPTIONAL] Fetches module data for a course from the LMSParameters
Name Type Description userID
string The user ID to fetch modules for classID
string The class ID to fetch modules for Returns
Details
-
<static> collapseModule( classID, moduleID, collapsed ) → {Promise}
-
Description
[OPTIONAL] Collapses a module in the LMSParameters
Name Type Description classID
string The ID of the class moduleID
string The ID of the module to collapse collapsed
boolean True if the module is collapsed, false otherwise Returns
Details
-
<static> collapseAllModules( classID, collapsed ) → {Promise}
-
Description
[OPTIONAL] Collapses all modules in the LMSParameters
Name Type Description classID
string The ID of the class collapsed
boolean True if all modules should be collapsed, false otherwise Returns
Details
-
<static> fetchAnnouncements( classID ) → {Promise.<Array.<Announcement>>}
-
Description
[OPTIONAL] Fetches recent announcements for a course from the LMSParameters
Name Type Description classID
string The class ID to fetch announcements for Returns
Details
-
<static> fetchMeetingURL( classID ) → {Promise.<string>}
-
Description
[OPTIONAL] Fetches the videoMeetingURL for a classParameters
Name Type Description classID
string The class ID to get the videoMeetingURL for Returns
Details
-
<static> fetchHomepage( classID ) → {Promise.<string>}
-
Description
[OPTIONAL] Fetches homepage HTML for a course from the LMSParameters
Name Type Description classID
string The class ID to get the homepage for Returns
Details
-
<static> fetchUsers( classID ) → {Promise.<Array.<ClassSection>>}
-
Description
[OPTIONAL] Fetches the users for a course from the LMSParameters
Name Type Description classID
string The class ID to fetch users for Returns
Details
-
<static> fetchDiscussionThreads( classID ) → {Promise.<Array.<PartialDiscussionThread>>}
-
Description
[OPTIONAL] Fetches discussion threads for a course from the LMSParameters
Name Type Description classID
string The class ID to fetch discussion threads for Returns
Details
-
<static> fetchDiscussionPosts( classID, threadID ) → {Promise.<DiscussionThread>}
-
Description
[REQUIRED IF dtpsLMS.fetchDiscussionThreads IS IMPLEMENTED] Fetches discussion posts in a thread from the LMSParameters
Name Type Description classID
string The class ID to fetch discussion posts for threadID
string The discussion thread ID to fetch discussion posts for Returns
Details
-
<static> fetchPages( classID ) → {Promise.<Array.<PartialPage>>}
-
Description
[OPTIONAL] Fetches pages for a course from the LMSParameters
Name Type Description classID
string The class ID to fetch pages for Returns
Details
-
<static> fetchPageContent( classID, pageID ) → {Promise.<Page>}
-
Description
[REQUIRED IF dtpsLMS.fetchPages IS IMPLEMENTED] Fetches content for a page from the LMSParameters
Name Type Description classID
string The class ID to fetch page content for pageID
string The page ID to fetch page content for Returns
Details
-
<static> gradebook( course ) → {Promise.<string>}
-
Description
[OPTIONAL] Renders custom gradebook HTML for unique grading systems or for a more tailored experience. The gradebook only shows for classes with a grade and with at least 1 assignment.Parameters
Name Type Description course
Class Class to render the gradebook for. If custom grade calculation is enabled (dtpsLMS.calculateGrade), those results can be accessed at course.gradeCalculation. Returns
Details
-
<static> gradebookDidRender( course )
-
Description
[OPTIONAL] Called after the HTML returned by dtpsLMS.gradebook has rendered. Runs any initialization needed for the gradebook, such as enabling interactive elements or what-if grades.Parameters
Name Type Description course
Class Class the gradebook was rendered for Details
-
<static> calculateGrade( course, assignments ) → {undefined|object}
-
Description
[OPTIONAL] Calculates class grades with a custom grade calculation formula. Used for unique grading systems.Parameters
Name Type Description course
Class Class to calculate grades for [DO NOT USE COURSE.ASSIGNMENTS to access assignments for grade calculation. Use the assignments parameter instead.] assignments
Array.<Assignment> Assignments used for grade calculation. Use this instead of course.assignments for hypothetical/what-if grade calculation. Returns
Details
-
<static> isUsualDueDate( date ) → {boolean}
-
Description
[OPTIONAL, INSTITUTION ONLY] This function returns true if the due date provided is usual/expected and false if the due date is unusual/expected. If the due date is unusual, it is shown in bold in the UI. For institutions where there is a pattern/standard for due dates between classes.Parameters
Name Type Description date
Date The due date to check Returns
Details
-
<static> updateAssignments( assignments, course ) → {Promise.<Array.<Assignment>>}
-
Description
[OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override assignment data returned by the LMS.Parameters
Name Type Description assignments
Array.<Assignment> Original assignments array course
Class The class that the assignment is in Returns
Details
-
<static> updateClasses( classes ) → {Promise.<Array.<Class>>}
-
Description
[OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override class data returned by the LMS.Parameters
Name Type Description classes
Array.<Class> Original classes array Returns
Details