public function clear_attempt($data) {
        global $DB;

        foreach ($data['criteria'] as $criterionid => $record) {
            $DB->delete_records('gradingform_rubric_fillings',
                array('criterionid' => $criterionid, 'instanceid' => $this->get_id()));
        }
    }