Pierre-Sassoulas / django-survey

A django survey app that can export results as CSV or PDF using your native language.
GNU Affero General Public License v3.0
217 stars 145 forks source link

Questions groups or blocks #175

Open maximloginov opened 2 years ago

maximloginov commented 2 years ago

I want to implement SF-36 Health Survey, some questions in this survey are grouped in blocks, for example, see questions 3-12 in https://rand.org/health-care/surveys_tools/mos/36-item-short-form/survey-instrument.html This group has a header and the same options for answers. Is it possible to implement this?

Basically, there are two questions:

  1. How to make a group header? e.g "The following items are about activities ... ?" in the example above.
  2. How to arrange the answers into a table?
Pierre-Sassoulas commented 2 years ago

How to make a group header? e.g "The following items are about activities ... ?" in the example above.

That would be a category to create in django admin

How to arrange the answers into a table?

This would be a new feature.

maximloginov commented 2 years ago

How to make a group header? e.g "The following items are about activities ... ?" in the example above. That would be a category to create in django admin

I tried that, but it does not look as a good solution. If I put question in category name, it is formatted as H3 element in view/html, it looks very different from other questions. Category description looks better, but the field in admin interface is too short for question text, therefore I decided its purpose is different. Also, category descrition does not support html tags like <strong> or <em> to emphasize some words in question...

How to arrange the answers into a table? This would be a new feature.

Right, and to me it looks like answers could be linked to header question, and all other "sub-questions" within the group inherit these answers.

maximloginov commented 2 years ago

If I try to implement this using https://github.com/Sinkler/django-radiogrid would you include the additional dependency to django-survey? The project seems to be well-maintained and compatible different python/django versions.

maximloginov commented 2 years ago

btw the issue #123 may be relevant to this one, @gjelsas could you confirm?

Pierre-Sassoulas commented 2 years ago

If I try to implement this using https://github.com/Sinkler/django-radiogrid would you include the additional dependency to django-survey?

Sure, but let's make it an optional extra_require guarded with conditional in the code and documented in the readme. It's more work at first but I don't want / won't be able to deal with it if the dependency is not maintained anymore (and it seems like a small lib with less than 30 stars).

gjelsas commented 2 years ago

btw the issue #123 may be relevant to this one, @gjelsas could you confirm?

Yes, Your suggestion would maybe be a way to implement that. Thanks!

pkuppens commented 1 year ago

@maximloginov , @Pierre-Sassoulas : I'm (also) looking to implement a set of healthcare questionnaires. This radiobutton grouping would be very useful. So my questions:

  1. @Pierre-Sassoulas is this now implemented in django-survey? (Or do I need to work around this?)
  2. @maximloginov , do you have a working example that you can share/document/show the steps how you implemented it?
Pierre-Sassoulas commented 1 year ago

I don't think so as this issue is still opened.