Allow changing answer types
Remains of #250, also requested by NC-Internal tests.
@jotoeri you mean something like:
I had a a multiple choice question but want to change it to a radio button question - the answers would then be "redisplayed" as radio button answers?
This would be nice, but (I think) difficult to achieve in all cases - I've not seen survey questonnaire apps doing this well.
Yup, that's it in fact. As for our current question types & way of storing this shouldn't be too much of a problem. Maybe on further question-types we will need to restrict to change only between specific types. But we'll see, when this comes into case.
As for our current question types & way of storing this shouldn't be too much of a problem.
Agreed. I do think it's worth trying to establish if there are any question types that can be mapped.
So with some limited thought, I put this together:
:+1: Easy to map question types
- multiple choice to radio button
- multiple choice to single column grid
- radio button to multiple choice
- radio button to single column grid
- long text to short text
- short text to long text
- single column grid to multiple choice
- single column grid to radio button
:-1: difficult/not worth the effort to map
- multiple choice to multi-column grid (#356 )
- multiple choice to short text
- multiple choice to long text
- radio button to multi-column grid (#356 )
- radio button choice to short text
- radio button to long text
- long text to any other format
- short text to any other format
I hope that makes sense - if not I can explain it.
How about "hiding" the old question and copying it while changing the type? So you can keep old submissions mapped to the hidden question, as they could potentially change their meaning based on the available answer type.
Hiding could be as simple as having a flag deleted (or similar) or could be implemented as a foreign key to the superseding question, which would allow deleting the old question if the new one is deleted.
Essentially we have that but don't use it, since deleted questions are not deleted, but are hidden by having order=0. However, we don't show this currently, since @jancborchardt said we should just show the results as the form looks currently, no matter if the submissions change. 🤷♂️
For here, i would also some kind of mapping for which question-types can be changed so it is logically usable. So more avoiding the problem, than fixing bad results. - E.g. Multiselect can only change to Multiselect & Dropdown, Long/Short Text can change. More the kind of 'visual changes', that are allowed for changing the question-type, but not allowing to change arbitrarily. For bigger changes the user just needs to create a new question.