I wanted to have a password/passcode system where a question is asked and the typed out answers leads to specific passages.
This part seems to work.
<<set $answer = prompt ("question")>>
<<if ($answer = "Answer 1")>> <<goto "Passage 1">> <<endif>>
<<if ($answer = "Answer 2")>><<goto "Passage 2">> <<endif>>
and now I wanted to add a "else" option that kind of looks like
<<else>> <<goto "passage 3">> <<endif>>
But it is not working, it sends the correct and incorrect answers to "passage 3".
Possible issues could be with "=" vs "is", not using if-> elseif -> else pattern, how each line does or does not need a <</if>> or <<endif>>..... I don't know.
Comments
<<set $answer = prompt ("question")>>
<<if ($answer = "Answer 1")>> <<goto "Passage 1">>
<<else if ($answer = "Answer 2")>><<goto "Passage 2">>
<<else>> <<goto "passage 3">> <<endif>>
Now I can have people skip to the later passages without having to go through the boring stuff.
If you want to compare a variable to a value withing a <<if>> or <elseif>> then use either the "is" key work or double equal signs "==", so the above should be changed to: To help with the whole single or double equals signs issue I suggest changing your <<set>> macros to use the "to" key word: