public class DefaultItemScoring extends java.lang.Object implements ItemScoring
Modifier and Type | Class and Description |
---|---|
class |
DefaultItemScoring.ItemResponseComparator
Sort Strings before Doubles.
|
Modifier and Type | Field and Description |
---|---|
java.util.TreeMap<java.lang.Object,Category> |
categoryMap |
Constructor and Description |
---|
DefaultItemScoring() |
DefaultItemScoring(boolean isContinuous) |
Modifier and Type | Method and Description |
---|---|
ItemType |
addAllCategories(java.lang.String optionScoreKey,
VariableType type)
Parses string from syntax file or database.
|
void |
addCategory(Category cat) |
void |
addCategory(java.lang.Object categoryID,
double scoreValue) |
boolean |
binaryScoring()
Determine whether the item scoring is binary or polytomous.
|
java.util.Iterator<java.lang.Object> |
categoryIterator()
Return category iterator for binary and polytomous items.
|
void |
clearCategory() |
double |
computeCategoryScore(java.lang.Object categoryId,
java.lang.Object response)
Returns 1 if response == categoryId and 0 otherwise.
|
double |
computeItemScore(java.lang.Object response)
Missing responses, omitted responses, and not reached responses are scored according to the value in
the SepcialDataCodes object.
|
org.apache.commons.math3.util.Pair[] |
computeScoreVector(java.lang.Object response)
Creates an array of category keys and their corresponding score for the response.
|
java.lang.String |
getAnswerKey()
This method return the answer key for an item.
|
java.lang.String |
getCategoryScoreString(java.lang.Object response) |
ItemType |
getItemType()
An item type is defined by its scoring.
|
VariableName |
getName() |
boolean |
isContinuous() |
void |
isContinuous(boolean isContinuous) |
double |
maximumPossibleScore() |
double |
minimumPossibleScore() |
int |
numberOfCategories()
Gets the number of response options.
|
int |
numberOfScoreLevels()
Gets the number of score levels.
|
java.lang.String |
printOptionScoreKey()
this method creates a String that represents the item scoring.
|
void |
removeCategory(Category cat) |
double[] |
scoreArray()
this method creates a double array of all existing options scores.
|
void |
setSpecialDataCodes(SpecialDataCodes specialDataCodes) |
public java.util.TreeMap<java.lang.Object,Category> categoryMap
public DefaultItemScoring()
public DefaultItemScoring(boolean isContinuous)
public void addCategory(Category cat)
public void removeCategory(Category cat)
public void addCategory(java.lang.Object categoryID, double scoreValue)
addCategory
in interface ItemScoring
public void clearCategory()
clearCategory
in interface ItemScoring
public int numberOfCategories()
numberOfCategories
in interface ItemScoring
public void isContinuous(boolean isContinuous)
isContinuous
in interface ItemScoring
public boolean isContinuous()
public int numberOfScoreLevels()
numberOfCategories()
unless the score categories are collapsed. With collapsed score categories,
the number of score levels will be less than the number of response options.numberOfScoreLevels
in interface ItemScoring
public double maximumPossibleScore()
maximumPossibleScore
in interface ItemScoring
public double minimumPossibleScore()
minimumPossibleScore
in interface ItemScoring
public java.util.Iterator<java.lang.Object> categoryIterator()
categoryIterator
in interface ItemScoring
public java.lang.String getCategoryScoreString(java.lang.Object response)
getCategoryScoreString
in interface ItemScoring
public void setSpecialDataCodes(SpecialDataCodes specialDataCodes)
public double computeItemScore(java.lang.Object response)
computeItemScore
in interface ItemScoring
response
- an item response that is either a Double or Stringpublic org.apache.commons.math3.util.Pair[] computeScoreVector(java.lang.Object response)
response
- an item responsepublic double computeCategoryScore(java.lang.Object categoryId, java.lang.Object response)
computeCategoryScore
in interface ItemScoring
categoryId
- category IDresponse
- response valuepublic java.lang.String getAnswerKey()
getAnswerKey
in interface ItemScoring
public ItemType addAllCategories(java.lang.String optionScoreKey, VariableType type)
addAllCategories
in interface ItemScoring
public boolean binaryScoring()
public ItemType getItemType()
getItemType
in interface ItemScoring
public java.lang.String printOptionScoreKey()
printOptionScoreKey
in interface ItemScoring
public double[] scoreArray()
scoreArray
in interface ItemScoring
public VariableName getName()
getName
in interface ItemScoring