r/learnpython • • 5d ago

CS teacher here: how are you keeping your kids from just copy-pasting ChatGPT answers when learning logic/coding?

[removed]

15 Upvotes

60 comments sorted by

36

u/d1ll1gaf 5d ago

Have your students explain their code to you verbally, focusing your questions not on what the code does but why they chose that way of doing it.

4

u/Kitchen-Touch-3288 5d ago

I'd suggest doing that and for the ones that are not so extrovert but with pen and paper (if they want to). The ones that want to learn but have extreme anxiety will apreciate it greatly.

8

u/civil_peace2022 5d ago

I had a teacher in grade 6 that had every student do public speaking every week, researching about some random topic. Honestly was the best thing ever. it would have been fantastic if that could have continued through high school.

If they don't learn public speaking in high school where the stakes are zero, where will they learn it? Its a very useful life skill.

Diagraming code on a black board / white board and explaining it is useful too.

3

u/Kitchen-Touch-3288 5d ago

it's true, but folks with anxiety problems won't even show up that day. that might be even a whole anothe issue to be honest so nvm,

2

u/pleaseineedanadvice 5d ago

Either they grow up or it means they re dont fit science

1

u/Kitchen-Touch-3288 5d ago

they won't fit life lol, nobody cares for mental issues cause they are not visible.

7

u/Nomapos 5d ago

Why don't you just provide a small searchable offline wiki with simple tutorials, examples, etc and then simply shut off the Internet?

7

u/Wonderful-Habit-139 5d ago

Used to be called the “man” when coding in C…

1

u/backfire10z 5d ago

That doesn’t help at home lol

-2

u/Nomapos 5d ago

If you're tech affine enough to teach a kid, you're tech affine enough to ban the computer from the network while the kid is learning. Or block the domains from AI tools, it's not like there's that many of them. Or simply unplug the router.

Don't know where you can possibly be struggling here, to be honest

3

u/dicoxbeco 5d ago

They are Python course instructors, not sysadmins. A middle school teacher having to contest approval for modifying firewall rules or requesting some Optiplex or Elitedesk for selfhosting to K-12 IT sounds like using a shotgun on a dartboard.

1

u/Nomapos 5d ago

The guy I'm replying to said *at home*.

I don't really see the problem in a school either. Using AI to create stuff is extremely easy. Might as well just ban the domains as a whole.

7

u/VioletWillows88 5d ago

Woah! I just wanna point out how cool it is that a high school (assuming it’s high school) offers Python learning in a computer science class. My high school did not offer that.

2

u/POGtastic itertools evangelist 5d ago

AP Computer Science is still taught in Java, but a lot of introductory classes have switched from C++ to Python.

1

u/johndoe60610 5d ago

Yep, mine taught PASCAL

4

u/NerdyWeightLifter 5d ago

Consider two distinct learning objectives:

  1. Learn to use Python themselves. Provide an application in which they can code and run Python programs, where every interaction is logged and the log can be replayed. They submit the log as the assignment result.
  2. AI Assisted Software Development - how they're really going to do it after your class. Give much harder problems with much latitude for creative variations. They should submit the full log of their Codex or Claude Code session as the assignment, along with the resulting solution.

1

u/NerdyWeightLifter 5d ago

And if you don't have the application needed to implement scenario #1, you can make it using scenario #2 in an afternoon.

3

u/Wanchor1 5d ago

Pen and paper

3

u/POGtastic itertools evangelist 5d ago

what actually works for your kids?

"I have a Smith-Corona Cornet that is in a heavy plastic case under the bed in the guest room. If I catch you using AI to do your homework, you will time-travel 50 years into the past."

I also have a few fountain pens lying around, so we can actually travel even farther back in time if needed.

3

u/backfire10z 5d ago

I had to look up what that was lol. (It’s a typewriter for those like me)

2

u/POGtastic itertools evangelist 5d ago

I got it for free off of Craigslist; a nice old lady had it lying around and basically said "get this the heck out of my house." I restored it to mostly working order, with the exception of a misaligned slug that doesn't print the number 8 or asterisks very well. To fix it, I need a soldering iron, which I have, and a steady hand, which I don't have.

2

u/backfire10z 5d ago

That’s pretty cool

3

u/LavishnessFew7882 5d ago

It is maybe unpopular but I think handwritten quizzes where they have to write out a function that does xyz thing will make them retain it better and feel more confident to try things without having an llm do it for them.

3

u/leostotch 5d ago

Have them walk you through their code verbally, telling you what they are doing, how, and why.

2

u/jmacey 5d ago

I use TDD, get them to plan and write the test. Then let the AI write the code to pass the test, see how good or bad it is, with a good code review, then repeat.

Also get them all to use the same prompt (or variant of) and compare the results to see the non-deterministic responses.

There a quite a few good articles / papers on various areas and it is something I am doing quite a lot of work on (it's difficult as you have to factor in so much including digital poverty).

Have a look at https://arxiv.org/pdf/2604.17460 https://cacm.acm.org/blogcacm/five-key-principles-to-update-cs-education-in-the-agentic-coding-era/ also https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6097646 the ideas of "Cognitive Surrender" is a big part of this (I know I do it! when I just let the ai do it for me!).

2

u/nacnud_uk 5d ago

Get them super efficient in AI prompt writing. That will be their job. They are not going to be coding line by line any more.

Get them able to ask about the logic breakdown of a problem, that kind of thing. Get them to be able to understand design, and ask the questions that matter.

I'd not overly worry about getting them to type

void main ( void );

2

u/onerichmeyer 5d ago

I've heard of teachers putting in hidden poison commands in assignments which causes the AI to write the output in a way that makes it easily detectable as being AI. The hidden text is usually white on a white background so it isn't visible to the students but the ai sees it

2

u/neuralbeans 5d ago edited 5d ago

It doesn't work anymore. Apparently AIs warn you about it now.

2

u/Expensive-Bear-1376 5d ago

About two weeks ago I still saw someone posting solution posts on LeetCode with variables like stiofcjsiwi just because somewhere hidden on the page was an instruction to do that.

1

u/onerichmeyer 5d ago

Good to know. I've not tried it myself.

1

u/onerichmeyer 5d ago

I've noticed that when I ask AI to write programs that regardless of the model they tend to use the exact same variable names and program flow. Particularly for well known student level programming problems. If every student program looked like AI generates then it mostly likely is.

1

u/TipIll3652 5d ago

Have them hand write the algorithm.

1

u/silfin 5d ago

There's a few ways I've had some success with.

Though I mostly have slightly older students (14-18) that have chosen to take computer science while having plenty of other options, so I have a largely well motivated group.

First off all I've let them know that developers who are better at programming tend to also get better results from Ai, so even if they expect to always use Ai in the future there's still a large benefit to learning the basics well.

Second, they are allowed to use Ai for any graded assignment, as long as they also let me know what they used it for and what prompts they used. If their AI use prevents me from assessing if they achieved the learning goals we have a chat to see if they understand what they submitted.

1

u/Xidium426 5d ago

Could do what I had to do in college 15 years ago, hand written code on tests.

Homework was "turn in your source code" and the teacher inspected it, but tests and mid-terms had large hand written sections that made up a large part of the grade. We didn't get docked for small things like a missing comma or regular stuff Intellisense would catch, they were looking to see that we had the general understanding of the languages.

At least I didn't have to hand write binary like the teacher made his first classes do back in the 80s...

1

u/victotronics 5d ago

If the code looks too good: have them explain it to you.

If you've given them a coding assignment, next week have them do a very similar problem, but with pen & paper. The ones that cheat will be obvious to you. And if the pen/paper solution is crap, also detract points from the "coded" solution.

1

u/Aceofsquares_orig 5d ago

Flipped classroom. In class exams. Pen and paper. Any take home assessments should be considered low scoring. With a small number of individuals, you can do verbal assessments but I'll leave that to you to decide. Lastly, don't listen to those people that say AI is the new CS or programming. The person behind the screen still need to know if the output fits the problem/code base which means they still need to be able to read code and any issues that AI produces, and there are plenty, they still need to be able to write code. Only after they have a decent grasp on programming and problem solving should they be introduced to AI assisted development. Not before.

1

u/_dissociative 1d ago

Having students explain each line of a solution or defend their debugging choice can reveal much more than a working code submission. Duro is an AI native API first PLM focused on connected engineering workflows.

1

u/MiniMages 5d ago

I have forced myself to write code on paper when I was trying to learn coding.

1

u/pleaseineedanadvice 5d ago

It s honestly not a good way to do it. I ve did at well but exams on paper while coding are too much of "who can avoid to forgett the columns" explaining verbally works

1

u/MiniMages 5d ago

I needed to force myself to remember basic stuff. Too many times I will figure out what and how i want to do something and then have no idea what to write. My brain would just be blank.

1

u/Slickshot_Showoff 5d ago

Im not a prefessional, but i do have a career tech school training in software development.

Honestly, the best thing you can do it teach them the simple things like how if/then/or/xor works, how loops work, the basics of variables, functions, libraries, and dictionaries.

But at the end of the day, AI is a new CS field, and by trying to tell them never to use you... you are only handicapping your students for the future.

The best thing here would be to incorporate a free frontier model into your classroom time, actually explain to the kids how prompts work (i.e. Role, Goal, Subject, Data, and Format) this gives a much stronger starting position for leveraging AI in a way that creates lasting lessons.

That doesnt mean go crazy and use AI for everything. Teach them basic powershell commands, how to spot easy malware, how to un-install norton, using task manager and setting up something like MSI monitor to track utilaztion.

1

u/neuralbeans 5d ago

Ask this in r/professors

I don't see how your debugging tasks can't be be done with AI as well.

0

u/armywalrus 5d ago edited 5d ago

When I learned python, my instructor told us we had to be "Google warriors." He showed us how to check the documentation and forums. In real life few of us code from scratch - and AI is not going away. My company wants us to use it. As far as they are concerned, it increases efficiency. And... . It can. Have you thought about maybe structuring your tests around what they need ro know to succeed and be competitive when everyone has ai? Maybe some multiple choice questions where they pick what the best tool is for a given scenario. Maybe some bad code to run and they have to look in the documentation and tell you what the error means. Maybe have them design a coding project where they have to apply their knowledge to design one, document what libraries they use and why, what errors they got and what they did to fix them. Things where they are thinking and applying knowledge that forces them to use AI as a tool only. Maybe we need to get creative in a different world. Maybe a RegEx challenge where they have to match a line of code pulled from Nasa.com or something, and cite the RegEx documentation, with extra credit given for any additional documented answers.

1

u/LayotFctor 5d ago edited 5d ago

But that's not the case here. You had your foundational lessons done with no AI and they're behind you. Using AI now will not remove the foundations you spent years drilling into your brain. It might get duller over time, but it never fully goes away.

People who use AI from day 1 have not learned those foundations.

I've met people with CS degrees who cannot even understand why a variable initated inside a loop causes the variable to not update correctly, because they haven't even wrapped their brains around a loop at all.

Ya sure AI improves efficiency. For us who've been through our training legitimately. The newbies who skipped all their fundamentals with AI are no better than literally anyone off the streets who can type. OP is a teacher who actually wants their kids not to waste their time.

0

u/armywalrus 5d ago

Did you read the whole comment?

0

u/LayotFctor 5d ago edited 5d ago

Did you read mine?

My point is that you're glossing over the newbies complete lack of fundamentals, because you have the fundamentals yourself. The basics like understanding boolean logic or nested loops is important work that requires real effort.

Your recommendation seems to be to skip all of this and go straight to libraries, which is what I don't agree with. You can google "what's the best library", but you can't make sense of fundamentals without putting in real work. You can't even understand code correctly without fundamentals.

And if you're ok with kids dropping fundementals completely, then what's even the point of going to programming class? Might as well just start vibecoding, no need for formal training whatsoever.

0

u/armywalrus 4d ago

Yes. Thats why I asked. It doesn't seem like you did. I didn't gloss over anything.

-2

u/jferments 5d ago

Teach them to code with AI. Just like the vast majority of developers aren't writing x86 assembly, in the future, the majority of developers will not be hand-writing source code. AI writes better code than 99% of developers at this point anyway.

The most important thing to do is teach students software engineering principles, how to design applications at the architectural level, and how to design good test infrastructure. Let a bot do the coding grunt work. Coding was never the interesting part of software development anyway.

5

u/ghostfaceschiller 5d ago

Every time I see someone say something like this: "Teach them how to design applications at the architectural level, and how to design good test infrastructure."

I have to ask - why is it that you think the AI won't be able to do that better than the human as well? If not already, then in the next 1-2 years?

1

u/CastMyGame 5d ago

We don’t know the answer to that yet. There should always be a level of decision making that a human should need to input.

We don’t care who could do mental math at an arithmetic level once the calculator was invented. I think we need to find what that equates to with AI in the end but I would say we are in the process of finding that out right now

1

u/ghostfaceschiller 5d ago

“There should always be a level of decision making that a human should need to input”

That would be nice, but I haven’t seen anything that indicates that will remain true

1

u/SearchContinues 5d ago

By that logic, in 3-4 years you'll just ask AI for an application that does a thing. 2 years after that you ask AI what you need. There is a version of the future where you don't have people making software as a product since it is just AI giving your answers . I'm not saying that is even wrong, but you can either ride a wave or get left behind and go into another field.

-1

u/chuckycastle 5d ago

Schools used to teach the Dewey decimal system. Schools should do a better job of teaching how to use AI-assisted coding tools.

How did math teachers deal with calculators? How did art teachers deal with Photoshop and DSLRs? Point is: teach them how to properly use the tools the world around them uses.

4

u/POGtastic itertools evangelist 5d ago

How did math teachers deal with calculators?

They moved heavily to in-class assessments (exams) and forbid calculators for them. Applied math then introduces stuff like computer algebra systems and numerical analysis.

A CS course sequence that functions similarly to mathematics would make the usual take-home assignments very low-stakes, and then base most of the grade on writing projects in testing centers with no outside resources allowed. Then upper-division electives would start introducing additional tooling.

I'm not saying that we should do that. I have no idea how we should be teaching software engineers today. I will say that the quality of candidate who shows up to interviews has been steadily dropping through the floor, (e.g. much more people with advanced degrees who cannot code FizzBuzz) and that indicates that a lot of people who would have failed to attain a degree are now attaining them.

1

u/chuckycastle 4d ago

Happy cake day! I love your take and definitely agree. That’s the whole point of my response: let’s think about how we evolve teaching in an AI-centric era.

Re: the SE problem, I think interviews should evolve, as well. It’d be silly to not expect seasoned devs to appreciate and leverage Claude or Codex to make them more efficient - so that’s what employers should be looking for, imho.

3

u/ghostfaceschiller 5d ago

This "tool" can pursue tasks across domains, and use tools of its own. It can decide that the given task might not actually be the right approach, and change course.

Bit different than a calculator or photoshop.

In fact the same "tool" that can code better than you also knows how to use photoshop. And Excel, and Blender, and...

5

u/Symbology451 5d ago

In my opinion, the point of a CS class for 10-15 year olds is not to teach them to use tools or even how to code at all, but rather how to think through problems.

The issue with AI is that you delegate a lot of the thinking to the tool and don’t actually learn how to actually address the problem at hand. It’s very much the same as having your dad do your math homework for you; you get the right answer and learn nothing.

0

u/chuckycastle 4d ago

I think that’s what we romantics want. The reality is that even Python wants people to Automate the Boring Stuff - I’d imagine they’re delighted. If we want to teach critical thinking, then let’s teach critical thinking. Don’t dress it up as a silly “coding” project when that’s not what it’s meant to be. We have plenty of garbage out there where people are profiting from “teaching coding” by having kids follow step-by-step instructions on blockly or scratch; that’s not coding, either.

0

u/Expensive-Bear-1376 5d ago

and learn zero actual problem-solving

So what? How is that your problem?

0

u/[deleted] 5d ago

[deleted] — view deleted comment