public static function set_course_competency_ruleoutcome($coursecompetencyorid, $ruleoutcome) {
        static::require_enabled();
        $coursecompetency = $coursecompetencyorid;
        if (!is_object($coursecompetency)) {
            $coursecompetency = new course_competency($coursecompetencyorid);
        }

        $courseid = $coursecompetency->get('courseid');
        self::validate_course($courseid);
        $coursecontext = context_course::instance($courseid);

        require_capability('moodle/competency:coursecompetencymanage', $coursecontext);

        $coursecompetency->set('ruleoutcome', $ruleoutcome);
        return $coursecompetency->update();
    }