Rating task difficulty

Fixes #145.
This assertion is done 10 times inside methods. Better move it at the file level?