protected function getResultVariables($resultId, $filterSubmission, $filterTypes = array())
    {
        $resultService = $this->getResultsService();
        $variables = $resultService->getStructuredVariables($resultId, $filterSubmission, array_merge($filterTypes, [\taoResultServer_models_classes_ResponseVariable::class]));
        $displayedVariables = $resultService->filterStructuredVariables($variables, $filterTypes);
        $responses = ResponseVariableFormatter::formatStructuredVariablesToItemState($variables);
        $excludedVariables = array_flip(['numAttempts', 'duration']);

        foreach ($displayedVariables as &$item) {
            if (!isset($item['uri'])) {
                continue;
            }
            $itemUri = $item['uri'];
            $item['state'] = isset($responses[$itemUri][$item['attempt']])
                ? json_encode(array_diff_key($responses[$itemUri][$item['attempt']], $excludedVariables))
                : null;
        }

        return $displayedVariables;
    }
protected function getResultVariables($resultId, $filterSubmission, $filterTypes = array())
    {
        $resultService = $this->getResultsService();
        $variables = $resultService->getStructuredVariables($resultId, $filterSubmission, array_merge($filterTypes, [\taoResultServer_models_classes_ResponseVariable::class]));
        $displayedVariables = $resultService->filterStructuredVariables($variables, $filterTypes);
        $responses = ResponseVariableFormatter::formatStructuredVariablesToItemState($variables);
        $excludedVariables = array_flip(['numAttempts', 'duration']);

        foreach ($displayedVariables as &$item) {
            if (!isset($item['uri'])) {
                continue;
            }
            $itemUri = $item['uri'];
            $item['state'] = isset($responses[$itemUri][$item['attempt']])
                ? json_encode(array_diff_key($responses[$itemUri][$item['attempt']], $excludedVariables))
                : null;
        }

        return $displayedVariables;
    }
protected function getResultVariables ( $ resultId , $ filterSubmission , $ filterTypes = array ( ) ) { $ resultService = $ this -> getResultsService ( ) ; $ variables = $ resultService -> getStructuredVariables ( $ resultId , $ filterSubmission , array_merge ( $ filterTypes , [ \ taoResultServer_models_classes_ResponseVariable :: class ] ) ) ; $ displayedVariables = $ resultService -> filterStructuredVariables ( $ variables , $ filterTypes ) ; $ responses = ResponseVariableFormatter :: formatStructuredVariablesToItemState ( $ variables ) ; $ excludedVariables = array_flip ( [ 'numAttempts' , 'duration' ] ) ; foreach ( $ displayedVariables as & $ item ) { if ( ! isset ( $ item [ 'uri' ] ) ) { continue ; } $ itemUri = $ item [ 'uri' ] ; $ item [ 'state' ] = isset ( $ responses [ $ itemUri ] [ $ item [ 'attempt' ] ] ) ? json_encode ( array_diff_key ( $ responses [ $ itemUri ] [ $ item [ 'attempt' ] ] , $ excludedVariables ) ) : null ; } return $ displayedVariables ; }
Extracts the result variables, with respect to the user's filter, and inject item states to allow preview with results

@param string $resultId
@param string $filterSubmission
@param array $filterTypes
@return array
Extracts the result variables with respect to the user s filter and inject item states to allow preview with results