Multi Select responses sorted based on selection

I have multiple selection question. For example if Responant1 choose A,B,C but clicked C 1st, A 2nd and B 3rd. i want to display the response as per the selection like CAB. could it be possible?

Hi,

I don't think this would be possible to display the sequence of selection.

Thanks

2 Likes

I am not sure what you plan to do after the selection of multiple choices, but if its all about output files to have them show in what order they get picked, maybe each selection can have a set of pre-set preference choice in a minimal display -

So instead of ABC... Z being a multiple choice question, they each will be given a set of choices each in a list saying - 1st Preference, 2nd Preference, 3rd Preference, No Preference (for the ones that don't want to be chosen)

Thats the only Hack I could think of at this point. If there is anything else, I will share that as well.

This may not have been directly helpful, but I hope it may help in imagining some alternate options.

https://docs.opendatakit.org/form-question-types/#rank-widget is basically a select with a preserved ordering. It doesn't say what was clicked first, but it's as close as you are going to get.

1 Like

you can use a calculate
selected-at(${name},0) ---------this will be in the calculation column and fetch 'C'

selected-at(${name},1) ---------this will be in the calculation column and fetch 'A'

selected-at(${name},2) ---------this will be in the calculation column and fetch 'B'

2 Likes

I havent tried this yet, but are you serious? This would be crazy good ! Amazing !!

yupp, tried and tested. it stories the values you pick in an array and assigngs a position to every value starting from 0,1,2...

so if you pick it in the sequence C A B it stores C in 0, A in 1 and B in 2

1 Like

This is a very clever solution, but I don't know how robust it is. My concern is that the spec does not guarantee the ordering, so I wouldn't rely on this ordering to be the same between future versions of Collect or Enketo.

I'm also not sure how robust it is between swipes. What happens if you select C, A, B, then swipe forward then back, remove A, swipe forward then back, then select A? Does it still save as "CAB" or "CBA" or something else? All this to say, it might be good to test extensively.

3 Likes

Brilliant ! and great to know of the rider @yanokwa has mentioned. Working between what we know, this is an awesome way to have things. Thank you @safi

1 Like

+1 Correct. The order select-multi options are stored is not prescribed by the spec, and may well vary depending on the particular widget - ie appearance - used for the multi-select. This is not something you should depend upon (and it could well change between versions). As @yanokwa indicates, if you wish to order things you really should use a rank control, not a regular select.

2 Likes

I am just thinking it opens up an entire box of randomized control testing in say focus groups. Just to see what people click and prefer on certain attributes. It may not work well for say ground level data collection, but say if I want to just see childen's preferences in food items and without asking questions, just leave a bunch of images - good food, junk food, logos etc... and just see what they click on and leave it there. .. This works out so well :slight_smile: .... maybe there are spaces I havent thought through but in areas I think it may work it might just open up new possibilities ... just saying ...

Yup. I dont deny the usefulness of being able to 'sort' (in this case, by order chosen) selected options. I'm merely saying you probably shouldn't rely on any current quirk of any particular implementation that happens to do so... :wink:

1 Like

Got your point sire :slight_smile:

@yanokwa he spec doesn't guarantee ordering. I used it in a case where I needed to know the sequence in which the user selects options and changes them if the user removes and selects another option and it worked fine. if for example the user select C A B and goes forward then back and removes A then forward and back again and selects A again then it will be saves as CBA like you said. I must say that even though i tested it, My testing was not too extensive. I appreciate your feedback and I will test it more thoroughly and update.