HOME - - - - - Lazarus Tutorials TOC - - - - - - Programming Challenges TOC - - - - - -

OMR- Optical Mark Recognition

Overview. We can do this!

Page URL: lt8n-chall-omr-overview.htm

I've been shirking a project for years. It seemed too big. It seemed the sort of thing that someone else would write, and save me the trouble.

Well... no one else has written what I want. And, the more I think about it, the more I think I could do this!... But will I? So, for now, I present it as a challenge to you. If you've got past being an absolute novice, I think you could have fun with this... and create something many people would find very useful.

What is "OMR"???

"OMR" stands for "Optical Mark Recognition". It is a close cousin of OCR (Optical Character Recognition), but simpler.

What some OMR software would let people do...

I want to be able to administer multiple choice tests or surveys, without much hassle over converting responses to data files.

I dream of the people responding using an ordinary ink-on-paper multiple choice answer sheet.

I would then just scan the sheets, and, presto, the computer would spit useful information from the data in the sheets... Feedback for test takers, compiled results from tests or surveys, etc. (If you had the software to read the sheets, I think you'd be amazed at how useful the data could be. For instance: A teacher gives a test. The software outputs a document saying things like...

The top two questions where the students
gave wrong answers were number 3 and 15.

On 3 (right answer "c"), many chose "a" and "e"
On 15 (right answer "b"), many chose "d"

Information like that would help a teacher give better post-test feedback to the students, don't you think?!

How hard can it be? It will be fun!

The challenge...

The sheets the users will enter their responses on will have four marks in their corners. I'm going to suggest the marks shown in the illustration, but I'm aware that different sorts of mark are more typical... probably for a reason! If you want to re-specify this part of the challenge, by all means do so.

((Image lt8n-chall-omr-simple.jpg should appear here))

It will also, of course, have... not shown in the illustration... a grid with boxes to fill in... a column for each possible answer, a row for each question.)

          a  b  c  d  e
1.       o  o  o  o  o
2.       o  o  o  o  o
3.       o  o  o  o  o
4.       o  o ... etc

One task of the challenge is to write software to print suitable sheets for the test given to hand out.

By the way- This challenge seems to me to be a perfect project for a group of programmers working together. Writing the "print the blank response form" code would make a good sub-task of the overall project. Please see my notes on how a coding project can be tackled by a group.

Further discussion...

With the proliferation of personal computers, today it is often possible to get people to do tests, complete surveys, etc, etc, on a computer, thus saving someone the task of entering the data for marking, analysis, etc.

But there are still times when ink-on-paper is a better data capture option.

When the test/ survey/ etc is built from multiple choice questions, for many years people commonly submitted their responses by filling in boxes on a grid... something like what you see below. (The grid was what is shown in black, the blue is meant to simulate someone's responses.)

You can subscribe to services which will convert the ink-on-paper to a machine readable data file. I have not been able to find an open source project supplying the tools for doing this. There should be available! You could make them!

What would they look like?

That would be up to you! Or up to your group, if you are doing it as a group project.

The whole group should participate in the design phase.

If you write a comprehensive user's manual for what you are making, at the start, even though you haven't yet made it, you have made an excellent start. (If you can't, resume your thinking about "what will this do?") (When you've got that sorted out, there will be less wasted time when you work on "... and how will it do that?")

As the group, together, writes the User Guide and Programmers Manual, ways to break the work up when it is time to start coding should emerge. One possible division of labor is sketched below... The divisions might be set up to make provision for...

If you think about it, those headings might make useful "chapter" divisions for the documentation, don't you think?

Looking at those in detail...

Form creation

If you don't constrain the layout of the form with the grid upon which the users will give their answers, you are making things very hard for yourself.

The "read sheets/ interpret and present responses" system should come with a "create forms for answers to be marked on" system.

You could say that the system will only ever be able to read a sheet of responses to 20 questions, with 5 options given for each. And give users a .pdf to print as often as they like, with the places for marking a response set out inflexibly.

But that wouldn't be very good, would it?

The Form Creation system should let the user create a form with the number of rows and columns arranged to suit the user... within whatever constraints are necessary for reading the responses.

And there are other things that a user of the system would want.

Furthermore, you almost certainly need reference marks on the form, so that it can be stretched to cancel out any distortion arising from imperfect scanning.

So many parameters!!! I would have a config file at the heart of the system, if I were building it. (Another name for a config file: "ini file".

(If config files are not something you're already using comfortably, I've done a tutorial on config/ ini files.)

Using a config file means that your system can be used to process OMR sheets of different formats.

First stage of conversion to machine readable data

In My Perfect World, every school teacher's lounge would have a high spec scanner so that a teacher could put a sheaf of answer sheets into a hopper, press a button, and moments later have a folder with good images of each answer sheet.

That day may be a ways off. (Because at the moment there's no inexpensive software package to process the images.)

At least initially, I suspect that the most viable data capture route is the teacher's cellphone.

What sort of data capture is to be used will have implications for the other design choices.

On any case, by some means the ink-on-paper response forms will first be turned into digital images. Then the real fun begins!

I've done a page with thoughts on the first part of turning the image into a file of data. (You can leave reading that until after you've been through this, the overview page.)

Evaluation of the captured data

Once the answer sheets have been turned into .jpgs (or somesuch), the system will have to generate a data file which is the equivalent of ...

First pupil said...
  Answer to Q1: "c"
  Answer to Q2: "a"
  Answer to Q3: "e"
  ... etc
Second pupil said...
  Answer to Q1: "e"
  Answer to Q2: "c"
  Answer to Q3: "d"
  ... etc
Third pupil said...
  Answer to Q1: "b"
  Answer to Q2: "c"
  Answer to Q3: "a"
  ... etc
ETC!...

One answer would be a data file with a header to say how many answer sheets were evaluated, how many questions were in the survey, and how many responses were available.

If I'd analyzed four sheets, each with three questions, for which there were five choices for the responder's answer, the data file I'd create might look like the following. (This is the core! I'd be inclined to have more information in the header lines, like "When was the survey filled in?") "Frills" like this make the difference between an "okay" app that "does the job", and a great app that's a pleasure to use and that produces a valuable product.)

Sample first data file...

4s,3q,5c
1st pupil,cae
2nd pupil,ecd
3rd pupil,bca
4th pupil,cbb

You're also going to want something better than "1st pupil", "2nd pupil", "3rd pupil"!

THINK about what collecting responses like this would be like. Think about making the process easy for that person.

Tabulation of results.

Once we've converted the responses to a machine readable file, it would be a pity to stop.

Now we need a program (or programs!) to analyze the results.

As I partially mentioned in the overview, if the questions were a test, then a program could be written to "mark" the tests, give the teacher the results, and give the students feedback ("You got 88%. You gave the wrong answer to questions 8, 16 and 21."

It could give the teacher a report, showing which questions were answered incorrectly by how many pupils.

In another use of the system, people could be asked what they think of services or products produced by someone. The analysis of those responses would have to be done differently to be useful... but many parts of the system from giving school or certification tests would be equally useful in the different situation.

Etc! Etc!... the system could also be used, say, for doing surveys. Suppose a school did a survey about the lunch menus...

What's your favorite?
   a) Lasagna b) Cottage Pie c) Chicken wings

Do you think the cafeteria is clean?
   a) Very clean b) Quite clean c) Messy d) Disgusting

By the way... something to know, if you ever write a survey: For questions like "Is it clean?", always give users 2 or 4 or 6 options. If your survey has an odd number of options, too many people will pick the middle one.

Other considerations

To pick just one instance of how this project could work well as a group project...

If the PRE-PLANNING has been done well, everyone knows what the format will be for the machine-readable version of responder's replies. I.e. the file I proposed might look like....

4s,3q,5c
1st pupil,cae
2nd pupil,ecd...

One sub-team could be writing the code to create that file from the response sheet scans at the same time as a different sub-team was writing the code to evaluate the responses.

A detail...

I hope you'll have fun with this in any language you like working with. As I like using Lazarus, I would be particularly interesting in any Lazarus solutions.

I would also be interested in any documentation you generate in the course of attempting this challenge. I'd be happy to "showcase" good efforts here.

Footnote!...

I have a wonderful scanner. (The software that comes with it adds enormously to it's utility.) I can turn 10 pages of a book into a .pdf... or a pretty well OCR'd word file... in about two minutes with it. (It is a Czur Shine Ultra.. £140 (2/24))





Search across my sites with a Google search...

This searches wywtk, skywoof, sheepdogguides, sheepdogsoftware and arunet... but doesn't always give all of the pages that have content which matches the criterion.

Use the following to search THIS site.... (Go to my other sites, below, and use their search buttons if you want to search them.)

(Alas... my Lazarus material is split across two sites... SheepdogGuides.com and WYWTK.com. Sorry!)

index sitemap advanced
search engine by freefind

Site Map    What's New    Search

This search engine is "old skool"- it merely looks for the words you type, so....
*    Spell them properly.
*     Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....


Please also note that I have four other sites, and that this search will not include them. They have their own search buttons.

My WhatYouWantToKnow site- https:/wywtk.com.

My Skywoof.com site.

My SheepdogSoftware.co.uk site.

https://www.arunet.co.uk/tkboyd/index2.htm: My ancient site at Arunet. (Some of the material there is dated, but there are useful pages about general principles which are timeless.)



Link to Lazarus Tutorials main page

To email this page's editor, Tom Boyd.... Editor's email address. Suggestions welcomed! Please cite "lt8n-chall-omr-overview.htm".






Test for valid HTML Page has been tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org. It passes in some important ways, but still needs work to fully meet HTML 5 expectations. (Copy your page's URL to your clipboard before clicking on the icon, so you can easily paste it into the validator when it has loaded.)-->

AND it has been tested with...  Test for valid CSS


(eXTReMe tracker icon) Why is there a script or hidden graphic on this page? I have my web-traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try one, check out their site. Neither my webpages nor my programs incorporate spyware, but if the page has Google tools, they also involve scripts. Why do I mention the scripts? Be sure you know all you need to about spyware.


-- Page ends --