Home > Artesis, linux, system administration, test > Automated multiple choice exam grading

Automated multiple choice exam grading

I wrote a little tool for automated multiple choice exam grading.

The idea:

  1. Students receive two sheets: one questions sheet and one answer sheet
  2. They indicate their correct answer by erasing the wrong answers (letters) on the answer sheet (see scan on the right)
  3. When all students have finished their exam, the answer sheets are batch-scanned and send to some email address.
  4. The server receives this email, starts processing the scans, calculates the grades and sends out a report to the lecturer

The solution:

  1. The answer sheet is just a simple spreadsheet (with the letters A01 – Axx in front of each answer)
  2. The documents are batch scanned and emailed using a Xerox WorkCentre 7346 scanner
  3. The processing itself consists of several steps:

Example report:

Total score is:  13/20 

L: 'leeg' -> no answer given
M: 'more' -> multiple answers given

Answer overview:
Ans: L (Correct:A)  -> 0
Ans: C (Correct:C)  -> 1
Ans: B (Correct:B)  -> 1
Ans: C (Correct:C)  -> 1
Ans: C (Correct:A)  -> -1
Ans: C (Correct:C)  -> 1
Ans: A (Correct:A)  -> 1
Ans: L (Correct:A)  -> 0


  • Integrate script into server (auto start when email is received)
  • Recognize student names / numbers
  • Increase usability (web interface for adding solution and answer sheets?)
  • Clean up code & post it here (v1 & v2 posted 25/08/2011)

Used software:

gocr, ocropus, bash, sed, djpeg, convert, small self written C program


(rename .doc files to .zip) (.zip file upload is not allowed at wordpress.com)

  • Version1: First test version, using “GOCR“, stopped using GOCR because of problems with lines where all letters where greyed out. (this would cause problems while grading)
  • Version2: Working version, ugly shell-script, added some comments to the C-code. (start the program using “./scan.sh imagefilename” (two processed examples included in the zip file)
  1. 25 August 2011 at 1:45 pm

    Love the idea.
    Where is the sample code?:)

    • jeroendoggen
      25 August 2011 at 9:18 pm

      Sample code added

  2. 26 March 2012 at 10:42 pm

    I love the idea — but wouldn’t be possible to let the students mark the right option and then check the missing letter when scanning ?

    • 26 September 2012 at 9:47 pm

      It’s very helpfull, i’m trying to do the same for android with tesseract, but i think that would be more interesting if i use a OMR than an OCR,

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: