To have students communicate with one another in separate groups, use discussion forums with groups enabled. This configuration will allow the instructor to choose the groups. Students will be able to contribute to only their group's forum, but it is possible for students to view other groups' threads depending on how the group forum is configured.
Enabling Groups in a forum:
1. In the course, click the "Edit Mode" on the top right:
2. Click on three dots and then on Edit Settings:
3. Scroll to the bottom of the page and open the tab Common module settings. Then change the Group mode setting to:
Separate Groups to allow students to contribute and view posts from only their own group.
Visible Groups to allow students to contribute to their own group, but only view posts from other groups.