First commit for adding new criteria to courses

- modified criteria api to have two paths, one for CriteriaAndCourses
and the other for just Criteria. This allow us the flexibility of
only interacting with the Criteria or the relationship it has with
courses
	- CoursesCriteriaResource - for model CoursesAndCriteria
	- CriteriaResource - for model Criteria
- current design is to have the add criteria option part of the
course configure form. When a new criteria is created, it is by default
added to the course as well
- editing criteria is only available to the author and admins. The
edit form is a new screen. When the update is submitted, the user
is redirected back to the course configure form they came from
- the add and edit form uses the same partial
- a partial has also been partially created for listing the criteria
currently being attached to the course. This partial is still under
construction
	- adding remove action
	- dropdown menu to add previously created courses
	- also intended for use in the question form
Created backend tests for criteria

- wrote tests for getting, creating, and updating criteria
- modified CriteriaFactory so that name and description can be set
implemented adding existing criteria / deactivating criteria in a course

NEED TO UPGRADE DATABASE
- modified api/courses/:courseId/criteria to only returned criteria
that are active
- added ability to add existing criteria
- added ability to deactivate criteria in a course
- created api to return all the criteria the user has access to
	- admins: all criteria
	- other users: their own + public criteria
- created a database upgrade script
	- removed constraint that a criterion name needs to be unique
	- added public attribute to Criteria - eg. default criterion
	- added active attribute to CriteriaAndCourses
Created more tests for criteria api

- created tests for adding/deactivating criteria in a course
- created tests for getting all accessible criteria
- added tests for getting only active criteria in the course
- updated dataformat to return the status of the criteria in the course
removed restriction for user to select dates in the past for

question creation.
Implemented warning message for cases where not enough answer

pairings are available for the user to complete their required number
of evaluations

- new API functions have been created to generate the information
needed to check whether there are adequate number of pairings
- test have been written for the new functions
- I've tried to create a short message for the warning but gives
enough information for the user so that they would not panic
Fixed Issue #80

The permissions are generated at login, therefore if the instructor
does not have any courses, they would not have permissiont to create
questions for example. Furthermore, the permissions are not being
updated after course creation, which is why the buttons are unavailable.

To fix this, I created a refresh function for the Session service,
which updates the permissions (including the new course).

On a side note, I have fixed the api call "/session/permissions" (typo)
Fixed test - fixed expected api address
Fixed Issue #83

An error message now appears when the user has entered more than 255
characters. The submit button will also stay disabled until the error
is resolved.
Partially fixed Issue #82

- when an invalid time period is submitted, the Save button stays disabled.
The reason is the $invalid property for the form becomes true. Fixed it
by using ng-if instead of ng-show
- changed time validation - answer_start cannot be equal to answer_end
Fix answer pairing availability, same answer pair

If no unscored pairs can be formed, then we have to return a scored
pair. Previously, it was just failing.

When forming unscored answer pairs, there was a possibility that it can
return a pair where both answers are the same due to randomly picking
from a list of all available answers. It should now pick from a list of
all available answers but minus the currently unscored answer.
Fix answers not pairing up with similar scores.

The sort by answer score wasn't working cause I assigned it the score
model object instead of the actual score.

This was actually picked up by the very basic score matched answer
pairing test.
Add more tests for the judgements module.

Particularly, the answer pair generation part. Unfortunately, due to
time constraints, the score matched pairing test is very basic. It
definitely needs to be improved upon.