You could limit the assignment so it is only seen by students in Group A (use restrictions) - that way Group B will never see the assignment and as such won't ever try it. At that point, then the Exclude Empty Grades will work because they will never receive a grade for it...
Or perhaps I have misunderstood what is happening exactly...