Hi Chris sorry to confuse you there, the THEN is more of an implied statement, it happens as if it's there. It is useful to remember it though as the flow of statements makes more sense. Classic programming flows usually use
IF <something>
THEN <something>
ELSE <something>.
I did have some hassles with this in Version 2.3 due to the way it parses statements, in the 2.4 beta it's very much improved and there are even some nice syntax help 'popups' which will aid lots of people, but this should still work in 2.3
So walking through it a little more slowly using a dropdown selector, just substitute radio buttons if you prefer...
Make your drop down and assign values to your options. Note they needn't be unique so a reasonable idea is to use 1=right and 0=wrong.
Say option B is correct, then A=0 B=1 C=0 D=0 and so on. If using a dropdown I'd also make a first item in the list of items 'Please select your answer'so it's clear what to do with the list.
When an option is selected it will change the variables value to your setting (look at the dropdown properties to check the name of the variable as you'll need it in a minute AND if using more than one dropdown on the page name the name_var uniquely to make it easier to keep tabs on whats going on).
Now go into the actions for the dropdown and set an ON SELECT ITEM event and set an IF action as follows
#dropdown_var>=1
(this means if the var equals one go on to the next statement, if wrong and not equal to one look for an ELSE and do what it says there or stop and do nothing)So currently this will check the value of the answer but do nothing.
Now you need to make something to happen depending on wether the answer is correct or not. A standard list item with a tick is good with some text as a way of giving feedback. Drop one on the page and apply a BEFOREDISPLAY event to this item and hide it using a DISPLAY action. It's now hidden before it displays on the page so exists but isn't seen.
Now go back to the dropdown actions adding the next line which is the 'what to do if the answer is correct'
IF CONDITION #dropdown_var>=1
DISPLAY ( show the list item )
What SHOULD happen now is the page opens, the drop down is seen and the feedback list element isn't. Select option B (value=1) and the IF CONDITION is evaluated as being correct so the hidden list item appears.
If the wrong answer is selected then the flow of actions stop so you should put in an indicator to the user for that.
For this you need an ELSE which will be used if the IF statement isn't fulfilled.
So now we can make an indicator of failure using another list item with a different image and text to say Wrong.
Again it would be hidden with a before display applied to it and revealed if the answer is wrong using a display action in the dropdowns list of actions giving you
IF CONDITION #dropdown_var>=1
DISPLAY (show the list item )
ELSE
DISPLAY (show the alternative list item)
Remember you can have multiple statements (actions) following the first evaluation and following the ELSE so you can add to the total score or another variable, play sounds etc.
Courselab doesn't really 'hold your hand' on these kinds of events and the documentation could probably give more examples but they are where an awful lot of power lies within the software. It is worth the effort of persevering through the frustration because even partially mastering them enables you to do so much more.
Imagine a note stave on the page, the user hears a tone then has to drag and drop a note onto the stave. If its right they're told if wrong the note slides to the right place. If you get the hang of actions then you can do this kind of thing and much more.
Sorry this is a bit long but hopefully it's more understandable.
Hi Chris sorry to confuse you there, the THEN is more of an implied statement, it happens as if it's there. It is useful to remember it though as the flow of statements makes more sense. Classic programming flows usually use
IF <something>
THEN <something>
ELSE <something>.
I did have some hassles with this in Version 2.3 due to the way it parses statements, in the 2.4 beta it's very much improved and there are even some nice syntax help 'popups' which will aid lots of people, but this should still work in 2.3
So walking through it a little more slowly using a dropdown selector, just substitute radio buttons if you prefer...
Make your drop down and assign values to your options. Note they needn't be unique so a reasonable idea is to use 1=right and 0=wrong.
Say option B is correct, then A=0 B=1 C=0 D=0 and so on. If using a dropdown I'd also make a first item in the list of items 'Please select your answer'so it's clear what to do with the list.
When an option is selected it will change the variables value to your setting (look at the dropdown properties to check the name of the variable as you'll need it in a minute AND if using more than one dropdown on the page name the name_var uniquely to make it easier to keep tabs on whats going on).
Now go into the actions for the dropdown and set an ON SELECT ITEM event and set an IF action as follows
#dropdown_var>=1
(this means if the var equals one go on to the next statement, if wrong and not equal to one look for an ELSE and do what it says there or stop and do nothing)So currently this will check the value of the answer but do nothing.
Now you need to make something to happen depending on wether the answer is correct or not. A standard list item with a tick is good with some text as a way of giving feedback. Drop one on the page and apply a BEFOREDISPLAY event to this item and hide it using a DISPLAY action. It's now hidden before it displays on the page so exists but isn't seen.
Now go back to the dropdown actions adding the next line which is the 'what to do if the answer is correct'
IF CONDITION #dropdown_var>=1
DISPLAY ( show the list item )
What SHOULD happen now is the page opens, the drop down is seen and the feedback list element isn't. Select option B (value=1) and the IF CONDITION is evaluated as being correct so the hidden list item appears.
If the wrong answer is selected then the flow of actions stop so you should put in an indicator to the user for that.
For this you need an ELSE which will be used if the IF statement isn't fulfilled.
So now we can make an indicator of failure using another list item with a different image and text to say Wrong.
Again it would be hidden with a before display applied to it and revealed if the answer is wrong using a display action in the dropdowns list of actions giving you
IF CONDITION #dropdown_var>=1
DISPLAY (show the list item )
ELSE
DISPLAY (show the alternative list item)
Remember you can have multiple statements (actions) following the first evaluation and following the ELSE so you can add to the total score or another variable, play sounds etc.
Courselab doesn't really 'hold your hand' on these kinds of events and the documentation could probably give more examples but they are where an awful lot of power lies within the software. It is worth the effort of persevering through the frustration because even partially mastering them enables you to do so much more.
Imagine a note stave on the page, the user hears a tone then has to drag and drop a note onto the stave. If its right they're told if wrong the note slides to the right place. If you get the hang of actions then you can do this kind of thing and much more.
Sorry this is a bit long but hopefully it's more understandable.