files-admin-code-tce-functions-omr

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

tce_functions_omr.php

Tags
file

Functions to import test data from scanned OMR (Optical Mark Recognition) sheets.

author

Nicola Asuni

since
2011-05-17

Table of Contents

Functions

F_encodeOMRTestData()  : encoded
Encode OMR test data array as a string to be printed on QR-Code.
F_decodeOMRTestData()  : array<string|int, mixed>
Decode OMR test data string (read from QR-Code) as array.
F_decodeOMRTestDataQRCode()  : array<string|int, mixed>
Read QR-Code from OMR page and return Test data.
F_decodeOMRPage()  : array<string|int, mixed>
Decode a single OMR Page and return data array.
F_importOMRTestData()  : bool
Import user's test data from OMR.

Functions

F_encodeOMRTestData()

Encode OMR test data array as a string to be printed on QR-Code.

F_encodeOMRTestData( $data) : encoded
Parameters
$data :

(array) array to be encoded

Return values
encoded

string.

F_decodeOMRTestData()

Decode OMR test data string (read from QR-Code) as array.

F_decodeOMRTestData( $str) : array<string|int, mixed>
Parameters
$str :

(string) string to be decoded.

Return values
array<string|int, mixed>

with test data (0 => test_id, n => array(0 => question_n_ID, 1 => array(answers_IDs)), or false in case of error.

F_decodeOMRTestDataQRCode()

Read QR-Code from OMR page and return Test data.

F_decodeOMRTestDataQRCode( $image) : array<string|int, mixed>

This function uses the external application zbarimg (http://zbar.sourceforge.net/).

Parameters
$image :

(string) image file to be decoded (scanned OMR page).

Return values
array<string|int, mixed>

with test data or false in case o error

F_decodeOMRPage()

Decode a single OMR Page and return data array.

F_decodeOMRPage( $image) : array<string|int, mixed>

This function requires ImageMagick library and zbarimg (http://zbar.sourceforge.net/).

Parameters
$image :

(string) image file to be decoded (scanned OMR page at 200 DPI with full color range).

Return values
array<string|int, mixed>

of answers data or false in case of error.

F_importOMRTestData()

Import user's test data from OMR.

F_importOMRTestData( $user_id,  $date,  $omr_testdata,  $omr_answers[,  $overwrite = false ]) : bool
Parameters
$user_id :

(int) user ID.

$date :

(string) date-time field.

$omr_testdata :

(array) Array containing test data.

$omr_answers :

(array) Array containing test answers (from OMR).

$overwrite : = false

(boolean) If true overwrites the previous answers on non-repeatable tests.

Return values
bool

TRUE in case of success, FALSE otherwise.

On this page
 

© 2004-2024 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy