# How to share solutions in a way they won't get uploaded

I teach a computer science course and I like to share sample solutions to assignments after the assignment is due. I think it helps students learn to see a solution sheet with sample solutions and notes on common mistakes, immediately after the assignment is due. However, I face all too much cheating: some students upload these solutions to websites like Course Hero, and then when I reuse those problems in a future semester, now it's all too easy and tempting for other students to search and find those solutions and copy from them. I would prefer to avoid that situation.

Are there any technical solutions that would allow me to share solutions with students, but in a way that makes it more difficult for them to share the solutions with others?

Right now I share solutions as a PDF. Unfortunately it's very easy to download that PDF and then upload it to a site like CourseHero. Is there some better way to allow students to view solutions, while making it harder for students to upload them elsewhere? I know I'm not going to make it impossible -- if nothing else, students can take a sequence of screenshots -- but if I make it tedious enough, then I suspect that would help. I suspect many of the students who upload solutions are not doing it to be malicious, but because of dark patterns at sites like CourseHero that pressure them to upload something, so if I can make it more onerous to upload solutions, they might upload something else instead.

Does anyone know of any technology that might meet this need?

I'm not interested in answers that tell me to never reuse problems in a future semester. I ask for your trust that I am aware of the pedagogical tradeoffs and have valid reasons to do so. I am willing to elaborate if you feel you need to hear that, but I suspect it is a tangent.

• This is such a central question. – Ben I. Sep 11 '20 at 2:26
• You can use unsee.cc - But people will take screenshots. – Daniel Sep 11 '20 at 9:01
• If people can in any way see the solution, they can reproduce it in whatever form they want. You are looking for the holy grail of DRM, which nobody has found thus far. – Polygnome Sep 11 '20 at 23:14
• @Polygnome, I can understand where you would get that impression, but no, I am not. See my comments here. – D.W. Sep 11 '20 at 23:16
• @Polygnome not only is it not hound, we have found a mathematical prof of its non existence. I teach about these ideas in my e-safety class. If you can see it then you can copy it. Any attempt to make it harder to copy will come fowl of anti-discrimination / accessibility laws. – ctrl-alt-delor Sep 19 '20 at 22:15

I don't have real answers, and I suspect there are none. I also reuse prompts, if only because good ones are almost absurdly hard to come up with, write-ups and supporting code take time, etc, etc, etc.

I've taken a series of steps to mitigate the cheating. Some of these are peculiar to my own situation, and may not translate directly to another context, but they also illustrate the type of thinking I use when I consider this particular (and particularly intractable) problem.

The first is to not weigh labs heavily in the grading. This sucks, because they are a huge portion of both the work and the learning in the class, but they are not trustworthy as high-stakes assessments if you do your assessment at the end by looking at the final result. (There is genuinely no getting around this fact.)

I explain this to my students, and encourage them, then, to use the labs as learning opportunities. The brunt of their grade comes from tests and quizzes. The labs help them to prepare.

Next I talk about plagiarism. I require them to keep in comments links to stackoverflow, indications of where friends have helped them, and any other sources they used. I point out that even very veteran software developers use stack overflow regularly, and I assure them that this sort of help is not cheating as long as it is cited.

Next, I make sure that my lab write-ups are extremely clear. Cheating typically centers around nervousness more than laziness. When students feel like they are not quite sure how to be successful, but nevertheless fear the consequences of failure, cheating is a natural outcome.

Then I have in-class working sessions where I go around and observe how the students are doing, and help them get un-stuck. This allows me to see regular progress, and helps the students to learn from the labs.

Finally, I grade some of the labs as code-review interviews, and award a harsh, current grade, and a second, more generous grade for once the required refactoring is complete.

I don't believe myself in thinking that this entirely nips the problem in the bud, but I have reason to believe that the outright copying is minimal in this setup.

Jack Applin (a two time winner of the Obfuscated C contest) at Colorado State University has created a Perl script called shadow. It takes any text file and spits out an HTML file as output that is readable in a browser, but not much else. Essentially it creates an HTML table, but does it in a way that is is not printable, nor copy-able. The file can have an expiration date so it won't render after a specified time. Different cells span different number of rows and columns and have different number of characters in them. Characters in cells may be rendered both left to right and right to left. Random characters are inserted in the output but rendered as non visible. Every character is encoded, so one doesn't see any of the original file's characters in the output file.

EDIT: While OCR can read the text, the benefit of the obfuscation is in the "wow" factor for students. When they try to cut/copy and see what happens, they immediately start asking questions on how the page was produced and declare they are going to unscramble it. Always nice to get students asking questions.

Jack has given me permission to post the script and you may find it at http://www.cs.colostate.edu/~fsieker/shadow .

• You can take a screenshot to recover a raster image, and OCR it. This is not much better than just posting the code as a raster image. This program may be valuable against web scraping; it will likely defeat web scraping web crawlers that can steal text from images, but don't contain full blown HTML rendering logic. – Kaz Sep 11 '20 at 8:05
• If anyone is interested, Jack has given me permission to post it and I can provide the link to download the script and give it a try. Yes, please! – Eric Duminil Sep 11 '20 at 8:27
• Then you get a law suet from the blind kid, because she can not read it. – ctrl-alt-delor Sep 19 '20 at 22:07
• Thanks a lot for the script! The obfuscated result is hilarious. – Eric Duminil Sep 21 '20 at 6:47

I'm not interested in answers that tell me to never reuse problems in a future semester.

Well in that case the answer is simple: you can't stop people from sharing these example solutions.

Obfuscation or any kind of self destructing documents are trivially circumvented by just taking a screenshot.

If you could block taking screenshots in the OS you couldn't block the user from running it in a VM and screenshotting that.

If you'd detect and block VMs they could take a picture with a phone.

If you'd only show them in a protected environment and forbid phones they could just write things down manually.

This is a race to the bottom you could never win.

• I appreciate your taking the time to write an answer, but I don't think this responds to the question. As I already wrote in my question, "I know I'm not going to make it impossible -- if nothing else, students can take a sequence of screenshots -- but if I make it tedious enough, then I suspect that would help." I'm not expecting that I will be able to stop students from doing it. (continued) – D.W. Sep 11 '20 at 8:40
• I'm asking if there is a way that will raise the bar... for instance, so that students are more likely to upload something else, when CourseHero prompts them to upload 10 documents to unlock their account. (What a business model.) So what I'm asking for is something less than what you seem to have assumed. Perhaps it is still impossible, but I don't think your arguments in this answer demonstrate that. – D.W. Sep 11 '20 at 8:40
• I'm familiar with these type of arguments regarding the problems with DRM but I don't think they answer the question that I am asking. – D.W. Sep 11 '20 at 8:44
• @D.W. I´m sorry that you don´t want to hear it, but anything you share online is public. Especially when we are talking about Cs-Students here. Your question is like "How do I stop the sun from shining" so any answer will be unsatisfactory. – Daniel Sep 11 '20 at 9:11
• I specifically answered in this way to illustrate that no matter how high you raise the bar, it can be trivially circumvented. Coursehero's business model etc is just a red herring, students will share among themselves through shared USB sticks and dropbox and the likes anyway, trying to prevent this is impossible. – somethingsomething Sep 11 '20 at 9:11

What about a barium meal test?

Let's say you have 8 questions that can be ordered in any way, that's 8! = 40,320 different combinations.

Or let's say you have a line like the following:

char* res = fun(a, (void*) b);

Rewrite it to something like this:

char *res=fun ( a,(void *)b ) ;

You now have 6 places which you can vary, for 2^6 = 64 combinations.

Then write something like this at the top of the instructions: "The wording and ordering of the questions are slightly different in each PDF. It is considered cheating to upload solutions online. If you do it, you will be caught."

You'd of course also want to add their name to the PDF in clear print, as well as some more subtle watermarks (that they'll be expected to find) to show that you mean business.

It should be quite trivial to automate this process using LaTeX. There are also more low-tech solutions, like changing the PDF metadata to indicate the uploader, or embedding gratuitous images and hiding individual watermarks in them.

• Teaching students that "low-level code formatting doesn't matter" seems very negative. C is hard enough to read, without littering the code with gratuitous variations like char* res and char *res.. – alephzero Sep 12 '20 at 14:37

Are you aware of the “Mountweazel” concept?

https://en.wikipedia.org/wiki/Fictitious_entry

Since it is impossible to prevent things being available a lateral approach is to include details that make it possible to quickly identify copying.

Not a cure but might be a treatment to what ails you.

First, the obvious disclaimer: it is not possible to completely avoid that they share your solutions. You need to provide something* to the students, and that something they will be able to share.

Second, try to produce a bit of variation between your assignments. For example, I may resolve a problem with a given file, and then change the order of the columns in the assignment file, just to force the students to do a little more than copying the provided recipe. The needed change is trivial, yet every year some student fail to do that. ☹

In some cases you may be able to create an assignment template, from which you can then easily create multiple variations (different numbers, names, even the order of the sentences might allow some tweaking...).

Third, watch the resources hat your students may be using, and try to avoid them the temptation. You may set search alerts for full phrases from your solutions, be aware of Stack Overflow questions similar to your assignment whose answers may be tempting to copy. If you have published on the website for the subject a set of solved assignments from past years, and you hand out a lab exam using one of them, disable the resource during the exam.

Fourth, detection. You may want to keep a local copy of the assignments handed out past years by other students (assuming this is allowed) so that you could find the original if someone submits the same solution as a previous year student [different than themselves]. You may want to tag your pdf with some hidden text, use weird variable names unlikely they would come up with or even intentionally include minor spelling mistakes that act as a brown M&M when you review it.

You may distribute solutions in such way that each student receives a different document. That could be for yourself to know the submitter, such as an entry on document metadata or steganographically tagging the solutions. Or it may be a document clearly watermarked with the student personal details, as that would discourage them to share it (they could be removed, but that requires more effort than simply uploading the file you gave them).

Fifth, make sure to make clear what can and cannot be done. Even if it's already buried on the institution honor code, it doesn't harm to include a redundant note on your own Syllabus saying that copying without attribution is cause on its own for failing the whole subject (not just that exam). On the other hand, I'd recommend to also list what can be done. While some people with no regards for the others work, other students would completely avoid acceptable resources afraid of this rule.

Finally, for a different type of course, pdf marked as not-copyable and pages as images may be appropriate. However, in Computer Science you often have problems where the students should copy the code, compile and run the professor solution, compare its output with the one of its own solution, etc. I'd dare most students won't do that, albeit that would greatly help them acquire the concepts being taught.

In my prior I focused on how to share the teacher solutions. Here I will cover a different approach.

Rather than providing an official solution to the exam, you may host an interactive lesson where the assignments are collaboratively solved by the whole class (or at least, those actively participating). So rather than providing your solution, you get the classroom to contribute their own. This may lead to a solution of worse quality, and it more demanding from the instructor, which would need to notice issues "on the fly". It is likely to be more realistic and have the students more involved (if not for its own, because it's a class they would attend, rather than a pdf they might choose not to open)

You can select relevant snippets from submitted solutions to include and collectively ask/show the issues on it. However note that forces you to correct them much quicker so you have that data available for the solving session.

If they need to upload 10 documents, then offer 10 documents on your website, that they can use. maybe some old exercises you don't need anymore?

• Why would a teacher want to help students get into a cheating site? – Ben I. Sep 13 '20 at 14:29