public function getSurveyData($surveyId) {
        $tracker = $this->loader->getTracker();

        $survey = $tracker->getSurvey($surveyId);

        $surveyInfo = $survey->getQuestionInformation($this->locale);

        $filteredSurveyInfo = $surveyInfo;
        foreach ($surveyInfo as $questionCode => $questionInfo) {
            if ($questionInfo['class'] == 'question_sub') {
                $parentCode                                           = $questionInfo['title'];
                $parent                                               = $surveyInfo[$parentCode];
                $filteredSurveyInfo[$questionCode]['question'] = $parent['question'] . ' | ' . $questionInfo['question'];
                if (isset($filteredSurveyInfo[$parentCode])) {
                    unset($filteredSurveyInfo[$parentCode]);
                }
            }
        }

        return $filteredSurveyInfo;
    }
public function getSurveyData($surveyId) {
        $tracker = $this->loader->getTracker();

        $survey = $tracker->getSurvey($surveyId);

        $surveyInfo = $survey->getQuestionInformation($this->locale);

        $filteredSurveyInfo = $surveyInfo;
        foreach ($surveyInfo as $questionCode => $questionInfo) {
            if ($questionInfo['class'] == 'question_sub') {
                $parentCode                                           = $questionInfo['title'];
                $parent                                               = $surveyInfo[$parentCode];
                $filteredSurveyInfo[$questionCode]['question'] = $parent['question'] . ' | ' . $questionInfo['question'];
                if (isset($filteredSurveyInfo[$parentCode])) {
                    unset($filteredSurveyInfo[$parentCode]);
                }
            }
        }

        return $filteredSurveyInfo;
    }
public function getSurveyData ( $ surveyId ) { $ tracker = $ this -> loader -> getTracker ( ) ; $ survey = $ tracker -> getSurvey ( $ surveyId ) ; $ surveyInfo = $ survey -> getQuestionInformation ( $ this -> locale ) ; $ filteredSurveyInfo = $ surveyInfo ; foreach ( $ surveyInfo as $ questionCode => $ questionInfo ) { if ( $ questionInfo [ 'class' ] == 'question_sub' ) { $ parentCode = $ questionInfo [ 'title' ] ; $ parent = $ surveyInfo [ $ parentCode ] ; $ filteredSurveyInfo [ $ questionCode ] [ 'question' ] = $ parent [ 'question' ] . ' | ' . $ questionInfo [ 'question' ] ; if ( isset ( $ filteredSurveyInfo [ $ parentCode ] ) ) { unset ( $ filteredSurveyInfo [ $ parentCode ] ) ; } } } return $ filteredSurveyInfo ; }
Gets question information about the survey structure from a specific survey and makes the result readable

@param $surveyId int ID of the survey
@return array List of survey information
Gets question information about the survey structure from a specific survey and makes the result readable