Change things so that I only have the option of new game when I get the correct answer:
newgame is Button(\"newgamename\", \"New Game\", scaleWidth*0.5, 7*scaleWidth, myanswercorrect);
");
A_finishing_interface is Slide("
Refine the interface:
Helpful to add a colour to the button which has been selected:
yesButt is Button(\"yes\", \"YES\", scaleWidth*0.5 + 90, 7*scaleWidth, true, (myanswer==\"Y\") ? \"lightblue\" : \"\");
noButt is Button(\"no\", \"NO\", scaleWidth*0.5 + 140, 7*scaleWidth, true, (myanswer==\"N\") ? \"lightblue\" : \"\");
proc initpurse: newgamename_clicked {
ix1 is randomInteger(1,8);
ix2 is randomInteger(1,8);
ix3 is randomInteger(1,8);
ix4 is randomInteger(1,8);
ix5 is randomInteger(1,8);
ix6 is randomInteger(1,8);
ix7 is randomInteger(1,8);
ix8 is randomInteger(1,8);
myanswer = \"\";
}
");
A_feedback is Slide("
Step 3: Add a message that responds to whether you get it right or wrong
Frame the question to be answered:
questiontext is Text(\"Have you enough money?\", scaleWidth*0.5, 7.5*scaleWidth, scaleWidth/4);
picture is coinspics // itemspics // coinstext // itemstext // addedtext // [newgame, yesButt, noButt, questiontext];
yesButt is Button(\"yes\", \"YES\", 3.5*scaleWidth, 7.4*scaleWidth, true, (myanswer==\"Y\") ? \"lightblue\" : \"\");
noButt is Button(\"no\", \"NO\", 4.5*scaleWidth, 7.4*scaleWidth, true, (myanswer==\"N\") ? \"lightblue\" : \"\");
responsetext is Text((myanswercorrect) ? \"Well done!\" : \"Try again\", 5.5*scaleWidth, 7.5*scaleWidth, scaleWidth/4);
picture is coinspics // itemspics // coinstext // itemstext // addedtext // [newgame, yesButt, noButt, questiontext, responsetext];
");
slideList is [MakingMoneyMathIntro,A_PrototypingMakeMoneyMath,A_randomiseCoins,A_randomiseCoinsAns,A_randomcoinaction,A_addNewGameButton,A_introYNbuttons, A_finishing_logic, A_finishing_interface, A_feedback];
B_morelikeMoneyMath is Slide("
Making it more like MoneyMath
Now need to make this more like Steve's version of Money Math:
- don't have all eight coins, and choose just 2 items randomly
- remove the display of the values of the coins and other extra text not needed
- turn the coins over, so that you don't see the value of the coin
");
B_modifyPicture is Slide("
Modify the picture so that there are just 4 coins and the 2 items ...
coinspics is [coin1pic,coin2pic,coin3pic,coin4pic,coin5pic,coin6pic,coin7pic,coin8pic];
coinspics is [coin1pic,coin2pic,coin3pic,coin4pic];
itemspics is [item1pic,item2pic,item3pic,item4pic,item5pic,item6pic];
itemspics is [item1pic,item2pic];
itemstext is [item1text,item2text,item3text,item4text,item5text,item6text];
itemstext is [item1text,item2text];
Remove the extra text etc:
coinstext is [coin1text,coin2text,coin3text,coin4text,coin5text,coin6text,coin7text,coin8text];
coinstext is [];
... or as below omit coinstext altogether:
picture is coinspics // itemspics // coinstext // itemstext // addedtext // [newgame, yesButt, noButt, questiontext, responsetext];
picture is coinspics // itemspics // itemstext // [newgame, yesButt, noButt, questiontext, responsetext];
");
B_turningcoinsover is Slide("
## retrieve different images to turn the coins over:
func coindisplay {
para ix;
if (ix==1) return \"1ph.gif\";
if (ix==2) return \"2ph.gif\";
if (ix==3) return \"5ph.gif\";
if (ix==4) return \"10ph.gif\";
if (ix==5) return \"20ph.jpg\";
if (ix==6) return \"50ph.jpg\";
if (ix==7) return \"poundh.gif\";
if (ix==8) return \"2poundsh.gif\";
}
... the original form of coindisplay() didn't have an 'h' before the '.' in the specification of the images.
");
B_chooserandpairitems is Slide("
Choose the two items you wish to buy at random ...
pairofitems is [items[jx1], items[jx2]];
jx1 is randomInteger(1,6);
jx2 is randomInteger(1,6);
item1pic is HTMLImage(\"item1pic\",scaleWidth*0.5,5.5*scaleWidth-2*scaleWidth*itemsselected[1],scaleWidth,scaleWidth,imagelocation // itemdisplay(jx1));
item2pic is HTMLImage(\"item2pic\", scaleWidth*1.8, 5.5*scaleWidth-2*scaleWidth*itemsselected[2],scaleWidth,scaleWidth,imagelocation // itemdisplay(jx2));
item1text is Text(pricedisplay(jx1, items), 0.6*scaleWidth,4.5*scaleWidth,scaleWidth/5);
item2text is Text(pricedisplay(jx2, items), 1.9*scaleWidth,4.5*scaleWidth,scaleWidth/5);
… randomising the items when you start a new game:
proc initpurse: newgamename_clicked {
ix1 is randomInteger(1,8);
ix2 is randomInteger(1,8);
ix3 is randomInteger(1,8);
ix4 is randomInteger(1,8);
ix5 is randomInteger(1,8);
ix6 is randomInteger(1,8);
ix7 is randomInteger(1,8);
ix8 is randomInteger(1,8);
myanswer = \"\";
jx1 is randomInteger(1,6);
jx2 is randomInteger(1,6);
}
");
B_updatelogic is Slide("
Change the logic so that it relates to the correct values (currently these are 'spendingmoney' and 'costofallitems':
costofallitems is round(price1 + price2 + price3 + price4 + price5 + price6, 2);
myanswercorrect is (myanswer==\"Y\") && (spendingmoney>=costofallitems) || (myanswer==\"N\") && (spendingmoney < costofallitems);
Might think of using price1 and price2 to compute costofallitems, but this is incorrect, since price1 and price2 refer to the prices for the first two items in the original form of the construal and are fixed.
Can overcome this by defining
prices is [price1, price2, price3, price4, price5, price6];
costofallitems is round(prices[jx1] + prices[jx2], 2);
... the original definition of spending money was:
spendingmoney is (purse[1]+purse[2]+purse[3]+purse[4]+purse[5]+purse[6]+purse[7]+purse[8])/100;
... which is modified to:
spendingmoney is (purse[1]+purse[2]+purse[3]+purse[4])/100;
");
A_slides is [A_PrototypingMakeMoneyMath,A_randomiseCoins,A_randomiseCoinsAns,A_randomcoinaction,A_addNewGameButton,A_introYNbuttons, A_finishing_logic, A_finishing_interface, A_feedback];
B_slides is [B_morelikeMoneyMath,B_modifyPicture, B_turningcoinsover, B_chooserandpairitems, B_updatelogic];
slideList is [MakingMoneyMathIntro] // A_slides // B_slides;