Package org.sakaiproject.tool.gradebook
Class CourseGradeRecord
- java.lang.Object
-
- org.sakaiproject.tool.gradebook.AbstractGradeRecord
-
- org.sakaiproject.tool.gradebook.CourseGradeRecord
-
- All Implemented Interfaces:
Serializable
public class CourseGradeRecord extends AbstractGradeRecord
A CourseGradeRecord is a grade record that can be associated with a CourseGrade.- Author:
- Josh Holtzman
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<CourseGradeRecord>calcComparator-
Fields inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
dateRecorded, gradableObject, graderId, id, studentId, version
-
-
Constructor Summary
Constructors Constructor Description CourseGradeRecord()Default no-arg constructorCourseGradeRecord(CourseGrade courseGrade, String studentId)The graderId and dateRecorded properties will be set explicitly by the grade manager before the database is updated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DoublegetAutoCalculatedGrade()DoublegetCalculatedPointsEarned()CourseGradegetCourseGrade()Convenience method to get the correctly cast CourseGrade that this CourseGradeRecord references.StringgetDisplayGrade()StringgetEnteredGrade()DoublegetEnteredPoints()DoublegetGradeAsPercentage()This method will fail unless this course grade was fetched "with statistics", since it relies on having the total number of points possible available to calculate the percentage.DoublegetNonNullAutoCalculatedGrade()For use by the Course Grade UI.static Comparator<CourseGradeRecord>getOverrideComparator(GradeMapping mapping)DoublegetPointsEarned()DoublegetTotalPointsPossible()voidinitNonpersistentFields(double totalPointsPossible, double totalPointsEarned)voidinitNonpersistentFields(double totalPointsPossible, double totalPointsEarned, double literalTotalPointsEarned)voidinitNonpersistentFields(double totalPointsPossible, double totalPointsEarned, double literalTotalPointsEarned, double totalPointsExtra)booleanisCourseGradeRecord()voidsetAutoCalculatedGrade(Double autoCalculatedGrade)voidsetCalculatedPointsEarned(double literalTotalPointsEarned)voidsetEnteredGrade(String enteredGrade)voidsetEnteredPoints(Double enteredPoints)voidsetTotalPointsPossible(Double totalPointsPossible)-
Methods inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
getDateRecorded, getGradableObject, getGraderId, getId, getStudentId, getVersion, setDateRecorded, setGradableObject, setGraderId, setId, setStudentId, setVersion, toString
-
-
-
-
Field Detail
-
calcComparator
public static Comparator<CourseGradeRecord> calcComparator
-
-
Constructor Detail
-
CourseGradeRecord
public CourseGradeRecord(CourseGrade courseGrade, String studentId)
The graderId and dateRecorded properties will be set explicitly by the grade manager before the database is updated.- Parameters:
courseGrade-studentId-
-
CourseGradeRecord
public CourseGradeRecord()
Default no-arg constructor
-
-
Method Detail
-
getOverrideComparator
public static Comparator<CourseGradeRecord> getOverrideComparator(GradeMapping mapping)
-
getGradeAsPercentage
public Double getGradeAsPercentage()
This method will fail unless this course grade was fetched "with statistics", since it relies on having the total number of points possible available to calculate the percentage.- Specified by:
getGradeAsPercentagein classAbstractGradeRecord- See Also:
AbstractGradeRecord.getGradeAsPercentage()
-
getCourseGrade
public CourseGrade getCourseGrade()
Convenience method to get the correctly cast CourseGrade that this CourseGradeRecord references.- Returns:
- CourseGrade referenced by this GradableObject
-
getEnteredGrade
public String getEnteredGrade()
- Returns:
- Returns the enteredGrade.
-
setEnteredGrade
public void setEnteredGrade(String enteredGrade)
- Parameters:
enteredGrade- The enteredGrade to set.
-
getEnteredPoints
public Double getEnteredPoints()
- Returns:
- Returns the enteredPoints.
-
setEnteredPoints
public void setEnteredPoints(Double enteredPoints)
- Parameters:
enteredPoints- The enteredPoints to set.
-
getAutoCalculatedGrade
public Double getAutoCalculatedGrade()
- Returns:
- Returns the autoCalculatedGrade.
-
getPointsEarned
public Double getPointsEarned()
- Specified by:
getPointsEarnedin classAbstractGradeRecord- Returns:
- Returns the pointsEarned
-
getDisplayGrade
public String getDisplayGrade()
- Returns:
- Returns the displayGrade.
-
isCourseGradeRecord
public boolean isCourseGradeRecord()
- Specified by:
isCourseGradeRecordin classAbstractGradeRecord- Returns:
- Whether this is a course grade record
- See Also:
AbstractGradeRecord.isCourseGradeRecord()
-
getNonNullAutoCalculatedGrade
public Double getNonNullAutoCalculatedGrade()
For use by the Course Grade UI.
-
initNonpersistentFields
public void initNonpersistentFields(double totalPointsPossible, double totalPointsEarned)
-
setCalculatedPointsEarned
public void setCalculatedPointsEarned(double literalTotalPointsEarned)
-
initNonpersistentFields
public void initNonpersistentFields(double totalPointsPossible, double totalPointsEarned, double literalTotalPointsEarned)
-
initNonpersistentFields
public void initNonpersistentFields(double totalPointsPossible, double totalPointsEarned, double literalTotalPointsEarned, double totalPointsExtra)
-
getCalculatedPointsEarned
public Double getCalculatedPointsEarned()
-
setAutoCalculatedGrade
public void setAutoCalculatedGrade(Double autoCalculatedGrade)
-
getTotalPointsPossible
public Double getTotalPointsPossible()
-
setTotalPointsPossible
public void setTotalPointsPossible(Double totalPointsPossible)
-
-