| org.sakaiproject.tool.gradebook.business.GradebookManager
All known Subclasses: org.sakaiproject.tool.gradebook.business.impl.GradebookManagerHibernateImpl,
GradebookManager | public interface GradebookManager (Code) | | Manages Gradebook persistence.
author: Josh Holtzman |
Method Summary | |
public void | addToGradeRecordMap(Map gradeRecordMap, List gradeRecords) | public Long | createAssignment(Long gradebookId, String name, Double points, Date dueDate, Boolean isNotCounted, Boolean isReleased) | public Long | createSpreadsheet(Long gradebookId, String name, String creator, Date dateCreated, String content) | public List | getAllAssignmentGradeRecords(Long gradebookId, Collection studentUids) Gets all grade records that belong to a collection of enrollments in a
gradebook. | public Assignment | getAssignment(Long assignmentId) | public List | getAssignmentGradeRecords(Assignment assignment, Collection studentUids) Get all assignment score records for the given set of student UIDs. | public Assignment | getAssignmentWithStats(Long assignmentId) Fetches an assignment and populates its non-persistent statistics
fields. | public List | getAssignments(Long gradebookId, String sortBy, boolean ascending) Fetches a List of Assignments, but does not populate non-persistent
fields.
Parameters: gradebookId - The gradebook ID Parameters: sortBy - The field by which to sort the list. | public List | getAssignments(Long gradebookId) | public List | getAssignmentsAndCourseGradeWithStats(Long gradebookId, String sortBy, boolean ascending) Same as the other getAssignmentsWithStats except for tacking the
CourseGrade (with statistics) at the end of the list. | public List | getAssignmentsWithStats(Long gradebookId, String sortBy, boolean ascending) Fetches a List of Assignments for a given gradebook, and populates the
Assignments with all of the statistics fields available in the Assignment
object.
Parameters: gradebookId - The gradebook ID Parameters: studentUids - The current enrollment list to filter dropped studentsfrom the calculation Parameters: sortBy - The field by which to sort the list. | public List | getComments(Assignment assignment, Collection studentIds) | public CourseGrade | getCourseGrade(Long gradebookId) Fetches the course grade for a gradebook as found in the database. | public Gradebook | getGradebook(Long id) | public Gradebook | getGradebook(String uid) | public String | getGradebookUid(Long id) Internal services use a Long ID to identify a gradebook.
External facades use a String UID instead. | public Gradebook | getGradebookWithGradeMappings(Long id) | public GradingEvents | getGradingEvents(GradableObject gradableObject, Collection studentUids) Gets the grading events for the enrollments on the given gradable object. | public List | getPointsEarnedCourseGradeRecords(CourseGrade courseGrade, Collection studentUids) | public List<CourseGradeRecord> | getPointsEarnedCourseGradeRecords(CourseGrade courseGrade, Collection studentUids, Collection assignments, Map scoreMap) | public List<CourseGradeRecord> | getPointsEarnedCourseGradeRecordsWithStats(CourseGrade courseGrade, Collection studentUids) As a side-effect, this version of the method calculates the mean course grade. | public Spreadsheet | getSpreadsheet(Long spreadsheetId) | public List | getSpreadsheets(Long gradebookId) | public List | getStudentAssignmentComments(String studentId, Long gradebookId) | public CourseGradeRecord | getStudentCourseGradeRecord(Gradebook gradebook, String studentId) Gets the course grade for a single student. | public List | getStudentGradeRecords(Long gradebookId, String studentId) Gets all grade records for a single student in a single gradebook,
not including the course grade. | public double | getTotalPoints(Long gradebookId) | public boolean | isEnteredAssignmentScores(Long assignmentId) Gets whether scores have been entered for the given assignment. | public boolean | isExplicitlyEnteredCourseGradeRecords(Long gradebookId) Gets whether there are explicitly entered course grade records in a gradebook. | public void | removeAssignment(Long assignmentId) Removes an assignment from a gradebook. | public void | removeSpreadsheet(Long spreadsheetid) | public void | updateAssignment(Assignment assignment) | public Set | updateAssignmentGradeRecords(Assignment assignment, Collection gradeRecords) Updates the grade records in the GradeRecordSet. | public Set | updateAssignmentGradesAndComments(Assignment assignment, Collection gradeRecords, Collection comments) | public void | updateComments(Collection comments) | public void | updateCourseGradeRecords(CourseGrade courseGrade, Collection gradeRecords) Updates the grade records for the keys (student IDs) in the studentsToPoints map. | public void | updateGradebook(Gradebook gradebook) Updates a gradebook's representation in persistence. |
addToGradeRecordMap | public void addToGradeRecordMap(Map gradeRecordMap, List gradeRecords)(Code) | | |
createAssignment | public Long createAssignment(Long gradebookId, String name, Double points, Date dueDate, Boolean isNotCounted, Boolean isReleased) throws ConflictingAssignmentNameException, StaleObjectModificationException(Code) | | Add a new assignment to a gradebook
Parameters: gradebookId - The gradebook ID to which this new assignment belongs Parameters: name - The assignment's name (must be unique in the gradebook and not be null) Parameters: points - The number of points possible for this assignment (must not be null) Parameters: dueDate - The due date for the assignment (optional) Parameters: isNotCounted - True if the assignment should not count towards the final course grade (optional) Parameters: isReleased - True if the assignment should be release/ or visble to students The ID of the new assignment |
getAllAssignmentGradeRecords | public List getAllAssignmentGradeRecords(Long gradebookId, Collection studentUids)(Code) | | Gets all grade records that belong to a collection of enrollments in a
gradebook.
Parameters: gradebookId - Parameters: studentUids - |
getAssignment | public Assignment getAssignment(Long assignmentId)(Code) | | Fetches an assignment
Parameters: assignmentId - The assignment ID The assignment |
getAssignmentGradeRecords | public List getAssignmentGradeRecords(Assignment assignment, Collection studentUids)(Code) | | Get all assignment score records for the given set of student UIDs.
Parameters: assignment - Parameters: studentUids - AssignmentGradeRecord list |
getAssignmentWithStats | public Assignment getAssignmentWithStats(Long assignmentId)(Code) | | Fetches an assignment and populates its non-persistent statistics
fields.
Parameters: assignmentId - The assignment ID Parameters: studentUids - The current enrollment list to filter dropped studentsfrom the calculation The GradableObject with all statistics fields populated |
getAssignments | public List getAssignments(Long gradebookId, String sortBy, boolean ascending)(Code) | | Fetches a List of Assignments, but does not populate non-persistent
fields.
Parameters: gradebookId - The gradebook ID Parameters: sortBy - The field by which to sort the list. A list of Assignments with only persistent fields populated |
getAssignments | public List getAssignments(Long gradebookId)(Code) | | Convenience method to get assignments with the default sort ordering
Parameters: gradebookId - The gradebook ID |
getAssignmentsAndCourseGradeWithStats | public List getAssignmentsAndCourseGradeWithStats(Long gradebookId, String sortBy, boolean ascending)(Code) | | Same as the other getAssignmentsWithStats except for tacking the
CourseGrade (with statistics) at the end of the list. This is
combined into one call as a way to avoid either exposing the
full enrollment list for the site or fetching it twice.
|
getAssignmentsWithStats | public List getAssignmentsWithStats(Long gradebookId, String sortBy, boolean ascending)(Code) | | Fetches a List of Assignments for a given gradebook, and populates the
Assignments with all of the statistics fields available in the Assignment
object.
Parameters: gradebookId - The gradebook ID Parameters: studentUids - The current enrollment list to filter dropped studentsfrom the calculation Parameters: sortBy - The field by which to sort the list. A list of Assignments with their statistics fields populated |
getCourseGrade | public CourseGrade getCourseGrade(Long gradebookId)(Code) | | Fetches the course grade for a gradebook as found in the database.
No non-persistent fields (such as points earned) are filled in.
Parameters: gradebookId - The gradebook id The course grade |
getGradebook | public Gradebook getGradebook(Long id)(Code) | | Fetches a gradebook based on its surrogate key
Parameters: id - The ID of the gradebook The gradebook |
getGradebookUid | public String getGradebookUid(Long id)(Code) | | Internal services use a Long ID to identify a gradebook.
External facades use a String UID instead. This method
translates.
|
getGradingEvents | public GradingEvents getGradingEvents(GradableObject gradableObject, Collection studentUids)(Code) | | Gets the grading events for the enrollments on the given gradable object.
Parameters: gradableObject - Parameters: enrollments - |
getPointsEarnedCourseGradeRecords | public List getPointsEarnedCourseGradeRecords(CourseGrade courseGrade, Collection studentUids)(Code) | | Get all course grade records (with autocalculated fields) for the given
gradebook and the given set of student UIDs
Parameters: gradebookId - Parameters: studentUids - CourseGradeRecord list |
getPointsEarnedCourseGradeRecordsWithStats | public List<CourseGradeRecord> getPointsEarnedCourseGradeRecordsWithStats(CourseGrade courseGrade, Collection studentUids)(Code) | | As a side-effect, this version of the method calculates the mean course grade.
The proliferation of method signatures is meant to cut back as much as possible on
redundant reads from the assignment grade records.
Parameters: courseGrade - This input argument is modified to include statistical information Parameters: studentUids - |
getSpreadsheet | public Spreadsheet getSpreadsheet(Long spreadsheetId)(Code) | | Fetches a spreadsheet that has been saved
Parameters: spreadsheetId - The saved spreadsheet object |
getSpreadsheets | public List getSpreadsheets(Long gradebookId)(Code) | | Parameters: gradebookId - a Collection of spreadsheets |
getStudentAssignmentComments | public List getStudentAssignmentComments(String studentId, Long gradebookId)(Code) | | method to get comments for a assignments for a student in a gradebook
Parameters: studentId - Parameters: gradebookId - |
getStudentGradeRecords | public List getStudentGradeRecords(Long gradebookId, String studentId)(Code) | | Gets all grade records for a single student in a single gradebook,
not including the course grade.
Parameters: gradebookId - The gradebook id Parameters: studentId - The unique student identifier A List of all of this student's grade records in the gradebook |
getTotalPoints | public double getTotalPoints(Long gradebookId)(Code) | | |
isEnteredAssignmentScores | public boolean isEnteredAssignmentScores(Long assignmentId)(Code) | | Gets whether scores have been entered for the given assignment.
(This may include scores for students who are not currently enrolled.)
Parameters: assignmentId - The assignment How many scores have been entered for the assignment |
isExplicitlyEnteredCourseGradeRecords | public boolean isExplicitlyEnteredCourseGradeRecords(Long gradebookId)(Code) | | Gets whether there are explicitly entered course grade records in a gradebook.
Parameters: gradebookId - The gradebook Whether there are course grade records that have a non-null enteredGrade field |
removeAssignment | public void removeAssignment(Long assignmentId) throws StaleObjectModificationException(Code) | | Removes an assignment from a gradebook. The assignment should not be
deleted, but the assignment and all grade records associated with the
assignment should be ignored by the application. A removed assignment
should not count toward the total number of points in the gradebook.
Parameters: assignmentId - The assignment id |
updateAssignmentGradeRecords | public Set updateAssignmentGradeRecords(Assignment assignment, Collection gradeRecords) throws StaleObjectModificationException(Code) | | Updates the grade records in the GradeRecordSet.
Implementations of this method should add a new GradingEvent for each
grade record modified, and should update the autocalculated value for
each graded student's CourseGradeRecord.
The set of student UIDs who were given scores higher than theassignment's value. |
updateCourseGradeRecords | public void updateCourseGradeRecords(CourseGrade courseGrade, Collection gradeRecords) throws StaleObjectModificationException(Code) | | Updates the grade records for the keys (student IDs) in the studentsToPoints map.
Map values must be valid strings (that exist in the gradebook's grade
mapping) or nulls.
Parameters: studentsToPoints - A Map of student IDs to grades |
updateGradebook | public void updateGradebook(Gradebook gradebook) throws StaleObjectModificationException(Code) | | Updates a gradebook's representation in persistence.
If the gradebook's selected grade mapping has been modified, the sort
value on all explicitly graded course grade records must be updated when
the gradebook is updated.
A gradebook's selected grade mapping may only change (to a different kind
of mapping) if there are no explicitly graded course grade records.
Parameters: gradebook - The gradebook to update throws: StaleObjectModificationException - |
|
|