-
Notifications
You must be signed in to change notification settings - Fork 141
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
Commas used in answers cause problems with results calculations #19
Comments
maybe we can have a config, where we can change delimiter. say from |
I think it's splitting an array based on commas and commas within the array elements are getting split. Sent from my iPhone
|
Hi, I'm having the same problem with comma. I think it comes from the flatten : rapidfire / app / services / rapidfire / question_group_results.rb
I'm not sure there is a better way than changing the comma in something else (with a config or not). When changing this delimiter, could we use I have listed the functions I think that should be changed :
What do you think ? |
+1 for config, but im not in favor of utf-8 chars. |
+1 for config and I used to split with |
I think this will give the results without having to worry about commas or special characters. |
work is under progress in this branch: |
@alexnesbitt there is a slight catch with answers = question.answers.group(:answer_text).count(:answer_text) in case of checkboxes, we store all the answers in |
Why do you treat checkboxes that way? Why not just store each answer that gets checked as it's own answer? That way, count will work fine. |
@alexnesbitt we have a usecase where user can see his/her answers against a questionnaire, and modify them. it becomes easy to populate the form again, if we have only answer, rather than a bunch of answers. i haven't faced any difficulties so far, so i guess we are good. |
I don't understand why having multiple answers is an issue for rendering a But it's not an issue for me so no need to change things for me. On Mon, May 19, 2014 at 8:35 PM, Yuva [email protected] wrote:
Alex Nesbitt |
i think i should have explained it better: rendering multiple answers associated with a single question (checkbox) was an issue:
@alexnesbitt thanks for bringing this up. i will keep this solution at the back of mind, and implement it if i get into trouble in future :) |
I understand the problem of trying to sync the answer when something that is becomes something that isn't. Very tough. In this case, I would delete all the answers in the answer group in case of an update and create new answers for whatever the user submits in their edit form. Thanks for what you have built. It was the best I could find for my use case. My bigger problem is scalability. Neither the method you use or the count method is going to work with Very high volume. I'm thinking I need to combine your approach to building the questionnaire with something like redis to keep the totals ready for a responsive view with 1000s if answer groups Sent from my iPhone
|
nice :) im looking forward to those scalability issues. maybe i can learn a thing or two, if you can share your experience, as in how you have solved those problems. |
If you use a comma within an answer it causes a problem with results.
for example, If my answer is "no, that is not right" the results will tabulate 1:"no" and 1:"that is not right"
I think the answers are being counted by splitting on a comma which leads to this problem. Not sure how to fix it.
The text was updated successfully, but these errors were encountered: