This addon from the University of New South Wales provides teachers and course managers a way to create teams automatically based on student responses to a student facing questionnaire. It’s a pretty neat way to utilize Moodle to systematically create groups across a course.
The criteria that can be defined are based on a simple multiple choice setup, but the questions, once answered by students predicates can be setup to ensure that each group can be allocated someone that meets a criteria.
Download the Team Builder addon for 2.7 and 2.8 at https://moodle.org/plugins/view/mod_teambuilder
Check out the video to see how complexity can be added to the group setup [direct video link: https://www.youtube.com/watch?v=J2jviBCBJ70].