Careful users of the language avoid such sentences. Although the sentence is acceptable, its meaning is ambiguous. The sentence could mean that “none” of the students handed in their assignment, or it could mean that “not all” the students handed it in. To make the meaning clear you need to say.
*Not all the students handed in their assignment. (Some did.)
*None of the students handed in their assignment. (No one did.)
Avoid using “all” and “both” with negatives. Remember, it is wrong to say, “Both the sisters aren’t beautiful”. You will have to say, “Neither sister is beautiful.” Similarly, instead of saying, “Both the bowlers aren’t bowling well,” you need to say, “Neither bowler is bowling well.”