Disqualification & Victory Views
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Disqualification & Victory Views serve as the terminal states for a team's journey within the Debug Arena. These views represent the two possible final outcomes of the competition: exclusion from the platform due to integrity violations or successful completion of all technical challenges.
The Disqualification view is triggered by the anti-cheat system (proctor.js) when a team exceeds a predefined threshold of security violations, such as tab-switching or exiting fullscreen mode. Conversely, the Victory view is accessible only to teams that have successfully debugged all levels, marking the conclusion of their session with a final total score. Sources: README.md, routes/arena_routes.py:126-151, static/js/proctor.js:29-33
Disqualification System
The disqualification system is a security enforcement mechanism that prevents teams from continuing the competition if they violate the "Protocol." This state is persistent and backed by the database.
Violation Threshold and Logic
Disqualification occurs when the violations field in the Team model reaches or exceeds the value of 3. This field is incremented via the /log_violation API endpoint, which is called by the client-side proctoring script. Sources: models/team.py:18, routes/arena_routes.py:108-112, static/js/proctor.js:4
The diagram above illustrates the transition from a security violation to the final Disqualification state.
Sources: static/js/proctor.js:23-45, templates/disqualified.html:20-29
Disqualification View Features
The /disqualified route renders a template that displays the following information:
- Team Identity: The name of the team that has been disqualified.
- Final Score: The total score accumulated before the protocol violation occurred.
- Status Label: A visual indicator set to "LOCKED."
- Return to Login: An option for the team to exit the session.
Sources: templates/disqualified.html:16-30, routes/arena_routes.py:126-137
Victory System
The Victory state is the successful termination point of the Debug Arena. It represents the "Arena Conquered" state.
Victory Trigger and Level Progression
Access to the Victory view is gated by the team's current_level. In the current implementation, a team must complete Level 8 to unlock the transition to victory. The run_code route checks if the completed level is the final one and updates the client-side modal to offer the "Claim Final Victory" action. Sources: templates/arena.html:150-156, routes/arena_routes.py:145-151
The sequence diagram shows the logic flow for a team successfully completing the final level and reaching the victory screen.
Sources: routes/submit_routes.py:46-52, routes/arena_routes.py:145-151
Victory View Features
The /victory route displays the "Mission Accomplished" screen, which includes:
- Final Standings: A prominent display of the team's
total_scoreformatted as the "Final Total Score." - Elite Status: A status badge labeled "Elite Debugger."
- College Affiliation: Displays the college name associated with the team.
- Celebration: Triggered client-side confetti effects upon page load.
Sources: templates/victory.html:18-40, templates/victory.html:51-66
Comparison of Terminal Views
| Feature | Disqualified View | Victory View |
|---|---|---|
| Trigger | violations >= 3 | current_level > total_levels |
| Route | /disqualified | /victory |
| Status Display | "LOCKED" | "Elite Debugger" |
| Visual Theme | Red / Alert / Error | Yellow / Gold / Accomplishment |
| Navigation | Logout only | View Leaderboard / Exit Arena |
| DB Impact | Session effectively terminated | Completion recorded |
Sources: templates/disqualified.html, templates/victory.html, routes/arena_routes.py:126-151
Implementation Details
Route Gatekeeping
Both views include checks to ensure teams cannot bypass logic to reach these states prematurely.
# From routes/arena_routes.py
@arena.route('/victory')
def victory():
if 'team_id' not in session:
return redirect(url_for('auth.login'))
team = Team.query.get(session['team_id'])
total_levels = max(LEVELS.keys())
# Redirect back if they haven't actually finished Level 8
if team.current_level <= total_levels:
return redirect(url_for('arena.dashboard'))
return render_template('victory.html', team=team)
Sources: routes/arena_routes.py:141-151
Administrative Overrides
While the Disqualification view represents a terminal state for the user, an administrative script admin_reset.py exists to reset a team's violations back to 0, effectively removing the disqualification status and allowing them to return to the Arena Dashboard. Sources: admin_reset.py:1-18
Conclusion
The Disqualification and Victory views provide the essential resolution to the competitive experience in Debug Arena. By integrating client-side proctoring with server-side validation and state management, the platform ensures that terminal states are reached either through mastery of the debugging challenges or through systematic enforcement of competition rules.