Two students, pair programming, basically same app and code. One shows output, the other doesn’t. I am stumped at the moment why. Again, Unit 4 Lesson 12 Decision Maker.
This one works:
This one doesn’t:
What am I missing?
Two students, pair programming, basically same app and code. One shows output, the other doesn’t. I am stumped at the moment why. Again, Unit 4 Lesson 12 Decision Maker.
This one works:
This one doesn’t:
What am I missing?
Hello @darrin.patterson,
there is a lot wrong with your project you have shown
var workType;
var intensityLevel;
// why is there 2 of these??
onEvent("upperOrlowerDropdown", "click", function( ) {
workType = getText("upperOrlowerDropdown");
Combinations();
});
// onEvent("upperOrlowerDropdown", "click", function( ) {
// lowerBody = getText("upperOrlowerDropdown");
// Combinations();
// });
// why is there 3 of these??
// onEvent("intensityLevel", "click", function( ) {
// hardIntensity = getText("intensityLevel");
// Combinations();
// });
// onEvent("intensityLevel", "click", function( ) {
// hardIntensity = getText("intensityLevel");
// Combinations();
// });
// onEvent("intensityLevel", "click", function( ) {
// easyIntensity = getText("intensityLevel");
// Combinations();
// });
onEvent("easyOrhardDropdown", "click", function( ) {
intensityLevel = getText("easyOrhardDropdown");
Combinations();
});
function Combinations() {
if (workType == "Upper-body" && intensityLevel == "Hard") {
setText("textBox", "\n\n\n\nBench Presses, Overhead Presses, Bicep Curls, and Arm Raises.");
} else if ((workType == "Upper-body" && intensityLevel == "Easy")) {
setText("textBox", "\n\n\n\nPush-Ups, Planks, Chin Ups, and Pull Ups.");
} else if ((workType == "Lower-body" && intensityLevel == "Hard")) {
setText("textBox", "\n\n\n\nLeg Curls, Dead Lifts, Front Squats, and Leg Presses.");
} else if ((workType == "Lower-body" && intensityLevel == "Easy")) {
setText("textBox", "\n\n\n\nWalking Lunges, Glute Bridge, Squats, and Calf Raises.");
}
}
it’d probably be best to let you figure out how it was solved either that or someone else will elaborate on why
Thank you again for taking the time to help me help my student.
varrience strikes again and solved the issue. I was unsure how, but now I see where the flaws were in my student’s code. Thank you again for your help.