This year, I’ve had a number of students come up with a clever solution for dealing with certain buttons that need to do the same things over and over. What they’ve done is defined a function that took parameters, and then called this function with the parameters necessary to create onEvents (event listeners)
As you can see in the following project, the student created a buttonChangeScreen function line 109 simply to switch screens. The function is called on lines 23, 24, 25, then again on 42, 43.
The answers to the quiz are: Q1) Carbon, Q2) Sulfur
My question is - is this good programming practice?! It doesn’t seem like it’s really “event driven” programming… it’s more like sequential programming before anything else!
I’m a little behind on looking at my formative assessments, and students are working on a bigger summative project now. Not sure whether to let this fly.
Thanks in advance!