How to combine several input data from items to one (string) variable in ztree?

74 Views Asked by At

In my experiment, users have the choice between 10 items per round they can select or leave the checkbox emtpy. In the next step, I'd like to create a new variable, e.g. MyInputR1, which holds the values of the previous checkboxes in the right order and as 1 new number.

My approach so far:
a)

  • Formatting input data: f1=format(D11,0.2).
  • Combining the input data and storing the information in a new variable: f = f1 + f2 + f3 + ....
  • Creating the variable MyInputR1 = stringtonumber(f)

b) Combining the input data (with values 0 or 1): MyInputR1 = D11 + D12 + D13 + D14 + ...

Unfortunately, the logic does not sum up and ztree does not understand what I am trying to do. Thus my question:

Is it possible to combine / string together input data into 1 new variable, instead of adding it up?


Input data: checkbox with values 0 or 1 in total 10 input variables (D11 - D110) Looking for a variable that e.g. looks like this: MyInputR1 = 0000011111

ztree code

Thanks for your help!

0

There are 0 best solutions below