In the case where teachers do not have the accessallgroups capability,
we only send "an attempt has been sumbitted "notification to teachers
in the same group as the student who submitted.
At the moment this considers all groups in the course. If this
particular quiz has a grouping set, then the logic should only consider
the groups in that grouping.