Preselecting a select one choice basing on score obtained from a Multiple choice question

Hi am trying to use a score obtained to preselect a single choice question basing on the score the respondent has scored as shown in


LSM
how do I preselect say 2 for an individual who qualifies to be in LSM group 2
aG4B842NdgpvMXwajY8jbU (2).xlsx (12.1 KB)

You can use a calculation to pre-set a value, e.g. once( if( ${YourScoreVar} = aValue, “choiceName”, “” ). Without once, the select cannot be edited.
Also a trigger construct would be an option.

1 Like

Hi @wroos, I didn’t understand, Can I use several If statements under the same calculation column of the single select question? as indicated in this image
LSM
it seems like I need several if statements

Is there a way I can use an if else, I have reduced the answer options to the preselection question to 3 that is DE, C1C2, B as shown
SEC
Am now able to preselect the first 2 options but unable to cater for the 3 as shown by the link Enketo Express for KoboToolbox

Hi @alexiga, yes you can use the if-else sentences. here the similar topic to yours

1 Like

Hi @osmanburcu, how is the else-if used

See IF, OR, AND functions in XForms - #27 by wroos.

1 Like

@alexiga, here is a similar post discussed previously that should solve your issue:

And this post discussed previously should also be helpful:

Thanks @Kal_Lam ,
Was able to solve this as in link Enketo Express for KoboToolbox but it does not preselect using android app, How do I go about this?

1 Like

Could you share the related part of your XLSForm here, please.

Testing your link:

  • I get score 32 if nothing is selected
  • I get nothing preselected initially, but after entering a score and removing it afterwards, I get still the last SEC preset.
  • I can manually change/set the score and the SEC (should be read_only).
  • I can enter extremely high scores (resulting in DE selected).
  • With the spinner I can even enter negative scores. (This seems to create an error msg, quickly disappearing, and also results in “DE” selected.)
  • It seems that your score field has a decimal type.
  • The maximum summed score if I select all items is 565, but I can enter bigger numbers.
  • If I enter 12345678901234567, the spinner stops working correctly with the last (17th) digit. (@Kal_Lam)
    Is this ok?

Would you mind, to check and preview/test your form also with the online validator, please?

1 Like