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

Add option to control if the questions is required or not #166

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

amrhossamdev
Copy link
Member

Fixes #165.

Added a checkbox to control if a question requires a response or not

@amrhossamdev
Copy link
Member Author

My first backend PR

image

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look great! I'd love to see two tests exercising these new changes: one in the relevant model spec, and one in the relevant request spec to ensure that we don't regress the behavior you've added in the future. LMK if you need clarity on what these tests should look like

@amrhossamdev
Copy link
Member Author

Code changes look great! I'd love to see two tests exercising these new changes: one in the relevant model spec, and one in the relevant request spec to ensure that we don't regress the behavior you've added in the future. LMK if you need clarity on what these tests should look like

Done

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! One small change remaining and then it’ll be ready to merge.

@@ -12,12 +12,13 @@
sign_in admin
post admin_study_survey_questions_path(study, survey),
params: {
question: { content_attributes: { type: 'label', label_text: 'Question' } }
question: { content_attributes: { type: 'label', required: true, label_text: 'Question' } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the value of required to false so we can verify that the value changes through the controller work as expected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work 🚀

@aaronbrethorst aaronbrethorst merged commit 532f1e4 into develop Sep 23, 2024
2 checks passed
@aaronbrethorst aaronbrethorst deleted the optional-survey-questions branch September 23, 2024 23:48
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

Successfully merging this pull request may close these issues.

Backend: Add a field to indicate if the question is required to be answered.
2 participants