package user.student; import assignment.Assignment; import assignment.AssignmentGrade; import course.CurveSetting; import course.LetterGrade; import admin.User; import util.GraderObject; import java.util.Collection; /** * Class containing all of the information for a student's record. */ public abstract class StudentRecord implements GraderObject { /** * Student's user information */ User student; /** * Student-specific comment from the instructor. */ String comment; /** * Student's assignment grades. */ Collection grades; /** * Raw percentage grade of the student. */ double rawPercentage; /** * Letter grade of the student. */ LetterGrade letterGrade; /** * Accessor for the student's grade on the specified Assignment. * @return grade the student received for the Assignment. *

pre: grades != null && grades.contains(assignment) post: grades.contains(return) && grades'.size() == grades.size() */ public abstract AssignmentGrade getAssignmentGrade(Assignment assignment); /** * Accessor for the entire Collection of * AssignmentGrades for the student. * @return all AssignmentGradess of this student. *

pre: grades != null; post: forall (AssignmentGrade ag; grades.contains(ag)) */ public abstract Collection getAllAssignmentGrades(); /** * Accessor for the personal User information of the student. * @return User information of the student. *

pre: student != null post: return.equals(student) */ public abstract User getUserInfo(); /** * Accessor for the comment written by the instructor about the student. * @return comment written by the instructor. *

pre: student != null post: // none */ public abstract String getStudentComment(); /** * Sets the comment for the student. * @param studentComment comment for the student. *

pre: student != null && studentComment != null; post: getStudentComment().equals(studentComment) */ public abstract void setStudentComment(String studentComment); /** * Calculates and returns the raw percentage grade of the student. * @return raw percentage grade. *

* pre: student != null post: // none */ public abstract double getRawPercentageGrade(); /** * Calculates and returns the letter grade of the student. * @param curve CurveSetting of the course a student is in. * @return letter grade. *

* pre: curve != null && student != null && getRawPercentageGrade() >= 0 post: // none */ public abstract LetterGrade getLetterGrade(CurveSetting curve); }