Skip to content

New question type "Matrix" in questionnaires#5948

Merged
jesusdb merged 55 commits intodecidim:developfrom
Platoniq:feature/matrix-question
May 8, 2020
Merged

New question type "Matrix" in questionnaires#5948
jesusdb merged 55 commits intodecidim:developfrom
Platoniq:feature/matrix-question

Conversation

@verarojman
Copy link
Copy Markdown
Contributor

@verarojman verarojman commented Apr 9, 2020

Note: This is a new version of #5876 to get rid of some unwanted commits.

🎩 What? Why?

Add new "matrix" question type to questionnaires, allowing for questions to have rows with a statement and a number of choices. It can accept either a single choice for each row or multiple choices (with an optional maximum number of choices per row).

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • Add/modify seeds
  • Add tests

📷 Screenshots

Answering matrix questions in questionnaire

image


Admin - Single option matrix question

image


Admin - Multiple option matrix question

image


Questionnaire with matrix questions that cannot be answered

image

decidim-bot and others added 30 commits February 24, 2020 18:05
* New translations en.yml (French)

* New translations en.yml (Hungarian)

* New translations en.yml (Hungarian)
@jesusdb
Copy link
Copy Markdown
Contributor

jesusdb commented Apr 27, 2020

Hello @verarojman, has this been approved by @decidim/product? Also, could you check the tests "[CI] Blogs / Tests", please?

@verarojman
Copy link
Copy Markdown
Contributor Author

Hi @jesusdb! Yes, it's been approved by @decidim/product, and I think the failing test has nothing to do with my code, it looks like a random install ruby deps failure related to sassc

@jesusdb
Copy link
Copy Markdown
Contributor

jesusdb commented Apr 29, 2020

@verarojman okay! Please solve the changelog conflict, and check the issues related to Code Climate

@jesusdb jesusdb self-requested a review May 4, 2020 12:38
Copy link
Copy Markdown
Contributor

@jesusdb jesusdb left a comment

Choose a reason for hiding this comment

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

Amazing!

@jesusdb jesusdb merged commit d3eeb16 into decidim:develop May 8, 2020
ace pushed a commit to aspgems/decidim that referenced this pull request May 12, 2020
* feature/initiatives_search_fo_new_design:
  Updates changelog
  Harmonizes the design of initiatives search in FO
  New question type "Matrix" in questionnaires (decidim#5948)
  Add filter options to Timeline and Activity tabs (decidim#5845)
  Remove relations between user and spaces on destroy account command (decidim#6041)
  Explain how to initialize a custom oauth2 client provider (decidim#6055)
  Reenable main tests on Crowdin PRs (decidim#6076)
  Enum and readonly component settings (decidim#6001)
  New Crowdin translations (decidim#6066)
  Add missing notifications (decidim#5906)
microstudi added a commit to Platoniq/decidim that referenced this pull request Jul 8, 2020
* New Crowdin translations (decidim#5761)

* New translations en.yml (French)

* New translations en.yml (Hungarian)

* New translations en.yml (Hungarian)

* Create question matrix row model

* Forms and specs

* Admin view logic

* Add matrix questions to update_questionnaire spec

* Make partials for different answer types

* Matrix answer layout

* Spec for matrix row element count when selecting question type

* Spec manage questionnaire matrix rows

* Spec adding matrix question

* Add matrix rows to question factory

* Update re-render form after error with matrix question

* Add spec for answer choice with new matrix row reference

* Spec for answer_form

* Add matrix rows to answer questionnaire command

* Show readonly matrix question when user not logged

* Make questionnaire answer view wider if it contains an answerable matrix question

* Answer matrix question spec

* Fix id for matrix multiple checkbox

* Enable max choices for matrix_multiple question

* Respect max choices for matrix multiple questions

* Fix erb style

* Normalize locale

* Preserve matrix choices on submission error

* Specs for user answer serializer

* Validate choices for mandatory matrix questions

* Spec for answering mandatory matrix questions

* Center matrix inputs

* Include not answered options as nil in user answers serializer for exports key consistency

* Compact arrays in csv export before transforming to_s

* Show alert for max choices on input change

* Spec for max_choices alert on input change

* Add matrix question type seeds to survey component

* Update changelog with PR reference

* fix eslint errors

* Normalize locales

* Fix failing remove matrix row spec

* Update changelog

* Remove questions regardless of matrix row errors

* Fix max choices component when no max choices defined

* Rename 'answers' to 'responses' in field names

* Update changelog

* Fix trailing whitespace

* Fix codeclimate issues in scss

* Fix scss errors from codeclimate

* Update changelog

* normalize js bundles

Co-authored-by: decidim-bot <decidim-bot@users.noreply.github.com>
Co-authored-by: Ivan Vergés <ivan@platoniq.net>
# Conflicts:
#	decidim-forms/app/assets/javascripts/decidim/forms/admin/forms.js.es6
#	decidim-forms/app/assets/javascripts/decidim/forms/forms.js.es6
#	decidim-forms/app/assets/stylesheets/decidim/forms/forms.scss
#	decidim-forms/app/commands/decidim/forms/admin/update_questionnaire.rb
#	decidim-forms/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb
#	decidim-forms/app/forms/decidim/forms/admin/question_form.rb
#	decidim-forms/app/forms/decidim/forms/answer_form.rb
#	decidim-forms/app/helpers/decidim/forms/admin/application_helper.rb
#	decidim-forms/app/models/decidim/forms/question.rb
#	decidim-forms/app/views/decidim/forms/admin/questionnaires/_form.html.erb
#	decidim-forms/app/views/decidim/forms/questionnaires/_answer.html.erb
#	decidim-forms/app/views/decidim/forms/questionnaires/show.html.erb
#	decidim-forms/config/locales/en.yml
#	decidim-forms/lib/decidim/forms/test/factories.rb
#	decidim-forms/lib/decidim/forms/test/shared_examples/has_questionnaire.rb
#	decidim-forms/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb
#	decidim-forms/spec/models/decidim/forms/question_spec.rb
@microstudi microstudi mentioned this pull request Jul 23, 2020
13 tasks
microstudi added a commit to Platoniq/decidim that referenced this pull request Jul 23, 2020
* New Crowdin translations (decidim#5761)

* New translations en.yml (French)

* New translations en.yml (Hungarian)

* New translations en.yml (Hungarian)

* Create question matrix row model

* Forms and specs

* Admin view logic

* Add matrix questions to update_questionnaire spec

* Make partials for different answer types

* Matrix answer layout

* Spec for matrix row element count when selecting question type

* Spec manage questionnaire matrix rows

* Spec adding matrix question

* Add matrix rows to question factory

* Update re-render form after error with matrix question

* Add spec for answer choice with new matrix row reference

* Spec for answer_form

* Add matrix rows to answer questionnaire command

* Show readonly matrix question when user not logged

* Make questionnaire answer view wider if it contains an answerable matrix question

* Answer matrix question spec

* Fix id for matrix multiple checkbox

* Enable max choices for matrix_multiple question

* Respect max choices for matrix multiple questions

* Fix erb style

* Normalize locale

* Preserve matrix choices on submission error

* Specs for user answer serializer

* Validate choices for mandatory matrix questions

* Spec for answering mandatory matrix questions

* Center matrix inputs

* Include not answered options as nil in user answers serializer for exports key consistency

* Compact arrays in csv export before transforming to_s

* Show alert for max choices on input change

* Spec for max_choices alert on input change

* Add matrix question type seeds to survey component

* Update changelog with PR reference

* fix eslint errors

* Normalize locales

* Fix failing remove matrix row spec

* Update changelog

* Remove questions regardless of matrix row errors

* Fix max choices component when no max choices defined

* Rename 'answers' to 'responses' in field names

* Update changelog

* Fix trailing whitespace

* Fix codeclimate issues in scss

* Fix scss errors from codeclimate

* Update changelog

* normalize js bundles

Co-authored-by: decidim-bot <decidim-bot@users.noreply.github.com>
Co-authored-by: Ivan Vergés <ivan@platoniq.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants