Closed fefrei closed 4 years ago
Thanks for your feedback. You can use the ‘other’ column in the question_list to determine which questions have an ‘other’ option containing free text; then you can use the write_open_ended method to get the answers submitted. See also the example code under the header ‘Write answers to an open-ended question’ in the Readme file. Hope this works for you!
The write_open_ended
method doesn't really work for me, as I don't want to write the answers out as text (but do some custom processing on them).
What I ended up doing was to get the code from question.metadata['title']
(this is what I was missing for quite some time), then inspect survey.dataframe[f"{code}[other]"]
to get the answers.
Thanks for you reply, and for making limepy! Despite my struggles, it helped a lot.
If you want to improve on this, I think my main recommendations would be:
code
property a bit easier to access, or mention the possibility to get it via question.metadata['title']
in the documentation, andAgain, thanks for making this! `
Thanks for your feedback, much appreciated! And thanks for the suggestions - I’ll look into them but it may take a while due to time constraints
Apologies for the long wait. I’ve added the question title to the question_list
and added an explanation to readme.
I'm using
limepy
to create a PDF report for a survey.Iterating through the questions, I have a
Question
object for every question, which is usually enough to build the report. However, it looks like some details are missing, e.g. for multiple choice questions with an Other option, I'm unable to find the freeform entries users made. I'd be happy to look them up manually in the survey's dataframe, but I don't see a way to get the question code from aQuestion
object.Maybe I'm overlooking something obvious – but if not: Could you add a
code
property to theQuestion
class?