Skip to end of metadata
Go to start of metadata
Contents Summary

Function Specifications

At present, Aspose.OMR for Cloud API exposes single function with string parameter that determines which specific action should be performed.

OMRFunctionParam Description

OMRFunctionParam is a separate class that has FunctionParam property. This property accepts string parameters, usually JSON strings, that are specific to each action. See examples given below for each action.

Property NameTypeDescription
FunctionParamstringParameters specific to actionName

OMR API Example

OMR Response structure

FieldMeaningValues Examples
int ErrorCode
Integer field that indicates whether any critical errors occured during task execution

No errors: <0>

Errors: <1|2|3..>

string ErrorText
String description of occured critical error. Empty if no critical errors occured

No errors: <"">

Errors: <"Error text example">

Payload.Result
Structure that contains response result 
string TemplateId

GUID string that is used to identify template on server

This value is assigned after Template Correction and used later in Template Finalization and Image Recognition

<5b535525-72fe-453f-83e8-5a058569620e>
double ExecutionTime
Indicates how long it took to perform task on server.<2.716449499130249>
ResponseFiles[]

This structure holds array of files returned in response

Type and content of files differes depending on action

 
string Name
Name of the file

<"AnswerSheet.omr">, <"AnswerSheetScan.dat">

long Size
Size of the image in bytes<546>
string Data
File data packed in base64 string<"UXVlc3Rpb24xOkE....24xMDpDCg==">
Info
Structure that holds information about task execution 
string ResponseVersion
String value representing version of the response.<"1.0">
int ProcessedTasksCount
Total amount of processed tasks<1>, <17>
int SuccessfulTasksCount
Total amount of successful tasks, i.e. tasks that completed without errors<1>, <15>
Details

Structure that holds additional information regarding performed task.

It contents information like:

TaskResult, that indicates if each particular task passed or failed,

Task Messages, that contain warnings and other messages regarding task, etc.

 

Content differ depeneding on action, see below for more details on each action.

 

 

Payload.Result.Files.Data is a base64 string containing resulting file. Actual string data may be acquired in the following way:

Base64 Data Unpacking

Payload.Result.Files.Data and Payload.Result.Info.Details content may vary depending on actionName. See examples for each action below.

Actions 

Generate Template

Expected parameters values:

  • name: <Path to a text file that contains template textual description>
  • actionName:  <"GenerateTemplate">
  • functionParams: <JSON string containing path to folder with images that are used in template textual description>

Invocation example:

 Response content details

  • Within OmrResponse.Payload.Result.Files we produce generated .omr template file and .png image.
  • Within OmrResponse.Payload.Result.Info.Details we produce JSON with following content:

OmrResponse.Payload.Result.Info.Details contains:


OmrResponse.Payload.Result.Info.Details GenerateTemplate 
example:


Full Response GenerateTemplate example:

Correct Template 

Expected parameters values:

  • name: <Path to an image file (image name) that is used to create template>
  • actionName: <"CorrectTemplate">
  • functionParams: <JSON string containing packed template data>

Invocation example:

Response content details

  • Within OmrResponse.Payload.Result.Files we produce .omrcr file with corrected template JSON data
  • Within OmrResponse.Payload.Result.Info.Details we produce JSON with following content:

OmrResponse.Payload.Result.Info.Details contains:

OmrResponse.Payload.Result.Info.Details Correction example:

Full Response Correction example:

Finalize Template

Expected parameters values:

  • name: <omrcr file recieved after Template Correction>
  • actionName: <"FinalizeTemplate">
  • functionParams: <Template ID string, recieved after Template Correction>

Invocation example:

Response content details

  • Within OmrResponse.Payload.Result.Files we produce RecognitionResult.dat file with finalization warnings and recognition data for the template image (note that it should not contain any results if image was filled)
  • Within OmrResponse.Payload.Result.Info.Details we produce JSON with following content:

OmrResponse.Payload.Result.Info.Details contains:

OmrResponse.Payload.Result.Info.Details Finalization example:

Full Response Finalization example:

Recognize Image

Expected parameters values:

  • name: <Path to image file (image name) that should be recognized>
  • actionName: <"RecognizeImage".>
  • functionParams: <Template ID, recieved after Template Correction>

Invocation example:

Response content details

  • Within OmrResponse.Payload.Result.Files we produce .dat file with recognition data for the provided image.
  • Within OmrResponse.Payload.Result.Info.Details we produce JSON with following content:

OmrResponse.Payload.Result.Info.Details contains:

OmrResponse.Payload.Result.Info.Details Recognition example:

Full Response Recognition example:

Grade Answers

Expected parameters values:

  • name: <Path to .dat file (file name) that contains recognition results that should be graded>
  • actionName: <"GradeAnswers".>
  • functionParams: <JSON string that contains grading rules>

Invocation example:

Response content details

  • Within OmrResponse.Payload.Result.Files we produce .grade file with grading results

Example of recognition results file:

AsposeForm.dat

PackedRules JSON example:

Rules JSON

Grading results example (.grade file):

AsposeForm.grade Example
Labels
  • No labels