Course Sections

Courseaffils

MVSim uses the CCNMTL-developed Courseaffils[1] library to provide course-based user groupings for the entire user experience. From the user perspective, nearly all interactions with the application occur within the context of a single course; if the user is associated with more than one course in the system, he has to select which course to work through before interacting with the application.

A COURSEAFFILS_COURSESTRING_MAPPER Django setting is used to determine how logged-in users should be auto-associated with courses. By default it is set to a Columbia-specific backend that integrates with the WIND login system and Djangowind[2] auth backend.

The primary courseaffils model is courseaffils.Course. Courses must be added to the system via the Django Admin UI before users can be associated with courses. Course-student and course-faculty mappings can be added directly through manual creation of auth.Groups associated with the courses, or automatically by setting a Course’s coursestring. (This automatic association feature is the bit that relies on the COURSEAFFILS_COURSESTRING_MAPPER setting and which defaults to a central-auth-based implementation specific to Columbia.)

On the backend, a user’s currently active Course object is available as request.course which is set through a session key in the courseaffils.middleware.CourseManagerMiddleware middleware.

(A lot of the above documentation should be moved to Courseaffils, which currently lacks any high-level docs.)

[1] https://github.com/ccnmtl/django_courseaffils [2] https://github.com/ccnmtl/djangowind

Course Sections

Beneath the primary Course containers, users are further associated into Course Sections via the mvsim.main.models.CourseSection model. Course Sections determine only one thing: which Starting States are available for a user to start a new game from.

This currently lacks any useful UI and has to be set via the Django Admin UI.

Currently all students in a class are automatically stuffed into a single “default” CourseSection. The CourseSection is created via a post_save signal on courseaffils.Course in mvsim.main.models and users are added to it in ad-hoc mvsim.main.views code. No Starting State is auto-associated.

CourseSections could also impact views on the high score table, which isn’t yet implemented anyway.