Create Survey Form from JSON Markup using C#

Surveys play a vital role in market research for companies or organizations to grow their businesses. They use survey forms to collect customer feedback, user reviews, or opinions. Survey forms usually include multi-choice questions to mark user inputs. We can easily generate surveys, quizzes, and ready-to-print OMR answer sheets from JSON markup programmatically. JSON allows storing and transporting data that can be parsed and processed programmatically. In this article, we will learn how to create a survey form from JSON markup using C#.

The following topics shall be covered in this article:

C# OMR API to Create Survey Form from JSON

For creating survey forms from JSON markup, we will be using the Aspose.OMR for .NET API. It allows designing, creating, and recognizing answer sheets, tests, MCQ papers, quizzes, feedback forms, surveys, and ballots.

Please either download the DLL of the API or install it using NuGet.

PM> Install-Package Aspose.OMR

Create OMR Survey Form from JSON Markup using C#

We can create a survey form from JSON markup by following the steps given below:

  • Firstly, create an instance of the OmrEngine class.
  • Next, call the GenerateJSONTemplate method with JSON markup file path as an argument.
  • After that, get results as an object of the GenerationResult class.
  • Finally, call the Save method to save template images and OMR template. It takes the path of the local disk folder and name of the template as arguments.

The following code example demonstrates how to create an OMR survey form template from JSON markup using C#.

Create OMR Survey Form from JSON Markup using C#

Create OMR Survey Form from JSON Markup using C#

We have used the following JSON template markup in the code example mentioned above.

Create PDF Survey Form from JSON in C#

We can also save the generated survey form in a PDF document by following the steps mentioned above. However, we just need to call the SaveAsPdf(string folder, string name) method instead of the Save method in the last step.

Create Survey in PDF from JSON Markup using C#

Create PDF Survey Form from JSON in C#.

Get a Free License

You can get a free temporary license to try the library without evaluation limitations.

Conclusion

In this article, we have learned how to create an OMR survey template from JSON markup and generate survey images. We have also seen how to save the generated survey in a PDF document programmatically. Besides, you can learn more about Aspose.OMR for .NET API using documentation. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also