Skip to content

feat: add admin question bank audit and integrity check - #418

Open
dhinith2007 wants to merge 2 commits into
vicharanashala:mainfrom
dhinith2007:main
Open

feat: add admin question bank audit and integrity check#418
dhinith2007 wants to merge 2 commits into
vicharanashala:mainfrom
dhinith2007:main

Conversation

@dhinith2007

Copy link
Copy Markdown

Admin Question Bank Audit & Integrity Check

🎯 Overview

This PR introduces a non-destructive Question Bank Audit & Integrity Check system for Admin and Superadmin users.

The feature provides a lightweight, client-side quality-control layer that automatically analyzes the Question Bank and identifies potential data-integrity issues before they affect assessment delivery.

Instead of manually inspecting thousands of question records, administrators can run an integrity audit and immediately understand the health, quality, and consistency of the question dataset through a dedicated dashboard.


💡 Problem

As the Question Bank grows, maintaining the consistency and integrity of question records becomes increasingly difficult.

Potential issues such as:

  • Missing or incomplete question prompts

  • Missing answer keys

  • Invalid choice configurations

  • Duplicate question content

  • Invalid FLN level mappings

  • Malformed SVG illustrations

can remain hidden inside a large dataset and potentially affect the reliability of assessments.

There was previously no dedicated interface for administrators to systematically identify and inspect these issues.


🚀 Proposed Solution

This PR adds a dedicated Question Bank Audit & Integrity Check dashboard that performs automated static analysis across every loaded question record.

The audit engine is implemented as a pure TypeScript utility, keeping the validation logic independent from React, the backend, database, and DOM.

Six Integrity Checks

Check | Severity | Validation -- | -- | -- Missing Question Text | 🔴 Critical | Detects missing, empty, whitespace-only, or extremely short prompts Missing Correct Answer | 🔴 Critical | Detects missing answer keys while correctly preserving 0 / "0" Invalid Choices | 🔴 Critical | Validates choice questions for at least 2 distinct non-empty options Duplicate Question Text | 🟡 Warning | Detects duplicates using normalized text comparison Invalid FLN Level | 🟡 Warning | Validates level boundaries from 1–93 SVG Markup Integrity | 🟡 Warning | Detects incomplete or malformed SVG markup

The 412 detected issues correspond to repeated curriculum/template prompts across sub-levels rather than missing answers, invalid levels, or malformed content.

This demonstrates that the audit is able to surface real dataset-level consistency patterns, rather than only synthetic test cases.


🧪 Verification

Unit Testing

Implemented a dedicated test suite covering all 12 required scenarios:

  • Valid question

  • Missing/short question text

  • Missing answer

  • Numeric 0 answer

  • String "0" answer

  • Invalid choices

  • Normalized duplicate questions

  • Level below valid range

  • Level above valid range

  • Valid level boundaries

  • Malformed SVG

  • Multiple simultaneous issues

Result: 12/12 tests passed.

TypeScript Validation

npm run lint

Frontend: 0 errors
Backend: 0 errors

Production Build

npm run build:frontend

Vite production build: PASS

Code Quality

git diff --check

No whitespace or formatting errors detected.

Browser Verification

The feature was verified through the running application:

  • Question Bank navigation

  • Audit execution

  • KPI cards

  • Category filters

  • Issue table

  • Live search

  • Question inspector

  • Read-only behavior

  • Browser console

No unhandled runtime errors observed.


📁 Scope of Changes

New Files

  • frontend/src/utils/questionBankAudit.ts

  • frontend/src/utils/questionBankAudit.test.ts

  • frontend/src/components/panels/QuestionBankPanel.tsx

Modified Files

  • frontend/src/components/PanelViews.tsx

  • frontend/src/components/Layout.tsx

Explicitly Unchanged

  • Backend APIs

  • Database schemas

  • Existing question records

  • Existing assessment functionality

  • Existing application routes


🌟 Engineering Impact

This feature establishes a foundation for proactive Question Bank quality monitoring within the FLN platform.

The architecture also keeps the audit engine independent and reusable, meaning additional validation rules can be introduced in the future without coupling the validation logic to the UI or backend.

Potential future extensions could include:

  • Automated remediation suggestions

  • Exportable audit reports

  • Historical integrity tracking

  • Quality trends across Question Bank versions

  • Duplicate similarity detection beyond exact normalized matches

  • Administrative approval workflows for flagged questions

For the current implementation, the focus remains intentionally narrow: detect, explain, and inspect — without modifying the underlying data.


✅ Final Status

Status: Ready for Review

The implementation is fully scoped to the approved Question Bank Audit & Integrity Check feature, with successful unit testing, TypeScript validation, production build verification, real-dataset analysis, and browser-level verification.

Screenshot 2026-09-01 152829 Screenshot 2026-09-01 152852 Screenshot 2026-09-01 152813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant