public class Test extends Model
Modifier and Type | Field and Description |
---|---|
private float |
CORRECT_ANSWER_SCORE
Correct answer score
|
private int |
def
Default questions in test
|
private Long |
editTime
Last time test was updated
|
private boolean |
evaluated
Flag for check if the test has been evaluated
|
private String |
feedback
Feedback to be showed to the student
|
static String |
FEEDBACK_HIGH
High feedback
|
static String |
FEEDBACK_MAX
Maximum feedback
|
static String |
FEEDBACK_MEDIUM
Medium feedback
|
static String |
FEEDBACK_MIN
Minimum feedback
|
static String |
FEEDBACK_NONE
None feedback
|
static List<String> |
FEEDBACK_VALUES
Feedback values
|
private int |
max
Maximum questions in test
|
private int |
min
Minimum questions in test
|
private static org.ksoap2.serialization.PropertyInfo |
PI_def |
private static org.ksoap2.serialization.PropertyInfo |
PI_feedback |
private static org.ksoap2.serialization.PropertyInfo |
PI_max |
private static org.ksoap2.serialization.PropertyInfo |
PI_min |
private static org.ksoap2.serialization.PropertyInfo[] |
PI_PROP_ARRAY |
private List<TestQuestion> |
questions
List of questions and related answers
|
private List<Float> |
questionsScore
Individual answers's score
|
private static String |
TAG
Tests tag name for Logcat
|
private float |
totalScore
Total test's score
|
Constructor and Description |
---|
Test(long selectedCourseCode,
int min,
int def,
int max,
String feedback)
Constructor from fields
|
Test(long crsCode,
int min,
int def,
int max,
String feedback,
Long editTime)
Constructor from fields
|
Modifier and Type | Method and Description |
---|---|
void |
evaluate()
Calculates total score and individual question's score of the test
|
int |
getDef()
Gets default questions in test
|
Long |
getEditTime()
Gets last time test was updated
|
String |
getFeedback()
Gets feedback to be showed to the student
|
int |
getMax()
Gets maximum questions in test
|
int |
getMin()
Gets minimum questions in test
|
Object |
getProperty(int param) |
int |
getPropertyCount() |
void |
getPropertyInfo(int param,
Hashtable arg1,
org.ksoap2.serialization.PropertyInfo propertyInfo) |
TestQuestion |
getQuestionAndAnswers(int i)
Gets the question stored in position i and related answers
|
List<TestQuestion> |
getQuestions()
Gets the questions list
|
Float |
getQuestionScore(int pos)
Gets individual score for question in position i
|
List<Float> |
getQuestionsScore()
Gets the questions's score
|
float |
getTotalScore()
Gets total test's score
|
boolean |
isEvaluated()
Checks if the test has been evaluated
|
(package private) void |
prepareEvaluation()
Initializes questions's score and total score
|
private String |
prepareString(String s)
Prepares a string for evaluate() method
|
void |
setDef(int def)
Sets default questions in test
|
void |
setEditTime(Long timestamp)
Sets last time test was updated
|
void |
setEvaluated(boolean evaluated)
Specifies if the test has been evaluated
|
void |
setFeedback(String feedback)
Sets feedback to be showed to the student
|
void |
setMax(int max)
Sets maximum questions in test
|
void |
setMin(int min)
Sets minimum questions in test
|
void |
setProperty(int param,
Object obj) |
void |
setQuestions(List<TestQuestion> questions)
Sets the questions list
|
void |
setQuestionScore(int pos,
Float score)
Sets individual answers's score
|
void |
setQuestionsScore(List<Float> questionsScore)
Sets the questions's score
|
void |
setTotalScore(float totalScore)
Sets total test's score
|
String |
toString() |
private final float CORRECT_ANSWER_SCORE
public static final String FEEDBACK_NONE
public static final String FEEDBACK_MIN
public static final String FEEDBACK_MEDIUM
public static final String FEEDBACK_HIGH
public static final String FEEDBACK_MAX
private static final String TAG
private List<TestQuestion> questions
private int min
private int def
private int max
private String feedback
private Long editTime
private float totalScore
private boolean evaluated
private static final org.ksoap2.serialization.PropertyInfo PI_min
private static final org.ksoap2.serialization.PropertyInfo PI_def
private static final org.ksoap2.serialization.PropertyInfo PI_max
private static final org.ksoap2.serialization.PropertyInfo PI_feedback
private static org.ksoap2.serialization.PropertyInfo[] PI_PROP_ARRAY
public Test(long selectedCourseCode, int min, int def, int max, String feedback)
selectedCourseCode
- Code of test's coursemin
- Minimum questions in testdef
- Default questions in testmax
- Maximum questions in testfeedback
- Feedback to be showed to the studentpublic Test(long crsCode, int min, int def, int max, String feedback, Long editTime)
crsCode
- Code of test's coursemin
- Minimum questions in testdef
- Default questions in testmax
- Maximum questions in testfeedback
- Feedback to be showed to the studenteditTime
- Last time test was updatedpublic TestQuestion getQuestionAndAnswers(int i)
i
- Question's positionpublic int getMin()
public void setMin(int min)
min
- Minimum questions in testpublic int getDef()
public void setDef(int def)
def
- Default questions in testpublic int getMax()
public void setMax(int max)
max
- Maximum questions in testpublic String getFeedback()
public void setFeedback(String feedback)
feedback
- Feedback to be showed to the studentpublic Long getEditTime()
public void setEditTime(Long timestamp)
timestamp
- Last time test was updatedpublic float getTotalScore()
public void setTotalScore(float totalScore)
totalScore
- Total test's scorepublic Float getQuestionScore(int pos)
pos
- Questions's position in testpublic void setQuestionScore(int pos, Float score)
pos
- Questions's position in testscore
- Questions's scorepublic List<TestQuestion> getQuestions()
public void setQuestions(List<TestQuestion> questions)
questions
- The questions to setpublic List<Float> getQuestionsScore()
public void setQuestionsScore(List<Float> questionsScore)
questionsScore
- The questions's scorepublic boolean isEvaluated()
public void setEvaluated(boolean evaluated)
evaluated
- true if the test has been evaluated
false if the test hasn't been evaluatedvoid prepareEvaluation()
private String prepareString(String s)
s
- String to be preparedpublic void evaluate()
public Object getProperty(int param)
public int getPropertyCount()
public void getPropertyInfo(int param, Hashtable arg1, org.ksoap2.serialization.PropertyInfo propertyInfo)
public void setProperty(int param, Object obj)