Why late homework is the enemy of memory

The brain consolidates what it has learnt during sleep. Making a child revise until 10pm sabotages precisely the stage that fixes memories. What to do instead.