diff --git a/badges/criteria_settings.php b/badges/criteria_settings.php index d1ba41c0927..ee8149ec4f0 100644 --- a/badges/criteria_settings.php +++ b/badges/criteria_settings.php @@ -55,6 +55,12 @@ if ($badge->is_active() || $badge->is_locked()) { redirect($return); } +// Make sure the criteria type is accepted. +$accepted = $badge->get_accepted_criteria(); +if (!in_array($type, $accepted)) { + redirect($return); +} + if ($badge->type == BADGE_TYPE_COURSE) { require_login($badge->courseid); $course = get_course($badge->courseid);