ohmage / server

The ohmage server application.
37 stars 25 forks source link

survey_response/read doesn't allow both survey_id_list and prompt_id_list #896

Open krozett opened 7 years ago

krozett commented 7 years ago

The documentation doesn't suggest that the two are mutually exclusive. Furthermore if you try to make a request where both are present, you get an error message:

Both a survey list (survey_id_list) and a prompt list (prompt_id_list) must be given.

Going by the code here: https://github.com/ohmage/server/blob/4a0d73929ab3bb83609761607d5e4adc3df45860/src/org/ohmage/request/survey/SurveyResponseRequest.java#L288

It looks like it doesn't allow both to be passed in, but that's the opposite of what the error message says. I'm not familiar with the internals of Ohmage, but it doesn't seem reasonable to make this restriction. We have a case where we want to get all responses to a given question in a given survey, and we are forced to pass in only the prompt_id_list. This isn't a huge deal since all our surveys have unique prompt ids, but I can see this being a problem for others who have the same prompt ids in different surveys.

Please either remove the restriction, or make the error message and documentation consistent with the behavior.