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 ItemScoringpublic void clearCategory()
clearCategory in interface ItemScoringpublic int numberOfCategories()
numberOfCategories in interface ItemScoringpublic void isContinuous(boolean isContinuous)
isContinuous in interface ItemScoringpublic 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 ItemScoringpublic double maximumPossibleScore()
maximumPossibleScore in interface ItemScoringpublic double minimumPossibleScore()
minimumPossibleScore in interface ItemScoringpublic java.util.Iterator<java.lang.Object> categoryIterator()
categoryIterator in interface ItemScoringpublic java.lang.String getCategoryScoreString(java.lang.Object response)
getCategoryScoreString in interface ItemScoringpublic void setSpecialDataCodes(SpecialDataCodes specialDataCodes)
public double computeItemScore(java.lang.Object response)
computeItemScore in interface ItemScoringresponse - 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 ItemScoringcategoryId - category IDresponse - response valuepublic java.lang.String getAnswerKey()
getAnswerKey in interface ItemScoringpublic ItemType addAllCategories(java.lang.String optionScoreKey, VariableType type)
addAllCategories in interface ItemScoringpublic boolean binaryScoring()
public ItemType getItemType()
getItemType in interface ItemScoringpublic java.lang.String printOptionScoreKey()
printOptionScoreKey in interface ItemScoringpublic double[] scoreArray()
scoreArray in interface ItemScoringpublic VariableName getName()
getName in interface ItemScoring