api/course

api/course

Classes

CourseCollection
CourseInstanceCollection

Members

(static, constant) exports.CourseInstances

Source:

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

(static, constant) exports.Courses

Source:

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

(static, constant) exports.getFutureEnrollmentMethod

Source:

Given a courseID, returns enrollment data for the upcoming 9 semesters.
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.sampleCourseName :string

Source:

The name of the sample course.

Type:
  • string

Methods

(static) exports.chooseBetween(slugs, studentID, coursesTakenSlugs) → {*}

Source:

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.

Returns:
Type
*

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

Source:

Returns the department from the given course slug.

Parameters:
Name Type Description
courseSlug

the course slug.

Returns:
Type
string

(static) exports.makeSampleCourse(args) → {String}

Source:

Creates a Course with a unique slug and returns its docID.

Parameters:
Name Type Description
args

An optional object containing arguments to the courses.define function.

Returns:

The docID of the newly generated Course.

Type
String

(static) exports.makeSampleCourseInstance(student, args) → {String}

Source:

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.

Returns:

The docID for the newly generated Interest.

Type
String

(static) exports.prereqsMet(coursesTakenSlugs, courseID) → {boolean}

Source:

Returns true if the coursesTakenSlugs fulfills courseID's prerequisites.

Parameters:
Name Type Description
coursesTakenSlugs

slugs of the courses taken.

courseID

course ID.

Returns:
Type
boolean

(static) getEnrollmentData(courseID, semesterID)

Source:

Returns an array with two elements: a string with the shortName of the semester, and an integer indicating the
current planned enrollment for the course in that semester.

Parameters:
Name Type Description
courseID

The ID of the course.

semesterID

The ID of the semester.