Displaying correct total amounts
April 18, 2006 12:00 AM
I am having problems getting a motivation activity to work properly. I have eight graphics interspersed throughout my program – the user is to click on the graphic once they see it to obtain a “monetary” reward (e.g., $250, $500, $1000). At any point in the program, they can click on a bank graphic to view their bank account. I have the bank account set up as a pop-up window. If they click on a graphic and receive money, it displays the amount of money in their bank account. If they have not earned money for clicking on a particular graphic, it shows $0.00 earned. This page is set up similar to a custom results page for a test. For each individual clickable graphic, I have an action set up at follows:On: Mouse ClickAction: Modify variableTarget: Graphic1 (graphic2, graphic3, and so on)Value: 500 (or value that pertains to the graphic)Modification Type: Set variable contentsIntitial value is 0 for all variables.I also have a variable Total_Money_Made with an initial value of 0. On the results page (or the bank account) I have an action to display the total money earned in a text box:On: ShowAction: Change ContentsTarget: Money total New contents: Total_Money_MadeSince I want the page to also show the total money accumulated, I have attempted to set up 8 actions (one for each variable as taken from a previous post):On: ShowAction: Modify VariableTarget: Total_Money_MadeValue: VAR(graphic1)Modification type: Add to variableOn: Show Action: Total_Money_MadeValue: VAR(graphic2)Modification type: Add to variableAnd so on...Problem #1 – the first time I click on a graphic and go to view the bank account, it shows the amount earned for that graphic, but does not show it in the Total Money Made box. If I close the pop-up window and view the account a second time, then it shows the amount (Problem #2). If I close the window and view it a third time, it adds the same amount onto the total. This happens with all the variables/graphics. So even though the user should only be able to earn a total possible amount of $5,000, if they view the bank account several times, that amount is not correct and will go way beyond $5,000.I am thinking that somewhere I need to add a “beenthere” variable meaning that once they have clicked on and earned the money for graphic1, they cannot earn any more money for that graphic if they click on it again. Also, if they view the bank account page numerous times (which they will) it needs to stop adding each time the page is shown.Any suggestions on how to do this?
Discussions have been disabled for this post