def _create_config_large(course_id, period_id): """ Create any needed groups/configs for a large course """ # large # Create a staff group set to (unconfigured) feed # COURSE_name_STAFF_feed_period # Create an adhoc staff group # COURSE_name_STAFF_period # Create a student group set to ad-hoc # COURSE_name_ADHOC_period # Create a student group set to (unconfigured) feed # COURSE_name_feed_period course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'], ) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'], ) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)
def _create_config_large(course_id, period_id): """ Create any needed groups/configs for a large course """ # large # Create a staff group set to (unconfigured) feed # COURSE_name_STAFF_feed_period # Create an adhoc staff group # COURSE_name_STAFF_period # Create a student group set to ad-hoc # COURSE_name_ADHOC_period # Create a student group set to (unconfigured) feed # COURSE_name_feed_period course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'],) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'],) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)
def _create_config_casual(course_id, period_id): """ Create any needed groups/configs for a casual course """ course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'], ) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_ADHOC_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'], ) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)
def _create_config_casual(course_id, period_id): """ Create any needed groups/configs for a casual course """ course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'],) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_ADHOC_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'],) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)
def _create_config_demonstration(course_id, period_id): """ Create any needed groups/configs for a demonstration course """ course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'], ) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An Open Registration student group name = "C_%s_OPEN_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students, Self Registered" % (course['name'], ) group.gtype = 2 # enrolment group.source = "open" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_ADHOC_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'], ) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)
def _create_config_demonstration(course_id, period_id): """ Create any needed groups/configs for a demonstration course """ course = get_course(course_id) # An ad-hoc Staff group name = "C_%s_STAFF_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Staff" % (course['name'],) group.gtype = 1 # staff group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An Open Registration student group name = "C_%s_OPEN_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students, Self Registered" % (course['name'],) group.gtype = 2 # enrolment group.source = "open" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id) # An ad-hoc student group name = "C_%s_ADHOC_%s" % (course['name'], period_id) group = Groups.get_by_name(name) if not group: group = Groups.Group(g_id=0) group.name = name group.title = "%s, Students" % (course['name'],) group.gtype = 2 # student group.source = "adhoc" group.period = period_id group.feed = None group.feedargs = "" group.active = True group.save() group = Groups.get_by_name(name) add_group(group.id, course_id)