Petr is right that the suggestions made here don't fit in with how the db works.
The group ids are attached to the discussions (ie the top post in a discussion only) AT THE TIME OF POSTING. The group id of posts is not determined at run time. This is intentional, because we don't want discussions coming and going as people change groups. If you made a post into a particular group it should stay there.
The single discussion forum currently uses one discussion. It can only have one groupid, hence the incompatibility with the idea of separate groups looking at one discussion.
The solution that's been floating around from years ago is to automatically replicate the single discussion (when the teacher saves it) into ONE DISCUSSION FOR EACH GROUP. eg three groups -> 3 discussion. This way each can have a separate groupid, and everything works fine. There are some maintenance problems with this:
1) If the main question post is altered, then all three discussions need to be altered to stay the same.
2) If the groups are changed or new groups are added, then new postings need to be created/deleted for those groups to keep in sync.
3) If the forum type is changed back to general, say, then you'll have three discussions all with the same initial post (this may not really be a problem).
I'm sure it can be done, but it involves exceptions and is a little bit hacky, sure.