You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 KiB

Database

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

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

Comment

Comment entity holds one message published in arbitrary comment thread.

  • commentThread, user -- keys of thread where this comment belongs and author of the comment
  • isPrivate -- flag if the comment is for author only or public
  • postedAt -- date and time of comment post
  • text -- actual text of the comment

CommentThread

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.

Exercise

Exercise is a structure describing one problem. Exercises can have tree structure (exerciseId of parent), but now it is not used.

  • author -- key for user entity of the author
  • name -- name of the exercise
  • version -- version of the exercise; each edit increses this counter
  • createdAt -- date and time of creation
  • updatedAt -- date and time of last modification
  • difficulty -- description of difficulty, curretly used ones are easy, medium and hard
  • isPublic -- flag if the exercise is publicly visible to all supervisors or only to author

ExerciseFile

ExerciseFile entity is extension of UploadedFile entity, so they share one database table. Exercise file has some additional data:

  • hashName -- sha1sum of file content, used as name in job configurations
  • fileServerPath -- URL where the file is stored on file server
  • exerciseId -- key of exercise this supplementary file belongs to

ExternalLogin

ExternalLogin entity provides mapping between username in external login service and local user account.

  • user -- key to local user entity
  • authService -- identifier which extrnal service is the user using
  • externalId -- username in that particular external instance

ForgottenPassword

This entity is used for logging requests about password resets.

  • user -- key to user who requested the password change (or NULL if not known)
  • requestedAt -- date and time of password reset request
  • sentTo -- email address where the reset token was sent to
  • redirectUrl -- URL where the user is supposed to change his password
  • IPaddress -- IP address from where the request came from (parsed from HTTP request header)

Group

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

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)

HardwareGroup

HardwareGroup entity represents used hardware groups by the backend. Now this table has to be changed manually when a new hardware group is added, but it is possible to automate this in the future. The hardware group has only one column with data, the textual description.

HardwareGroupAvailabilityLog

This entity provides information about hardware group changes during time. System administrator should keep the data up-to-date with backend state.

  • hardwareGroup -- key to HardwareGroup entity
  • isAvailable -- flag if the hardware group becomes available or disabled
  • loggedAt -- date and time of the change
  • description -- reason for the change

Instance

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
  • description -- Markdown styled textual description
  • 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)

Licence

Licence entity gives validity to instance. For normal usage an instance needs valid licence for proper functionality.

  • instance -- instance key the licence is bound to
  • isValid -- flag if this licence is valid or blocked by administrator
  • validUntil -- date and time until the licence is valid (expiration time)
  • note -- optional note about the licence

LocalizedAssignment

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)
  • description -- actual text
  • localizedAssignment -- key refering to parent localized assignment; when editing, new version is created as a child of the original one
  • createdAt -- date and time of creation

Login

Login entity holds credentials for logging into ReCodEx system using internal authentication.

  • user -- key refering to user entity
  • username -- mail of the user
  • passwordHash -- hashed password, generated by Nette Passwords::hash() method

Permission

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
  • action -- action, usually different for each endpoint, wildcard can be specified as *; from example above action is view-all string
  • isAllowed -- flag if the rule is allowed of denied

ReferenceExerciseSolution

ReferenceExerciseSolution contains additional data for reference solution than normal solution created by student submit.

  • exercise, solution -- keys refering to exercise this entity is bound to and solution entity used for submitting
  • uploadedAt -- date and time of creation
  • description -- textual description of used algorithm or other note about the particular solution

ReferenceSolutionEvaluation

ReportedErrors

Resource

Role

RuntimeEnvironment

Solution

SolutionEvaluation

SolutionFile

SolutionRuntimeConfig

Submission

SubmissionFailure

TestResult

UploadedFile

User

UserAction

UserSettings

User settings belong to some particular user and contains settings mostly for web application.

  • darkTheme -- dark mode will be used in text editor in web application
  • vimMode -- turn vim mode on in text editor used by web application
  • defaultLanguage -- default language which will be used in web application