Hey everybody,
I am having a hard time understanding how to use the <<checkbox>> macro in SC2:
I try to compare the two arrays, but the condition in <<if>> is never met, as $userInput remains empty.
What am I doing wrong?
I am having a hard time understanding how to use the <<checkbox>> macro in SC2:
<<set $rightAnswer to [true, false, false, true, false, false, false, true, false]>> <h3>Which of these ingredients do you need for the potion?</h3> <<checkbox "$userInput[0]" false true>>stinging nettle <<checkbox "$userInput[1]" false true>>mandrake <<checkbox "$userInput[2]" false true>>yellow cress <<checkbox "$userInput[3]" false true>>fly agaric <<checkbox "$userInput[4]" false true>>asarabacca <<checkbox "$userInput[5]" false true>>woodruff <<checkbox "$userInput[6]" false true>>garlic <<checkbox "$userInput[7]" false true>>lady's mantle <<checkbox "$userInput[8]" false true>>puffball <<button Check>> <<if $userInput == $rightAnswer>> <<goto "correct">> <<else>> <<goto "false">> <</if>> <</button>>
I try to compare the two arrays, but the condition in <<if>> is never met, as $userInput remains empty.
What am I doing wrong?