Setting up a course in group mode can be a good strategy if you teach multiple sections of the same course but you want to use one single moodle course. Within the same course section, you might also want to have the students work in separate groups, and the group mode can help in this case as well.
Groups can be set at two levels.
There are three group modes
Using groups with discussion forums allow teachers to restrict interaction between students. Separate groups mean only students in the same group can see and participate in discussions within a particular forum. Visible groups allow students to see other group's discussions but only participate in their own group's discussions.
Once you have set up the group mode either at the course or at the activity level, you have to create your groups.
You can restrict the access to an activity, resource, or course topic to a specific group. This option is useful if you are teaching multiple sections of the same course and you have enabled the groups within Moodle.
In the settings of the activity or resource, select Restrict access, then click on the Add restriction button. In the Add restriction selection menu, choose Groups to enable the restriction by group.
Finally, select the group you would like the activity or resource to be restricted to.
Once you have groups enabled in your course, you can also use groups within a forum. There are three options: