Class

CourseCollection

api/course.CourseCollection()

Represents a specific course, such as "ICS 311". To represent a specific course for a specific academicTerm, use CourseInstance.

Constructor

# new CourseCollection()

Creates the Course collection.

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

Extends

  • api/base~BaseSlugCollection

Methods

# checkIntegrity() → {Array}

Returns an array of strings, each one representing an integrity problem with this collection. Returns an empty array if no problems were found. Checks slugID and interestIDs.

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

A (possibly empty) array of strings indicating integrity issues.

Array

# define(description, name, shortName, slug, num, creditHrs, interests, syllabus, corequisites, prerequisites, retired)

Defines a new Course.

Parameters:
Name Type Description
description Object

Object with keys name, shortName, slug, num, description, creditHrs, interests, syllabus, and prerequisites.

name

is the official course name.

shortName

is an optional abbreviation. Defaults to name.

slug

must not be previously defined.

num

the course number.

creditHrs

is optional and defaults to 3. If supplied, must be a num between 1 and 15.

interests

is a (possibly empty) array of defined interest slugs or interestIDs.

syllabus

is optional. If supplied, should be a URL.

corequisites

is optional. If supplied, must be an array of Course slugs or courseIDs.

prerequisites

is optional. If supplied, must be an array of previously defined Course slugs or courseIDs.

retired

is optional, defaults to false.

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

If the definition includes a defined slug or undefined interest or invalid creditHrs.

Meteor.Error

The newly created docID.

Example
Courses.define({ name: 'Introduction to the theory and practice of scripting',
                 shortName: 'Intro to Scripting',
                 slug: 'ics_215',
                 num: 'ICS 215',
                 description: 'Introduction to scripting languages for the integration of applications.',
                 creditHrs: 4,
                 interests: ['perl', 'javascript', 'ruby'],
                 syllabus: 'http://courses.ics.hawaii.edu/syllabuses/ICS215.html',
                 prerequisites: ['ics_211'] });

# dumpOne(docID) → {Object}

Returns an object representing the Course docID in a format acceptable to define().

Parameters:
Name Type Description
docID

The docID of a Course.

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

An object representing the definition of docID.

Object

# findNames(instanceIDs) → {Array}

Returns a list of Course names corresponding to the passed list of Course docIDs.

Parameters:
Name Type Description
instanceIDs

A list of Course docIDs.

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

If any of the instanceIDs cannot be found.

Meteor.Error
Array

# hasInterest(course, interest) → {boolean}

Returns true if Course has the specified interest.

Parameters:
Name Type Description
course

The user (docID or slug)

interest

The Interest (docID or slug).

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

If course is not a course or interest is not a Interest.

Meteor.Error

True if the course has the associated Interest.

boolean

# removeIt(instance)

Remove the Course.

Parameters:
Name Type Description
instance

The docID or slug of the entity to be removed.

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

If docID is not a Course, or if this course has any associated course instances.

Meteor.Error

# update(instance, name, shortName, num, description, creditHrs, interests, syllabus, prerequisites, retired)

Update a Course.

Parameters:
Name Type Description
instance

The docID (or slug) associated with this course.

name

optional

shortName

optional

num

optional

description

optional

creditHrs

optional

interests

An array of interestIDs or slugs (optional)

syllabus

optional

prerequisites

An array of course slugs. (optional)

retired

optional boolean.

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