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 22

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 289

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

Array

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

Defines a new Course.

Parameters:
Name Type Description
description Object

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

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.

repeatable

is optional, defaults to false.

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',
                 });

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

An object representing the definition of docID.

Object

# findCourseNumberByName(name) → {string}

Returns the course number of the course name

Parameters:
Name Type Description
name string

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

string

# findDoc(name) → {Object}

Courses have names, but they also have a method 'getName' that returns the ${num}: ${shortName}. This method will return the doc that has that getName.

Parameters:
Name Type Description
name String | Object

Either the docID, or an object selector, or the 'name' field value.

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

If the document cannot be found.

Meteor.Error

The document associated with name.

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 219

If any of the instanceIDs cannot be found.

Meteor.Error
Array

# findRelatedCareerGoals(docIdOrSlug) → {Array.<CareerGoals>}

Returns a list of CareerGoals that have common interests.

Parameters:
Name Type Description
docIdOrSlug string

a course ID or slug.

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

CareerGoals that share the interests.

Array.<CareerGoals>

# findRelatedInternships(docIdOrSlug) → {Array.<Internship>}

Returns a list of Internships that have common interests.

Parameters:
Name Type Description
docIdOrSlug string

a course ID or slug.

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

Internships that share the interests.

Array.<Internship>

# findRelatedOpportunities(docIdOrSlug) → {Array.<Opportunity>}

Returns a list of the Opportunities that have common interests.

Parameters:
Name Type Description
docIdOrSlug string

a course ID or slug.

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

Opportunities that share the interests.

Array.<Opportunity>

# getName(docIdOrSlug) → {string}

Returns the name of the ID or slug.

Parameters:
Name Type Description
docIdOrSlug string

an ID or slug.

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

Course number and short name.

string

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

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 188

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, repeatable, 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

repeatable

optional boolean.

retired

optional boolean.

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