DeterminePrize()
Pulls prize data (ParsePrizes()
), calculates a weighted random (GetWeightedRandom()
), then determines the angle to land the wheel on. This function is called by startSpin()
, before every spin.
ParsePrizes()
Looks for the segments
object in the current wheel (found in the _RawData["myWheelId"]["segments"]
).
Updates the
To save winner's data, POST to "save-prize-winners" with the folllowing post data:
To download winners in CSV format, Visit "api/download-winners"
To download winners in CSV format, Visit "api/download-prizes"
The wheel type is saved in the directory "assets/data/wheel-types". You can create and save custom wheel types in this directory using the examples in the same directory.
The available wheel types will be loaded on page load. These are pushed into the home(taccom) template. You can change the current wheel type on page by selecting the dropdown menu (Select Wheel Type).
A new javascript function,"AseChangeWheelType()" is created to handle the change events in the dropdown button. this function accepts a parameter which defines the selected wheel type.