예제 #1
0
        private List <Respondent> GetRespondentListPage(long surveyId, int page, int pageSize, bool limitPageSize, GetRespondentListSettings settings)
        {
            RequestSettings parameters = settings.Serialize();

            parameters.Add("survey_id", surveyId.ToString());
            parameters.Add("page", page);
            if (limitPageSize)
            {
                parameters.Add("page_size", pageSize);
            }
            return(GetRespondentListRequest(parameters));
        }
예제 #2
0
        //TODO: deal with account upgrade notifications

        //Auto-paging
        public List <Respondent> GetRespondentList(long surveyId, GetRespondentListSettings settings)
        {
            var  respondents = new List <Respondent>();
            bool cont        = true;
            int  page        = 1;

            while (cont)
            {
                RequestSettings parameters = settings.Serialize();
                parameters.Add("survey_id", surveyId.ToString());
                parameters.Add("page", page);
                var newRespondents = GetRespondentListRequest(parameters);
                if (newRespondents.Count > 0)
                {
                    respondents.AddRange(newRespondents);
                }
                if (newRespondents.Count < 1000)
                {
                    cont = false;
                }
                page++;
            }
            return(respondents);
        }