Classes
Members
# 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.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.
Methods
# static exports.chooseBetween(slugs, studentID, coursesTakenSlugs) → {*}
Chooses the 'best' course to take given an array of slugs, the student and the courses the student has taken.
Parameters:
Name | Type | Description |
---|---|---|
slugs |
an array of course slugs to choose between. |
|
studentID |
the student's ID. |
|
coursesTakenSlugs |
an array of the course slugs the student has taken. |
# static exports.getDepartment(courseSlug) → {string}
Returns the department from the given course slug.
Parameters:
Name | Type | Description |
---|---|---|
courseSlug |
the course slug. |
# static exports.makeSampleCourseInstance(student, args) → {String}
Creates a CourseInstance with a unique slug and returns its docID. Also creates a new Course.
Parameters:
Name | Type | Description |
---|---|---|
student |
The student slug associated with this course. |
|
args |
Optional object providing arguments to the CourseInstance definition. |
The docID for the newly generated Interest.
# static exports.prereqsMet(coursesTakenSlugs, courseID) → {boolean}
Returns true if the coursesTakenSlugs fulfills courseID's prerequisites.
Parameters:
Name | Type | Description |
---|---|---|
coursesTakenSlugs |
slugs of the courses taken. |
|
courseID |
course ID. |
# 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. |