original_string: protected function get_responses_for_external($row) {
          $responses = [];
          foreach ($row as $el => $val) {
              // Get id from column name.
              if (preg_match('/^val(\d+)$/', $el, $matches)) {
                  $id = $matches[1];
  
                  $responses[] = [
                      'id' => $id,
                      'name' => $this->headers[$this->columns[$el]],
                      'printval' => $this->other_cols($el, $row),
                      'rawval' => $val,
                  ];
              }
          }
          return $responses;
      }
code: protected function get_responses_for_external($row) {
          $responses = [];
          foreach ($row as $el => $val) {
              // Get id from column name.
              if (preg_match('/^val(\d+)$/', $el, $matches)) {
                  $id = $matches[1];
  
                  $responses[] = [
                      'id' => $id,
                      'name' => $this->headers[$this->columns[$el]],
                      'printval' => $this->other_cols($el, $row),
                      'rawval' => $val,
                  ];
              }
          }
          return $responses;
      }
code_tokens: protected function get_responses_for_external ( $ row ) { $ responses = [ ] ; foreach ( $ row as $ el => $ val ) { // Get id from column name. if ( preg_match ( '/^val(\d+)$/' , $ el , $ matches ) ) { $ id = $ matches [ 1 ] ; $ responses [ ] = [ 'id' => $ id , 'name' => $ this -> headers [ $ this -> columns [ $ el ] ] , 'printval' => $ this -> other_cols ( $ el , $ row ) , 'rawval' => $ val , ] ; } } return $ responses ; }
docstring: Return user responses data ready for the external function.
  
  @param stdClass $row the table row containing the responses
  @return array returns the responses ready to be used by an external function
  @since Moodle 3.3
docstring_tokens: Return user responses data ready for the external function .