test plan:
* enroll students in a course in multiple sections
* should be able to use the
"Require group members to be in the same section"
checkbox on two areas:
(1) when creating a group set and selecting
"split students into X groups"
(2) when creating groups manually for a group set
and selecting "Randomly assign students" in the
cog menu (assuming the group set is empty and none
of the groups have size restrictions)
* when checked, this option should ensure that
students are only grouped together with students
from their own section
closes #CNVS-32360
Change-Id: I84f43e0106f2382ea75bdeaa0a455978e307698a
Reviewed-on: https://gerrit.instructure.com/93513
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Chris Ward <cward@instructure.com>
fixes CNVS-14666
altered styles and markup to include form elements
in group category edit view.
abstracted some element handling for autoloader
controls into edit view to be shared by create view.
updated group category API to include auto_leader
in JSON serialization (so the edit form
can set the state correctly)
Changed edit view to set form state based on
auto_leader value in GroupCategory model from API.
add tests for GroupCategoryEditView in coffee script
update GroupCategories::Params to favor form
submission value over raw api value for auto leader
if both are specified and the form version is
enabled.
add ability to nil out auto_leader status by
unchecking checkbox on form
TEST PLAN:
- login as a teacher
- create a group set
- edit the group set
- you should be able to change the
group leadership settings
- you should be able to nil out autoloader settings
by unchecking the checkbox on the edit form
- ensure that as students are added to the groups
the leadership settings are effective (that is
a leader still gets assigned at random
or by first joining student depending on
leadership strategy selected)
Change-Id: Iecbb4829f5efccda1bd97bca1d99c3bd4c15bffe
Reviewed-on: https://gerrit.instructure.com/41965
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
closes: CNVS-11834
This creates a way for an instructor to
assign a random student as the group leader.
It only applies when an instructor is having groups
created automatically at the time of defining
a group category.
This also take an opportunity to refactor out
some bloated code from the group_categories_controller
and move it into some separate objects
that can be more easily understood and rapidly
unit tested through all the necessary permutations
(allowing higher level integration tests to just
cover a case or two)
It ALSO removes group leadership knowledge into
it's own object so that the callbacks in other
objects are simple and the logic regarding
how to do group leadership management is in
one place.
TEST PLAN:
AUTO_DISTRIBUTION:
1) login as an instructor
2) go to the "people" tab and try to create a group
set.
3) click on the "Create [0] groups for me" radio
button; verify you now have controls for assigning
a group leader automatically and that the strategy
radio buttons are greyed out.
4) check the "Assign a group leader automatically"
checkbox; verify the 2 nested radio buttons for
"random" and "first" strategies become enabled
5) select a strategy and fill out the rest of the
form, then submit (make sure your background job
is running)
6) verify after groups are created that each group
has a leader, and that the leader is in fact a member
of the group.
SelfSignup:
1) login as an instructor
2) go to the "people" tab and try to create a group
set.
3) enable self-signup.
4) check the "Assign a group leader automatically"
checkbox; verify the 2 nested radio buttons for
"random" and "first" strategies become enabled
5) select a strategy and fill out the rest of the
form, then submit.
6) Login as a student for the same course and join
the group.
7) verify that the student has been made the group
leader.
Change-Id: I2cdd9f5ed2fd577469beec4ab7369c69ecf7eaa6
Reviewed-on: https://gerrit.instructure.com/35130
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>