Open andreykul opened 9 years ago
Solved by #3
Modified criteria. Need to remove all code and rewrite it.
What do you think of a Single Table Inheritance from User?
Going to be trying to model this using an Assignment
table where:
User
.Course
.User
can:
Course
,Course
, andCourse
.Don't use an Assignment
since it will be used as part of a course.
In other words Assignments
and Labs
.
Also by your description it is no different from a role
that we had before.
The only difference is that now you might not need multiple assignments between a user
and a course
. Like you said before it can serve as a permissions table.
You're right. It's not that different. But the STI will probably not work, either since a User might not just be a User.
What did we decide upon on Mon? I don't quite remember.
We decided on Monday to use the three relationships as described in the issue.
But tell you what, let's do AB
testing:
You implement A
.
I implement B
.
We will meet on Monday and compare the two. What do you think?
Sounds good.
Refer to branch dev-issue1
of my AlexSafatli/Marker fork for my Permissions
table implementation.
As a case study, I created a user u
and a course c
. To determine u
's permissions for course c
, the following command would have to be performed.
c_permissions = u.permissions.where(course: c)
or
c_permissions = u.permissions.find_by_course(c)
To see if u
can see the marks for that course,
c_permissions.marks
To facilitate a clearer syntax, we could establish a method in the User
model that does this implicitly.
Permissions doesn't make too much sense since they are overlays of each other.
Modified original post.
Story
User has a role in a course
In order to know what to show to a user in a course I want to add a
role
relationship between a user and a courseScenario 1
Given
Bob
is astudent
in theCSCI1100
course. WhenBob
goes to theCSCI1100
course home page. Then He seesgrades
in the side barScenario 2
Given
Alice
is amarker
forCSCI1100
course And 5 labs have been assigned to her WhenAlice
goes to theCSCI1100
course home page. Then She sees5 labs(s) remaining to mark
Scenario 3
Given
Charlie
is aninstructor
for theCSCI1100
course. And there are 76 submission for Assignment 1. WhenCharlie
goes to theCSCI1100
course home page. Then He sees76 assignment[s) have been submitted for Assignment 1