Added again code to fix bug when reseting assign grades (https://tracker.moodle.org/browse/MDL-41877)