Skip to content

Developer docs: Data storage

Jonathan Wu edited this page Nov 10, 2023 · 3 revisions

This page describes the way CTFOJ stores data about problems, users, contests, and just about anything customizable through the site interface.

Problems

Problem data (hints, description, editorial) is stored in the filesystem as:

metadata/problems/<problem_id>/hints.md
metadata/problems/<problem_id>/description.md
metadata/problems/<problem_id>/editorial.md

If the problem has a download link, the zip file will be stored in the filesystem as:

dl/<problem_id>.zip

Basic data about the problem (name, id, point value, category, answer, and whether it's a draft) are stored in the problems table.

A list of users who have solved a problem can be found by querying the problem_solved table for user_id where problem_id=<problem_id>.

Submissions to the problem will be stored in the submissions table, with problem_id=<problem_id>, along with other data such as the verdict (correct/incorrect) and the actual text submitted.

Contests

## TODO

Announcements

## TODO

User Data

## TODO

File Structure

All of these data files will be stored in a designated data folder, while CTFOJ code resides in the src folder. Required data files are symlinked from the data folder to the working directory (src folder).