org.sakaiproject.tool.gradebook
Class Assignment

java.lang.Object
  extended byorg.sakaiproject.tool.gradebook.GradableObject
      extended byorg.sakaiproject.tool.gradebook.Assignment
All Implemented Interfaces:
Serializable

public class Assignment
extends GradableObject

An Assignment is the basic unit that composes a gradebook. It represents a single unit that, when aggregated in a gradebook, can be used as the denomenator in calculating a CourseGradeRecord.

Author:
Josh Holtzman
See Also:
Serialized Form

Field Summary
static Comparator dateComparator
           
static String DEFAULT_SORT
           
static Comparator meanComparator
           
static Comparator nameComparator
           
static Comparator pointsComparator
           
static String SORT_BY_DATE
           
static String SORT_BY_MEAN
           
static String SORT_BY_NAME
           
static String SORT_BY_POINTS
           
 
Fields inherited from class org.sakaiproject.tool.gradebook.GradableObject
gradebook, id, log, mean, name, removed, version
 
Constructor Summary
Assignment()
           
Assignment(Gradebook gradebook, String name, Double pointsPossible, Date dueDate)
           
 
Method Summary
protected  Double calculateMean(Collection grades, int numEnrollments)
          returns the mean score for students with entered grades.
 Date getDateForDisplay()
          The date to display in the UI.
 Date getDueDate()
           
 String getExternalAppName()
           
 String getExternalId()
           
 String getExternalInstructorLink()
           
 String getExternalStudentLink()
           
 Double getPointsForDisplay()
          The number of points to display in the UI.
 Double getPointsPossible()
           
 boolean isCounted()
           
 boolean isCourseGrade()
           
 boolean isExternallyMaintained()
           
 boolean isNotCounted()
           
 void setCounted(boolean counted)
          This cover is for the benefit of JSF checkboxes.
 void setDueDate(Date dueDate)
           
 void setExternalAppName(String externalAppName)
           
 void setExternalId(String externalId)
           
 void setExternalInstructorLink(String externalInstructorLink)
           
 void setExternallyMaintained(boolean externallyMaintained)
           
 void setExternalStudentLink(String externalStudentLink)
           
 void setNotCounted(boolean notCounted)
           
 void setPointsPossible(Double pointsPossible)
           
 
Methods inherited from class org.sakaiproject.tool.gradebook.GradableObject
calculateStatistics, equals, getFormattedMean, getGradebook, getId, getMean, getName, getVersion, hashCode, isRemoved, setGradebook, setId, setMean, setName, setRemoved, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SORT_BY_DATE

public static String SORT_BY_DATE

SORT_BY_NAME

public static String SORT_BY_NAME

SORT_BY_MEAN

public static String SORT_BY_MEAN

SORT_BY_POINTS

public static String SORT_BY_POINTS

DEFAULT_SORT

public static String DEFAULT_SORT

dateComparator

public static Comparator dateComparator

nameComparator

public static Comparator nameComparator

pointsComparator

public static Comparator pointsComparator

meanComparator

public static Comparator meanComparator
Constructor Detail

Assignment

public Assignment(Gradebook gradebook,
                  String name,
                  Double pointsPossible,
                  Date dueDate)

Assignment

public Assignment()
Method Detail

isCourseGrade

public boolean isCourseGrade()
Specified by:
isCourseGrade in class GradableObject
Returns:
Whether this gradable object is a course grade

getPointsForDisplay

public Double getPointsForDisplay()
Description copied from class: GradableObject
The number of points to display in the UI.

Specified by:
getPointsForDisplay in class GradableObject

getDateForDisplay

public Date getDateForDisplay()
Description copied from class: GradableObject
The date to display in the UI.

Specified by:
getDateForDisplay in class GradableObject

getDueDate

public Date getDueDate()
Returns:
Returns the dueDate.

setDueDate

public void setDueDate(Date dueDate)
Parameters:
dueDate - The dueDate to set.

isNotCounted

public boolean isNotCounted()

setNotCounted

public void setNotCounted(boolean notCounted)

isCounted

public boolean isCounted()

setCounted

public void setCounted(boolean counted)
This cover is for the benefit of JSF checkboxes.


getExternalInstructorLink

public String getExternalInstructorLink()
Returns:
Returns the externalInstructorLink.

setExternalInstructorLink

public void setExternalInstructorLink(String externalInstructorLink)
Parameters:
externalInstructorLink - The externalInstructorLink to set.

isExternallyMaintained

public boolean isExternallyMaintained()
Returns:
Returns the externallyMaintained.

setExternallyMaintained

public void setExternallyMaintained(boolean externallyMaintained)
Parameters:
externallyMaintained - The externallyMaintained to set.

getExternalStudentLink

public String getExternalStudentLink()
Returns:
Returns the externalStudentLink.

setExternalStudentLink

public void setExternalStudentLink(String externalStudentLink)
Parameters:
externalStudentLink - The externalStudentLink to set.

getPointsPossible

public Double getPointsPossible()
Returns:
Returns the pointsPossible.

setPointsPossible

public void setPointsPossible(Double pointsPossible)
Parameters:
pointsPossible - The pointsPossible to set.

getExternalId

public String getExternalId()
Returns:
Returns the externalId.

setExternalId

public void setExternalId(String externalId)
Parameters:
externalId - The externalId to set.

getExternalAppName

public String getExternalAppName()
Returns:
Returns the externalAppName.

setExternalAppName

public void setExternalAppName(String externalAppName)
Parameters:
externalAppName - The externalAppName to set.

calculateMean

protected Double calculateMean(Collection grades,
                               int numEnrollments)
returns the mean score for students with entered grades.

Specified by:
calculateMean in class GradableObject
Parameters:
grades - A collection of grades as percentage values (Doubles)
Returns:
The mean of all entered grades