protected function getCategorizedResults($post, $sourceSurveyData, $targetSurveyData) {
        $surveyCompare = $this->getSurveyCompare($sourceSurveyData, $targetSurveyData, $post);

        $categorizedResults = [];
        foreach (array_keys($this->questionStatusClasses) as $status) {
            $categorizedResults[$status] = [];
        }

        foreach ($surveyCompare as $result) {
            if (isset($result['status'])) {
                if ($result['status'] == 'missing') {
                    $categorizedResults[$result['status']][$result['source']] = $result;
                } else {
                    $categorizedResults[$result['status']][$result['target']] = $result;
                }
            } else {
                $categorizedResults['other'][] = $result;
            }
        }
        return $categorizedResults;
    }
protected function getCategorizedResults($post, $sourceSurveyData, $targetSurveyData) {
        $surveyCompare = $this->getSurveyCompare($sourceSurveyData, $targetSurveyData, $post);

        $categorizedResults = [];
        foreach (array_keys($this->questionStatusClasses) as $status) {
            $categorizedResults[$status] = [];
        }

        foreach ($surveyCompare as $result) {
            if (isset($result['status'])) {
                if ($result['status'] == 'missing') {
                    $categorizedResults[$result['status']][$result['source']] = $result;
                } else {
                    $categorizedResults[$result['status']][$result['target']] = $result;
                }
            } else {
                $categorizedResults['other'][] = $result;
            }
        }
        return $categorizedResults;
    }
protected function getCategorizedResults ( $ post , $ sourceSurveyData , $ targetSurveyData ) { $ surveyCompare = $ this -> getSurveyCompare ( $ sourceSurveyData , $ targetSurveyData , $ post ) ; $ categorizedResults = [ ] ; foreach ( array_keys ( $ this -> questionStatusClasses ) as $ status ) { $ categorizedResults [ $ status ] = [ ] ; } foreach ( $ surveyCompare as $ result ) { if ( isset ( $ result [ 'status' ] ) ) { if ( $ result [ 'status' ] == 'missing' ) { $ categorizedResults [ $ result [ 'status' ] ] [ $ result [ 'source' ] ] = $ result ; } else { $ categorizedResults [ $ result [ 'status' ] ] [ $ result [ 'target' ] ] = $ result ; } } else { $ categorizedResults [ 'other' ] [ ] = $ result ; } } return $ categorizedResults ; }
Function to get Survey compare results sorted by status

@param $post Post request data
@param $sourceSurveyData array with source survey data
@param $targetSurveyData array with target survey data
@return array compare results sorted by status
Function to get Survey compare results sorted by status