Why is "Show Debug Commands" not visible/possible for students? (Unit 3)

When I look at the level that has a “For Teachers Only” link and then click on the “Example Solution 1” there is an actualy a debugger available (step in/out, watch variables). I was pretty excited to see this, alas I can not figure out how to access this at any other time in Code Studio. I’m sure I’m doing something wrong because it makes no sense that in the lesson on debugging (Unit 3 Lesson 6 in csp3-2024), for instance, the students would not have access to this tool.

Link to lesson: Code.org

How can I and my students access the Debug Commands for their app development?

thank you,
Kevin

Debugger:

Finding that view:

Me right now: :exploding_head: :sob: :sob: :sob:

Howdy @krich,

Interesting i think this may be a bug you should possibly reach out to code.org’s support team about the issue if you haven’t already

although this solution isn’t currently ideal you can setup your own watch expression in the meantime while awaiting a reply from the support team

var a = "text";
setInterval(function(){
  console.log(a);
}, 3e2)

or if you wish to watch every time it’s updated you could possibly also do

function setWatchVar(n, v) {
	var tmpset = v;
    Object.defineProperty(window, n, {
        set: function(v) {
            console.log(n + " was set to " + v);
            return tmpset = v;
        },
        get: function(v) {
            return tmpset;
        }
    })
}
setWatchVar("a", 0);
a = 2;

you can adjust the time as needed the measurement is within ms though so be careful and hope this band aid will be of some use to you

Varrience

@krich The enhanced debugging tool is introduced to the students in U4L3 (Variables Practice) when they learn about Local and Global Scope. Students don’t need the step tools based on the instructional goals for unit 3.

@varrience I agree that this is a bug or at least a signficant design oversight. Debuggers, even rudimentary ones, are powerful tools that I’d love to give my students the opportunity to use as soon as we talk about debugging. I’ve seen too many engineers that never learned even the basics of a debugger because they first learned to put log messages in the code. This adversely impacted their productivity (when all you have is a hammer, everything is a nail). Thank you for your help!

Kevin

@tstone Thank you for the response. I’m really disappointed to hear that the debugger is unavailalble for a lesson on debugging (and then the app development). Even just the rudimentary ability to set a breakpoint and then step line by line is useful. I’m perplexed as to why this is not (at least optionally at the instructors discretion) made available to the students. I understand trying not to overwhelm the students but I’d much rather they’d learned how to use a very basic debugger as early as possible, it is such a valuable tool to anyone developing code. :sleepy:

thank you,
Kevin