public class TestItem extends Item
It is not recommended that developers generate new instances of this class since this is a memory-structural class.
Modifier and Type | Field and Description |
---|---|
protected double |
averageTest
Average test rating
|
protected double |
maxTest
Maximum test rating value
|
protected double |
minTest
Minimum test rating value
|
protected int |
testItemIndex
Index in the DataModel array which stores test items
|
protected SortedRatingList |
testUsersRatings
Array of test users that have rated this test item
|
Constructor and Description |
---|
TestItem(String id,
int itemIndex,
int testItemIndex)
Creates a new instance of a test item.
|
Modifier and Type | Method and Description |
---|---|
void |
addTestRating(int testUserIndex,
double rating)
Adds a new test rating of a test user to the test item.
|
double |
getMaxTestRating()
Gets the maximum test rating received by the item
|
double |
getMinTestRating()
Gets the minimum test rating received by the item
|
int |
getNumberOfTestRatings()
Gets the number of test users that have rated the item.
|
int |
getTestItemIndex()
Returns the test item index inside the DataModel
|
double |
getTestRatingAt(int pos)
Returns the test rating of the test user to the test item at the pos position
|
double |
getTestRatingAverage()
Gets the average value of test ratings
|
int |
getTestUserAt(int pos)
Returns the index of the TestUser that have test rated the TestItem at the given position
|
addRating, findUser, getDataBank, getId, getItemIndex, getMaxRating, getMinRating, getNumberOfRatings, getRatingAt, getRatingAverage, getUserAt
protected int testItemIndex
protected double minTest
protected double maxTest
protected double averageTest
protected SortedRatingList testUsersRatings
public TestItem(String id, int itemIndex, int testItemIndex)
id
- Item unique identifieritemIndex
- Index in the DataModel array which stores itemstestItemIndex
- Index in the DataModel array which stores test itemspublic int getTestItemIndex()
public int getTestUserAt(int pos)
pos
- Positionpublic double getTestRatingAt(int pos)
pos
- Positionpublic int getNumberOfTestRatings()
public void addTestRating(int testUserIndex, double rating)
testUserIndex
- Test user index which identifies the specific test user in the DataModelrating
- Rating valuepublic double getMinTestRating()
public double getMaxTestRating()
public double getTestRatingAverage()
Copyright © 2020. All rights reserved.