Suggestions on improving my schema

prisma

#1

Hi, I’m working on a project where I can track students grades.

Two types of Users exist in this project, Teachers and Students.

Teachers can view all the courses they teach, the students registered for the courses and change evaluation mode, grades etc.

Students can only see the grades to the courses they’re registered to.

This is my current schema:

type User {
  id: ID! @unique
  email: String! @unique
  password: String!
  firstName: String!
  lastName: String!
  student: Student
  teacher: Teacher
}

type Teacher {
  id: ID! @unique
  info: User! @unique
  courses: [Course!]!
}

type Student {
  id: ID! @unique
  info: User! @unique
  year: Int!
  courses: [StudentCourse!]!
}

type Course {
  id: ID! @unique
  name: String!
  semester: String!
  year: Int!
  teacher: Teacher!
  situation: [StudentCourse!]!
}

type StudentCourse {
  id: ID! @unique
  course: Course!
  student: Student!
  evaluation: [Evaluation!]!
  finalGrade: Int
}

type Evaluation {
  id: ID! @unique
  name: String!
  gradeAvg: Float
  studentCourse: StudentCourse
  situation: [EvaluationSituation!]!
}

type EvaluationSituation {
  id: ID! @unique
  name: String
  grade: Float
}

Ok, so StudentCourse is the relation between a Course and a Student, and for that Student I can see the finalGrade and the evaluation in detail.

The part where I think I need improvemenets is the Evaluation type.
So I thought that a Course can have as evaluation modes a written exam, project presentation, weekly assignments.

EvaluationSituation can have as data info on Week 1 assignment, Week2 etc. (all these are part of the weekly assignmnets evaluation).

Do you think it’s good this schema? I’m thinking maybe it would be better to have Evaluation for a Course, not for CourseStudents, but then I don’t know how to keep track of the grade for each student’s evaluation.

Do you have any ideas on how I can improve this?

Thanks in advance! :blush: