Creating a Paper-based Examination using Question Generators

This tutorial explains how to design and generate paper-based, individualised multiple-choice examinations using question generators that produce isomorphic variants. While digital examinations offer scalability and convenience, they are inherently more vulnerable to security risks. In contrast, paper-based assessments provide a substantially higher level of integrity for high-stakes contexts. The same question generators can also be used to create large question banks that are exportable to learning management systems or other digital platforms for formative, practice, or take-home assessments. However, for summative or high-stakes examinations, paper-based delivery remains the more secure option.

The steps below guide you through the initial setup and the creation of your first exam paper. While several steps are required, most involve one-off preparation (such as installation and downloading sample files).


One-off Preparation

Installing the .NET SDK

  1. Download and install the .NET SDK from Microsoft:
    https://dotnet.microsoft.com/en-us/download/dotnet/10.0 .
    This tutorial uses .NET 10 (LTS: Long-Term Support). Choose the installer appropriate for your operating system (Windows, macOS, or Linux).
  2. Open a console window: Then type: dotnet --version.
    If installation succeeded, a version number such as 10.0.104 will be displayed.

Installing the Dividni Framework

  1. Download the latest Dividni framework.
  2. Unzip the contents into a convenient location:
  3. (Windows only) Add the Dividni folder to your system PATH:
  4. Verify installation by running:

    dotnet ~/Dividni/McqTestGen.dll -version (macOS/Linux)
    dotnet C:\Dividni\McqTestGen.dll -version (Windows)

    On Windows (once PATH is set):
    McqTestGen.exe -version

    A successful installation prints something similar to: McqTestGen version 24.11.12.

Creating Your First Exam Paper

A multiple-choice examination paper consists of three essential components: (1) a cover page or prologue containing examination details and candidate instructions, (2) the set of questions, and (3) an OMR (Optical Mark Recognition) answer sheet on which students record their responses.

Rather than relying on static questions, this framework employs question generators that algorithmically produce isomorphic variants. Multiple distinct exam scripts can therefore be generated while preserving equivalence in structure, difficulty, and learning outcomes. Each student receives a unique yet isomorphic exam script.

Sample files are provided to allow you to test the workflow before creating your own questions. Download them here: https://dividni.com/tutorial/samples.zip

The samples folder contains several C# source files (with the .cs extension), each implementing a question generator. Each generator defines a single question model and produces multiple isomorphic variants. For simplicity, we refer to a question generator simply as a “question” in the sections below.

The McqTestGen tool (part of Dividni) generates multiple isomorphic versions of an exam paper.

  1. Open a console window.
  2. Navigate to the samples folder:
    cd C:\Users\John\samples (Windows)
    cd ~/samples (macOS/Linux)
  3. Run:

    McqTestGen.exe -prologue SampleCover.html -paperCount 2 ApplesAndOrangesMCQ.cs (Windows)
    dotnet ~/Dividni/McqTestGen.dll -prologue SampleCover.html -paperCount 2 ApplesAndOrangesMCQ.cs (macOS/Linux)

    This produces two exam scripts: 0000000000.html and 0000000001.html. Open them in a browser to observe differences between versions.
  4. Increase -paperCount (e.g., to 4) to generate additional scripts.
  5. Set the starting identifier using -startId, e.g. -startId 42.
  6. Generate proof copies with answers marked:

    McqTestGen.exe -proof -prologue SampleCover.html -paperCount 2 ApplesAndOrangesMCQ.cs (Windows)
    dotnet ~/Dividni/McqTestGen.dll -proof -prologue SampleCover.html -paperCount 2 ApplesAndOrangesMCQ.cs (macOS/Linux)
  7. Alongside .html scripts, corresponding .txt answer files are generated. These contain tab-separated values: question number, answer code, and mark. (Answer codes: 1=A, 2=B, 4=C, 8=D, 16=E.)
  8. Add multiple questions by listing additional .cs files: ... NationalCapitalsMCQ.cs PrancingPonyLocationMCQ.cs
  9. Insert page breaks using .xx between question files.
  10. Generate 200 exam scripts with OMR sheets (pre-filled with version identifiers):

    McqTestGen.exe -startId 42 -paperCount 200 -prologue SampleCover.html -omr OmrTemplate.svg ApplesAndOrangesMCQ.cs NationalCapitalsMCQ.cs PrancingPonyLocationMCQ.cs (Windows)
    dotnet ~/Dividni/McqTestGen.dll -startId 42 -paperCount 200 -prologue SampleCover.html -omr OmrTemplate.svg ApplesAndOrangesMCQ.cs NationalCapitalsMCQ.cs PrancingPonyLocationMCQ.cs (macOS/Linux)
If you are at the University of Auckland, download the UoA sample pack from https://dividni.com/tutorial/samplesUoA.zip . Be sure to read the included _Readme.txt file.

Creating a Question

Proficient C# programmers may author questions directly in C#. However, many instructors may prefer to generate questions without writing code. To support this workflow, we provide a comprehensive prompt file: Dividni_MegaPrompt.txt.

To generate questions using the prompt file:

  1. Load Dividni_MegaPrompt.txt into your chat session.
  2. Upload or paste your teaching materials and request automated question generation (e.g., 20 questions).
  3. Save each generated question for later inclusion in your exam paper.

Use the generated questions with McqTestGen as described earlier (see step 3 above).

Slightly Advanced Topics

  1. Including images: Use the HTML <img> tag.
  2. Including mathematics: Enable KaTeX or MathJax using -math katex or -math mathjax.
  3. Shared instructions: See ApplesAndOrangesMCQx2.cs.
  4. Styling exam papers: Use a stylesheet via -css exam.css.

Conducting Exams

To administer examinations, the generated HTML exam scripts must be printed. Tools such as ChromiumHtmlToPdf can batch-convert HTML files into PDF format, thereby automating and streamlining large-scale printing workflows.