MDL-48633 mod_lesson: grade handling is buggy when scales in use