-
Notifications
You must be signed in to change notification settings - Fork 2
Database
+------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | name | varchar(255) | NO | | NULL | | | slug | varchar(255) | NO | | NULL | | | active | tinyint(1) | NO | | 1 | | | created_at | timestamp | YES | | NULL | | | updated_at | timestamp | YES | | NULL | | +------------+------------------+------+-----+---------+----------------+
+-----------+------------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------------------------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| course_id | int(10) unsigned | NO | MUL | NULL | |
| user_id | int(10) unsigned | NO | MUL | NULL | |
| role | enum('instructor','assistant','student') | NO | | NULL | |
+-----------+------------------------------------------+------+-----+---------+----------------+
There is a many-to-many relationship between a user and a course. A user has one of three roles for a course. They are either an instructor, assistant, and student.
+--------------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | course_id | int(10) unsigned | NO | MUL | NULL | | | name | varchar(255) | NO | | NULL | | | slug | varchar(255) | NO | | NULL | | | description | mediumtext | NO | | NULL | | | created_at | timestamp | YES | | NULL | | | updated_at | timestamp | YES | | NULL | | | requiresRepository | tinyint(1) | NO | | 0 | | | similarity | double(8,2) | NO | | 100.00 | | | fileChecker | varchar(255) | NO | | | | | start | datetime | NO | | NULL | | | due | datetime | NO | | NULL | | +--------------------+------------------+------+-----+---------+----------------+
Assignments have a many-to-one relationship with a course. In the future, the value of similarity and fileChecker should be stored elsewhere. The column similarity is the value sent to the similarity checker. The column FileChecker is the path where the ideal file system layout is stored. In the future, It would be nice to create a plugin/module system so that an instructor can enhance what occurs during a git hook.
+---------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | assignment_id | int(10) unsigned | NO | MUL | NULL | | | user_id | int(10) unsigned | NO | MUL | NULL | | | repository_id | int(10) unsigned | YES | MUL | NULL | | | created_at | timestamp | YES | | NULL | | | updated_at | timestamp | YES | | NULL | | +---------------+------------------+------+-----+---------+----------------+
A submissions refers to a student's individual work for an assignment.
Each submission is linked to an assignment and a user.
It is safe to assume that the user has the roll of a student for the assignment attached to the course.
The column repository_id should only be used if the connected assignment has requiresRepository set to true.
+-------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | | NULL | |
| path | varchar(255) | NO | UNI | NULL | |
| initialized | tinyint(1) | NO | | 0 | |
| backend | enum('git') | NO | | NULL | |
| created_at | timestamp | YES | | NULL | |
| updated_at | timestamp | YES | | NULL | |
+-------------+------------------+------+-----+---------+----------------+
At the start the goal was to have 3 different repository types: AssignmentRepository, GroupRepository, and IndividualRepository.
Assignment repositories would be used for individual assignments compared to a group repository that should allow students to work together on a project.
Currently we only have the AssignmentRepository finished.
In the future we should rename this table to AssignmentRepository since the underlying model Repository in laravel is starting to get coupled with courses. This means that we would have three database tables and three different classes in laravel.