App lab help debugging

[A student created this app but I need help trying to get it work, it works for a while an then it goes back to showing one outfit at the very end instead of changing outfits.]

Link to the project or level: [Code.org - App Lab]
What I expect to happen: [when items are selected different outfits are supposed to be outputed on the final screen (screen3) ]
What actually happens: [The app works for a a little bit and then continues to go back to one picture.]
What I’ve tried: [tried set property after function, tried to set image to final screen, tried to follow code from checkbox output Code.org - App Lab }

@bflanders,

If you look at the code, a lot of the code isn’t ever run. For example, the block of code that runs when “trendy_check” changes will only run if the trendy checkbox is checked. (Checking the checkbox is the event).

I think your student wants the trendy picture hidden if it isn’t checked, but it will never get hidden because that code never runs (it only runs when there is a change of status in the trendy check checkbox).

So, you may want to have them look and see if they can find an event that will execute and check all of the checkboxes at once.

They may also want to consider what will happen if multiple boxes are checked (ie, only the top image will show up). A different kind of input may be a better choice.

Hope this helps a little. Let us know if we can help further.

Mike

Michael,

Thank you so much for your help, I was looking at a YouTube video on checkboxes and does the student need to create a variable for each item?

Could you also send me a sample code of what this would look like if you have a chance.

Thanks,

Brenda

They could use a variable and it looks like they are currently. I may use a different input option (such as a drop down) which would only allow for one choice at a time. If you use multiple check boxes, you would have to probably use some conditional statements and more results. For example, if both trendy and sporty are checked, use this outfit. If only one is checked use this outfit … it could get pretty overwhelming pretty quick to try and figure out all the options.

Mike

Many Thanks!!

Brenda

Michael,

Sorry to bother you again but I my students got to involved in their Apps and I want to help them work but how do you do multiple dropdown boxes with a finish endpoint?

Here is the code:

Magnesium 2 - App Lab (code.org)

If it is not involved maybe we can make it work. I was thinking all the events would go in the event of the finish button but it does not work.

Thanks,

Brenda Flanders

@bflanders,

A few things. The way they have it coded now (if functioning), it would immediately change screens after the first dropdown is selected. It isn’t quite working now because it should use the “getText” block rather than the “getChecked” block in the comparisons. You could use this to choose something from the first dropdown which could them take them to a screen with the 2nd dropdown, etc.

If they go that route, my suggestion would be to have them get a sheet of paper and map out the final results. What are the final screens going to be? Then have them draw a path of how you would get there. If there are three drop downs and each drop down offers 3 choices, that is in theory up to 27 different final landing screens (3 x 3 x 3) … if you want a different landing screen for each possible combination which could be a lot of coding.

Another option would be similar to the link below where each choice awards “points” towards a final screen. In this option, I would still have them map it out, but you can see how making one choice may score points for multiple final choices and in the end, the highest score determines the final result.

There are probably other ways to do it and there may be a way to code it so the finish button does the calculations, but just my 2 cents.

Mike

Thank you, I learn better from seeing the examples.

Next year my 8th graders are going to simple apps like the ones on App Lap training and modify it.

Thanks for your help,

Brenda

1 Like