-
-
Notifications
You must be signed in to change notification settings - Fork 393
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Free text field for multiple choice answers #3134
Merged
josepjaume
merged 19 commits into
master
from
free_text_field_for_multiple_choice_answers
Apr 9, 2018
Merged
Free text field for multiple choice answers #3134
josepjaume
merged 19 commits into
master
from
free_text_field_for_multiple_choice_answers
Apr 9, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned deivid-rodriguez
Apr 5, 2018
ghost
added
the
status: WIP
label
Apr 5, 2018
deivid-rodriguez
force-pushed
the
free_text_field_for_multiple_choice_answers
branch
4 times, most recently
from
April 5, 2018 23:40
13c9389
to
0990c68
Compare
This was referenced Apr 6, 2018
Merged
To be reused for answer options later.
Otherwise, living in a hash column, they're very difficult to extend.
Since they're no longer a hash but a regular model.
And also simplify them a bit.
And refactor.
Since the column lives in the `AnswerOption` model, the `option` part is redundant. The old name came from the initial approach to the feature where a single free text option per question was allowed, so the column lived in the question model.
For consistency with the other question types.
deivid-rodriguez
force-pushed
the
free_text_field_for_multiple_choice_answers
branch
from
April 6, 2018 13:23
0990c68
to
a68b241
Compare
This was referenced Apr 6, 2018
josepjaume
approved these changes
Apr 9, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃帺 What? Why?
This PR adds a new feature to multiple choice questions. It allows any option to be configured as a "free text" option, meaning that the user can enter a custom value when selecting the option.
Previously both the available answers for a question and the options the user selected on each answer were stored in jsonb hashes in single DB columns. I found it really hard and prone to errors and bad user experience to implement this feature on top of that, so I upgraded both to fully fledged models.
This PR sits on top of #3133 , so that one should be reviewed first. I splitted it to make reviewing easier and minify the diff.
馃搶 Related Issues
None.
馃搵 Subtasks
CHANGELOG
entry馃摲 Screenshots (optional)