Unit 4 Lesson 13 bubble 4 on student project: redefinition of " x" and Read Only?

[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: [https://studio.code.org/s/csp4-2020/stage/13/puzzle/4?section_id=2843583&user_id=20293716&viewAs=Teacher]
What I expect to happen: [expected: get text of location “chooser2”]
What actually happens: [It retrieves the text but there is a yellow triangle stating “Read only” and is seems to be in conjunction with my variable that has a yellow triangle for var location (error message redefinition of “location”]
What I’ve tried: [renamed the var with location1]


Unfortunately I am unable to see the work of your students via that link. (It just brings me to my version of stage 13 puzzle 4!) In order for others to see it, would you please go to that level and click ‘share’, then paste the link in this thread?

It looks like location is already defined. I have submitted a bug about speed already having a definition. There could be others. Anything the kids might want to name a variable probably shouldn’t already have a definition.

Okay, I think he had an issue with global and local names being similar. He fixed that but now here is the thing that is tripping us

Link to the project or level: [https://studio.code.org/projects/applab/_khHHRYVNW2x-ZoIOR4zeFHMkbscTFonf5-2CDTODnU] provide the shared link
What I expect to happen: [Display the restaurant name when called on]
What actually happens: [Displays the same name whenever I do a different option than the default setting ("Itallian, 5 miles away, ")] What I’ve tried: [I deleted the code with the same names to test if it worked with the 3 options, if (type=="Itallian" && location1== "5 miles away" && cost== "") {
setText(“result_area”, “You would like TonyD’s New York Pizza & Restaurant”);
} else if (type==“Mexican” && location1== “5 miles away” && cost== “") { setText("result_area", "You would like Salsa's"); } else if (type=="Chinese" && location1== "5 miles away" && cost== "”) {
This code works itself, but whenever the full code is added, the restaurant name defaults to “You would like TonyD’s New York Pizza & Restaurant”. ]

OMG… I feel like such a rookie looking for coding issues… It was, but an easy fix by talking it out

You are now officially a computer programmer. To complete your training you will need to read The Hitchhiker’s Guide to the Galaxy and watch the movie Starship Troopers.