Marking CIS 1500 Assignment 1: Part 1

Automating the Grading process

I’ve got 90 students to mark and I’m running behind on time. So the natural
thing to do is to document what I try, what works, and what I end up doing to
figure out the marks for my students. Anywhere that it would come in, I will
have removed any personal data from a student. Hopefully, none of the code and
nothing super related to the coding problem they solved comes in, either.

First thing is first

The students made submissions through a feature known as “Dropbox” (no, not /that/ dropbox), and we (the TA’s) have to download a zip of all of theirsubmissions. This could be great, if it weren’t for a few obstacles.

Desire2Learn’s software does not work properly with Mozilla Firefox. It uses
some javascript to alter database requests that just does not seem to run right
in FF.

I have no ability to select or view ‘students from my lab’. I have three /paper/
sheets of separately alphabetised data for each of my labs.

We started off using Ubuntu 10.04 and having students write code on it and
compile with gcc. Someone in our department decided it was a reasonable choice
to upgrade to 10.04 the week that all the students moved in, and it turns out
the SunRay terminal server (we use dumb terms for our labs; lower power costs
etc) running Solaris is for some reason incompatible with some setting in
10.04’s XServer. So we switched to Debian 6. And of the four linux servers for
the CS department, there will always be at least one down – sometimes two,
rarely three, and on that occasional moment, all of them will be out of
commission.

It should be noted that ‘down’ here means they authenticate and suck you in,
warn you about your kerberos password expiring in 350ish days (thanks! I’ll keep
it in mind!), display the MOTD, and then hang. No prompt appears and ^C, ^D, ^Z,

Esc, Alt+Est, Alt+X, or any reasonable combination will cause anything useful.
It’s like a program stuck in a while loop.

Back on topic: We decided to let students use Windows and PellesC if they want,
because (sigh) it was just far more stably available than our linux systems.

This meant that we needed two separare dropboxes, one for Pelles and one for
gcc. Yes, we know that there should be no differences (these are super simple
assignments), but the argumentation seems to be, “on the off chance that
something crazy happens, this is insurance and we know where this is alleged to
work.”

So, D2L forces me to use Internet Explorer,
I have 3 separately alphabetised lists of students on paper (90 out of 530)
I have assignments to collect across two separate dropboxes.

How to go about it

I have written out the names of all 90 of my students from the 3 labs into a
text file, tab-separated. I’ve also downloaded /all/ of the assignments off of
the site, because it’s relatively easy to do that. Unfortunately, D2L doesn’t
just give the most recent submission, it gives all files – so there’s some old-
versions floating around that need to be gotten rid of.

Time to write a script!

It’s going to have to get all of the filenames and keep only the newest ones.
The first way that pops into my head is as follows.

# The submissions have the dates in the filename,
# so the reversed output of ls will have the newest
# file listed first.
#
files = `ls`
files = files.split(“\n”)
files.reverse!

# Since the names are all generated by Desire2Learn,
# multiple submissions are identical for the first several
# characters. I chose to check against the first 16 or so,
# as that seems like a reasonable maximum length for a last
# name, to deal with the case of two people who share last
# names.
#
# If the first 16 characters match, this is an alternate-
# submission. And since I know they’re reverse-chronologically
# ordered, I can discard all but the first. Clever!
#
copy_files = []
old_file = “…………….”
files.each do |file|
if file[0,15] != old_file then
copy_files << file
old_file = file[0,15]
end
end

# broken out of the loop above for clarity
copy_files.each do |file|
`cp “#{file}” “filtered/#{file}”`
end

Now I need to deal with the much harder problem of only marking my students.

One thought on “Marking CIS 1500 Assignment 1: Part 1

Leave a Reply

Your email address will not be published.