original_string: public static function data_for_report($courseid, $userid, $moduleid) {
          global $PAGE;
  
          $params = self::validate_parameters(
              self::data_for_report_parameters(),
              array(
                  'courseid' => $courseid,
                  'userid' => $userid,
                  'moduleid' => $moduleid
              )
          );
          $context = context_course::instance($params['courseid']);
          self::validate_context($context);
          if (!is_enrolled($context, $params['userid'], 'moodle/competency:coursecompetencygradable')) {
              throw new coding_exception('invaliduser');
          }
  
          $renderable = new output\report($params['courseid'], $params['userid'], $params['moduleid']);
          $renderer = $PAGE->get_renderer('report_competency');
  
          $data = $renderable->export_for_template($renderer);
  
          return $data;
      }
code: public static function data_for_report($courseid, $userid, $moduleid) {
          global $PAGE;
  
          $params = self::validate_parameters(
              self::data_for_report_parameters(),
              array(
                  'courseid' => $courseid,
                  'userid' => $userid,
                  'moduleid' => $moduleid
              )
          );
          $context = context_course::instance($params['courseid']);
          self::validate_context($context);
          if (!is_enrolled($context, $params['userid'], 'moodle/competency:coursecompetencygradable')) {
              throw new coding_exception('invaliduser');
          }
  
          $renderable = new output\report($params['courseid'], $params['userid'], $params['moduleid']);
          $renderer = $PAGE->get_renderer('report_competency');
  
          $data = $renderable->export_for_template($renderer);
  
          return $data;
      }
code_tokens: public static function data_for_report ( $ courseid , $ userid , $ moduleid ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: data_for_report_parameters ( ) , array ( 'courseid' => $ courseid , 'userid' => $ userid , 'moduleid' => $ moduleid ) ) ; $ context = context_course :: instance ( $ params [ 'courseid' ] ) ; self :: validate_context ( $ context ) ; if ( ! is_enrolled ( $ context , $ params [ 'userid' ] , 'moodle/competency:coursecompetencygradable' ) ) { throw new coding_exception ( 'invaliduser' ) ; } $ renderable = new output \ report ( $ params [ 'courseid' ] , $ params [ 'userid' ] , $ params [ 'moduleid' ] ) ; $ renderer = $ PAGE -> get_renderer ( 'report_competency' ) ; $ data = $ renderable -> export_for_template ( $ renderer ) ; return $ data ; }
docstring: Loads the data required to render the report.
  
  @param int $courseid The course id
  @param int $userid The user id
  @param int $moduleid The module id
  @return \stdClass
docstring_tokens: Loads the data required to render the report .