Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

set_participant_properties

  • mama0107
  • mama0107's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 months ago #162856 by mama0107
set_participant_properties was created by mama0107
Ich arbeite mit der Version 2.62 des Limesurvey. Mit einem kleinen Java-Programm möchte ich meine Umfrage verwalten. Dabei nutze ich jdk1.8.0_91 und RemoteControl mit json.


Ich kann mit get_participant_properties mir die Parameter eines Umfrageteilnehemers anzeigen

new StringEntity("{\"method\": \"get_participant_properties\", \"params\": {\"sSessionKey \": \""+sessionKey+"\", \"iSurveyId \": \""+surveyid+"\", \"iTokenId\":\""+participant_id+"\" }, \"id\": 1}");

liefert

{"id":1,"result":{"tid":2,"participant_id":null,"firstname":"","lastname":"","email":"","emailstatus":"OK","token":"mB755ZDQfd","language":"de","blacklisted":null,"sent":"N","remindersent":"N","remindercount":0,"completed":"N","usesleft":1,"validfrom":null,"validuntil":null,"mpid":null},"error":null}

Oder

new StringEntity("{\"method\": \"get_participant_properties\", \"params\": [ \""+sessionKey+"\", \""+surveyid+"\", \""+participant_id+"\" ], \"id\": 94}");

liefert

{"id":94,"result":{"tid":2,"participant_id":null,"firstname":"","lastname":"","email":"","emailstatus":"OK","token":"mB755ZDQfd","language":"de","blacklisted":null,"sent":"N","remindersent":"N","remindercount":0,"completed":"N","usesleft":1,"validfrom":null,"validuntil":null,"mpid":null},"error":null}



Wenn ich diesem Umfrageteilnehmer eine andere Sprache einstellen will, dann habe ich Probleme mit der Übergabe des zu ändernden Parameters

new StringEntity("{\"method\": \"set_participant_properties\", \"params\": [ \""+sessionKey+"\", \""+surveyid+"\", \""+participant_id+"\", \"language\":\"es\" ], \"id\": 94}");

dann erhalte ich

{"id":null,"result":null,"error":"unable to decode malformed json"}

oder

new StringEntity("{\"method\": \"set_participant_properties\", \"params\": [ \""+sessionKey+"\", \""+surveyid+"\", \""+participant_id+"\", \""+aTokenProperties+"\" ], \"id\": 194}");

ERROR StatusCode 500



new StringEntity("{\"method\": \"set_participant_properties\", \"params\": {\"sSessionKey \": \""+sessionKey+"\", \"iSurveyId \": \""+surveyid+"\", \"iTokenId\":\""+participant_id+"\", \"language\":\"es\" }, \"id\": 491}");

ERROR StatusCode 500


Wie kann ich in Java den Parameter übergeben?


Vielen Dank Cornelia
The topic has been locked.
Moderators: Joffm

Lime-years ahead

Online-surveys for every purse and purpose