Add/subtract from variable depending on state selected/normal
Jan 21, 2014
Hi all,
I'm building an activity where users can click on different parts of a paragraph, e.g. to identify the topic sentence. Users click the various sentences to highlight them and click again to deselect (SELECTED/NORMAL states). What I need is a variable to act as a counter that increases by 1 when an incorrect sentence is selected, and subtracts 1 again if they deselect it. (After they click a "submit" button the layer they see will be determined by the number of incorrect sentences they included, hence the need for a counter.)
I've tried adding "Adjust variable" triggers to add/subtract 1 when any of the rectangles over the incorrect sentences are selected - screenshots below - but it only ever seem to do one or the other, only add or only subtract.
Any suggestions on what I'm doing wrong... or better ways of doing this? Thanks in advance!
4 Replies
Hi Erin
I had developed a similar type on interaction where a value of the variable changes to +1 / -1 on clicking. The .story file is attached. You can analyze the triggers given to the 'correct' checkboxes in my file.
Hope this helps.
Hi Dipti,
Thanks a million for posting your .story file. I see what you've done in terms of adding variables, together rather than adding/subtracting value from a single variable. Will give it a go - thanks again!
Thank you! This thread helped me today. :)
Awesome Laura! Love when the older threads are still helpful. Thanks for sharing :)
This discussion is closed. You can start a new discussion or contact Articulate Support.