Post

Web CBT-MATICS: A Scalable Computer-Based Test Platform for Academic Competitions

Web CBT-MATICS: A Scalable Computer-Based Test Platform for Academic Competitions
Go React PostgreSQL Docker WebSocket

Web CBT-MATICS is a high-performance Computer-Based Test (CBT) platform engineered for MATICS, the premier Mathematics, Actuarial, and Information Systems Competition at Universitas Hasanuddin. It handles hundreds of concurrent participants with real-time state synchronization, anti-cheat monitoring, and instant scoring.

📋 Overview

Running large-scale academic competitions presents unique challenges: ensuring fair assessments, maintaining exam integrity, and streamlining grading. Traditional methods often falter under the weight of manual logistics.

Web CBT-MATICS addresses these by providing a digital ecosystem that automates the mundane while preserving rigorous standards. From real-time markdown rendering for complex math equations to millisecond-latency leadership updates, the platform is built for speed and reliability.


🏗️ System Architecture

The platform follows a clean layer architecture with a clear separation of concerns, ensuring maintainability and scalability.

flowchart TB
    subgraph Client ["Client Layer (React)"]
        Participant[Participant UI]
        Admin[Admin Dashboard]
        Invigilator[Invigilator Dashboard]
    end

    subgraph LB ["Load Balancing"]
        Nginx[Nginx Reverse Proxy]
    end

    subgraph Backend ["Backend Layer (Go/Gin)"]
        API[REST API Handlers]
        WS[WebSocket Hub]
        Service[Business Logic]
        Worker[Background Job Worker]
    end

    subgraph Data ["Data Layer"]
        Postgres[(PostgreSQL DB)]
        Redis[(Redis Cache)]
    end

    Participant -->|HTTPS/WSS| Nginx
    Admin -->|HTTPS| Nginx
    Invigilator -->|HTTPS/WSS| Nginx

    Nginx --> API
    Nginx --> WS

    API --> Service
    WS --> Service
    Service --> Postgres
    Service --> Redis
    Worker --> Postgres

Technology Stack

ComponentTechnologyRole
BackendGo (Gin)High-concurrency API & WebSocket handling
FrontendReact (Vite)Responsive, interactive UI with TailwindCSS
DatabasePostgreSQLRelational data integrity for exams/scores
Real-timeGorilla WebSocketLive state, chats, and violation alerts
DeploymentDocker & NginxContainerized production environment

⚡ Key Features

🛡️ Anti-Cheat System (The “Eagle Eye”)

One of the most critical aspects of an online exam is integrity. We implemented a heuristic based anti-cheat system that monitors client-side events.

Event TypeDescription
Tab Blur/FocusDetects when a user switches browser tabs
Window BlurDetects when the browser window loses focus
Visibility ChangeMonitors if the exam page is hidden
Copy/PastePrevents and logs clipboard interactions
Fullscreen ExitAlerts if the user exits forced fullscreen mode

All events are streamed via WebSockets to the Invigilator Dashboard in real-time.

sequenceDiagram
    participant P as Participant
    participant B as Backend Service
    participant I as Invigilator

    Note over P: User switches tab
    P->>B: WSS: {"type": "violation", "kind": "tab_switch"}
    B->>B: Log violation to DB
    B->>I: WSS: Broadcast Violation Alert
    Note over I: Dashboard flashes warning

🔄 Real-Time Synchronization

Using Go’s lightweight goroutines, the platform handles concurrent connections efficiently. This powers:

  • Instant Auto-Save: Answers are saved as they are typed/selected.
  • Live Leaderboards: Scores are recalculated instantly upon submission.
  • In-Exam Chat: Direct line of communication between proctors and participants.

📝 Flexible Exam Management

  • Dual Mode Support: Supports both Multiple Choice (auto-graded) and Essay (manually graded with rubrics).
  • Dynamic Scoring: Configure positive points for correct answers and negative numbering systems.
  • Team & Individual: Supports individual preliminary rounds and team-based semifinal stages.

🚀 Deployment & CI/CD

The system is fully containerized using Docker, allowing for consistent environments from development to production.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Simplified Docker Compose structure
services:
  backend:
    build: ./backend
    ports: ["8080:8080"]
    depends_on: [db]
  
  frontend:
    build: ./frontend
    ports: ["3000:80"]
  
  db:
    image: postgres:15-alpine
    volumes: [pgdata:/var/lib/postgresql/data]

We utilize GitHub Actions for our CI/CD pipeline, ensuring that every push to main runs tests and builds the Docker images automatically.


🎯 Conclusion

Web CBT-MATICS transforms the chaos of academic competitions into a streamlined, digital experience. By leveraging the performance of Go and the interactivity of React, we’ve built a platform that is not just a tool, but a reliable infrastructure for the future of academic assessment.

🔗 Live Platform & Repository

  • Live Site: cbt.matics.space (Restricted Access)
  • GitHub: [Private - Contact for Access]
This post is licensed under CC BY 4.0 by the author.