Returns the answers in simple raw array format, without value processing etc.

Function may return more fields than just the answers.

@param string $tokenId Gems Token Id
@return array Field => Value array
347559
public function getRawTokenAnswerRow($tokenId)
    {
        $source = $this->getSource();
        return $source->getRawTokenAnswerRow($tokenId, $this->_surveyId, $this->_gemsSurvey['gsu_surveyor_id']);
    }
1255742
private function lineNumber(int $tokenID): int
    {
        while (empty($this->tokens[$tokenID][self::TOKEN_LINE])) {
            --$tokenID;
        }

        return $this->tokens[$tokenID][self::TOKEN_LINE];
    }
356872
public static function objectId($fieldId)
    {
        //====================================================================//
        // decode
        $result = self::isIdField($fieldId);
        if (empty($result)) {
            return false;
        }
        //====================================================================//
        // Return List Name
        return   $result['ObjectId'];
    }
1109431
public function processTokenData(\Gems_Tracker_Token $token)
    {
        if ($token->getReceptionCode()->isSuccess() && $token->isCompleted()) {
            $respTrack = $token->getRespondentTrack();
            $fields    = $respTrack->getCodeFields();
            $answers   = $token->getRawAnswers();
            $newFields = [];

            foreach ($fields as $code => $value) {
                if (isset($answers[$code]) && ($answers[$code] != $value)) {
                    $newFields[$code] = $answers[$code];
                }
            }

            if ($newFields) {
                // \MUtil_Echo::track($answers, $newFields);
                $respTrack->setFieldData($newFields);
            }
        }

        return false;
    }
853246
public function certificates($serverId, $siteId)
    {
        return $this->transformCollection(
            $this->get("servers/$serverId/sites/$siteId/certificates")['certificates'],
            Certificate::class,
            ['server_id' => $serverId, 'site_id' => $siteId]
        );
    }
358677
public function toArray($tokenList) {
        $expr = array();
        foreach ($tokenList as $token) {
            if ($token instanceof \PHPSQLParser\utils\ExpressionToken) {
                $expr[] = $token->toArray();
            } else {
                $expr[] = $token;
            }
        }
        return $expr;
    }
1039353
public function processTokenInsertion(\Gems_Tracker_Token $token)
    {
        $this->token = $token;

        if ($token->getReceptionCode()->isSuccess() && (!$token->isCompleted())) {
            // Read questioncodes
            $questions = $token->getSurvey()->getQuestionList(null);
            $fields    = [];
            $results   = [];

            // Check if they match a prefix schema
            foreach ($questions as $code => $text) {
                $upperField = strtoupper($code);
                $fields[$code] = $upperField;
            }

            if (count($fields) > 0) {
                $results = $results + $this->getTrackFields($fields);
            }

            return $results;
        }
    }
937827
public static function get_steps($tourid) {
        $steps = cache::get_stepdata($tourid);

        $return = [];
        foreach ($steps as $step) {
            $return[$step->id] = step::load_from_record($step);
        }
        return $return;
    }
300398
public function getToken($id)
    {
        if ($id) {
            $ownerClass = $this->tokenConfig['owner'];
            $owner = DataObject::get_by_id($ownerClass, $id);

            if ($owner) {
                $tokenDBColumn = $this->tokenConfig['DBColumn'];
                return $owner->{$tokenDBColumn};
            } else {
                user_error("API Token owner '$ownerClass' not found with ID = $id", E_USER_WARNING);
            }
        } else {
            user_error("TokenAuthenticator::getToken() requires an ID as argument.", E_USER_WARNING);
        }
    }
1136121
public function generateTokenValues(TokenInterface $token): array
    {
        $tokenValue     = bin2hex(random_bytes(16)) . uniqid();
        $tokenType      = 'bearer';
        $tokenExpiresIn = $this->getTokenExpirationPeriod();
        $refreshValue   = bin2hex(random_bytes(16)) . uniqid();

        assert(is_string($tokenValue) === true && empty($tokenValue) === false);
        assert(is_string($tokenType) === true && empty($tokenType) === false);
        assert(is_int($tokenExpiresIn) === true && $tokenExpiresIn > 0);
        assert($refreshValue === null || (is_string($refreshValue) === true && empty($refreshValue) === false));

        return [$tokenValue, $tokenType, $tokenExpiresIn, $refreshValue];
    }
284256
private function endingToken(int $tokenID): int
    {
        $level = null;
        for ($localID = $tokenID; $localID < $this->countTokens; ++$localID) {
            $token = $this->tokens[$localID];
            if ($token[self::TOKEN_CODE] == '{') {
                ++$level;
                continue;
            }

            if ($token[self::TOKEN_CODE] == '}') {
                --$level;
            }

            if ($level === 0) {
                break;
            }
        }

        return $localID;
    }
565169
public function th_getUidTopics($uid)
    {
        $arr = [];
        foreach ($this->subArr as $topic => $set) {
            if ($set->contains($uid)) {
                $arr[] = $topic;
            }
        }
        return $arr;
    }
947853
protected function recurseArrayForTokens($arr, $tokens)
    {
        $out = [];
        foreach ($arr as $name => $value) {
            if (is_array($value)) {
                $out[$name] = $this->recurseArrayForTokens($value, $tokens);
                continue;
            }
            if (is_string($value)) {
                foreach ($tokens as $token => $tval) {
                    $value = str_replace($token, $tval, $value);
                }
                $out[$name] = $value;
                continue;
            }
            $out[$name] = $value;
        }

        return $out;
    }
653260
public function getTokenStatusLinkForTokenId($tokenId)
    {
        $token = $tokenId ? $this->loader->getTracker()->getToken($tokenId) : null;

        if (! ($tokenId && $token->exists)) {
            return $this->getStatusIcon('D');
        }

        return $this->getTokenStatusLink(
                $tokenId, $token->getStatusCode(),
                $token->getPatientNumber(), $token->getRoundDescription(),
                $token->getSurveyName(), $token->getResult()
                );
    }
289895
public function processTokenInsertion(\Gems_Tracker_Token $token)
    {
        $this->token = $token;

        if ($token->getReceptionCode()->isSuccess() && (!$token->isCompleted())) {
            // Read questioncodes
            $questions = $token->getSurvey()->getQuestionList(null);
            $fields    = [];
            $results   = [];

            // Check if they match a prefix schema
            foreach ($questions as $code => $text) {
                $upperField = strtoupper($code);
                $prefix     = substr($upperField, 0, $this->prefixLength);
                if (array_key_exists($prefix, $this->prefixes)) {
                    $fields[$prefix][$code] = substr($upperField, $this->prefixLength);
                }
            }

            if (count($fields) > 0) {
                foreach ($fields as $prefix => $requests) {
                    // Find which method to call
                    $method  = $this->prefixes[$prefix];
                    $results = $results + $this->$method($requests);
                }
            }

            return $results;
        }
    }
1280915
public function getNumberOfAnswers($surveyId) {
        $fields['tokenCount'] = 'COUNT(DISTINCT gto_id_token)';
        $select               = $this->loader->getTracker()->getTokenSelect($fields)->andReceptionCodes([]);
        $select->forSurveyId($surveyId)
                ->onlySucces()
                ->onlyCompleted();
        $row                  = $select->fetchRow();
        return sprintf($this->_('Answered surveys: %d.'), $row['tokenCount']);
    }
459096
public function getTokenCountUnanswered()
    {
        $tokenSelect = $this->tracker->getTokenSelect(new \Zend_Db_Expr('COUNT(*)'));
        $tokenSelect
                ->andReceptionCodes(array())
                ->andSurveys(array())
                ->andRounds(array())
                ->forRespondent($this->getRespondentId())
                ->forGroupId($this->getSurvey()->getGroupId())
                ->onlySucces()
                ->onlyValid()
                ->forWhere('gsu_active = 1')
                ->forWhere('gro_active = 1 OR gro_active IS NULL')
                ->withoutToken($this->_tokenId);

        $this->_addRelation($tokenSelect);

        return $tokenSelect->fetchOne();
    }