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;
    }
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;
    }
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 ; }
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
Return user responses data ready for the external function .