original_string: protected function run_create_course($shortname, $coursesize) {
  
          // We are in $CFG->dirroot.
          $command = 'php admin/tool/generator/cli/maketestcourse.php';
  
          $options = array(
              '--shortname="' . $shortname . '"',
              '--size="' . get_string('shortsize_' . $coursesize, 'tool_generator') . '"'
          );
  
          if (!$this->progress) {
              $options[] = '--quiet';
          }
  
          if ($this->filesizelimit) {
              $options[] = '--filesizelimit="' . $this->filesizelimit . '"';
          }
  
          // Extend options.
          $optionstoextend = array(
              'fixeddataset' => 'fixeddataset',
              'bypasscheck' => 'bypasscheck',
          );
  
          // Getting an options string.
          foreach ($optionstoextend as $attribute => $option) {
              if (!empty($this->{$attribute})) {
                  $options[] = '--' . $option;
              }
          }
          $options = implode(' ', $options);
          if ($this->progress) {
              system($command . ' ' . $options, $exitcode);
          } else {
              passthru($command . ' ' . $options, $exitcode);
          }
  
          if ($exitcode != 0) {
              exit($exitcode);
          }
      }
code: protected function run_create_course($shortname, $coursesize) {
  
          // We are in $CFG->dirroot.
          $command = 'php admin/tool/generator/cli/maketestcourse.php';
  
          $options = array(
              '--shortname="' . $shortname . '"',
              '--size="' . get_string('shortsize_' . $coursesize, 'tool_generator') . '"'
          );
  
          if (!$this->progress) {
              $options[] = '--quiet';
          }
  
          if ($this->filesizelimit) {
              $options[] = '--filesizelimit="' . $this->filesizelimit . '"';
          }
  
          // Extend options.
          $optionstoextend = array(
              'fixeddataset' => 'fixeddataset',
              'bypasscheck' => 'bypasscheck',
          );
  
          // Getting an options string.
          foreach ($optionstoextend as $attribute => $option) {
              if (!empty($this->{$attribute})) {
                  $options[] = '--' . $option;
              }
          }
          $options = implode(' ', $options);
          if ($this->progress) {
              system($command . ' ' . $options, $exitcode);
          } else {
              passthru($command . ' ' . $options, $exitcode);
          }
  
          if ($exitcode != 0) {
              exit($exitcode);
          }
      }
code_tokens: protected function run_create_course ( $ shortname , $ coursesize ) { // We are in $CFG->dirroot. $ command = 'php admin/tool/generator/cli/maketestcourse.php' ; $ options = array ( '--shortname="' . $ shortname . '"' , '--size="' . get_string ( 'shortsize_' . $ coursesize , 'tool_generator' ) . '"' ) ; if ( ! $ this -> progress ) { $ options [ ] = '--quiet' ; } if ( $ this -> filesizelimit ) { $ options [ ] = '--filesizelimit="' . $ this -> filesizelimit . '"' ; } // Extend options. $ optionstoextend = array ( 'fixeddataset' => 'fixeddataset' , 'bypasscheck' => 'bypasscheck' , ) ; // Getting an options string. foreach ( $ optionstoextend as $ attribute => $ option ) { if ( ! empty ( $ this -> { $ attribute } ) ) { $ options [ ] = '--' . $ option ; } } $ options = implode ( ' ' , $ options ) ; if ( $ this -> progress ) { system ( $ command . ' ' . $ options , $ exitcode ) ; } else { passthru ( $ command . ' ' . $ options , $ exitcode ) ; } if ( $ exitcode != 0 ) { exit ( $ exitcode ) ; } }
docstring: Creates a course with the specified shortname, coursesize and the provided maketestsite options.
  
  @param string $shortname The course shortname
  @param int $coursesize One of the possible course sizes.
  @return void
docstring_tokens: Creates a course with the specified shortname coursesize and the provided maketestsite options .