An open API service indexing awesome lists of open source software.

https://github.com/codervivek5/ai-based-online-exam-software


https://github.com/codervivek5/ai-based-online-exam-software

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

# Random Paper Generator
### AI-Based Scalable Examination Platform (Module B)

---

## Overview

The **Random Paper Generator** is a core module of the **AI-Based Scalable Examination Platform**.
It dynamically generates **unique and secure question papers** for each candidate **at exam time**.

No question paper is pre-generated or stored beforehand.
Instead, papers are created **just-in-time** using **deterministic, seed-based randomization**, ensuring:

- Maximum security
- Fairness across candidates
- Full reproducibility for audits

---

## Key Objectives

### 1. Randomized Question Papers
- Every candidate receives a **unique paper**
- Questions are selected based on:
- Difficulty balance
- Topic coverage
- Exam blueprint rules

---

### 2. Security-First Design
- No full paper stored before the exam
- Generation happens only at runtime
- Eliminates risks of paper leaks or memorization

---

### 3. Fairness & Standardization
- All candidates receive papers with:
- Same difficulty distribution
- Same topic weightage
- No advantage or disadvantage due to randomization

---

### 4. High Scalability
- Designed to support **hundreds of thousands of concurrent candidates**
- Stateless and horizontally scalable architecture

---

### 5. Reproducibility & Auditability
Any paper can be regenerated later using only:
- `candidate_id`
- `exam_id`
- Secure random seed

No need to store the complete paper in the database.

---

## Core Concepts

---

## 1. Question Item Bank

All questions are stored in a centralized **Item Bank** database.

### `questions` Table Structure

| Field | Description |
|------|------------|
| `question_id` | Unique question identifier |
| `exam_id` | Associated exam |
| `topic_id` | Subject/topic category |
| `difficulty_level` | Easy / Medium / Hard |
| `question_text` | Main question content |
| `options[]` | Answer choices (if applicable) |
| `correct_option` | Correct answer reference |
| `marks` | Question weight |
| `metadata` | Tags, source, analytics |

---

## 2. Exam Blueprint

Blueprints define the **structure and constraints** of a paper.

### Example Blueprint
```json
{
"exam_id": "SSC_2025_MATHS",
"total_questions": 100,
"time_limit_minutes": 120,
"sections": [
{
"topic": "Algebra",
"difficulty_distribution": {
"easy": 5,
"medium": 10,
"hard": 5
}
},
{
"topic": "Geometry",
"difficulty_distribution": {
"easy": 5,
"medium": 10,
"hard": 5
}
}
]
}
````

Blueprints guarantee **consistent difficulty and topic coverage** across all candidates.

---

## 3. Seed-Based Paper Generation

For each candidate, a **secure deterministic seed** is generated:

```
seed = hash(candidate_id + exam_id + secret_key)
```

This seed is used to initialize a **Pseudo-Random Number Generator (PRNG)**.

### Benefits

* Each candidate gets a unique paper
* Same seed always regenerates the same paper
* No need to store question papers

---

## 4. Question Selection Algorithm

### Step-by-Step Flow

1. Load the exam blueprint
2. Generate candidate-specific seed
3. For each section:

* Filter questions by topic & difficulty
* Shuffle using seeded PRNG
* Select required number of questions
4. Compile and return final paper JSON

---

## 5. Supported Question Types

* Multiple Choice Questions (Single / Multiple Correct)
* Fill-in-the-Blank
* Numerical Answer Type
* Match-the-Following
* Case-based / Comprehension Sets

---

## API Design

### `POST /generate-paper`

#### Request

```json
{
"candidate_id": "123456",
"exam_id": "SSC_MOCK_2025"
}
```

#### Response

```json
{
"exam_id": "SSC_MOCK_2025",
"candidate_id": "123456",
"questions": [
{
"qid": 101,
"text": "2 + 2 = ?",
"options": ["3", "4", "5"],
"marks": 1
},
{
"qid": 205,
"text": "Solve for x...",
"options": ["2", "3", "4"],
"marks": 2
}
],
"time_limit_minutes": 120
}
```

---

## Performance Targets

| Metric | Target |
| ---------- | --------------------- |
| Latency | < 200 ms per paper |
| Throughput | > 1000 papers/second |
| Memory | Optimized via caching |

---

## Security Measures

* In-memory paper generation
* No disk writes before exam start
* AES-256 encryption for temporary persistence (if required)
* Signed URLs for media assets
* Strict authentication & authorization for API access

---

## Fairness & Normalization

* Blueprint-based difficulty control
* Shift-wise balancing supported
* Post-exam normalization using statistical models

---

## Failure Handling & Recovery

* Service crash → paper regenerated instantly using seed
* Stateless services allow quick redeployment
* Cluster auto-healing ensures high availability

---

## Observability & Monitoring

* **Metrics**: Generation time, pool usage, error rates
* **Logs**: Request IDs, seed hashes (audit-safe)
* **Tracing**: Distributed tracing across services

---

## Developer Utilities

* Blueprint Validator
* Item Bank Sufficiency Checker
* Paper Simulator
* Stress Testing Tools (up to 1M concurrent requests)

---

## Recommended Tech Stack

* **Languages**: Python (rapid dev) or Go (high performance)
* **Database**: PostgreSQL
* **Caching**: Redis
* **Infrastructure**: Kubernetes with auto-scaling
* **Secrets Management**: AWS KMS / HashiCorp Vault

---