How kunalekare/answer_evalution_system_with_ai works
1. Purpose and entry points
AssessIQ is a student-answer evaluation platform: it accepts text or uploaded answer sheets, extracts and analyzes content, produces rubric-like scores/feedback, and exposes teacher/student/admin workflows. The backend FastAPI entry point is api/main.py (also launched via run_backend.py); the React SPA starts at frontend/src/index.js and composes routes/UI in frontend/src/App.jsx.
2. API and role-oriented application boundary
FastAPI route modules separate public evaluation/upload operations from authentication and institutional workflows. Key boundaries include evaluation/result APIs, upload/extraction task handling, dashboards, user management, community, and grievance features:
• api/routes/evaluation.py
• api/routes/upload.py
• api/routes/auth.py
• api/routes/results.py
• api/routes/upload_extraction_task.py
The frontend calls this HTTP boundary through frontend/src/services/api.js; authentication state is managed client-side in frontend/src/context/AuthContext.jsx.
3. Answer-ingestion and extraction pipeline
Evaluation begins with direct text or uploaded PDFs/images. Files are persisted under the local upload hierarchy, then OCR/extraction yields text for downstream evaluation. OCR is an explicit pluggable boundary supporting local engines and Sarvam’s cloud OCR API; layout analysis and question segmentation support multi-question answer sheets.
• api/services/file_storage_service.py
• api/services/ocr_service.py
• api/services/layout_analysis_service.py
• api/services/question_segmentation_service.py
• uploads/student_answers/.gitkeep
4. Text understanding and comparison
Extracted/student text and model answers pass through cleaning, NLP, semantic similarity, and structural/alignment analysis. The system combines conventional NLP features with Sentence-BERT-based semantic comparison; optional language correction and concept graph analysis enrich evaluation signals.
• api/services/text_cleaning_service.py
• api/services/nlp_service.py
• api/services/semantic_service.py
• api/services/sentence_alignment_service.py
• api/services/concept_graph_service.py
5. Evaluation, scoring, and integrity
The scoring layer combines semantic, keyword/rubric, Bloom-taxonomy, structural, confidence, and optional diagram signals into marks, grades, explanations, and feedback. Anti-gaming checks are a distinct policy signal before results are finalized. Diagram evaluation is isolated because it operates on visual content rather than only text.
• api/services/scoring_service.py
• api/services/rubric_scoring_service.py
• api/services/bloom_taxonomy_service.py
• api/services/diagram_service.py
• api/services/anti_gaming_service.py
6. Persistence and operational infrastructure
SQLAlchemy-backed models provide the durable system-of-record for users, evaluations, and related workflow data; README identifies SQLite as the default database. Configuration is centralized and environment-driven. Local filesystem directories retain uploaded inputs, processed artifacts, model answers, and results. Docker and Azure deployment automation support containerized/cloud operation.
• database/models.py
• config/settings.py
• uploads/processed/.gitkeep
• uploads/results/.gitkeep
• Dockerfile
• .github/workflows/azure-deploy.yml
7. User-facing workflows
The React application provides evaluation, results/history, dashboards, manual checking, student management, and role-specific views. It is a separate Node/React runtime from the Python API and is deployable as a static web app.
• frontend/src/pages/Evaluate.jsx
• frontend/src/pages/Results.jsx
• frontend/src/pages/ManualChecking.jsx
• frontend/src/pages/Dashboard.jsx
• frontend/src/pages/StudentDashboard.jsx
• frontend/staticwebapp.config.json
Main entry points: main.py API entry · App.jsx SPA entry and routes · scoring_service.py Scoring and feedback · evaluation.py Evaluation and results
Components 20
React SPA
Separate browser runtime for role-based workflows.
- SPA entry and routes
frontend/src/App.jsx - Client auth state
frontend/src/context/AuthContext.jsx - API client
frontend/src/services/api.js - Teacher workflows · Evaluation, results, dashboard, and manual checking.
frontend/src/pages/Evaluate.jsx - Student dashboard
frontend/src/pages/StudentDashboard.jsx
FastAPI API
HTTP boundary and institutional workflows.
- API entry
api/main.py - Evaluation and results · Evaluation submission and result retrieval APIs.
api/routes/evaluation.py - Auth and upload workflows · Authentication, uploads, extraction tasks, and institutional workflows.
api/routes/upload.py
Evaluation Pipeline
Extraction, analysis, scoring, and integrity stages.
- Ingestion and OCR · Persists uploads and extracts text through pluggable OCR.
api/services/ocr_service.py - Layout and segmentation · Finds layout and separates multi-question answer sheets.
api/services/layout_analysis_service.py - Text understanding · Cleaning, NLP, Sentence-BERT similarity, alignment, and concepts.
api/services/semantic_service.py - Scoring and feedback · Combines rubric, semantic, Bloom, structural, and confidence signals.
api/services/scoring_service.py - Anti-gaming policy
api/services/anti_gaming_service.py - Diagram evaluation · Separately evaluates visual answer content.
api/services/diagram_service.py
Data & Storage
Durable records and local artifacts.
- System of record · SQLite is the default durable store for users and evaluations.
database/models.py - Upload artifacts · Stores student inputs, processed artifacts, and results.
uploads/student_answers/.gitkeep - Environment settings
config/settings.py
Deployment
Container and Azure delivery automation.
- Container build
Dockerfile - Azure deployment
.github/workflows/azure-deploy.yml - Static web app config
frontend/staticwebapp.config.json
Connections 22
- SPA entry and routes → Client auth state: uses
- SPA entry and routes → Teacher workflows: renders
- SPA entry and routes → Student dashboard: renders
- Teacher workflows → API client: calls
- Student dashboard → API client: calls
- API client → API entry: HTTP
- API entry → Evaluation and results: mounts
- API entry → Auth and upload workflows: mounts
- Auth and upload workflows → Ingestion and OCR: uploads and tasks
- Evaluation and results → Text understanding: submits text
- Ingestion and OCR → Upload artifacts: reads and writes
- Ingestion and OCR → Layout and segmentation: extracted content
- Layout and segmentation → Text understanding: question text
- Text understanding → Scoring and feedback: comparison signals
- Diagram evaluation → Scoring and feedback: visual signals
- Anti-gaming policy → Scoring and feedback: policy signal
- Scoring and feedback → System of record: stores evaluations
- Evaluation and results → System of record: reads results
- Environment settings → API entry: configures
- Container build → API entry: packages
- Azure deployment → Container build: builds and deploys
- Static web app config → SPA entry and routes: hosts