MDL-46576 core_grade: Check that sumofgradesonly config setting exists before using it