3.1. Getting poll results through POST or GET

The following conditions are required for receipt of poll results from Simpoll API by your script:

  1. Enabled option «Enable result sending» in poll settings;
  2. POST or GET selected in «Sending method» field;
  3. Full URL of script specified in «URL for result sending» field
    (for example, http://example.org/result.php);

Then Simpoll will send POST (or GET) inquiry to specified URL every time once your poll is passed.

Example of sent data:


            POST:
            (

                [sp_survey_id] => 551
                [sp_survey_key] => aa7ca07e

                [sp_resp] => Array
                    (
                        [id] => 172693
                        [ip_addr] => 127.0.0.1
                        [name] => Respondent No.172693
                        [time_start] => 2011-12-13 13:23:24
                        [time_end] => 2011-12-13 13:23:45
                        [time_delta] => 00:00:21
                        [quiz_passed] => 0
                        [quiz_percent] => 33
                        [quiz_correct] => 3
                        [quiz_wrong] => 2
                    )

                [sp_result] => 1

                [sp_answers] => Array
                    (
                        [1] => Array
                            (
                                [0] => Italy
                            )

                        [2] => Array
                            (
                                [0] => Pyramids
                                [1] => Kremlin
                                [2] => Colosseum
                                [3] => Eifel tower
                            )

                    )

            )

				

3.2. Description of transferred parameters

  • sp_survey_id — identifier of the poll in Simpoll database
  • sp_survey_key — text identifier used in poll’s URL
  • sp_resp — array with description of the respondent:
    • id — identifier of the respondent in Simpoll database
    • ip_addr — IP address of the respondent
    • name — respondent name
    • time_start — time of poll start
    • time_end — time of poll finish
    • time_delta — time spent for the poll
    The following fields are sent only for polls of «Test» type:
    • quiz_passed — whether the test is passed (1 - yes, 0 - no)
    • quiz_percent — percent of correct answers (0 .. 100)
    • quiz_correct — quantity of correct answers
    • quiz_wrong — quantity of mistakes
  • sp_result — flag of passing the poll (always 1)
  • sp_answers — array of respondent answers. The keys are question numbers, elements – arrays of answers to each question