views:

146

answers:

4

I'm in the late stages of developing a Linux based computing lab for CS students at my university. In my undergraduate days I remember being able to submit my homework assignments with a command like:

submit [classname] [projectname] [source files]

which would then copy all my files to a directory students couldn't access but the instructor could.

I was imagining adding a submit user and group account, and then developing a world executable script owned by this group with the setuid bit set. Students could then execute the script which only whisked those files off somewhere as the submit user but that students couldn't get at late. Starting with this approach I've gotten hung up on the fact that my Linux distribution ignores setuid on scripts.

I would appreciate advice on approaches to solving this problem that involved:

1) Students being able to submit their own code to someplace other than their home directory. 2) Students can't see other students' submitted code. 3) Low administrative overhead (I'd like to avoid creating sets of directories for each class) 4) Does not involve a root user trouncing through directories in order to examine submissions.

Thanks for any help!

+2  A: 

Well, the easiest way would be to have them email their assignments. This is a lot more flexible as it allows students to submit from off campus/without having to connect to a school server. I know that I (and many of my classmates) preferred to work on our own hardware (which was frequently vastly superior to that available in the campus labs), and the scenario that your propose would require each student working offsite to log in to a campus machine, ftp their code into their home directory, and then execute your script from the command line.

One professor had each student tar/gzip their assignment into in archive named "[lastname][firstinitial]-[assignmentnumber].gz and email it to "submit[coursenumber].[sectionnumber]@myuniversity.edu" with a subject of "assignment submit". If you require any automated processing at that point, your app could poll applicable emails from that account and do whatever it pleases with the attachments. Probably by submitting into a database, but not necessarily if you don't have the time/expertise to implement such a solution.

There are many other reasons such a client-agnostic approach is superior to having to use a shell interface, but for the sake of brevity I'll not go into them here.

If you must use a script like you propose, modify your script calling convention to submit [student login name] [projectname] [source files]. Have the script copy said files to a write-only folder that is acessible to all students, or students in the specified course. Script logic:

  1. Does [parent folder].[student login].[projectname] exist? If not, create it.
  2. Copy specified files into the directory created in (1).

If you want to get fancy, just grab the login name automatically. This would also prevent other students from writing over each others files, which may be a requirement.

Good luck.

David Lively
Thanks for this idea. My bias towards a script is only based on my experience as an undergraduate. An email based solution does seem superior. (As a side note, its unlikely students have machines in their dorms as high end as these -> i7/GTX 260/6GB Ram/Dual monitors).
Rich
Wow! That's some serious hardware. Still, there's a lot to be said for late night homework sessions at Starbucks with your laptop. =)If you want to have some real fun, get some senior undergrads to write an email gateway as a senior project that dumps the data into a database, and a teacher's website that can view/edit/download/otherwise administer each submission. Put those kids to work!
David Lively
E-mail is, however, not guaranteed delivery. It can be delayed a long time, or never get to the destination at all. With the script method, the student has instant positive confirmation that the assignment has been submitted successfully, and the lecturer can trust the submitted timestamp (and doesn't have to deal with "but I definitely sent it!!").
caf
I think email is reliable enough these days to make this an infrequent edge case, at best. Worst case, the student can show the instructor the email in her "sent items" folder, which will have a timestamp.
David Lively
+1  A: 

You could create a writeable directory with the sticky bit set (chmod +t), which means that anyone can create a file in that directory, but only the owner of a file can delete or move (rename) it. (That's how /tmp works).

The submission script then just uses gpg to encrypt the file with the public key of the lecturer / tutor, and copy the result to the submission directory (and ensuring that it is not group or world writeable).

This seems to fit the bill:

  • The script doesn't need any special permission; and
  • No-one can delete, modify or view another's submitted assignment.

It could even be trivially extended to sign the submitted assignment with the student's GPG key.

caf
+1  A: 

You'll need to either write the 'business' logic in a compiled language, or compile the shell script itself.

SHC is probably available in your distro, try yum / apt-get install shc. It not only allows you to write one off scripts like this quickly and put them to use, it helps keep people from reading them and 'noticing' ways to play with it.

Note, the encryption is only good enough to discourage the casual observer. However, this should solve your problem and in your case, any degree of obfuscation is just an added plus.

Tim Post
+1  A: 

Why not create a Subversion repository where each student has their own branch?

  • The repository can be accessed from any computer with HTTP (or whatever protocol you like)
  • If the lab has any template or "starter" code, it can be copied from the trunk
  • When you collect the assignment, just check out the last revision before the due date
  • Feedback and comments can be given as a new revision
  • If the student needs to re-do any part of the lab, they just commit again
  • Per-directory access control can be set up for privacy
  • Students gain valuable experience using a revision control system
  • If students get to work in groups, this makes collaboration much easier
Jay Conrod
I've always wanted to get students using SC but never had a convincing reason. It would be really interesting to build this into the foundation of each course they take.
Rich