diff --git a/src/main/java/nl/tudelft/labracore/model/Grade.java b/src/main/java/nl/tudelft/labracore/model/Grade.java
new file mode 100644
index 0000000000000000000000000000000000000000..bcea6256d5af2be14d79ff2db783519683a7bdaa
--- /dev/null
+++ b/src/main/java/nl/tudelft/labracore/model/Grade.java
@@ -0,0 +1,78 @@
+/*
+ * Labracore - A connecting core service for Labrador products
+ * Copyright (C) 2020- Delft University of Technology
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package nl.tudelft.labracore.model;
+
+import java.time.LocalDateTime;
+
+import javax.persistence.Embeddable;
+import javax.persistence.ManyToOne;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import com.sun.istack.NotNull;
+import com.sun.istack.Nullable;
+
+/**
+ * The grade given to an Assignment submission. Grades can be defined in many different ways. We support all
+ * the grade types in {@link GradeScheme}.
+ *
+ * When a score or grade is given, some maximum needs to be used to indicate the relative score represented.
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Embeddable
+public class Grade {
+ /**
+ * The scheme the grade is in. This indicates the type of grade one is getting. Examples of different
+ * schemes are a pass/fail scheme, or an absolute score.
+ */
+ @NotNull
+ private GradeScheme type;
+
+ /**
+ * The score assigned to the work. This should be relativized with the grade scheme selected. For
+ * instance, a score of 1 does not necessarily mean the work is bad, as the grade could be given using a
+ * pass/fail scheme, in which case 1 represents a pass.
+ */
+ @NotNull
+ private Integer score;
+
+ /**
+ * The time this grade was assigned or the time that the script finished grading the particular submission
+ * this assignment is used in.
+ */
+ @NotNull
+ private LocalDateTime gradedAt;
+
+ /**
+ * Whether the grade was given by a script or by a human. {@code true} when given by a script.
+ */
+ @NotNull
+ private Boolean isScriptGraded;
+
+ /**
+ * The {@link Person} that graded this submission. Can be null when the grade was given through a script.
+ * Can also be the {@link Person} that initiated the script grading if such an action was done manually.
+ */
+ @ManyToOne
+ @Nullable
+ private Person gradedBy;
+}
diff --git a/src/main/java/nl/tudelft/labracore/model/GradeScheme.java b/src/main/java/nl/tudelft/labracore/model/GradeScheme.java
new file mode 100644
index 0000000000000000000000000000000000000000..77b6dbf16db8cae54fe982e517fb605c0a0480d8
--- /dev/null
+++ b/src/main/java/nl/tudelft/labracore/model/GradeScheme.java
@@ -0,0 +1,70 @@
+/*
+ * Labracore - A connecting core service for Labrador products
+ * Copyright (C) 2020- Delft University of Technology
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package nl.tudelft.labracore.model;
+
+import lombok.Getter;
+
+/**
+ * The scheme of a grade. The scheme of a grade can currently be pass/fail or some number. In the case of a
+ * number score, a maximum should be defined for the score to relativize it to other scores.
+ *
+ * Different grades and score types represent different levels of precision that can be represented through
+ * integers.
+ */
+public enum GradeScheme {
+ PASS_FAIL(
+ 0, 1
+ ),
+
+ DUTCH_GRADE(
+ 10, 100
+ ),
+ DUTCH_GRADE_1000(
+ 100, 1000
+ ),
+
+ SCORE_OUT_OF_10(
+ 0, 10
+ ),
+ SCORE_OUT_OF_100(
+ 0, 100
+ ),
+ SCORE_OUT_OF_1000(
+ 0, 1000
+ ),
+ SCORE_OUT_OF_10000(
+ 0, 10000
+ );
+
+ /**
+ * The minimum integer number that can be assigned as a grade within this scheme.
+ */
+ @Getter
+ private final int min;
+
+ /**
+ * The maximum integer number that can be assigned as a grade within this scheme.
+ */
+ @Getter
+ private final int max;
+
+ GradeScheme(int min, int max) {
+ this.min = min;
+ this.max = max;
+ }
+}
diff --git a/src/main/java/nl/tudelft/labracore/model/Person.java b/src/main/java/nl/tudelft/labracore/model/Person.java
index 71b85ac4ecae7108cd9f8b41f6771e4933675e9c..b04af3ae2d9377c27bbddbfbed99afcff0fe1fba 100644
--- a/src/main/java/nl/tudelft/labracore/model/Person.java
+++ b/src/main/java/nl/tudelft/labracore/model/Person.java
@@ -116,4 +116,10 @@ public class Person {
@ManyToMany(mappedBy = "people")
private List<Cluster> clusters = new ArrayList<>();
+ @Builder.Default
+ @ToString.Exclude
+ @EqualsAndHashCode.Exclude
+ @ManyToMany(mappedBy = "grade.gradedBy")
+ private List<Submission> graded = new ArrayList<>();
+
}
diff --git a/src/main/java/nl/tudelft/labracore/model/Submission.java b/src/main/java/nl/tudelft/labracore/model/Submission.java
index 6e9a43ade4c4dd7582cb7e50bd0f00764c189d04..063c5874094f75513e500ead084b2a3e58fcd3df 100644
--- a/src/main/java/nl/tudelft/labracore/model/Submission.java
+++ b/src/main/java/nl/tudelft/labracore/model/Submission.java
@@ -19,10 +19,7 @@ package nl.tudelft.labracore.model;
import java.time.LocalDateTime;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
+import javax.persistence.*;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
@@ -54,5 +51,6 @@ public class Submission {
private LocalDateTime submissionTime = LocalDateTime.now();
private LocalDateTime approvalTime;
- private Double grade;
+ @Embedded
+ private Grade grade;
}