January 9, 2017 at 3:54 pm #342241
Alexis ScottMember3 pts@ascott7223
PS – I know that everyone on the planet has a calculator available if they’re doing e-learning, but part of the challenge is to have the module itself do the tallying, thus my needing help.
Thanks in advance!
Attachments:January 10, 2017 at 7:36 am #342260
Perhaps I’m oversimplifying this, but what about adding an action to each item/button to increase a variable (“Total”) with each click. For example:
Action: Modify Variable
Target: Total, Type: Add to Variable, Value: 0.50
A secondary action could then change the contents of a text box to display the new total.
Have you thought about adding plus (+) and minus (-) buttons below the price? You could then assign Add to Variable or Subtract from Variable actions to simulate the customer putting the item back.January 10, 2017 at 8:55 am #342276
Tim KMember317 pts@timk
To upgrade Clammers approach, you could create variables for the amount of each product and make the buttons add 1 to the respective variable. Multiply the amounts with the prices, and sum up the individual product costs. Then you could display something like:
You cart contains:
2 Apples for $1
3 Croissants for $3
Total = $4January 10, 2017 at 11:33 am #342291
Jason DalrympleMember45 pts@JasonADal
I’m using a similar method for the add to variable that’s outlined above in a module where the actions a learner takes tallies the score for the “test” instead of using a test itself.
Since you want the action to subtract from the total if it’s removed from the cart, you could add a variable to indicate if the items is in or out of the cart and use if statements to modify the total.
Initial value: out
OnClick: Set variable cart_state = “in” IF cart_state = “out”, ELSE set variable cart_state = “in”
OnClick: Add to variable “total” (amount) if cart_state = “in”, Else subtract from variable “total” (amount)
OnClick Change content of the text box to the new total
With drag and drop, thanks to Tim, it is possible to modify the total if the item is dragged to the drop area, but I’m not sure how you could subtract from variable if it’s dragged out of the drop area.January 19, 2017 at 11:33 am #342695
Math NotermansMember119 pts@mnotermans5114
You must be logged in to reply to this topic.