original_string: protected function get_drag_item_repeats() {
          $countimages = 0;
          if (isset($this->question->id)) {
              foreach ($this->question->options->drags as $drag) {
                  $countimages = max($countimages, $drag->no);
              }
          }
  
          if (!$countimages) {
              $countimages = self::START_NUM_ITEMS;
          }
          $itemrepeatsatstart = $countimages;
  
          $imagerepeats = optional_param('noitems', $itemrepeatsatstart, PARAM_INT);
          $addfields = optional_param('additems', false, PARAM_BOOL);
          if ($addfields) {
              $imagerepeats += self::ADD_NUM_ITEMS;
          }
          return array($itemrepeatsatstart, $imagerepeats);
      }
code: protected function get_drag_item_repeats() {
          $countimages = 0;
          if (isset($this->question->id)) {
              foreach ($this->question->options->drags as $drag) {
                  $countimages = max($countimages, $drag->no);
              }
          }
  
          if (!$countimages) {
              $countimages = self::START_NUM_ITEMS;
          }
          $itemrepeatsatstart = $countimages;
  
          $imagerepeats = optional_param('noitems', $itemrepeatsatstart, PARAM_INT);
          $addfields = optional_param('additems', false, PARAM_BOOL);
          if ($addfields) {
              $imagerepeats += self::ADD_NUM_ITEMS;
          }
          return array($itemrepeatsatstart, $imagerepeats);
      }
code_tokens: protected function get_drag_item_repeats ( ) { $ countimages = 0 ; if ( isset ( $ this -> question -> id ) ) { foreach ( $ this -> question -> options -> drags as $ drag ) { $ countimages = max ( $ countimages , $ drag -> no ) ; } } if ( ! $ countimages ) { $ countimages = self :: START_NUM_ITEMS ; } $ itemrepeatsatstart = $ countimages ; $ imagerepeats = optional_param ( 'noitems' , $ itemrepeatsatstart , PARAM_INT ) ; $ addfields = optional_param ( 'additems' , false , PARAM_BOOL ) ; if ( $ addfields ) { $ imagerepeats += self :: ADD_NUM_ITEMS ; } return array ( $ itemrepeatsatstart , $ imagerepeats ) ; }
docstring: Returns an array of starting number of repeats, and the total number of repeats.
  
  @return array
docstring_tokens: Returns an array of starting number of repeats and the total number of repeats .