Skip to content

Conversation

@ty-kim7
Copy link

@ty-kim7 ty-kim7 commented Oct 19, 2025

This pull request focuses on improving the SQL challenge workflow in CTFd by introducing a more robust "test mode" for SQL query validation, enhancing user feedback, and updating dependencies. The changes clarify the distinction between test mode and real submissions, provide better error handling and notifications in the frontend, and update the backend and Dockerfile for improved reliability and maintainability.

Key changes include:

Test Mode Refactor and Backend Improvements:

  • Replaced the ambiguous "preview" flag with a clearer "test" flag throughout the backend, ensuring that test attempts for SQL challenges do not record submissions but still check correctness and provide detailed feedback. The logic and messaging for test mode were updated accordingly in both the API and plugin code (challenges.py, __init__.py). [1] [2] [3] [4] [5]
  • Updated the SQL judge server Go code to match the latest API changes and upgraded the go-mysql-server dependency to v0.20.0 for improved compatibility and features. The Dockerfile now uses Go 1.23 and ensures dependencies are tidied before building. [1] [2] [3] [4]

Frontend User Experience Enhancements:

  • Improved error handling in the SQL challenge frontend: added a new showErrorToast function for better error notifications, replaced alert() calls with toast notifications, and implemented a 20-second timeout for both test and submit requests to handle server delays gracefully. [1] [2] [3] [4] [5] [6] [7] [8]
  • Refined result display logic to distinguish between test mode and real submissions, ensuring that UI feedback and modals are only shown for actual solves, not for test attempts. (Fa84a477L452R517, platform/CTFd/themes/ddps/assets/js/sql_challenge.jsL520-R575)

Admin Interface Improvements:

  • Enhanced the SQL challenge admin page by improving the state dropdown and adding a "View Challenge Page" button for easier navigation. [1] [2]

These updates collectively make the SQL challenge experience clearer, more user-friendly, and robust for both participants and administrators.

@ty-kim7 ty-kim7 merged commit 74b2053 into main Oct 19, 2025
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