Error Monitoring Strategy
ProctorAI utilizes a multi-layered monitoring strategy to ensure both technical stability and exam integrity. This strategy encompasses pre-exam hardware verification, global exception handling, and real-time behavioral anomaly detection.
Pre-Exam System Verification
Before a student can access the exam environment, the platform performs a series of mandatory system checks. This proactive monitoring ensures that the hardware and network environment meet the minimum requirements for a secure session.
The system validates the following components during the setup phase:
| Check | Description | Recovery Action |
| :--- | :--- | :--- |
| Browser Compatibility | Verifies WebRTC support and modern API availability. | Prompts user to update or switch browsers. |
| Network Connection | Monitors RTT (Round Trip Time) and online status. | Blocks entry if the connection is unstable or offline. |
| Webcam Access | Requests and verifies active video stream permissions. | Provides troubleshooting steps for camera privacy settings. |
| Microphone Access | Requests audio permissions and initializes an AnalyserNode. | Ensures audio levels are detectable before proceeding. |
| Identity Verification | Uses canvas pixel analysis to ensure a face is present. | Prevents exam start if identity cannot be verified. |
Global Error Reporting
ProctorAI implements a centralized error handling mechanism via the ErrorReporter component. This utility is designed to catch unhandled exceptions across the Next.js App Router and provide a graceful recovery path for the user without compromising the exam state.
Usage in Global Error Boundaries
The ErrorReporter is automatically invoked by the Next.js error.tsx or global-error.tsx files. It captures the error digest and provides a "Reset" interface to attempt a client-side recovery.
import ErrorReporter from "@/components/ErrorReporter";
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<html>
<body>
<ErrorReporter error={error} reset={reset} />
</body>
</html>
);
}
Real-Time Violation Monitoring
During an active session, the platform monitors "behavioral errors"—actions that deviate from the established integrity rules. These are processed as real-time events and transmitted to the Proctor Dashboard.
Monitored Anomalies
The system monitors for the following behavioral triggers:
- Tab Switching: Detected via the
visibilitychangeAPI. Repeated violations may trigger an automatic "Flagged" status. - Gaze Deviation: Monitors if the student's eyes leave the screen area for an extended period.
- Audio Anomalies: Detects background voices or sudden noise spikes using the Web Audio API.
- Face Presence: Continuous monitoring via
videoRefto ensure the student remains in view.
Alert Severity Levels
Violations are categorized by severity to help proctors prioritize interventions:
- Low: Minor gaze deviations or unusual head movements.
- Medium: Background audio anomalies or unauthorized browser tab switches.
- High/Critical: Total face absence, multiple faces detected, or system-level tampering.
Analytics and Trend Monitoring
System-level performance and integrity trends are aggregated in the Analytics Dashboard. This allows administrators to monitor the health of the proctoring ecosystem at scale.
Key metrics tracked include:
- Flagged Rate: Percentage of sessions requiring proctor intervention.
- Violation Distribution: Breakdown of the most common error types (e.g., 40% Tab Switches vs. 10% Audio Anomaly).
- Risk Score Over Time: A rolling average of student risk scores used to identify peak periods of suspicious activity.
Visual-Edit Instrumentation
For developers using Orchids tooling, the application includes visual-edit instrumentation. This allows for live debugging and adjustment of the monitoring UI components without manual code changes, ensuring that proctoring alerts and dashboard metrics are rendered accurately across different viewports.