org.sakaiproject.component.gradebook
Class GradebookExternalAssessmentServiceImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.sakaiproject.component.gradebook.BaseHibernateManager
              extended by org.sakaiproject.component.gradebook.GradebookExternalAssessmentServiceImpl
All Implemented Interfaces:
GradebookExternalAssessmentService, org.springframework.beans.factory.InitializingBean

public class GradebookExternalAssessmentServiceImpl
extends BaseHibernateManager
implements GradebookExternalAssessmentService


Field Summary
 
Fields inherited from class org.sakaiproject.component.gradebook.BaseHibernateManager
authn, MAX_NUMBER_OF_SQL_PARAMETERS_IN_LIST, propertiesMap, sectionAwareness
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
GradebookExternalAssessmentServiceImpl()
           
 
Method Summary
 void addExternalAssessment(String gradebookUid, String externalId, String externalUrl, String title, double points, Date dueDate, String externalServiceDescription)
           
 void addExternalAssessment(String gradebookUid, String externalId, String externalUrl, String title, Double points, Date dueDate, String externalServiceDescription, Boolean ungraded)
          Wrapper created when category was added for assignments tool
 void addExternalAssessment(String gradebookUid, String externalId, String externalUrl, String title, Double points, Date dueDate, String externalServiceDescription, Boolean ungraded, Long categoryId)
          This method is identical to GradebookExternalAssessmentService.addExternalAssessment(String, String, String, String, Double, Date, String, Boolean) but allows you to also specify the associated Category for this assignment.
 boolean isAssignmentDefined(String gradebookUid, String assignmentName)
          Check to see if an assignment with the given name already exists in the given gradebook.
 boolean isExternalAssignmentDefined(String gradebookUid, String externalId)
          Check to see if an assignment with the given external id already exists in the given gradebook.
 void removeExternalAssessment(String gradebookUid, String externalId)
          Remove the assessment reference from the gradebook.
 void setEventTrackingService(EventTrackingService eventTrackingService)
           
 void setExternalAssessmentToGradebookAssignment(String gradebookUid, String externalId)
          Break the connection between an external assessment engine and an assessment which it created, giving it up to the Gradebook application to control from now on.
 void updateExternalAssessment(String gradebookUid, String externalId, String externalUrl, String title, double points, Date dueDate)
           
 void updateExternalAssessment(String gradebookUid, String externalId, String externalUrl, String title, Double points, Date dueDate, Boolean ungraded)
           
 void updateExternalAssessmentScore(String gradebookUid, String externalId, String studentUid, Double points)
           
 void updateExternalAssessmentScore(String gradebookUid, String externalId, String studentUid, String points)
          Updates an external score for an external assignment in the gradebook.
 void updateExternalAssessmentScores(String gradebookUid, String externalId, Map studentUidsToScores)
           
 void updateExternalAssessmentScoresString(String gradebookUid, String externalId, Map studentUidsToScores)
          Updates a set of external scores for an external assignment in the gradebook.
 
Methods inherited from class org.sakaiproject.component.gradebook.BaseHibernateManager
addPermission, calculateEquivalentPercent, calculateEquivalentPointValueForPercent, convertPointsToLetterGrade, convertPointsToPercentage, createAssignment, createAssignmentForCategory, createCategory, createDefaultLetterGradePercentMapping, createOrUpdateDefaultLetterGradePercentMapping, createUngradedAssignment, createUngradedAssignmentForCategory, deletePermission, filterGradeRecordsByStudents, finalizeNullGradeRecords, getAllStudentUids, getAssignment, getAssignmentGradeRecord, getAssignments, getAssignmentsForCategory, getAssignmentWithoutStats, getAssignmentWithoutStats, getAuthn, getCategories, getCategoriesWithAssignments, getCategory, getComments, getCountedStudentGradeRecords, getCourseGrade, getCourseGradeRecord, getDefaultLetterGradePercentMapping, getEventTrackingService, getGradebook, getGradebookUid, getLetterGradePercentMapping, getPermissionsForGB, getPermissionsForGBForCategoryIds, getPermissionsForUser, getPermissionsForUserAnyCategory, getPermissionsForUserAnyGroup, getPermissionsForUserAnyGroupAnyCategory, getPermissionsForUserAnyGroupForCategory, getPermissionsForUserForCategory, getPermissionsForUserForGoupsAnyCategory, getPermissionsForUserForGroup, getPropertiesMap, getPropertyValue, getSectionAwareness, getUserUid, isAssignmentDefined, isExplicitlyEnteredCourseGradeRecords, isGradebookDefined, postEvent, removeCategory, saveOrUpdateLetterGradePercentMapping, setAuthn, setPropertyValue, setSectionAwareness, updateAssignment, updateCategory, updateGradebook, updatePermission, updatePermission, validateLetterGradeMapping
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.service.gradebook.shared.GradebookExternalAssessmentService
isGradebookDefined
 

Constructor Detail

GradebookExternalAssessmentServiceImpl

public GradebookExternalAssessmentServiceImpl()
Method Detail

setEventTrackingService

public void setEventTrackingService(EventTrackingService eventTrackingService)
Overrides:
setEventTrackingService in class BaseHibernateManager

addExternalAssessment

public void addExternalAssessment(String gradebookUid,
                                  String externalId,
                                  String externalUrl,
                                  String title,
                                  double points,
                                  Date dueDate,
                                  String externalServiceDescription)
                           throws ConflictingAssignmentNameException,
                                  ConflictingExternalIdException,
                                  GradebookNotFoundException
Specified by:
addExternalAssessment in interface GradebookExternalAssessmentService
Throws:
ConflictingAssignmentNameException
ConflictingExternalIdException
GradebookNotFoundException

updateExternalAssessment

public void updateExternalAssessment(String gradebookUid,
                                     String externalId,
                                     String externalUrl,
                                     String title,
                                     double points,
                                     Date dueDate)
                              throws GradebookNotFoundException,
                                     AssessmentNotFoundException,
                                     AssignmentHasIllegalPointsException
Specified by:
updateExternalAssessment in interface GradebookExternalAssessmentService
Throws:
GradebookNotFoundException
AssessmentNotFoundException
AssignmentHasIllegalPointsException
See Also:
org.sakaiproject.service.gradebook.shared.GradebookService#updateExternalAssessment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long, java.util.Date)

removeExternalAssessment

public void removeExternalAssessment(String gradebookUid,
                                     String externalId)
                              throws GradebookNotFoundException,
                                     AssessmentNotFoundException
Description copied from interface: GradebookExternalAssessmentService
Remove the assessment reference from the gradebook. Although Samigo doesn't currently delete assessments, an instructor can retract an assessment to keep it from students. Since such an assessment would presumably no longer be used to calculate final grades, Samigo should also remove that assessment from the gradebook.

Specified by:
removeExternalAssessment in interface GradebookExternalAssessmentService
externalId - the UID of the assessment
Throws:
GradebookNotFoundException
AssessmentNotFoundException
See Also:
GradebookService.removeExternalAssessment(java.lang.String, java.lang.String)

updateExternalAssessmentScore

public void updateExternalAssessmentScore(String gradebookUid,
                                          String externalId,
                                          String studentUid,
                                          Double points)
                                   throws GradebookNotFoundException,
                                          AssessmentNotFoundException
Throws:
GradebookNotFoundException
AssessmentNotFoundException
See Also:
GradebookService.updateExternalAssessmentScore(java.lang.String, java.lang.String, java.lang.String, Double)

updateExternalAssessmentScores

public void updateExternalAssessmentScores(String gradebookUid,
                                           String externalId,
                                           Map studentUidsToScores)
                                    throws GradebookNotFoundException,
                                           AssessmentNotFoundException
Specified by:
updateExternalAssessmentScores in interface GradebookExternalAssessmentService
Throws:
GradebookNotFoundException
AssessmentNotFoundException

updateExternalAssessmentScoresString

public void updateExternalAssessmentScoresString(String gradebookUid,
                                                 String externalId,
                                                 Map studentUidsToScores)
                                          throws GradebookNotFoundException,
                                                 AssessmentNotFoundException
Description copied from interface: GradebookExternalAssessmentService
Updates a set of external scores for an external assignment in the gradebook.

Specified by:
updateExternalAssessmentScoresString in interface GradebookExternalAssessmentService
Parameters:
gradebookUid - The Uid of the gradebook
externalId - The external ID of the assignment/assessment
studentUidsToScores - A map whose String keys are the unique ID strings of the students and whose String values are points earned on this assessment or null if the score should be removed.
Throws:
GradebookNotFoundException
AssessmentNotFoundException

isAssignmentDefined

public boolean isAssignmentDefined(String gradebookUid,
                                   String assignmentName)
                            throws GradebookNotFoundException
Description copied from interface: GradebookExternalAssessmentService
Check to see if an assignment with the given name already exists in the given gradebook. This will give external assessment systems a chance to avoid the ConflictingAssignmentNameException.

Specified by:
isAssignmentDefined in interface GradebookExternalAssessmentService
Throws:
GradebookNotFoundException

isExternalAssignmentDefined

public boolean isExternalAssignmentDefined(String gradebookUid,
                                           String externalId)
                                    throws GradebookNotFoundException
Description copied from interface: GradebookExternalAssessmentService
Check to see if an assignment with the given external id already exists in the given gradebook. This will give external assessment systems a chance to avoid the ConflictingExternalIdException.

Specified by:
isExternalAssignmentDefined in interface GradebookExternalAssessmentService
Parameters:
gradebookUid - The gradebook's unique identifier
externalId - The external assessment's external identifier
Throws:
GradebookNotFoundException

setExternalAssessmentToGradebookAssignment

public void setExternalAssessmentToGradebookAssignment(String gradebookUid,
                                                       String externalId)
Description copied from interface: GradebookExternalAssessmentService
Break the connection between an external assessment engine and an assessment which it created, giving it up to the Gradebook application to control from now on.

Specified by:
setExternalAssessmentToGradebookAssignment in interface GradebookExternalAssessmentService

addExternalAssessment

public void addExternalAssessment(String gradebookUid,
                                  String externalId,
                                  String externalUrl,
                                  String title,
                                  Double points,
                                  Date dueDate,
                                  String externalServiceDescription,
                                  Boolean ungraded)
                           throws GradebookNotFoundException,
                                  ConflictingAssignmentNameException,
                                  ConflictingExternalIdException,
                                  AssignmentHasIllegalPointsException
Wrapper created when category was added for assignments tool

Specified by:
addExternalAssessment in interface GradebookExternalAssessmentService
externalId - some unique identifier which Samigo uses for the assessment. The externalId is globally namespaced within the gradebook, so if other apps decide to put assessments into the gradebook, they should prefix their externalIds with a well known (and unique within sakai) string.
externalUrl - a link to go to if the instructor or student wants to look at the assessment in Samigo; if null, no direct link will be provided in the gradebook, and the user will have to navigate to the assessment within the other application
points - this is the total amount of points available and must be greater than zero. it could be null if it's an ungraded item.
Throws:
GradebookNotFoundException
ConflictingAssignmentNameException
ConflictingExternalIdException
AssignmentHasIllegalPointsException

addExternalAssessment

public void addExternalAssessment(String gradebookUid,
                                  String externalId,
                                  String externalUrl,
                                  String title,
                                  Double points,
                                  Date dueDate,
                                  String externalServiceDescription,
                                  Boolean ungraded,
                                  Long categoryId)
                           throws GradebookNotFoundException,
                                  ConflictingAssignmentNameException,
                                  ConflictingExternalIdException,
                                  AssignmentHasIllegalPointsException
Description copied from interface: GradebookExternalAssessmentService
This method is identical to GradebookExternalAssessmentService.addExternalAssessment(String, String, String, String, Double, Date, String, Boolean) but allows you to also specify the associated Category for this assignment. If the gradebook is set up for categories and categoryId is null, assignment category will be unassigned

Specified by:
addExternalAssessment in interface GradebookExternalAssessmentService
Throws:
GradebookNotFoundException
ConflictingAssignmentNameException
ConflictingExternalIdException
AssignmentHasIllegalPointsException

updateExternalAssessment

public void updateExternalAssessment(String gradebookUid,
                                     String externalId,
                                     String externalUrl,
                                     String title,
                                     Double points,
                                     Date dueDate,
                                     Boolean ungraded)
                              throws GradebookNotFoundException,
                                     AssessmentNotFoundException,
                                     ConflictingAssignmentNameException,
                                     AssignmentHasIllegalPointsException
Specified by:
updateExternalAssessment in interface GradebookExternalAssessmentService
Throws:
GradebookNotFoundException
AssessmentNotFoundException
ConflictingAssignmentNameException
AssignmentHasIllegalPointsException

updateExternalAssessmentScore

public void updateExternalAssessmentScore(String gradebookUid,
                                          String externalId,
                                          String studentUid,
                                          String points)
                                   throws GradebookNotFoundException,
                                          AssessmentNotFoundException
Description copied from interface: GradebookExternalAssessmentService
Updates an external score for an external assignment in the gradebook.

Specified by:
updateExternalAssessmentScore in interface GradebookExternalAssessmentService
Parameters:
gradebookUid - The Uid of the gradebook
externalId - The external ID of the assignment/assessment
studentUid - The unique id of the student
points - The number of points earned on this assessment, or null if a score should be removed
Throws:
GradebookNotFoundException
AssessmentNotFoundException


Copyright © 2011 Sakai Project. All Rights Reserved.