tce_functions_omr.php
Tags
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
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
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
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
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.