blackboard.data.gradebook
Class Score

java.lang.Object
  extended by blackboard.data.BbObject
      extended by blackboard.data.gradebook.Score
All Implemented Interfaces:
IBbObject, java.lang.Cloneable

public class Score
extends BbObject

The Score class represents a grade in a course for a specific user and Lineitem. The critical data is the grade, but a String-based Id is provided for association of the Score with an external attempt handler. This handler would typically be the Blackboard assessment engine, but could easily be a third-party tool.

When manipulating Score objects, the lineitemId, grade, and courseMembershipId attributes must be set before persisting.

Conceptually, a Score represents a value that may be calculated from one or more Attempts. An Attempt actually represents a user's interaction with a "gradeable" item. E.g., a session with a given quiz. This cardinality affects several method signatures that imply logic based on related Attempt data. In Release 6, though, only a single attempt is supported.

Because Attempts are tighly coupled to the component that generates their value, they are not directly exposed in this version of the API.

Note: Score has replaced LwScore which has been removed from the 6.0 APIs as part of general platform development.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Nested Class Summary
static class Score.AttemptLocation
          Enumeration class used to indicate the physical repository for an attempt.
 
Field Summary
static DataType SCORE_DATA_TYPE
           
 
Fields inherited from class blackboard.data.BbObject
_bbAttributes
 
Constructor Summary
Score()
          Constructs and returns a new Score object with date added and date changed initialized to the current date.
Score(Outcome outcome)
          For internal use only.
 
Method Summary
protected  void clearAttemptId()
           
 java.lang.Object getAttemptId()
          Returns a String-based Id for the external attempt handler.
 Score.AttemptLocation getAttemptLocation()
          Returns whether the attempt associated with this score is internal to Blackboard or external.
 Id getCourseMembershipId()
          Returns the Id of the CourseMembership for the user this Score is associated with.
 DataType getDataType()
          Returns the DataType identifier for this object.
 java.util.Calendar getDateAdded()
          Returns the date and time this Score was added to the gradebook.
 java.util.Calendar getDateChanged()
          Returns the date and time this Score was modified.
 java.lang.String getGrade()
          Returns the actual grade for this Score.
 Id getId()
          Returns the Id associated with this BbObject.
 Id getLineitemId()
          Returns the Id of the gradebook Lineitem this score is attached to.
 Outcome getOutcome()
          For internal use only.
 void setAttemptId(java.lang.Object id, Score.AttemptLocation location)
          Sets the attempt Id to be used by an external attempt handler.
protected  void setAttemptLocation(Score.AttemptLocation attemptLocation)
           
 void setCourseMembershipId(Id id)
          Sets the CourseMembership Id to be associated with this Score.
 void setDateAdded()
          Sets the date and time this Score was added to the gradebook using the current time.
 void setDateAdded(java.util.Calendar cDateAdded)
          Sets the date and time this Score was added to the gradebook using the provided Calendar.
 void setDateChanged()
          Sets the date and time this Score was modified using the current time.
 void setDateChanged(java.util.Calendar cDateChanged)
          Sets the date and time this Score was modified using the provided Calendar.
protected  void setExternalAttemptId(java.lang.String id)
          Sets the attempt Id to be used by an external attempt handler.
 void setGrade(java.lang.String strGrade)
          Sets the actual grade for this Score.
protected  void setInternalAttemptId(Id id)
          Sets the attempt Id to be used by an internal attempt handler.
 void setLineitemId(Id id)
          Sets the Lineitem Id this Score is related to.
 java.lang.String toString()
          Returns the contents of this Lineitem object as a line-feed separated list of name value pairs of this object's properties.
 void validate()
          Validates the contents of this Score.
 
Methods inherited from class blackboard.data.BbObject
clone, getBbAttributes, getCreatedDate, getModifiedDate, persist, setCreatedDate, setId, setModifiedDate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCORE_DATA_TYPE

public static final DataType SCORE_DATA_TYPE
Constructor Detail

Score

public Score()
Constructs and returns a new Score object with date added and date changed initialized to the current date.


Score

public Score(Outcome outcome)
For internal use only.

Method Detail

getId

public Id getId()
Description copied from class: BbObject
Returns the Id associated with this BbObject.

Specified by:
getId in interface IBbObject
Overrides:
getId in class BbObject
Returns:
Id value for this BbObject

getOutcome

public Outcome getOutcome()
For internal use only.


getCourseMembershipId

public Id getCourseMembershipId()
Returns the Id of the CourseMembership for the user this Score is associated with.

Returns:
A CourseMembership Id

setCourseMembershipId

public void setCourseMembershipId(Id id)
Sets the CourseMembership Id to be associated with this Score.

Parameters:
id - A valid CourseMembership Id

getLineitemId

public Id getLineitemId()
Returns the Id of the gradebook Lineitem this score is attached to.

Returns:
A Lineitem Id

setLineitemId

public void setLineitemId(Id id)
Sets the Lineitem Id this Score is related to.

Parameters:
id - A valid Lineitem Id

getAttemptId

public java.lang.Object getAttemptId()
Returns a String-based Id for the external attempt handler. This Id would be a standard Blackboard Id for scores associated with a Blackboard assessment, and would be substituted into the attempt handler URL for a third-party tool.

Returns:
The Id of the attempt this Score is derived from. Returns null if there is no attempt attempt associated with this Score.

setAttemptId

public void setAttemptId(java.lang.Object id,
                         Score.AttemptLocation location)
Sets the attempt Id to be used by an external attempt handler. This can be either a standard Blackboard Id or a free-form String for use by a non-Blackboard attempt handler.

Parameters:
id - The Id of the attempt this Score is derived from.
location - The location of the attempt this Score is associated with.

setInternalAttemptId

protected void setInternalAttemptId(Id id)
Sets the attempt Id to be used by an internal attempt handler. This Id can be either a standard Blackboard PkId or a free-form String for use by a non-Blackboard attempt handler. Note that calling this method will clear the external attempt ID, if there is one, currently associated with this Score.

Parameters:
id - The Id of the attempt this Score is derived from.

setExternalAttemptId

protected void setExternalAttemptId(java.lang.String id)
Sets the attempt Id to be used by an external attempt handler. This Id can be either a standard Blackboard PkId or a free-form String for use by a non-Blackboard attempt handler. Note that calling this method will clear the internal attempt ID, if there is one, currently associated with this Score.

Parameters:
id - The Id of the attempt this Score is derived from.

clearAttemptId

protected void clearAttemptId()

getAttemptLocation

public Score.AttemptLocation getAttemptLocation()
Returns whether the attempt associated with this score is internal to Blackboard or external.

Returns:
If no attemptId is set, the return is AttemptLocation.UNSET.

setAttemptLocation

protected void setAttemptLocation(Score.AttemptLocation attemptLocation)

getGrade

public java.lang.String getGrade()
Returns the actual grade for this Score. The grade is returned as a String since it can be any type from numeric to letter to 'Pass' or 'Fail'.

Returns:
The grade information for this Score

setGrade

public void setGrade(java.lang.String strGrade)
Sets the actual grade for this Score. The grade is set as a String since it can be any type from numeric to letter to 'Pass' or 'Fail'.

Parameters:
strGrade - The grade information for this Score

getDateAdded

public java.util.Calendar getDateAdded()
Returns the date and time this Score was added to the gradebook. This field is separate from the database row specific timestamp for creation, which simply tags the time the row was inserted.

Returns:
A Calendar containing the date and time when this Score was added to the gradebook

setDateAdded

public void setDateAdded()
Sets the date and time this Score was added to the gradebook using the current time. This field is separate from the database row specific timestamp for creation, which simply tags the time the row was inserted.


setDateAdded

public void setDateAdded(java.util.Calendar cDateAdded)
Sets the date and time this Score was added to the gradebook using the provided Calendar. This field is separate from the database row specific timestamp for creation, which simply tags the time the row was inserted.

Parameters:
cDateAdded - The date and time this Score was added to the gradebook

getDateChanged

public java.util.Calendar getDateChanged()
Returns the date and time this Score was modified. This field is separate from the database row specific timestamp for modification, which simply tags the time the row was updated.

Returns:
A Calendar containing the date and time when this Score was modified

setDateChanged

public void setDateChanged()
Sets the date and time this Score was modified using the current time. This field is separate from the database row specific timestamp for creation, which simply tags the time the row was updated.


setDateChanged

public void setDateChanged(java.util.Calendar cDateChanged)
Sets the date and time this Score was modified using the provided Calendar. This field is separate from the database row specific timestamp for creation, which simply tags the time the row was updated.

Parameters:
cDateChanged - The date and time this Score was modified

getDataType

public DataType getDataType()
Returns the DataType identifier for this object. Can be used to uniquely identify the "type" of this data object.

Specified by:
getDataType in interface IBbObject
Specified by:
getDataType in class BbObject
Returns:
The DataType for this object

toString

public java.lang.String toString()
Returns the contents of this Lineitem object as a line-feed separated list of name value pairs of this object's properties. The line-feed character used is the one specified by the java system property "line.separator". This method can be used for debug purposes.

Overrides:
toString in class BbObject
Returns:
A String that represents the contents of this object

validate

public void validate()
              throws ValidationException
Validates the contents of this Score. Internal consistency checks are also performed.

Specified by:
validate in interface IBbObject
Overrides:
validate in class BbObject
Throws:
ValidationException - If validation of this object fails


Copyright © 2003 Blackboard, Inc. All Rights Reserved.