Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radio value in downloaded csv/excel mightn't reflect nameed response value #465

Open
frumbert opened this issue Feb 7, 2023 · 0 comments

Comments

@frumbert
Copy link

frumbert commented Feb 7, 2023

Set up a radio question.

Set the possible answers to (set so values are not the same as their positional index)

2=Red
1=Blue
0=Green

Answer the survey. Select "Green". Submit the survey.

Download the results with this ticked:

  • Include choice codes

The spreadsheet will list the value of the response as 3.

This seems to be because in the generate_csv function in questionnaire.class.php where it iterates choices, it simply starts at zero and uses a counter $c to find the value , rather than looking at the actual choice value of the matched choice.

                    } else if (($choicecodes == 1) && ($choicetext == 1)) {
                        $responsetxt = $c.' : '.$content;
                    } else if ($choicecodes == 1) {
                        $responsetxt = $c;

It should look at the choice response and if it has a named response find the value of the index of the selected choice, in this case 0=Green would show a choice code of 0 in the column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant