CONTRIB-926 Course reset plus more grade features.

Signed-off-by: Joseph Rézeau <moodle@rezeau.org>
CONTRIB-4274

Signed-off-by: Joseph Rézeau <moodle@rezeau.org>
OK for CONTRIB-823 and CONTRIB-4075.

Signed-off-by: Joseph Rézeau <moodle@rezeau.org>