views:

46

answers:

3

I'm seeking advice about setting up an email gateway so students can email me homework and the email will be processed automatically.

For example, if a [email protected] emails me with a subject of "CS208 hw1", I would cross check studenta in a list of students taking CS208, then take all the attached files, dump them in that student's hw1 folder and respond with an email stating what files were received and when. If the student's email was malformed in some way such as bad subject, or missing files, the service would send an appropriate email.

I have administrative access to an on-campus Linux machine that could be configured as an email server.

Offhand I was thinking of using fetchmail and a cron job to consistently read a designated user's email and perform the appropriate responses with some sort of script. Does this sound like a good way to go? I would welcome better ideas?

+2  A: 

Personally, I would root for a page with an upload dialog and also the possibility to list current files and maybe an FTP server. The problem with Email is, that the transmission until the server is out of your reach, as the mail gets processed by other servers than your own on the way. Mails could be lost or altered on the way, not all servers might accept attachments of a certain size or type. Although the idea is quite good, I think it would produce a less than optimal solution than others, like the mentioned page or ftp server.

edit

I'd rather prefer msw's way. A version control system would spare you much hassle and problems. * tips hat to msw*

Femaref
This is a good idea too. What would you suggest in terms of a quick and dirty implementation? A PHP based site? (I'm no web programmer).
Rich
As you already have the resources (Linux server), yes, PHP would be an idea. But considering msw's input, a sort of version control (considering this is CS200 class) would be way better and students will need to learn to use it anyway. Will prevent many headaches.
Femaref
@Rich You could always get a student to make it for you, for extra credit ;)
Slokun
@Slokun It may not surprise you to know that I get that response a lot. In practice, student implemented projects are not high quality (not surprisingly since it takes years to become a good programmer and lots of time to maintain a project). On top of that, as soon as the course is over I'm left to maintain their mess. I like students to do these sorts of projects to learn, but I've always re-implemented anything mission critical once they are gone. That's not to say I didn't learn while they were implementing it. :)
Rich
@Rich I figured as much :P I was actually surprised to find out one of the most mission-critical sites at my college was originally written by students for their final project. Used by all 110,000+ students there for course registration, tax forms, class records, etc. But finding that out did explain a lot of it's little quirks, despite it having been upgraded a lot since they did it...
Slokun
A: 

If you have a web mail interface, then iMacros for Firefox can be an a good automation solution. You can use the built-in Javascript for more complex if/then decisions:

Ruby8848
+2  A: 

I expect that in practice there will be far, far more exceptions to whatever rules you prescribe than there will be conforming mail which is properly handled. You'll be buying yourself a headache of manual fixups and "the computer ate my homework" claims.

Since this is a CS 200 level class, require them to use some version control system and save yourself the hassles of parsing free-format e-mail with the rigid structure that a VCS imposes. Your students will benefit too from the requirement. If my 10-year-old could appreciate the merit of automatic revision control within Google Docs, I'm guessing your students can handle Mercurial or git or even (gasp!) Subversion.

added in response to comment

Yes, but with Mercurial (and presumably git) "repository" is a fancy word for "directory" and is not the heavyweight DBMSy thingy that older VCS models may have led you to expect.

Here is how as a student I would expect to work on a hypothetical assignment:

studenta@dorm$ hg clone https://Rich.univ.edu/studenta/cs208
$ cd cs208 ; broswer ./hw1.html
$ mkdir hw1 ; cd hw1 ; make my work files 
$ hg add * ; hg commit -m "perfect the first time!" # updates locally only
$ make lots of bug fixes
$ hg commit -m "okay really done now"
$ hg push 
# sleep, party, go to class with hangover
$ hg pull
$ browse hw2.html ; mkdir hw2 
...

The assignments in the student's repository placed there by you was just for the sake of demonstration. Since you "own" the Rich.unix.edu machine, their pushes become authoritative. You'd

  1. Write a (tiny) script to hg init $student/cs208 on Rich.univ.edu for each student in the roster.
  2. Figure whether HTTPS or SSH works best in your environment
  3. Add commentary - if desired - to the student's files that they'd pick up on their next pull
  4. Have a managed, convenient, logged record of all the interactions.
  5. The students get affirmative feedback at the moment of push that it was accepted

Finally, should the repository server be down they could

$ hg export tip | mail -s "server down; assignment done" [email protected]

And you'd still have a timestamped, digested version of their submission which has a rigid format which you could commit for them, or better still:

"Dr. Rich, the server was down!!!"
"But you sent me an export via e-mail, yes?"
"Of course, sir."
"Well, just push when the machine is back up, I already have proof that you completed it on time."
"Oh gee, Dr. Rich, you're swell!"

msw
version control system sounds way better than my idea. +1
Femaref
I've thought of this in the past but scrapped it because I was not clear on what the repository would look like. What did you have in mind? A different repository for each student?
Rich
see "added" above.
msw
@msw Thanks for this. I'm going to try it out this semester.
Rich
@msw Thought you would like an update. I'm using a Mecurial repository for each student and another class-wide one for updates to our communal data structures. I grade programs by pulling each repository, dumping a grade.txt in each Java package that they submit as an assignment, liberally write comments and change code for feedback, and push back to their repository. Mostly we interface with Mecurial through MecurialEclipse, an Eclipse plugin. The students love it and it's awesome fun. Thank you for the recommendation.
Rich
@rich: so glad it worked for you; it is nice to know for similar situations.
msw