Adding and subtracting variables in drag and drop

Sep 01, 2014

Hey all: First - thanks for the help in getting this newbie this far (particularly steve). Your patience is appreciated. The following screenr shows a example of what I'm trying to do and not do. There are objects on the left that represent courses, each course equals a certain number of credits. When students drag and drop a course object on to a Quarter target, the number of credits for that quarter adds at the bottom of the column using a state change that add to the respective variable. The total number of credits assigned adds in the center of the screen. I've set this up with help from you all such that as the object is dragged the state is set to correct so it can be placed in any target.

The next challenge is to subtract the credits from the respective quarter and overall totals when an course object is dragged off of a quarter target to a new target (with appropriate add) or dragged back to the side.

At first I thought I might need to use java script but after just looking at the calculator posted I think I'm just not structuring thing right.

https://player.vimeo.com/video/204929895

I've attached the .story to show what I've done so far.

Any help is much appreciated.

Carlo

1 Reply
Simon Blair

Hi Carlo,

Maybe something like this would work:

  • Set up 2 variables associated with each course (e.g. "Univ101Fall" and  "Univ101Winter"
  • When the Univ101 object is dropped,
    • reset both Univ101 variables to 0
    • set Univ101Fall to 5 if it's dropped on Fall
    • set Univ101Winter to 5 if it's dropped on Winter
  • Whenever any object is dropped on Fall
    • Reset FCR to 0
    • Add Univ101Fall (and the other fall courses) to FCR

Apply the same thing to Winter and to the other courses.

This discussion is closed. You can start a new discussion or contact Articulate Support.