-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Surveys for unregistered users #4996
Conversation
@decidim/product what should we do here? I don't know if this has been discussed in MetaDecidim, and I'd like an approval from you before reviewing the code 😄 |
As I know this may be controversial. I've created in meta-decidim a proposal to discuss the benefits of this feature: https://meta.decidim.org/processes/roadmap/f/122/proposals/14323 |
Hi! I'm with Marc, it's better if we can discuss on meta.decidim. In fact, I think that this depends on #4991? Because before, an external user was not enable to see the survey. |
I'd say it's related but not dependant. You can decide to show the survey or to allow answers. The first is useful to let the user know what to expect, and the other to not required them to log in. There's no code coincidences between them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm blocking this PR until it is discussed on MetaDecidim. Feel free to discard my review once this is handled! 😄
Hi everyone, The changes are:
Now I have some questions about these changes, I would like if any of you could guide me a little for the better way to implement them. My questions are:
Thanks a lot in advance! |
We could just add the warning as a message without this logic of hide / show for simplicity.
As far as I know we don't have this kind of saving partials IP addesses.
Yes, it's implemented on user registration with https://github.com/markets/invisible_captcha |
Thanks @andreslucena for your answers. I'll probably finish this PR during May. |
Hey @microstudi |
We too. Our client deserves something like google forms (focusing first on let unregistered participants answer). So, maybe we can built and epic and improve a lot surveys. for example: adding more ways to answer (timetable, etc..). |
Yes, still on it! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. @carolromero & @xabier feel free to chime in. |
I see the bot closed this PR. Are you still working on it @microstudi ? |
yes! hopefully soon enough |
ok! let's keep it open then :) |
# Conflicts: # decidim-forms/app/models/decidim/forms/answer.rb # decidim-surveys/config/locales/ca.yml # decidim-surveys/config/locales/es.yml
@oriolgual this is ready to review. Thanks |
decidim-forms/app/commands/decidim/forms/answer_questionnaire.rb
Outdated
Show resolved
Hide resolved
decidim-forms/app/commands/decidim/forms/answer_questionnaire.rb
Outdated
Show resolved
Hide resolved
decidim-forms/app/controllers/decidim/forms/concerns/has_questionnaire.rb
Show resolved
Hide resolved
decidim-forms/db/migrate/20190315203056_add_session_token_to_decidim_forms_answers.rb
Outdated
Show resolved
Hide resolved
No longer on the project, I shouldn't be blocking this
* Add allow_unregistered option to surveys component * locales for allow_unregistered settings action * relax permissions to allow answers withou users * Add session token to answer for grouping anonymous answers * check if an unregistered user has already answered the questionnaire * add unregistered users test * rubocop happiness * change test to match new locale messages * add changelog entry [ci skip] * unregisterd users settings warning * add ip hash to unregistered surveys * add invisible_captcha to forms * Add user status to answers export * remove unused key * avoid NULL column * use current instead of now * refactor questionnaire validation for unregistered users * simplify questionnaire validation and fix meetings reuse * fix meetings tests
* Add allow_unregistered option to surveys component * locales for allow_unregistered settings action * relax permissions to allow answers withou users * Add session token to answer for grouping anonymous answers * check if an unregistered user has already answered the questionnaire * add unregistered users test * rubocop happiness * change test to match new locale messages * add changelog entry [ci skip] * unregisterd users settings warning * add ip hash to unregistered surveys * add invisible_captcha to forms * Add user status to answers export * remove unused key * avoid NULL column * use current instead of now * refactor questionnaire validation for unregistered users * simplify questionnaire validation and fix meetings reuse * fix meetings tests
* Surveys for unregistered users (decidim#4996) * Add allow_unregistered option to surveys component * locales for allow_unregistered settings action * relax permissions to allow answers withou users * Add session token to answer for grouping anonymous answers * check if an unregistered user has already answered the questionnaire * add unregistered users test * rubocop happiness * change test to match new locale messages * add changelog entry [ci skip] * unregisterd users settings warning * add ip hash to unregistered surveys * add invisible_captcha to forms * Add user status to answers export * remove unused key * avoid NULL column * use current instead of now * refactor questionnaire validation for unregistered users * simplify questionnaire validation and fix meetings reuse * fix meetings tests * Fix missing translations [ci skip]
🎩 What? Why?
In our organization we've come with the necessity to allow everyone to answer certain surveys, whether is registered and logged in the platform or not. We find this specially important to avoid the use of external tools where to place that data (like google forms).
This pull-request implements this feature by adding a new setting option (same as
allow_answers
) in the survey component admin module (see screenshot). Modules affected ardecidim-forms
anddecidim-surveys
.In order to make this work I've added a db migration to create a unique token based on the session id of the anonymous user in the
decidim_form_answers
. This is being used by the data exporter to group all the answers of the user (as theuser_id
field will benil
in those cases).[UPDATE]
After discussion, these has been added in order to improve security:
📌 Related Issues
non related issues
📋 Subtasks
CHANGELOG
entry📷 Screenshots (optional)