|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.data.BbObject blackboard.data.gradebook.Lineitem
public class Lineitem
The Lineitem
class represents a single gradable item in a course. These correspond to
the Items that are defined in the user interface for the course gradebook. Included are methods for providing URL's to analysis
and attempt handlers, and accessors for a String-based assessment Id. These handlers would typically be
the Blackboard assessment engine, but could easily be third-party tools.
Interacting with the gradebook programmatically, typically consists of the following:
Lineitem
courseId
, pointsPossible
, and
title
must be set before persisting.
LineitemDbPersister
After creating the Lineitem, the task of actually recording student scores comes down to the following:
Score
object
ScoreDbPersister
Note: Persisting a Lineitem requires the caller to have a PersistPermission
with the name "OutcomeDefinition", with
actions for create, modify, or delete, as appropriate. For system extensions, this is declared with a line in the manifest such as
<permission type="persist" name="OutcomeDefinition" actions="create,modify,delete"/>
Note: Lineitem
has completely replaced LwLineitem
which has been removed from the 6.0 APIs
as part of general platform development.
Nested Class Summary | |
---|---|
static class |
Lineitem.AssessmentLocation
Simple class to define where the assessment identified by assessmentId is located. |
Field Summary | |
---|---|
static DataType |
LINEITEM_DATA_TYPE
Standard field used in persistence layer. |
Fields inherited from class blackboard.data.BbObject |
---|
_bbAttributes |
Constructor Summary | |
---|---|
Lineitem()
Constructs and returns a new Lineitem object with date added and date changed initialized to the current date. |
|
Lineitem(OutcomeDefinition outcomeDefinition)
Creates the Lineitem using the specified OutcomeDefinition . |
Method Summary | |
---|---|
protected void |
clearAssessmentId()
Clears the assessmentId and sets assessmentLocation to UNSET . |
java.lang.String |
getAnalysisHandlerUrl()
|
java.lang.Object |
getAssessmentId()
Returns a String-based Id for the associated assessment. |
Lineitem.AssessmentLocation |
getAssessmentLocation()
assessmentLocation indicates whether the assessment referenced by this Lineitem
is native to the Blackboard server or stored externally. |
java.lang.String |
getAttemptHandlerUrl()
Returns the URL for this item's attemptHandler if this Lineitem points to an
external assessment. |
int |
getColumnOrder()
Returns the column position for this line item. |
Id |
getCourseId()
Returns the Id of the Course this Lineitem 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 Lineitem was modified. |
Id |
getId()
Returns the Id associated with this BbObject . |
boolean |
getIsAvailable()
Returns a flag describing whether students can see the item in their views of the gradebook. |
java.lang.String |
getName()
Returns the name of the Lineitem. |
OutcomeDefinition |
getOutcomeDefinition()
For internal use only. |
float |
getPointsPossible()
Gets the points possible for this Lineitem |
BbList |
getScores()
Gets all scores associated with this LineItem. |
java.lang.String |
getType()
Returns the type of the Lineitem, for example 'Assessment' or 'Homework'. |
float |
getWeight()
Gets the weight used in calculating cumulative scores. |
void |
setAnalysisHandlerUrl(java.lang.String analysisHandlerUrl)
|
void |
setAssessmentId(java.lang.Object id,
Lineitem.AssessmentLocation location)
Sets the assessment Id to be used by an external assessment handler. |
void |
setAssessmentLocation(Lineitem.AssessmentLocation assessmentLocation)
Manual over-ride for assessmentLocation . |
void |
setAttemptHandlerUrl(java.lang.String attemptHandlerUrl)
Sets the URL to render student attempt data, if this Lineitem is set to interact with external
assessment engines. |
void |
setColumnOrder(int iColumnOrder)
|
void |
setCourseId(Id id)
Sets the Course Id associated with this Lineitem. |
void |
setDateAdded()
Sets the date and time this Lineitem was added to the gradebook using the current time. |
void |
setDateAdded(java.util.Calendar cDateAdded)
Sets the date and time this Lineitem was added to the gradebook using the provided Calendar. |
void |
setDateChanged()
Sets the date and time this Lineitem was modified using the current time. |
void |
setDateChanged(java.util.Calendar cDateChanged)
Sets the date and time this Lineitem was modified using the provided Calendar. |
protected void |
setExternalAssessmentId(java.lang.String id)
Sets the assessment Id to be used by an external assessment handler. |
protected void |
setInternalAssessmentId(Id id)
Sets the assessment Id to be used by an internal assessment handler. |
void |
setIsAvailable(boolean bIsAvailable)
Sets a flag describing whether students can see the item in their views of the gradebook. |
void |
setName(java.lang.String strName)
Sets the name of the Lineitem. |
void |
setPointsPossible(float fPointsPossible)
Sets the maximum points possible for this Lineitem . |
void |
setScores(BbList scores)
Associates the input Score objects to this LineItem object. |
void |
setType(java.lang.String strType)
Sets the type of the Lineitem. |
void |
setWeight(float fWeight)
Sets the weight (as a percentage) for this Lineitem . |
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 LineItem . |
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 |
---|
public static final DataType LINEITEM_DATA_TYPE
Constructor Detail |
---|
public Lineitem()
public Lineitem(OutcomeDefinition outcomeDefinition)
Lineitem
using the specified OutcomeDefinition
.
For internal use only.
Method Detail |
---|
public Id getId()
BbObject
Id
associated with this BbObject
.
getId
in interface IBbObject
getId
in class BbObject
Id
value for this BbObject
public OutcomeDefinition getOutcomeDefinition()
public Id getCourseId()
public void setCourseId(Id id)
id
- A valid Course Idpublic java.lang.Object getAssessmentId()
assessmentLocation
is EXTERNAL.
This value would be substituted into the analysis handler URL for a third-party tool.
public void setAssessmentId(java.lang.Object id, Lineitem.AssessmentLocation location)
Id
or a free-form String for use by a non-Blackboard
assessment handler. If setting the value for an external assessment, the type of the id
parameter
must be a String and the location
parameter must be AssessmentLocation.EXTERNAL
.
if setting the value for a Blackboard assessment, the type of the id
parameter must be Id
and the location
parameter must be AssessmentLocation.INTERNAL
.
id
- The Id of the assessment this Lineitem is associated with.location
- The location of the assessment this Lineitem is associated with.
java.lang.IllegalArgumentException
- Thrown if id
and location
arguments do not agree.protected void setInternalAssessmentId(Id id)
id
- The Id of the assessment this Lineitem is derived from.protected void setExternalAssessmentId(java.lang.String id)
Id
or a free-form String for use by a non-Blackboard assessment handler.
To link to an external assessment engine, you must also call #setAttemptHandlerUrl()
. The gradebook
rendering logic will display the scores with a link to that URL, passing this id as a parameter.
Note: calling this method will clear the internal assessment ID, if there is one, currently associated with this Lineitem.
id
- The Id of the assessment this Lineitem is derived from.protected void clearAssessmentId()
assessmentId
and sets assessmentLocation
to UNSET
.
public Lineitem.AssessmentLocation getAssessmentLocation()
assessmentLocation
indicates whether the assessment referenced by this Lineitem
is native to the Blackboard server or stored externally. It may be implied by other properties:
OutcomeDefinition
object's asiDataId
attribute
is set, assessmentLocation
is Lineitem.AssessmentLocation.INTERNAL
OutcomeDefinition
object's linkId
attribute
is set, assessmentLocation
is Lineitem.AssessmentLocation.EXTERNAL
assessmentLocation
is Lineitem.AssessmentLocation.UNSET
This value should typically only be of interest if the Lineitem
points to an external
assessment engine. It is then set implicitly via #setExternalAssessmentId()
.
public void setAssessmentLocation(Lineitem.AssessmentLocation assessmentLocation)
assessmentLocation
. This method should not be called directly.
assessmentLocation
- Value to set.public java.lang.String getName()
public void setName(java.lang.String strName)
strName
- The name of the Lineitempublic java.lang.String getType()
public void setType(java.lang.String strType) throws java.lang.IllegalArgumentException
strType
- The type of the Lineitem, as a String. The value does not have to conform to a preset list.
java.lang.IllegalArgumentException
public boolean getIsAvailable()
getIsAvailable
in interface Available
public void setIsAvailable(boolean bIsAvailable)
setIsAvailable
in interface Available
bIsAvailable
- True if the Lineitem should be visible to the student, false otherwisepublic int getColumnOrder()
public void setColumnOrder(int iColumnOrder)
public float getPointsPossible()
Lineitem
public void setPointsPossible(float fPointsPossible)
Lineitem
.
fPointsPossible
- Float value for points possible.public float getWeight()
public void setWeight(float fWeight)
Lineitem
. Thus, if you wanted to weight this
lineitem as 40% of the total, you should set this value to .40F.
fWeight
- Percentage weight as a float value.public java.lang.String getAttemptHandlerUrl()
attemptHandler
if this Lineitem
points to an
external assessment.
Note that in release 5.x, the URL format for the system extension did not include the Virtual Installation information; in release 6.x, the URL includes a string in the URL that does identify the Virtual Installation. As a result, developers should double check the value to make sure it is in the proper format.
public void setAttemptHandlerUrl(java.lang.String attemptHandlerUrl)
Lineitem
is set to interact with external
assessment engines.
Note that in release 5.x, the URL format for the system extension did not include the Virtual Installation information; in release 6.x, the URL includes a string in the URL that does identify the Virtual Installation. As a result, developers should double check the value to make sure it is in the proper format.
attemptHandlerUrl
- URL value.public java.lang.String getAnalysisHandlerUrl()
public void setAnalysisHandlerUrl(java.lang.String analysisHandlerUrl)
public java.util.Calendar getDateAdded()
public void setDateAdded()
public void setDateAdded(java.util.Calendar cDateAdded)
cDateAdded
- The date and time this Lineitem was added to the gradebookpublic java.util.Calendar getDateChanged()
public void setDateChanged()
public void setDateChanged(java.util.Calendar cDateChanged)
cDateChanged
- The date and time this Lineitem was modifiedpublic BbList getScores()
public void setScores(BbList scores)
Score
objects to this LineItem object. The LineItem must be
persisted before invoking this method. The scores are not persisted
when this LineItem is persisted. The client must explicitly persist each Score.
scores
- - List of Score
objectspublic DataType getDataType()
DataType
identifier for this object. Can be used to
uniquely identify the "type" of this data object.
getDataType
in interface IBbObject
getDataType
in class BbObject
DataType
for this objectpublic java.lang.String toString()
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.
toString
in class BbObject
String
that represents the contents of this objectpublic void validate() throws ValidationException
LineItem
. Internal consistency
checks are also performed.
validate
in interface IBbObject
validate
in class BbObject
ValidationException
- if validation of this object fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |