Back to top

getSurveyFrequencies

getSurveyFrequencies – returns answer frequencies for survey
request_method: GET
 
GET parameters:

  • action=getSurveyFrequencies
  • ank_id=123        (survey id)

Response example:

[
{"besedilo_vprasanja":"Vec odgovorov z drugo", //question type multiple answers
"id_vprasanja":"803405_0",
"vrsta_vprasanja":"0",
"odgovori":{
"invalid":{"-1":{"text":"Ni odgovoril","cnt":0},"-2/*… all non-responses*/},
"validCnt":3, //valid responses
"allCnt":3, //all answers
"valid":[
{"text":"Prvi ","text_graf":"Prvi ","cnt":0,"vrednost":1},
{"text":"Drugi","text_graf":"Drugi","cnt":"1","vrednost":2},
{"text":"Tretji","text_graf":"Tretji","cnt":0,"vrednost":3},
{"text":"Drugo:","text_graf":"Drugo:","cnt":"2","vrednost":4}, //other
{"text":"nekaj drugega","cnt":1,"text_graf":null,"vrednost":"nekaj drugega","other":1}, 
{"text":"nekaj","cnt":1,"text_graf":null,"vrednost":"nekaj","other":1}
]
}
},
{"besedilo_vprasanja":"En odgovor z drugo", //question type one answer
"id_vprasanja":"803406_0",
"vrsta_vprasanja":"1",
"odgovori":[
{"invalid":{"-1":{"text":"Ni odgovoril","cnt":0},"-2/*… all non valid answers*/},
"valid":[
{"text":"0","text_graf":null,"cnt":"1"},//cnt showa how many times this radio has been chosen
{"text":"1","text_graf":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"naslov":"Prvi"},//answer text
{"invalid":{/*… tukaj so vsi neustrezni odgovori za ta radio button },
"valid":[
{"text":"0","text_graf":null,"cnt":"2"},
{"text":"1","text_graf":null,"cnt":"1"}
],
"validCnt":3,
"allCnt":3,
"naslov":"Drugi"},
{"invalid":{"/*… all non valid answers*/},
"valid":[
{"text":"0","text_graf":null,"cnt":"1"},
{"text":"1","text_graf":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"naslov":"Tretji"},
{"invalid/*… all non valid answers },
"valid":[
{"text":"0","text_graf":null,"cnt":"1"},
{"text":"1","text_graf":null,"cnt":"2"}
],
"validCnt":3,
"allCnt":3,
"naslov":"Drugo:"},
{"invalid/*… },
"invalidCnt":1,
"allCnt":3,
"validCnt":2,
"average":null,
"valid":[ //answers for 'other'
{"text":"nekaj nekaj drugega","cnt":1,"text_graf":null},
{"text":"nekaj nekaj","cnt":1,"text_graf":null}
],
"other":1,
"naslov":"Drugo:"}
]
},
{"besedilo_vprasanja":"Besedilo", //text type question
"id_vprasanja":"803407_0",
"vrsta_vprasanja":"2",
"odgovori":[
{"invalid/*… all non valid answers*/},
"invalidCnt":1,
"allCnt":3,
"validCnt":2,
"average":null,
"valid":[
{"text":"neko besedilo","cnt":1,"text_graf":null},
{"text":"pozdravljen svet","cnt":1,"text_graf":null}
]}]}]