original_string: public static function register_course($courseinfo) {
          $params = array('courses' => array($courseinfo));
          $hubcourseids = self::call('hub_register_courses', $params);
          if (count($hubcourseids) != 1) {
              throw new moodle_exception('errorcoursewronglypublished', 'hub');
          }
          return $hubcourseids[0];
      }
code: public static function register_course($courseinfo) {
          $params = array('courses' => array($courseinfo));
          $hubcourseids = self::call('hub_register_courses', $params);
          if (count($hubcourseids) != 1) {
              throw new moodle_exception('errorcoursewronglypublished', 'hub');
          }
          return $hubcourseids[0];
      }
code_tokens: public static function register_course ( $ courseinfo ) { $ params = array ( 'courses' => array ( $ courseinfo ) ) ; $ hubcourseids = self :: call ( 'hub_register_courses' , $ params ) ; if ( count ( $ hubcourseids ) != 1 ) { throw new moodle_exception ( 'errorcoursewronglypublished' , 'hub' ) ; } return $ hubcourseids [ 0 ] ; }
docstring: Publish one course
  
  Expected contents of $courseinfo:
  [
  'sitecourseid' => new external_value(PARAM_INT, 'the id of the course on the publishing site'),
  'fullname' => new external_value(PARAM_TEXT, 'course name'),
  'shortname' => new external_value(PARAM_TEXT, 'course short name'),
  'description' => new external_value(PARAM_TEXT, 'course description'),
  'language' => new external_value(PARAM_ALPHANUMEXT, 'course language'),
  'publishername' => new external_value(PARAM_TEXT, 'publisher name'),
  'publisheremail' => new external_value(PARAM_EMAIL, 'publisher email'),
  'contributornames' => new external_value(PARAM_TEXT, 'contributor names'),
  'coverage' => new external_value(PARAM_TEXT, 'coverage'),
  'creatorname' => new external_value(PARAM_TEXT, 'creator name'),
  'licenceshortname' => new external_value(PARAM_ALPHANUMEXT, 'licence short name'),
  'subject' => new external_value(PARAM_ALPHANUM, 'subject'),
  'audience' => new external_value(PARAM_ALPHA, 'audience'),
  'educationallevel' => new external_value(PARAM_ALPHA, 'educational level'),
  'creatornotes' => new external_value(PARAM_RAW, 'creator notes'),
  'creatornotesformat' => new external_value(PARAM_INTEGER, 'notes format'),
  'demourl' => new external_value(PARAM_URL, 'demo URL', VALUE_OPTIONAL),
  'courseurl' => new external_value(PARAM_URL, 'course URL', VALUE_OPTIONAL),
  'enrollable' => new external_value(PARAM_BOOL, 'is the course enrollable', VALUE_DEFAULT, 0),
  'screenshots' => new external_value(PARAM_INT, 'the number of screenhots', VALUE_OPTIONAL),
  'deletescreenshots' => new external_value(PARAM_INT, 'ask to delete all the existing screenshot files
  (it does not reset the screenshot number)', VALUE_DEFAULT, 0),
  'contents' => new external_multiple_structure(new external_single_structure(
  array(
  'moduletype' => new external_value(PARAM_ALPHA, 'the type of module (activity/block)'),
  'modulename' => new external_value(PARAM_TEXT, 'the name of the module (forum, resource etc)'),
  'contentcount' => new external_value(PARAM_INT, 'how many time the module is used in the course'),
  )), 'contents', VALUE_OPTIONAL),
  'outcomes' => new external_multiple_structure(new external_single_structure(
  array(
  'fullname' => new external_value(PARAM_TEXT, 'the outcome fullname')
  )), 'outcomes', VALUE_OPTIONAL)
  ]
  
  @param array|\stdClass $courseinfo
  @return int id of the published course on the hub
  @throws moodle_exception if communication to moodle.net failed or course could not be published
docstring_tokens: Publish one course