There have been a lot of questions floating around recently dealing with the breakout activities, specifically how I make the screen locks and control the scoring. Surprisingly enough, these two aspects are the simplest parts to code. Here's how:
Let's Say I want to see this screen with the bouncing ball...
1) Figure out what you want to unlock the next screen. In this example I want the ball on screen 2 to show when the button on screen 1 is pressed.
2) In the graph behind the screen you want locked, create a variable. Use conditionals to set it to 1 when the conditions are met and 0 when they are not (see image below).
2) Upload the image you want to block the screen. In the coordinate for the center put the restriction to have it only show when the condition for unlocking has not been met. That way the lock screen will disappear when the condition has been met. You may also want to find a way to keep the image from being moveable. I like to use a list but that's up to you.
Take a look at the example activity here: https://teacher.desmos.com/activitybuilder/custom/5b200b098a624c7e6c083f8c
How does scoring work?
If you want to figure it out yourself or don't want to have the magic spoiled I wont force you to read the next part...
Scoring is possibly the simplest part of the breakout activities. With the exception of linear functions (which gave a random number as the "score"), each of the breakouts has been scored the same way:
- On each screen record the number of attempts it takes to complete the challenge. This will in most cases be a button pressCount or an input submitCount
- You can keep a running total or do it all on one screen, but in either case you want a total of each of the button presses on the last screen.
- Assign a point value to each of the attempts. In most cases this will vary based on the challenge. If a challenge requires a minimum of more than one press (See Breakout! April, Screen 5) make sure you take that into account. Total these points. This will be the minimum number of points deducted to complete the activity.
- Create a variable that starts with the maximum score PLUS the minimum deduction and subtract the point values per attempt for each screen. (see image below left)
- Source your variable into the note to show the score! (see below right)