PDA

View Full Version : Can VBA do = camera to scan paper image:check marks ABCD = auto grading in classroom



Sam62
04-29-2008, 01:52 PM
I'm a 5th grade teacher using excel to help make me a more efficient teacher. I have been working on this excel program for 2 years and now I want to be able to grade tests much faster by scanning a sheet of paper that the student has marked the answers to questions. I know it can be done because I have seen it but it costs too much money for my class.

1 A B C D E (lets say their is a heavy pencil mark over B)
2 A B C D E (Now, their is a mark over C) etc


0. I use excel to capture an image of an answer sheet that has question numbers and responses where I have marked out the correct letter. THis sheet is saved to be use to compare against a student's sheet

1. A student comes to the desk and excel scans their response sheet under the camera.

2. EXcel captures the image, uses some kind of image matching routine to check the student's sheet image to my answer sheet image and sees that the student has a marked over the D instead of the B.for question 1 (etc)

3. Reports back to excel and then I can handle the rest but I don't lnoiw if there are any activex, ocx, or ??? routines out there like a Punch card routine, a Scan Card routine, etc
Thanks for any leads or help.

Oorang
05-02-2008, 06:23 AM
Hi Sam, the biigest issue that you are going to run into here is the optical character recognition (OCR). Microsoft Document Imaging has rudimentry OCR but your milage may vary, it can be a bit tetchy. Here is example code:Public Sub SimpleExample()
'MODI object require you to set a reference to <<<<<<<<<<<<<<<<
'"Microsoft Document Imaging". It is usually found at:
'C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MDIVWCTL.DLL
Dim mdiDoc As MODI.Document
Dim mdiImg As MODI.Image
Dim strTxt As String
Set mdiDoc = New MODI.Document
mdiDoc.Create "D:\Test\OCR Test.tif" 'Confusing Syntax. This opens the file.
mdiDoc.OCR miLANG_ENGLISH, True, True
For Each mdiImg In mdiDoc.Images
strTxt = strTxt & (mdiImg.Layout.Text & vbNewLine)
Next
mdiDoc.Close False
MsgBox strTxt
End Sub

Sam62
05-02-2008, 06:22 PM
Thank you Oorang for responding - It's people like you that make this forum hum! I only have office XP 2002 in the class and I think that the Modi functions are basically in 2003. Also, I really don't need the overhead of OCR but really just Optical Mark Recognition. My thought is that I would take a picture of the correct "bubble" marks on the answser sheet and then when the student marks the response sheet, they wave it under a camera and it compares the answser sheet to the response sheet. I have seen it done and it only takes 1.5 seconds per student. Do you have any ideas on that? thanks

Oorang
05-02-2008, 06:59 PM
Hi Sam,
Thanks for the kind words :) Good news, I am fairly certain MODI was in that release as well (I believe that was the first release to have it actually). It's just the path will be different. Do a file search for MSO.dll and see what it turns up. I suspect it will be the path just Office10 instead of Office11.

Sam62
05-02-2008, 09:29 PM
No, not in Office 10. Any ideas about an image processor/OMR type of vb6/vb net to shell out to?

tpoynton
05-03-2008, 10:45 AM
assuming the doc camera is TWAIN, perhaps something like http://www.dosadi.com/eztwain1.htm might help.

I'm interested in what you come up with...I looked (not very hard, though) for something VBA could hook into for OMR. didnt even find MODI.

Sam62
05-03-2008, 08:35 PM
Thanks Mr. Tpoynton, your hypertext was interesting and I sent them an email. I'll let you know their response. Do you know of anyone that might want to help my classroom with this routine?

Sam62
05-03-2008, 08:43 PM
By the way, as a teacher, I should have re-read my initial post.

1 A B C D E (lets say the correct mark is a heavy pencil mark over B) on the correct answer sheet for question one and continue down the sheet with more numbers

1 A B C D E (Now, their mark is a mark over C) on the student's response sheet using the same image layout as the correct answer sheet.

tpoynton
05-04-2008, 05:23 AM
I'm sure folks here would be happy to help!

Oorang
05-05-2008, 08:58 AM
Hi tpoynton,
I took a look at EZ Twain and while it is free, the learning curve looks to be a bit steep for a novice coder. Could you perhaps post some example code using that accomplishes the task the OP needed help with?

EDIT
Sam, I apologize, but I posted the wrong path to the dll. It's actually:
C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MDIVWCTL.DLL

If you have it, it's likely to be in 10 not 11. But I would still search for MDIVWCTL.DLL

tpoynton
05-05-2008, 09:16 AM
I wish I could! I might have time to look at it over the next few months.

You implied I am not a novice coder...THANKS! I'm pretty much a novice, though :)

Sam62
05-14-2008, 09:36 AM
Thanks OOrang for staying involved. I did search for the new DLL you mentioned above, but it is not in the office or windows folder. I still havn't heard from EZtwain. I'll give them a couple more days and then write again. Have you thought of any other way?