Why is my self-checking code SOMETIMES failing me here?

I’ve been working on an activity for Chain Rule, and have screens with LOTS of randomization and ability to endlessly generate new problems, so that they can essentially have unlimited practice. This has proved to make the self-checking tricky, but I have been able to work through all of those quirks, or so I thought…

So I’m testing this screen and SOMETIMES the self-check is reading the result as wrong when it is definitely correct. Other times, even with the same structure for outside/inside function, it reads it as correct. I’ve been trying to troubleshoot, including setting the parameters in the graph component to see what the “check values” were giving, and then evaluating the “wrong” entry at those same values, and it is all lining up - I don’t see why it is reading “incorrect” on just SOME of the generated functions!

Here are some examples:
It read this wrong:

But this correct:

And also read this wrong:

…but other problems with the sin(kx) inside function, it read correctly.

I am at my wits end and so frustrated! :slightly_frowning_face: I’ve been working on this (and using increasingly complex functions as they advance screens, so this will be the “finale” screen), and am really happy with how the activity is shaping up, except for this!

I seem to have solved the problem by changing the way I check the results and using a “test value <0.001” rather than a rounded value =0:

I guess it had something to do with the rounding. I added the “fixed” version to the activity linked above.

I think the lesson is to leave epsilon-wiggle-room in the correctness check! :woman_shrugging:

Maybe not so much the rounding itself that’s the problem, but the way Desmos calculates the derivatives.

1 Like

Hmmmm… could be. As part of my troubleshooting, I set the parameters in the graph and computed the test values, and then separately evaluated the “wrong” expression at those same values, and the results given were exactly the same. So… I’m not really sure what that means, lol! :thinking: :joy: But the fixed version seems to be reliable. :blush: (at least until I discover the next bug… )

It might be worth knowing that students can bypass doing any differentiation by just asking Desmos to find the derivative. I’m not sure of the best solution to this problem, but maybe don’t use this in a high stakes context.

1 Like

Thanks for the reminder - good point! I don’t intend to use this for anything that is graded for more than completion and effort, and at least part of it, we’ll be doing in class so I can keep an eye on what they’re up to, lol.

When it comes to derivative problems, I have resigned myself to the fact that they can easily cheat the answers - between Wolfram, Derivative-calculator, Photomath, etc… :roll_eyes: So they will use the resources I give them to learn the derivative rules because, eventually, I WILL require them to demonstrate proficiency on a proctored assessment.

1 Like