original_string: public static function set_course_module_competency_ruleoutcome($coursemodulecompetencyorid, $ruleoutcome) {
          static::require_enabled();
          $coursemodulecompetency = $coursemodulecompetencyorid;
          if (!is_object($coursemodulecompetency)) {
              $coursemodulecompetency = new course_module_competency($coursemodulecompetencyorid);
          }
  
          $cm = get_coursemodule_from_id('', $coursemodulecompetency->get('cmid'), 0, true, MUST_EXIST);
  
          self::validate_course_module($cm);
          $context = context_module::instance($cm->id);
  
          require_capability('moodle/competency:coursecompetencymanage', $context);
  
          $coursemodulecompetency->set('ruleoutcome', $ruleoutcome);
          return $coursemodulecompetency->update();
      }
code: public static function set_course_module_competency_ruleoutcome($coursemodulecompetencyorid, $ruleoutcome) {
          static::require_enabled();
          $coursemodulecompetency = $coursemodulecompetencyorid;
          if (!is_object($coursemodulecompetency)) {
              $coursemodulecompetency = new course_module_competency($coursemodulecompetencyorid);
          }
  
          $cm = get_coursemodule_from_id('', $coursemodulecompetency->get('cmid'), 0, true, MUST_EXIST);
  
          self::validate_course_module($cm);
          $context = context_module::instance($cm->id);
  
          require_capability('moodle/competency:coursecompetencymanage', $context);
  
          $coursemodulecompetency->set('ruleoutcome', $ruleoutcome);
          return $coursemodulecompetency->update();
      }
code_tokens: public static function set_course_module_competency_ruleoutcome ( $ coursemodulecompetencyorid , $ ruleoutcome ) { static :: require_enabled ( ) ; $ coursemodulecompetency = $ coursemodulecompetencyorid ; if ( ! is_object ( $ coursemodulecompetency ) ) { $ coursemodulecompetency = new course_module_competency ( $ coursemodulecompetencyorid ) ; } $ cm = get_coursemodule_from_id ( '' , $ coursemodulecompetency -> get ( 'cmid' ) , 0 , true , MUST_EXIST ) ; self :: validate_course_module ( $ cm ) ; $ context = context_module :: instance ( $ cm -> id ) ; require_capability ( 'moodle/competency:coursecompetencymanage' , $ context ) ; $ coursemodulecompetency -> set ( 'ruleoutcome' , $ ruleoutcome ) ; return $ coursemodulecompetency -> update ( ) ; }
docstring: Update ruleoutcome value for a course module competency.
  
  @param int|course_module_competency $coursemodulecompetencyorid The course_module_competency, or its ID.
  @param int $ruleoutcome The value of ruleoutcome.
  @return bool True on success.
docstring_tokens: Update ruleoutcome value for a course module competency .