edx/edx-platform — pull request #4364 by aboudreault (2014-07-10 14:35:05+00:00)
Title: (WIP) Modified cohorts module to support the new workgroup type

This PR contains the addition of a new cohort type: workgroup. This type can be used to create various cohorts. To give you more context, this is used to create group projects between students, so they can also have a private/cohorted discussion in the unit. Some detials:

* The current behavior of edx cohorts has not changed. It remains the same as before.
* If we want to interact with a different type of cohort, we need to specify it with group_type=CourseUserGroup.WORKGROUP with the needed function.
* A user can now be in multiple cohort, ONLY if we specified it explicitly with the allow_multiple parameter of the add_user_to_cohort function. This shouldn't be used with the normal COHORT type, but might be for other types.
* The get_cohort() behave the same as before and HAS to return only one user cohort.
* In get_cohort(), auto_cohort is only supported for normal course cohort. (type COHORT).
* A new function is available: get_cohorts(), which should be used to get all cohorts of a user.
* We can use the type CourseUserGroup.ANY where appropriate to get cohorts of all types.

cc @antoviaque @jimabramson @gwprice @chrisndodge