Used database schema is generated by ORM framework Doctrine from ReCodEx API source code. Tables are directly mapped to _entities_, which are PHP classes annotated with data provided by ORM framework. In the following text there is a brief description of each such entity. There may be some additional database tables for many-to-many relations between entities, but these tables are not discussed in detail because there are only two columns with keys of both related tables in each one. Graphical database schema is added as attachement to this documentation.
Assignment table represents exercise assignment in a group. It holds keys of the exercise (_exerciseId_) and group (_groupId_) where is the exercise assigned. Other columns are:
- _isPublic_ -- assignment can be public (visible to students) or private (visible only to supervisor of the group)
- _submissionCountLimit_ -- number of attempts student can make to solve the exercise
- _scoreConfig_ -- configuration for calculating point score; actual syntax depends on used score calculator
- _firstDeadline_ -- date and time after that no new submissions are received
- _allowSecondDeadline_, _secondDeadline_ -- flag if another deadline is allowed, date and time of that deadline
- _maxPointsBeforeFirstDeadline_, _maxPointsBeforeSecondDedline_ -- maximal amount of points for correct solutions for first (respectively second) deadline
- _scoreCalculator_ -- name of used score score calculator or NULL for API's default one
- _canViewLimitRatios_ -- flag if student can view percentage of used time and memory limits for each test
- _deletedAt_ -- assignment cannot be deleted due to possible numerous dependencies, but can be hidden from the users; published assignments have NULL value, deleted ones have time of deletion
CommentThread entity contains all comments in one thread by one-to-many relation. From database perspective, this table has only one column with primary key and the relation is made by foreign key column in Comment table.
Group entity contains data about a group. They can be hierarchical, reference to the parent is obtained by _parentGroup_ key. Top level groups has this field set to NULL. Each group belongs to one instance referenced by _instance_ key. Also, each group has its administrator user referenced by _admin_ key. Other data:
- _name_ -- name of the group
- _description_ -- Markdown styled text description of the group
- _threshold_ -- percentage of maximal points required to complete the course in float between 0 and 1 (or NULL)
- _publicStats_ -- flag if user can view total number of points for other users in the group
- _isPublic_ -- flag if the group is visible for all students in instance or it is hidden (only for members)
- _externalId_ -- external identifier of the group (or NULL), for example course code like NPRG042
GroupMembership represents relation between group and its members. Also it contains additional data, so this entity is not autogenerated by Doctrine. Essential parts are keys to user and group entities (_user_ and _group_ keys). Additional data:
- _status_ -- user status in the group, one of _requested_, _accepted_ and _rejected_
- _type_ -- type of user access, one of _student_, _supervisor_ and _*_ for all
- _requestedAt_ -- date and time the join request was received (or NULL)
- _joindedAt_ -- date and time the request for joining was accepted (or NULL)
- _rejectedAt_ -- date and time the request for joining was rejected (or NULL)
- _studentSince_ -- date and time when the user became a student, usually time of registration (or NULL)
- _supervisorSince_ -- date and time when the user became a supervisor (or NULL)
Instance entity represents separation of multiple organisations using the same API server. Each group or user belong to exactly one instance. User permissions are only valid in his instance.
- _admin_ -- key referencing administrator user entity
- _isOpen_ -- flag if new user can register themselves in this instance
- _isAllowed_ -- flag if the instance cen be used or is disabled for all users
- _createdAt_ -- date and time of instance creation
- _updatedAt_ -- date and time of last modification
- _needsLicence_ -- flag if this instance needs a velid license
- _deletedAt_ -- instance cannot be directly deleted due to possibility of many dependencies, but instead it can be hidden from users by setting this field to date and time of deletion (active instances have NULL value)
LocalizedAssignment entity represent text or description of the problem in one language mutation. Exercises and assignments uses these text to display problem description to users. The text can be Markdown styled.
- _name_ -- title of this localized assignment
- _locale_ -- language code of locale this text is written in (for example _en_)
Permission entity holds permissions for user roles. API endpoints can have a permission restriction assigned by annotation _@UserIsAllowed(exercises="view-all")_ which are checked before endpoint invocation. These permission are gained to user roles in this entity.
- _role_ -- key of the role this permission is assigned to
- _resource_ -- resource name, usually same for all endpoints in one presenter; from the example above resource is _exercises_ string
Resource entity represent different resources used in ReCodEx system. These resources can be used in presenter actions for access restrictions. Resource contain list of permissions in one-to-many relation, but from database perspective this table has only one column with the resource name.
Stores information about supported environments which can be used for evaluation on workers. On student submit the correct environment is determined by extensions of uploaded files.
- _user_ -- user key to whom this solution belongs to
- _files_ -- exercise solution files which user uploaded and are associated with solution; not actual database column, one-to-many relation is stored by each file
- _solutionRuntimeConfig_ -- runtime configuration key which was used during execution on worker
- _resultYml_ -- whole yaml file with evaluation results acquired from backend
- _testResults_ -- results of all tests associated with user solution; not actual database table, one-to-many relation is stored by TestResult entities
SolutionFile entity is extension of UploadedFile entity, so they share one database table. Solution file has one additional column of associated solution key.
SolutionRuntimeConfig entity connects job configuration to runtime environment. This entity is backed up on every update, old version is set as _createdFrom_ key in the new version. On student submission one runtime config is chosen based on files extensions and corresponding job configuration is used for evaluation in the backend.
Entity which represents one file which was uploaded to API server. This entity uses _Single Table Inheritance_ and its children are ExerciseFile and SolutionFile entities.