master
Petr Stefan 8 years ago
parent 0eaa348d66
commit 6fe1bd6f27

@ -4,7 +4,7 @@ Used database schema is generated by ORM framework Doctrine from ReCodEx API sou
## Assignment
Assignment table represents exercise assignment in a group. It holds keys of the exercise and group where is the exercise assigned. Other columns are:
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
@ -18,36 +18,148 @@ Assignment table represents exercise assignment in a group. It holds keys of the
## 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()](https://api.nette.org/2.3/source-Security.Passwords.php.html#27) 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

Loading…
Cancel
Save