Namespace

api/course

api/course

Classes

CourseCollection
CourseInstanceCollection

Members

# static constant exports.CourseInstances

Provides the singleton instance of this class to all other entities.

View Source api/course/CourseInstanceCollection.ts, line 440

# static constant exports.Courses

Provides the singleton instance of this class to all other entities.

View Source api/course/CourseCollection.ts, line 306

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

View Source api/course/CourseCollection.methods.ts, line 36

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.

View Source api/course/SampleCourses.ts, line 22

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.

View Source api/course/CourseUtilities.ts, line 110

*

# static exports.getDepartment(courseSlug) → {string}

Returns the department from the given course slug.

Parameters:
Name Type Description
courseSlug

the course slug.

View Source api/course/CourseUtilities.ts, line 148

string

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

View Source api/course/SampleCourses.ts, line 59

The docID for the newly generated Interest.

String

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

View Source api/course/CourseUtilities.ts, line 18

boolean

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

View Source api/course/CourseCollection.methods.ts, line 17