forms icon indicating copy to clipboard operation
forms copied to clipboard

Support conditional logic

Open ei8fdb opened this issue 4 years ago • 17 comments

Is your feature request related to a problem? Please describe. No it's not.

Describe the solution you'd like

Like if you answered yes to question A, you go to question B otherwise question C ?

Describe alternatives you've considered There's not real alternative as there is no logic supported currently.

Additional context I'm a UX researcher and use creating long, or complicated questionnaires a lot. Being able to use conditional logic allows to direct the user down pre-defined paths is very important for me.

I understand this might be complicated/a lot of work to implement. There's also a lot of ways to implement this so I think it requires time to discuss.

If there is a possibility of this being implemented I can give lots of context!

ei8fdb avatar May 06 '20 16:05 ei8fdb

#227 ?

skjnldsv avatar May 06 '20 16:05 skjnldsv

More like your answer in that issue.

You would like conditional question? Like if you answered yes to question A, you go to question B otherwise question C ?

Would you like me to close this and discuss it over there? I thought it was different enough that it warranted a separate issue.

ei8fdb avatar May 06 '20 16:05 ei8fdb

I guess this is what it's about, yeah :thinking: Not super clear though. :see_no_evil:

skjnldsv avatar May 06 '20 16:05 skjnldsv

Since it is about different use-cases, I would also consider this separate.

That is, right and wrong answers are for quizzes. Conditional logic is for when you want to skip entire sections. Different things.

jancborchardt avatar May 06 '20 18:05 jancborchardt

im a TYPO3-dude, many things you are discussin here, i allready seen in a TYPO3 Extension called "powermail" and "powermail_cond". take a look here for "inspiration" how something could look like: https://docs.typo3.org/typo3cms/extensions/powermail_cond/stable/Records/Index.html and https://github.com/einpraegsam/powermail/tree/develop/Documentation resp. https://github.com/einpraegsam/powermail/blob/develop/Documentation/ForEditors/AddNewForms.md

Sorry, stumbled just across nexcloud-forms and it looks very very promising! Including the planed milestones - but maybe no need to reinvent the wheel when we talking about "forms".

funkyferdy avatar Aug 07 '20 09:08 funkyferdy

Google forms does it perfect:

1 Question: Do you like to have coloured cards? Yes
No
2, (only on "Yes") Choose colour: red yellow green 3. Thanks for your answer

trojanobelix avatar Sep 24 '20 14:09 trojanobelix

Several days ago I've started working on an attempt to implement support.

I use the example @trojanobelix metioned as template.

JDPDO avatar Aug 05 '21 08:08 JDPDO

@JDPDO Interesting. Is there anywhere we can try it out?

ei8fdb avatar Aug 05 '21 08:08 ei8fdb

The frontend needs a change for the prerequisite implementation. A kind of selection window is needed for choosing a prerequisite Option.

To change the frontend properly and only do it once: Which alternative you like the most?

First option (🎉 reaction): using a AppSettingsDialog

image

Or second (🚀 reaction): using the AppSidebar similar to the sharing sidebar of the app.

image

Both options with some kind of question selection tree. Or do you have other proposals? (reaction :eyes:)

JDPDO avatar Aug 05 '21 09:08 JDPDO

@JDPDO Interesting. Is there anywhere we can try it out?

If started a fork. See https://github.com/JDPDO/forms. It is to early to test it properly yet. Just wanted to let you know.

JDPDO avatar Aug 05 '21 09:08 JDPDO

Thanks for posting the screenshots. They're very helpful.

Both options with some kind of question selection tree. Or do you have other proposals?

Can I suggest you add maybe 👂 as an emoji to vote for "other proposals"? :)

Other proposal My preference would be to have something like Google Forms, visible in the page, like so:

Screenshot 2021-08-05 at 11 06 46

The reasoning being for efficiency, and reducing the number of clicks and movement for the user. When making a survey it can take anything from 20-30 minutes to many hours, particularly when changing the design of the questions, etc. This translates into lots of clicks, etc so trying to reduce that would be good for the user.

Would you like me to give more explanation/info?

ei8fdb avatar Aug 05 '21 09:08 ei8fdb

Can I suggest you add maybe as an emoji to vote for "other proposals"? :)

Nice idea but: image 😔

My preference would be to have something like Google Forms...

I like that idea. :grinning: Google does it like (check this and go to that)-Style. They doing something like referencing between sections or from options to sections. Maybe we should keep #624 in mind too.

I thought more of: Which conditions have to be true, that this question or option gets enabled? Think this is more extendable in the future. Maybe for questions depending on specific values of text- or date-options. What do you think? Is this better or worse?

The way they referencing conditions without extra option windows is nice :+1:. I will keep that in mind. Good point with the clicks.

Would you like me to give more explanation/info?

Hope I have got you right.

JDPDO avatar Aug 05 '21 10:08 JDPDO

Can I suggest you add maybe as an emoji to vote for "other proposals"? :)

Nice idea but: image 😔

Yes I saw that. Can I suggest 👀 instead?

My preference would be to have something like Google Forms...

I like that idea. 😀 Google does it like (check this and go to that)-Style. They doing something like referencing between sections or from options to sections. Maybe we should keep #624 in mind too.

Google Forms works only if pages are treated as sections - when you skip a question, the UI only shows you a webpage, with the questions in that section.

This is how crowdsignal treats questions, pages, and conditional logic:

image

image

image

I've thought alot (probably too much to be honest!) about forms creation. I make surveys/polls/forms daily. I'm working on a project at the moment that is, basically a form builder.

I created this visualisation of "the anatomy of a form" to communicate to colleagues the information architecture of a form.

The anatomy of a form - The anatomy of a form

Right now NextCloud Forms is at position 1, i.e. 1 page, multiple questions.

#624 is talking about position 3/4. Adding sections is useful, but (IMO) isn't as useful as adding pagination (i.e. splitting the form over separate pages)

To improve readability we'd need to get to position 5 - pagination. Conditional Logic is most useful for pagination.

We often want to add all the things(!) and it often ends up making it overly complicated. :)

I thought more of: Which conditions have to be true, that this question or option gets enabled? Think this is more extendable in the future. Maybe for questions depending on specific values of text- or date-options. What do you think? Is this better or worse?

I think I understand what you mean and, just my opinion, that seems more complicated than saying "continue unless these [X] conditions.

In my mind form conditional logic is just a bunch of if, then, else statements. If there's no if or then statements, then you just continue. And (I think) that's how most form conditional logic works. (I could be wrong!)

The way they referencing conditions without extra option windows is nice 👍. I will keep that in mind. Good point with the clicks.

Would you like me to give more explanation/info?

Hope I have got you right.

Yep you did! :)

I hope this is helpful.

ei8fdb avatar Aug 05 '21 11:08 ei8fdb

Yes I saw that. Can I suggest instead?

Done. :wink:

Google Forms works only if pages are treated as sections - when you skip a question, the UI only shows you a webpage, with the questions in that section.

Conflicting Forms (Try, are only 3 steps) are possible. If google forms encounters a conflict which section to display next it goes with the last selected redirect. The second section/page is not displayed if opposite is chosen in question named _2 even if a redirect to section two is set in question named _1.

This program behavior should be avoided by us.

This is how crowdsignal treats questions, pages, and conditional logic

Switching tabs (Questions - Branching) for editing should we keep in mind.

I created this visualisation of "the anatomy of a form" to communicate to colleagues the information architecture of a form.

Like it. :smiley: Now the form terminology is clear.

We often want to add all the things(!) and it often ends up making it overly complicated. :)

:laughing: You're right.

I think I understand what you mean and, just my opinion, that seems more complicated than saying "continue unless these [X] conditions.

The benefit of saving the conditions to the depended following question would be, that a question can depend on multiple preceding questions. The other way around, this will be more difficult. But do we need that really?

In my mind form conditional logic is just a bunch of if, then, else statements. If there's no if or then statements, then you just continue. And (I think) that's how most form conditional logic works. (I could be wrong!)

Agreed. One problem remains: Which question got the condition?

argumentation

implement ... ... condition at preceding question condition at following question
conflicts possible if sections are added :heavy_check_mark: :x:
multiple conditions :x: :heavy_check_mark:
:heavy_plus_sign: simple programming :heavy_check_mark: :x:
:heavy_plus_sign: workflow :warning: The following question is at creation time not available. Or the following question have to be defined before. :heavy_check_mark: straight forward working
:heavy_plus_sign: exports to other tools :heavy_check_mark: seems to be common :x: multiple conditions could make this impossible or very unpleasant.
:information_source: point in time check condition, then redirect immediately to following question check conditon, when should display

:heavy_plus_sign: : undiscussed :information_source: : comes along with... :heavy_check_mark: : pro :x: : con

JDPDO avatar Aug 05 '21 18:08 JDPDO

Moment: The chosen data schema would support both approaches. It should not be to hard to implement both in different branches. See optionId and conditionOptionId in Prerequiste Entity of currently implemented schema.

JDPDO avatar Aug 05 '21 18:08 JDPDO

Any update on this issue since two years ago when @JDPDO started a great job on it?

Thatoo avatar Jul 03 '23 07:07 Thatoo

We are wondering about this feature as we are currently using Microsoft Forms on Microsoft 365 which already supports this. This feature alone is holding a few of our clients back from switching. We were wondering if there an ETA even if it is 2 or more years from now.

johnnyq avatar Oct 04 '23 21:10 johnnyq