|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.pavlov.event.AnswerEvent
public final class AnswerEvent
An event generated when a user answers a question in a quiz. Contains, directly and indirectly, almost all available information about the user, the current book and chapter, and the current quiz.
| Constructor Summary | |
|---|---|
AnswerEvent(boolean wasCorrect)
Creates a new AnswerEvent instance. |
|
AnswerEvent(boolean correct,
User user,
QuestionData question,
QuizData quiz,
BookData book,
ChapterData chapter,
boolean newQuiz)
Creates a new AnswerEvent instance. |
|
| Method Summary | |
|---|---|
BookData |
getBookData()
Returns the BookData for the Book containing the answered question. |
ChapterData |
getChapterData()
Returns the ChapterData for the chapter containing the answered question. |
ChapterStatistics |
getChapterStatistics()
Returns the ChapterStatistics for the chapter containing the answered question. |
int |
getNumberOfAnswers()
How many questions answered in the current quiz. |
int |
getNumberOfCorrectAnswers()
How many correct answers in the current quiz. |
int |
getNumberOfIncorrectAnswers()
How many incorrect answers in the current quiz. |
double |
getPercentageOfCorrectAnswers()
Percentage of correct answers in the current quiz. |
QuestionData |
getQuestionData()
Returns the QuestionData for the answered question. |
QuizData |
getQuizData()
Returns the QuizData for the current quiz. |
User |
getUser()
Returns the User who answered the question. |
boolean |
isCorrect()
Whether the answer was correct. |
boolean |
isNewQuiz()
Returns true if this is the first answer in a quiz. |
void |
setCorrect(boolean newCorrect)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnswerEvent(boolean wasCorrect)
AnswerEvent instance.
wasCorrect - whether the answer was correct
public AnswerEvent(boolean correct,
User user,
QuestionData question,
QuizData quiz,
BookData book,
ChapterData chapter,
boolean newQuiz)
AnswerEvent instance.
wasCorrect - whether the answer was correcttheUser - an User valuetheQues - a QuestionData valuetheQuiz - a QuizData valuetheBook - a BookData valuetheChapter - a ChapterData valuenewQuiz - a boolean value| Method Detail |
|---|
public boolean isCorrect()
boolean valuepublic void setCorrect(boolean newCorrect)
public int getNumberOfAnswers()
int valuepublic int getNumberOfCorrectAnswers()
int valuepublic int getNumberOfIncorrectAnswers()
int valuepublic double getPercentageOfCorrectAnswers()
double valuepublic QuizData getQuizData()
QuizData valuepublic ChapterStatistics getChapterStatistics()
ChapterStatistics valuepublic QuestionData getQuestionData()
QuestionData valuepublic User getUser()
User valuepublic ChapterData getChapterData()
ChapterData valuepublic BookData getBookData()
BookData valuepublic boolean isNewQuiz()
boolean value
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||