Classes
Members
# static constant exports.chooseBetween
Chooses the 'best' course to take given an array of slugs, the student and the courses the student has taken.
# static constant exports.CourseInstances
Provides the singleton instance of this class to all other entities.
# static constant exports.Courses
Provides the singleton instance of this class to all other entities.
# static constant exports.getDepartment
Returns the department from the given course slug.
# static constant exports.getFutureEnrollmentMethod
Given a courseID, returns enrollment data for the upcoming 9 academicTerms. The returned data is an object with fields courseID and enrollmentData. CourseID is the course ID. EnrollmentData is an array of arrays. Each interior array is a tuple: a string containing the shortname and an integer indicating the enrollment data.
Example
{ courseID: 'xghuyf2132q3',
enrollmentData: [['Sp19', 0], ['Su19', 1], ['Fa19', 5],
['Sp20', 25], ['Su20', 2], ['Fa20', 0],
['Sp21', 1], ['Su21', 0], ['Fa21', 1]]
}
# static constant exports.makeSampleCourse
Creates a Course with a unique slug and returns its docID.
# static constant exports.makeSampleCourseInstance
Creates a CourseInstance with a unique slug and returns its docID. Also creates a new Course.
Methods
# static getEnrollmentData(courseID, termID)
Returns an array with two elements: a string with the shortName of the academicTerm, and an integer indicating the current planned enrollment for the course in that academicTerm.
Parameters:
Name | Type | Description |
---|---|---|
courseID |
The ID of the course. |
|
termID |
The ID of the academicTerm. |