View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
18568Bug reportsRemoteControlpublic2023-02-09 18:20
Reporterautopoiesis74 Assigned To 
PrioritynoneSeverityminor 
Status acknowledgedResolutionopen 
Product Version5.4.x 
Summary18568: Multiple-choice short answer export via API delivers not properly coded data
Description

When I export the short answers of multiple-choice questions via API (sResponseType='short'), I get only "Y" but no "N". I can observe this behavior as well when I download the answer codes manually via the response module without additional configuration but the difference is that I have the option to use the convert settings there. The API doesn't provide this option.
To make the data modeling job easier, the standard short response export should anyway always include the "N" answers :-)

Steps To Reproduce

Steps to reproduce

Export answers of multiple choice question via API with sResponseType='short' setting

Expected result

"Y" and "N" should be provided

Actual result

only "Y" is provided

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)5.4.15+221212
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & version5.5.5-10.3.35-MariaDB-1:10.3.35+maria~buster
Server OS (if known)Linux
Webserver software & version (if known)
PHP Version7.4.33

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2022-12-22 09:48

developer   ~73256

With Short answer : value saved in database are Y for checked and [empty] for not checked.

No reason to export N in my opinion.

autopoiesis74

autopoiesis74

2022-12-22 10:08

reporter   ~73258

It makes a difference for proper and easy calculations in reports. For multiple choice, empty means that a user didn't see the question, "N" means that he didn't select the subquestion which is a huge difference...

autopoiesis74

autopoiesis74

2022-12-22 10:11

reporter   ~73259

Also, when I export long answers "No" is provided.

gabrieljenik

gabrieljenik

2022-12-22 22:30

manager   ~73295

@c_schmitz thoughts?

autopoiesis74

autopoiesis74

2023-02-08 15:29

reporter   ~73733

Hi, I have noticed that this new feature has been released: https://github.com/LimeSurvey/LimeSurvey/pull/2843

I have tried to export the responses with the R library including the new options mentioned in the release, e.g. like this "aAdditionalOptions= c('convertY'=TRUE,'yValue'=1,'convertN'=TRUE,'nValue'=0)" but nothing changed. The export result still shows only the "Y" answers. Do I do anything wrong?

gabrieljenik

gabrieljenik

2023-02-08 15:34

manager   ~73734

Well, maybe there is a confussion.
07641 is for converting Y values to a custom value, like '1'.

The export result still shows only the "Y" answers

This is not addressed by 07641, but should be addressed by this current ticket (18568)

Am I missing something?

autopoiesis74

autopoiesis74

2023-02-08 15:39

reporter   ~73735

Ok, thanks, but I am still confused :-) What is the purpose of 07641 then?

gabrieljenik

gabrieljenik

2023-02-08 15:56

manager   ~73739

07641: Update API to support the Y/N conversion feature which was only available in frontend.

autopoiesis74

autopoiesis74

2023-02-08 16:50

reporter   ~73755

But this is what I tried to achieve: Convert answercodes from 'Y' or 'N' to another character with the remote control API-function export_responses and it didn't work out for me.

gabrieljenik

gabrieljenik

2023-02-08 17:21

manager   ~73759

Can you please paste the piece of your code related to the API call?

autopoiesis74

autopoiesis74

2023-02-09 08:34

reporter   ~73764

sure:

library(limer)
options(lime_api = 'https://xxx')
options(lime_username = 'xxx')
options(lime_password = 'xxx')
get_session_key()
answers195486 <- call_limer(method = 'export_responses',
params = list(iSurveyID = 195486,
sDocumentType = 'csv',
sLanguageCode= 'en',
sCompletionStatus='all',
sHeadingType='code',
sResponseType='short',
aAdditionalOptions= c('convertY'=TRUE,'yValue'=1,'convertN'=TRUE,'nValue'=0)))
release_session_key()

gabrieljenik

gabrieljenik

2023-02-09 14:00

manager   ~73776

Last edited: 2023-02-09 14:02

I will move all these to the 07641.
Let me know if it is ok to remove the notes from this ticket

Issue History

Date Modified Username Field Change
2022-12-22 09:21 autopoiesis74 New Issue
2022-12-22 09:48 DenisChenu Note Added: 73256
2022-12-22 09:48 DenisChenu Bug heat 0 => 2
2022-12-22 10:08 autopoiesis74 Note Added: 73258
2022-12-22 10:08 autopoiesis74 Bug heat 2 => 4
2022-12-22 10:11 autopoiesis74 Note Added: 73259
2022-12-22 22:30 gabrieljenik Note Added: 73295
2022-12-22 22:30 gabrieljenik Bug heat 4 => 6
2022-12-22 22:31 gabrieljenik Status new => acknowledged
2023-02-08 15:29 autopoiesis74 Note Added: 73733
2023-02-08 15:34 gabrieljenik Note Added: 73734
2023-02-08 15:39 autopoiesis74 Note Added: 73735
2023-02-08 15:56 gabrieljenik Note Added: 73739
2023-02-08 16:50 autopoiesis74 Note Added: 73755
2023-02-08 17:21 gabrieljenik Note Added: 73759
2023-02-09 08:34 autopoiesis74 Note Added: 73764
2023-02-09 14:00 gabrieljenik Note Added: 73776
2023-02-09 14:02 gabrieljenik Note Edited: 73776