Multiple conditions

Hi there,

I wonder if anyone can shed some light on having multiple conditions on an action?

Without an 'else if' option in play, I'm trying to use multiple actions and I don't seem to be having much luck.

Here's my Scenario...

Multiple choice question - "Have you experienced any of the following?"

* Mars Bars

* Happy Hour

* Train Ride

* Tree Climbing

* None of the above

Selecting one of these options and results in the user being directed to the "Feedback One" page.

Selecting more than more, but less than all options results in the user being directed to the "Feedback Two" page.

Selecting all answers results in the user being directed to the "Feedback Three" page.

This is a simple task when two feedback pages are involved by using the condition and else options on an action. However, without an 'else if' option, it appears to be a little more difficult.

I've tried assigning multiple actions to the questions submit button as follows:

- Onclick Goto FeedbackOne - If Question One is equal to 1

- Onclick Goto FeedbackOne - If Question One is greater than 1 + If Question One is less than 5

- Onclick Goto FeedbackOne - If Question One is equal to 5

This doesn't seem to work and I'm not sure if it's because the way I've setup the actions is "incorrect", or if the value stored in the Question One variable might either not yet exist, or be incorrect?!?!?

I'm kinda hoping there's an easier way which I've overlooked, either way, if anyone has experience with this scenario, I'm very much interested in knowing how you achieved it.

Thanks all.

B.

Discussion (3)

G'day Benjamin,

When in doubt do a display e.g. Add an action after the process question to show you what is in the variable:

Display Message Var(Question_002) - or whatever the variable is.

You will see that it's the either ~~~null~~~ or the value of the choice(s) selected delimited with a comma and the order with be the choice order, as follows:

"~~~null~~~" - Nothing selected - not including the quotes:-)

"Mars Bars,Train Ride,Tree Climbing"- Options 1,3,4 selected, ditto re quotes.

HTH

Regards, Peter

www.LectoraDeveloper.com

undefined

Hey Ben! I duplicated your scenario and created a quick example. You can download it to check it out and see how I would put the functionality in place. I tested it using the Lectora Preview and HTML and everything seems to be working as expected. Please let me know if you have any questions.

Thank you both very much for the replies.

Firstly, Peter. Knowing full well I could display the contents of a variable in a text block, I didn't for a second think to use it for viewing a variables contents for development/debugging purposes. You've given sight to the blind! Thanks a million.

Jennifer, your approach confirms I was heading in the right direction, which is very reassuring. I spent almost an entire day on this yesterday (taking comfort in Edison's famous quote) and I arrived at the same method as you've described, only I applied it to the questions submit button, not onshow.

For some reason I didn't get it working. However I've re-jigged your example to suit my setup and it works! So obviously I've just got a little crease I need to iron out and I should be good to go.

I've attached my example as an alternative approach. The reason I prefer it is because the onclick action directs the user to the specific page, without first hitting the 'Feedback 1' page. This avoids having the Feedback 1 page flash momentarily before the redirect occurs, so it's a slightly cleaner approach.

Thanks a million to both of you.

B.

P.s. For anyone that utilises the method in this thread. I suggest using one of the many online "combination generators" to make sure you have all the necessary combinations covered - I used this one

Discussions have been disabled for this post