[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]
Link to the project or level:App Lab - Code.org What I expect to happen: I don’t understand how to use the check box feature. I want to make it so that if I check off a certain combination of items, when I click the Go button it takes me to the correct screen. For example, if I check the banana and orange and press Go, it takes me to page A, but if I select just banana and press Go, it takes me to page B, and so on. What actually happens: No matter what I check, when I press Go it goes to the page I have linked to Go. What I’ve tried: I am new at this and I guess I just don’t understand how to actually code checkboxes vs. making it appear as if checking the boxes has any impact on what screen comes up when the Go button is pressed. Hope this makes sense
Like with everything in App Lab, there are probably a number of ways to make it work. You would want to make sure to use the id of each checkbox and look to see if it is checked and assign that status to a variable. Then, you can use some conditional statements to move to certain screens based on which checkboxes are checked.
Some pseudo code …
On the event of the button being clicked.
var a = getProperty of first check box, “checked”)
var b = getProperty of 2nd check box …
etc.
If a is checked and be is not checked go to screen C. . If a and b are both checked go to screen D, etc.
OR … assign each checkbox a numerical value and use conditionals to open a screen based on the point value of all checked boxes.
Does this help a little?
Here’s a linkto a youtube video showing a few examples of using checkboxes. If you search the forum for checkboxes, you will find some other examples as well, but feel free to check back in if you start adding more to your project and it isn’t working how you intend it to.