org.sakaiproject.tool.gradebook
Class CourseGradeRecord

java.lang.Object
  extended by org.sakaiproject.tool.gradebook.AbstractGradeRecord
      extended by 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
static Comparator<CourseGradeRecord> calcComparator
           
 
Fields inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
dateRecorded, gradableObject, graderId, id, studentId, version
 
Constructor Summary
CourseGradeRecord()
          Default no-arg constructor
CourseGradeRecord(CourseGrade courseGrade, String studentId)
          The graderId and dateRecorded properties will be set explicitly by the grade manager before the database is updated.
 
Method Summary
 Double getAutoCalculatedGrade()
           
 Double getCalculatedPointsEarned()
           
 CourseGrade getCourseGrade()
          Convenience method to get the correctly cast CourseGrade that this CourseGradeRecord references.
 String getDisplayGrade()
           
 String getEnteredGrade()
           
 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.
 Double getNonNullAutoCalculatedGrade()
          For use by the Course Grade UI.
static Comparator<CourseGradeRecord> getOverrideComparator(GradeMapping mapping)
           
 Double getPointsEarned()
           
 void initNonpersistentFields(double totalPointsPossible, double totalPointsEarned)
           
 void initNonpersistentFields(double totalPointsPossible, double totalPointsEarned, double literalTotalPointsEarned)
           
 boolean isCourseGradeRecord()
           
 void setAutoCalculatedGrade(Double autoCalculatedGrade)
           
 void setEnteredGrade(String enteredGrade)
           
 
Methods inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
getDateRecorded, getGradableObject, getGraderId, getId, getStudentId, getVersion, setDateRecorded, setGradableObject, setGraderId, setId, setStudentId, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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:
getGradeAsPercentage in class AbstractGradeRecord
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.

getAutoCalculatedGrade

public Double getAutoCalculatedGrade()
Returns:
Returns the autoCalculatedGrade.

getPointsEarned

public Double getPointsEarned()
Specified by:
getPointsEarned in class AbstractGradeRecord
Returns:
Returns the pointsEarned

getDisplayGrade

public String getDisplayGrade()
Returns:
Returns the displayGrade.

isCourseGradeRecord

public boolean isCourseGradeRecord()
Specified by:
isCourseGradeRecord in class AbstractGradeRecord
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)

initNonpersistentFields

public void initNonpersistentFields(double totalPointsPossible,
                                    double totalPointsEarned,
                                    double literalTotalPointsEarned)

getCalculatedPointsEarned

public Double getCalculatedPointsEarned()

setAutoCalculatedGrade

public void setAutoCalculatedGrade(Double autoCalculatedGrade)


Copyright © 2011 Sakai Project. All Rights Reserved.