org.sakaiproject.tool.gradebook
Class AssignmentGradeRecord

java.lang.Object
  extended byorg.sakaiproject.tool.gradebook.AbstractGradeRecord
      extended byorg.sakaiproject.tool.gradebook.AssignmentGradeRecord
All Implemented Interfaces:
Serializable

public class AssignmentGradeRecord
extends AbstractGradeRecord

An AssignmentGradeRecord is a grade record that can be associated with an Assignment.

Author:
Josh Holtzman
See Also:
Serialized Form

Field Summary
protected  String displayGrade
           
 
Fields inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
dateRecorded, gradableObject, graderId, id, pointsEarned, studentId, version
 
Constructor Summary
AssignmentGradeRecord()
           
AssignmentGradeRecord(Assignment assignment, String studentId, Double grade)
          The graderId and dateRecorded properties will be set explicitly by the grade manager before the database is updated.
 
Method Summary
 Assignment getAssignment()
           
 String getDisplayGrade()
           
 Double getGradeAsPercentage()
          Returns null if the points earned is null.
 boolean isCourseGradeRecord()
           
 void setDisplayGrade(String displayGrade)
           
 
Methods inherited from class org.sakaiproject.tool.gradebook.AbstractGradeRecord
getDateRecorded, getGradableObject, getGraderId, getId, getPointsEarned, getStudentId, getVersion, setDateRecorded, setGradableObject, setGraderId, setId, setPointsEarned, setStudentId, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

displayGrade

protected String displayGrade
Constructor Detail

AssignmentGradeRecord

public AssignmentGradeRecord()

AssignmentGradeRecord

public AssignmentGradeRecord(Assignment assignment,
                             String studentId,
                             Double grade)
The graderId and dateRecorded properties will be set explicitly by the grade manager before the database is updated.

Parameters:
assignment - The assignment this grade record is associated with
studentId - The student id for whom this grade record belongs
grade - The grade, or points earned
Method Detail

getGradeAsPercentage

public Double getGradeAsPercentage()
Returns null if the points earned is null. Otherwise, returns earned / points possible * 100.

Specified by:
getGradeAsPercentage in class AbstractGradeRecord
See Also:
AbstractGradeRecord.getGradeAsPercentage()

getDisplayGrade

public String getDisplayGrade()
Returns:
Returns the displayGrade.

setDisplayGrade

public void setDisplayGrade(String displayGrade)
Parameters:
displayGrade - The displayGrade to set.

isCourseGradeRecord

public boolean isCourseGradeRecord()
Specified by:
isCourseGradeRecord in class AbstractGradeRecord
Returns:
Whether this is a course grade record
See Also:
AbstractGradeRecord.isCourseGradeRecord()

getAssignment

public Assignment getAssignment()