Package org.dnsge.powerschoolapi.detail
Class Assignment
- java.lang.Object
-
- org.dnsge.powerschoolapi.detail.Assignment
-
public class Assignment extends java.lang.Object
Object that represents an Assignment in PowerschoolExposes many fields with information about the assignment
- Version:
- 1.0.3
-
-
Constructor Summary
Constructors Constructor Description Assignment(java.lang.String name, java.lang.Integer assignmentId, java.lang.Integer totalPoints, java.lang.Integer scoredPoints, java.lang.Float scorePercent, java.lang.String scoreLetterGrade, java.lang.String category, java.lang.String dueDateString, java.lang.String scoreEntryDateString, AssignmentFlagContainer flagContainer, boolean isMissingDetails)
Basic constructor for an AssignmentAssignment(java.lang.String name, java.lang.Integer assignmentId, java.lang.Integer totalPoints, java.lang.String dueDateString, java.lang.String category)
Constructor for a semi-completed Assignment
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static Assignment
generateFromJsonObject(org.json.JSONObject assignmentJSON)
Creates a new Assignment from a JSONObject retrieved by aPowerschoolClient
and asked for by aCourse
objectjava.lang.Integer
getAssignmentId()
java.lang.String
getCategory()
java.util.Date
getDueDate()
java.lang.String
getDueDateString()
AssignmentFlagContainer
getFlagContainer()
java.lang.String
getName()
java.lang.Integer
getScoredPoints()
java.util.Date
getScoreEntryDate()
java.lang.String
getScoreEntryDateString()
java.lang.String
getScoreLetterGrade()
java.lang.Float
getScorePercent()
java.lang.Integer
getTotalPoints()
int
hashCode()
java.lang.Boolean
isAbsent()
java.lang.Boolean
isCollected()
java.lang.Boolean
isExempt()
java.lang.Boolean
isIncomplete()
java.lang.Boolean
isLate()
java.lang.Boolean
isMissing()
boolean
isMissingDetails()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Assignment
public Assignment(java.lang.String name, java.lang.Integer assignmentId, java.lang.Integer totalPoints, java.lang.Integer scoredPoints, java.lang.Float scorePercent, java.lang.String scoreLetterGrade, java.lang.String category, java.lang.String dueDateString, java.lang.String scoreEntryDateString, AssignmentFlagContainer flagContainer, boolean isMissingDetails)
Basic constructor for an Assignment- Parameters:
name
- Assignment NameassignmentId
- Assignment IDtotalPoints
- Total points possiblescoredPoints
- Scored pointsscorePercent
- Percentage gradescoreLetterGrade
- Letter Gradecategory
- Assignment categorydueDateString
- Due date StringscoreEntryDateString
- entry date StringflagContainer
-AssignmentFlagContainer
object holding the status flagsisMissingDetails
- Whether the assignment is not fully generated/populated
-
Assignment
public Assignment(java.lang.String name, java.lang.Integer assignmentId, java.lang.Integer totalPoints, java.lang.String dueDateString, java.lang.String category)
Constructor for a semi-completed Assignment- Parameters:
name
- Assignment nameassignmentId
- Assignment IDtotalPoints
- Total points possibledueDateString
- Due date as Stringcategory
- Assignment category
-
-
Method Detail
-
generateFromJsonObject
public static Assignment generateFromJsonObject(org.json.JSONObject assignmentJSON)
Creates a new Assignment from a JSONObject retrieved by aPowerschoolClient
and asked for by aCourse
object- Parameters:
assignmentJSON
- JSONObject to use to construct the Assignment- Returns:
- New Assignment object from JSONObject
- See Also:
JSONObject
,DefaultPowerschoolClient
,Course
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A
String
formatted like"{Assignment Name} ({Score Percent})"
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getName
public java.lang.String getName()
- Returns:
Assignment
name
-
getAssignmentId
public java.lang.Integer getAssignmentId()
- Returns:
Assignment
ID
-
getTotalPoints
public java.lang.Integer getTotalPoints()
- Returns:
- Total points possible on the
Assignment
-
getScoredPoints
public java.lang.Integer getScoredPoints()
- Returns:
- Points actually scored on the
Assignment
-
getScorePercent
public java.lang.Float getScorePercent()
- Returns:
- Score on the
Assignment
as a percent out of 100
-
getScoreLetterGrade
public java.lang.String getScoreLetterGrade()
- Returns:
- Score on the
Assignment
as a letter grade
-
getCategory
public java.lang.String getCategory()
- Returns:
- Teacher-defined category of the
Assignment
-
getDueDateString
public java.lang.String getDueDateString()
- Returns:
- Due date of the
Assignment
in the format of"yyyy-MM-dd"
-
getScoreEntryDateString
public java.lang.String getScoreEntryDateString()
- Returns:
- Date that the
Assignment
was graded in the format of"yyyy-MM-dd"
-
isCollected
public java.lang.Boolean isCollected()
- Returns:
- Does the
Assignment
have the "Collected" flag (NOT if it has been graded)
-
isLate
public java.lang.Boolean isLate()
- Returns:
- Does the
Assignment
have the "Late" flag
-
isMissing
public java.lang.Boolean isMissing()
- Returns:
- Does the
Assignment
have the "Missing" flag
-
isExempt
public java.lang.Boolean isExempt()
- Returns:
- Does the
Assignment
have the "Exempt" flag
-
isAbsent
public java.lang.Boolean isAbsent()
- Returns:
- Does the
Assignment
have the "Absent" flag
-
isIncomplete
public java.lang.Boolean isIncomplete()
- Returns:
- Does the
Assignment
have the "Incomplete" flag
-
getDueDate
public java.util.Date getDueDate()
- Returns:
- Due date of the
Assignment
- See Also:
Date
-
getScoreEntryDate
public java.util.Date getScoreEntryDate()
- Returns:
- Date that the
Assignment
was graded - See Also:
Date
-
isMissingDetails
public boolean isMissingDetails()
- Returns:
- Whether the
Assignment
is missing certain details (i.e. theAssignment
hasn't been graded yet)
-
getFlagContainer
public AssignmentFlagContainer getFlagContainer()
- Returns:
AssignmentFlagContainer
object with thisAssignment's
flags
-
-