api/ice

api/ice

Members

(static, constant) exports.gradeCompetency :Object

Source:

The competency points earned for each grade A, B, or C.

Type:
  • Object

Methods

(static) exports.assertICE(obj)

Source:

Throws error if obj is not an ICE object.

Parameters:
Name Type Description
obj

The object to be tested for ICEness.

Throws:

If obj is not ICE.

Type
Meteor.Error

(static) exports.getEarnedICE(docs) → {Object}

Source:

Returns an ICE object that represents the earned ICE points from the passed Course\Opportunity Instance Documents.
ICE values are counted only if verified is true.

Parameters:
Name Type Description
docs

An array of CourseInstance or OpportunityInstance documents.

Returns:

The ICE object.

Type
Object

(static) exports.getProjectedICE(docs) → {Object}

Source:

Returns an ICE object that represents the total ICE points from the passed Course/Opportunity Instance Documents.
ICE values are counted whether or not they are verified.

Parameters:
Name Type Description
docs

An array of CourseInstance or OpportunityInstance documents.

Returns:

The ICE object.

Type
Object

(static) exports.isICE(obj) → {boolean}

Source:

Returns true if the object passed conforms to the ICE object specifications.
Note this does not test to see if additional fields are present.

Parameters:
Name Type Description
obj

The object, which must be an object with fields i, c, and e.

Returns:

True if all fields are present and are numbers.

Type
boolean

(static) exports.makeCourseICE(course, grade) → {Object}

Source:

Returns an ICE object based upon the course slug and the passed grade.
Students only earn ICE competency points for 'interesting' courses. Interesting
courses are courses that have non other slugs.
If an A, then return 9 competency points.
If a B, then return 5 competency points.
Otherwise return zero points.

Parameters:
Name Type Description
course

The course slug. If it's the "uninteresting" slug, then disregard it.

grade

The grade

Returns:

The ICE object.

Type
Object