Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I recently answered a question here: bubble sort a character array in alphabetic order in c

I felt that due to the nature of the code, the best way to help the OP learn would be to provide him with improved code. I don't typically do that, but in this case I felt it was appropriate so that his own code could be used as an example of how to incrementally fix and improve code for style + clarity.

However after I posted the answer and it was accepted, I saw in the comments that the question was actually for homework! So I inadvertently provided the answer to a homework question.

What is the best course of action to take in this situation? Should I leave the answer up so that it benefits others? Should I delete the answer (even though the OP has seen it) because it gives away a homework answer?

Can we have a system in place that clearly prompts users to indicate if a question is homework? I feel as though I've been duped into spoon-feeding the OP an answer to his homework.

share|improve this question
It's too late now. The OP posted a valid question that you answered. If (s)he copied your code they may have cheated but, meh, that's their responsibility. You're not here to police every possible student and what they might do. – ben is uǝq backwards Mar 21 '12 at 18:38
@Ben: Thanks. That's a good way of looking at it. – Cam Mar 21 '12 at 18:40
Right, I don't understand how it's your problem if someone wants to cheat on their homework. @Ben: That's answer material. He can't accept your comment. – Cody Gray Mar 21 '12 at 21:25
Thank you @CodyGray, done. – ben is uǝq backwards Mar 21 '12 at 21:39
up vote 8 down vote accepted

It's too late now... The OP posted a valid question that you answered, generously I think. If (s)he copied your code they may have cheated but, meh, that's their responsibility. You're not here to police every possible student and what they might do.

Further reading: How do I ask and answer homework questions?

share|improve this answer

I wouldn't worry too much about it. Many CS departments these days run all code submitted through a plagiarism checking service, much like is done with papers in other departments. Any commercial service worth it's salt is scraping code off of Stack Overflow into it's vault of samples.

share|improve this answer
Those plagiarism services are shady. They don't ask before pulling the content down, nor do they respect any licensing or robots.txt. You put any sort of .doc up there and they snarf it. I actively inhibited those services when I ran my own sites. They would get never-ending streams, bad redirects, intentionally munged code, Project Gutenberg texts. – user7116 Mar 21 '12 at 22:53
@sixlettervariables - Agreed, but within the context of this question, their nefarious sample collection process should benefit the OP'concern. That said, I like the idea of putting in caltrops like that to hinder their crawling and scraping. – cdeszaq Mar 22 '12 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .