All Projects → floft → freetron

floft / freetron

Licence: other
Open-source scantron software implementation

Programming Languages

C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
CMake
9771 projects
Makefile
30231 projects
QMake
1090 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to freetron

bootstrap-add-clear
bootstrap plugin to add a (x) clear button to your input fields
Stars: ✭ 36 (+157.14%)
Mutual labels:  forms
mobx-form
Declarative, complex forms with Mobx/React with lots of dynamic/imperative hooks
Stars: ✭ 29 (+107.14%)
Mutual labels:  forms
BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (+128.57%)
Mutual labels:  bubble
react-form-validation-demo
React Form Validation Demo
Stars: ✭ 88 (+528.57%)
Mutual labels:  forms
jquery-ajaxSubmit
Effortlessly submit forms using AJAX and JSON.
Stars: ✭ 39 (+178.57%)
Mutual labels:  forms
autograder
Automatic assignment grading for instructor use in programming courses
Stars: ✭ 14 (+0%)
Mutual labels:  grading
form-js
View and visually edit JSON-based forms.
Stars: ✭ 125 (+792.86%)
Mutual labels:  forms
yii2-forms
Forms CRUD - formbuilder, generator code
Stars: ✭ 32 (+128.57%)
Mutual labels:  forms
docker-formio-api
Docker Form.io Server based on Debian w/s6 init, Zabbix Monitoring
Stars: ✭ 14 (+0%)
Mutual labels:  forms
node-wufoo
A Node.JS library for the Wufoo API.
Stars: ✭ 13 (-7.14%)
Mutual labels:  forms
django-formidable
On the way to glory! again!
Stars: ✭ 19 (+35.71%)
Mutual labels:  forms
react-emotion-multi-step-form
React multi-step form library with Emotion styling
Stars: ✭ 25 (+78.57%)
Mutual labels:  forms
tubular-dotnet
Tubular .NET Library
Stars: ✭ 16 (+14.29%)
Mutual labels:  forms
AppleMusicAnimation
No description or website provided.
Stars: ✭ 25 (+78.57%)
Mutual labels:  bubble
laravel-crud-forms
Create CRUD Forms for Laravel Models.
Stars: ✭ 38 (+171.43%)
Mutual labels:  forms
CustomFormViews
A clean collection of views used for forms.
Stars: ✭ 12 (-14.29%)
Mutual labels:  forms
ContactEtc
Laraval package to instantly add a customisable contact form to your site.
Stars: ✭ 21 (+50%)
Mutual labels:  forms
Autofillr
A browser extension that fills registration forms with randomly but consistently generated fake data.
Stars: ✭ 17 (+21.43%)
Mutual labels:  forms
AltoControls
Custom controls for .Net WinForm
Stars: ✭ 76 (+442.86%)
Mutual labels:  forms
Table-Detection-Extraction
Detect the tables in a form and extract the tables as well as the cells of the tables.
Stars: ✭ 35 (+150%)
Mutual labels:  forms

freetron

A professor encouraged me to write a software implementation of a scantron machine. It's licensed under the ISC or MIT licenses. The goal was to scan a PDF of the key and all the students' sheets, grade, email the students their grade and a copy of their sheet, and then display statistics about the exam. While the program doesn't quite do all that, it does grade scanned forms and provide a website interface for convenience. Feel free to try it out and improve it.

At the moment this only supports one type of form available directly from Apperson or in website/files/form.pdf.

Using

You can either use this as a command-line utility or run it as a daemon providing a website interface.

Dependencies

a C++11 compiler
CppDB (Boost or MIT)
CppCMS (LGPL)
PoDoFo (LGPL)
OpenIL/DevIL (LGPL)
libtiff (custom: http://www.libtiff.org/misc.html)

Note: PoDoFo must be compiled with C++11 not C++98 otherwise it won't extract images. You can modify the CMakeLists.txt file. For Arch, look at my PKGBUILD for podofo-cpp11 and for freetron.

Compiling

make: make; make install
cmake: cd cmake; cmake .; make; make install

I have tested g++ and clang++ on Linux. For Mac you'll find most of the dependencies in Macports, Fink, Homebrew, or whatever you use, but you'll probably have to build CppCMS and CppDB. On Windows you'll have to build basically all of these.

Note: Use cmake if you want the keys generated on install; otherwise, use make and then generate the keys and put them in /srv/freetron or whatever website directory you choose:

cppcms_make_key --hmac sha256 --cbc aes256 \
    --hmac-file website/hmac.txt --cbc-file website/cbc.txt

Running

Website interface: ./freetron --daemon website/
Command line interface: ./freetron -i KeyID form.pdf

Example

Download a computer-generated form or a scanned form created from the Apperson form mentioned above. Below is the output of these two example forms. The first takes about 1 second and the second about 3 seconds on my computer.

$ ./freetron -i 123456789 freetron_example.pdf 2>/dev/null
ID          Answers (key first)
123456789   A B C D E A B C D E A B C D E
1233224     A A D D D A B C D E A B B C E
987444      A B C D E E D C B A B C D E D

Scores
  987444      40.00%
  1233224     66.67%

$ ./freetron -i 1793240 freetron_example2.pdf 2>/dev/null
ID          Answers (key first)
1793240     E D B B C A B D C B D A D E E B D C E C A A E C C D C C C E C E E D D A C B E A D E A A A C D A E A
888324401   D D B B C C B D A B D A E E E B D C B C A B E C D D C C E E C D D D A A C A A A D A A B A C D A E A
3741083751  _ C C C B A B D C B C A D D E A D D E A A A E C D D E A C B C E E E D C C E E C C E B A _ E B A E B

Scores
  888324401   70.00%
  3741083751  52.00%

If you specify the -d option, it'll generate debug images, which allows you to find any problematic bubbles or boxes. Below is the output from the third page of the example scanned form. Note that since OpenIL doesn't allow multi-threading, this greatly extends the run time.

Freetron Debug Image

If you run the examples in the website, you get: Freetron Website

Navigating the Code

If you want to extend or modify this program, this summary of what the different portions do may be useful.

options -- All parameters for the supported style of forms (e.g. bubble aspect ratio)

Core functionality

extract -- Extract the images from the PDF
processor -- Manage the extracting and processing threads, what to do with each image, etc. Basically, if you want to extend this program, you would add additional code to the end of parseImage.
read -- Find filled bubbles for the answers, ID, etc. on the form.
rotate -- Determine the rotation from the list of black boxes on the left and bottom of the form.

Image processing

blobs -- Connected-component labeling of black objects in image
histogram -- Self explanatory
box -- Taking a starting pixel, determine if the object that point is a part of is actually one of those black boxes on the left and bottom.
outline -- Contour tracing. Given a starting point, get a vector of points on the boundary of that object.
boxes -- Find the blobs and determine if each is a box.

Data structures

forms -- Each form (on the command line you will have only one) stores all the information needed about it and the individual pages of that form.
pixels -- Data structure for storing pixel data
data -- Data structures for coordinates, answers, etc.
disjointset -- Used in the connected-component labeling.

Utilities

log -- Log messages will be put at end of output
maputils -- Iterators and whatnot
math -- All the distance, average, stdev, etc. functions
threadqueue(void) -- Run the processing in a number of threads.
cores -- Get the number of cores for determining the number of threads to use.

Website

The website uses CppCMS, so you may want to become acquainted with that to understand this code.

website -- Main website application
rpc -- Get/set data for Javascript RPC
database -- Manage saving/reading database information using CppDB
date -- Access the date in a thread-safe way
content, skin, *.tmpl, *.js, *.css -- For the page templates and website design

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].