cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 36 forks source link

Improve get responses #13

Closed Jan-E closed 7 years ago

Jan-E commented 7 years ago

@andrewheiss I made up some improvements for get_responses.

First improvement is that '...' (dots or ellipsis) is not in R's environment, so the 7th argument of get_responses() does not do anything. We will have to add it. Tested in R 3.3.0. Background: we wanted to use iFromResponseID and iToResponseID: https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/remotecontrol/remotecontrol_handle.php#L2433 There was no way to do that with get_responses() in limer.

Second improvement is to remove the default 'en' language. My business partner had a hard time to understand why he did not get results with sLanguageCode = 'nl', until I told him it had to be sLanguageCode = 'nl-informal'. By changing the default from 'en' to NULL, Limesurvey uses getBaseLanguageFromSurveyID to get the languge: https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/remotecontrol/remotecontrol_handle.php#L2447 There is a tiny chance that this may break current implementations: when a LS-user has a survey with, for instance, 'nl' as base languge and 'en' as second language a call to get_responses without a value for sLanguageCode will not get the 'en' results anymore.

Please review and merge the PR

Jan-E commented 7 years ago

BTW: Ideally, you should change all default arguments to LS's defaults, but this may cause too many backwards compatibility issues.

codecov-io commented 7 years ago

Current coverage is 0.00% (diff: 0.00%)

Merging #13 into master will not change coverage

@@           master   #13   diff @@
===================================
  Files           6     6          
  Lines          32    34     +2   
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
  Hits            0     0          
- Misses         32    34     +2   
  Partials        0     0          

Powered by Codecov. Last update 4e7ed83...3c9587a

andrewheiss commented 7 years ago

Thanks!