Class Assignment


  • public class Assignment
    extends java.lang.Object
    Object that represents an Assignment in Powerschool

    Exposes many fields with information about the assignment

    Version:
    1.0.3
    • 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 Name
        assignmentId - Assignment ID
        totalPoints - Total points possible
        scoredPoints - Scored points
        scorePercent - Percentage grade
        scoreLetterGrade - Letter Grade
        category - Assignment category
        dueDateString - Due date String
        scoreEntryDateString - entry date String
        flagContainer - AssignmentFlagContainer object holding the status flags
        isMissingDetails - 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 name
        assignmentId - Assignment ID
        totalPoints - Total points possible
        dueDateString - Due date as String
        category - Assignment category
    • Method Detail

      • generateFromJsonObject

        public static Assignment generateFromJsonObject​(org.json.JSONObject assignmentJSON)
        Creates a new Assignment from a JSONObject retrieved by a PowerschoolClient and asked for by a Course 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 class java.lang.Object
        Returns:
        A String formatted like "{Assignment Name} ({Score Percent})"
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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. the Assignment hasn't been graded yet)
      • getFlagContainer

        public AssignmentFlagContainer getFlagContainer()
        Returns:
        AssignmentFlagContainer object with this Assignment's flags