Admin Controls & CLI Tools
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Admin Controls & CLI Tools in the Debug Arena platform provide event organizers with the necessary mechanisms to manage team progress, handle security overrides, and maintain session integrity. These tools are designed to facilitate manual intervention during live coding events, such as reinstating disqualified teams or managing session-specific data.
The system encompasses both backend logic integrated into the Flask application and standalone CLI utilities. These components allow administrators to interact directly with the database to reset violation counters and monitor team statistics, ensuring that the competitive environment remains functional and fair.
Sources: README.md:37-41, admin_reset.py:1-24
CLI Administration Tools
The platform provides a Command Line Interface (CLI) tool specifically for team management and session overrides. This tool operates outside the standard web interface, allowing for direct database manipulation through the application context.
Team Reset Utility
The admin_reset.py script serves as the primary CLI interface for resetting team statuses. It is used to reinstate teams that have been automatically disqualified by the proctoring system due to protocol violations.
- Logic: The script searches for a team by its
team_name, resets theviolationscount to 0, and commits the changes to the database. - Context: It imports the Flask
appinstance to access theapp_context, ensuring that database operations are performed within the correct environment.
Sources: admin_reset.py:5-24, models/team.py:20
Violation and Security Management
Administrators manage the automated proctoring system, which monitors team behavior in real-time. The system enforces a strict "three-strike" policy before automatic disqualification.
Security Overrides
While the system automatically increments violations via the /log_violation endpoint, administrators can use CLI tools to manually override these states.
| Feature | Description | File Reference |
|---|---|---|
| Violation Threshold | Disqualification occurs at 3 violations | proctor.js, arena_routes.py |
| Manual Reset | Resets violation count to 0 | admin_reset.py |
| Status Monitoring | Displays Current Score and Violations | admin_reset.py |
Data Flow for Disqualification and Reinstatement
The following sequence shows how a team moves from a violation state to being reinstated by an administrator.
Configuration and Environment
Admin tools rely on the core application configuration to access the database and system resources.
Database Configuration
The admin tools utilize the SQLALCHEMY_DATABASE_URI defined in the main application. This ensures that CLI scripts target the same data source as the live web application, whether it is a local SQLite instance or a production-ready PostgreSQL database.
- Database Path: Typically located at
instance/db.sqlite3for local development. - Track Modifications: Disabled (
False) to reduce overhead.
Sources: app.py:23-31, database/init_db.py:11-18
Team Model Fields for Administration
Administrators primarily interact with the following fields within the Team model:
| Field | Type | Description |
|---|---|---|
team_name | String(50) | Unique identifier for the team used in CLI commands. |
violations | Integer | Counter used to track anti-cheat strikes (Default: 0). |
total_score | Integer | Calculated points across all levels. |
current_level | Integer | Tracks team progression through the arena. |
| Sources: models/team.py:7-22 |
Conclusion
Admin Controls & CLI Tools provide a robust backend management layer for the Debug Arena. By combining automated proctoring with manual CLI-based overrides, the system allows for flexible event management. The ability to reset team violations and monitor stats through direct database interaction ensures that technical issues or specific event requirements can be addressed without disrupting the overall platform architecture.
Sources: README.md:37-41, admin_reset.py:20-22