Patch from https://tracker.moodle.org/browse/MDL-31998 to fix some Feedback logic.