original_string: public static function competency_viewed($competencyorid) {
          static::require_enabled();
          $competency = $competencyorid;
          if (!is_object($competency)) {
              $competency = new competency($competency);
          }
  
          if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                  $competency->get_context())) {
              throw new required_capability_exception($competency->get_context(), 'moodle/competency:competencyview',
                  'nopermissions', '');
          }
  
          \core\event\competency_viewed::create_from_competency($competency)->trigger();
          return true;
      }
code: public static function competency_viewed($competencyorid) {
          static::require_enabled();
          $competency = $competencyorid;
          if (!is_object($competency)) {
              $competency = new competency($competency);
          }
  
          if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                  $competency->get_context())) {
              throw new required_capability_exception($competency->get_context(), 'moodle/competency:competencyview',
                  'nopermissions', '');
          }
  
          \core\event\competency_viewed::create_from_competency($competency)->trigger();
          return true;
      }
code_tokens: public static function competency_viewed ( $ competencyorid ) { static :: require_enabled ( ) ; $ competency = $ competencyorid ; if ( ! is_object ( $ competency ) ) { $ competency = new competency ( $ competency ) ; } if ( ! has_any_capability ( array ( 'moodle/competency:competencyview' , 'moodle/competency:competencymanage' ) , $ competency -> get_context ( ) ) ) { throw new required_capability_exception ( $ competency -> get_context ( ) , 'moodle/competency:competencyview' , 'nopermissions' , '' ) ; } \ core \ event \ competency_viewed :: create_from_competency ( $ competency ) -> trigger ( ) ; return true ; }
docstring: Logg the competency viewed event.
  
  @param competency|int $competencyorid The competency object or competency id
  @return bool
docstring_tokens: Logg the competency viewed event .