|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectShortAnswerQuestion
public class ShortAnswerQuestion
This is the Question which accepts only short answer. Short answer is one word.
Field Summary | |
---|---|
private java.lang.String |
correctAnswer
Correct answer of the question. |
private java.lang.String |
text
Text of question. |
Constructor Summary | |
---|---|
ShortAnswerQuestion(java.lang.String text,
java.lang.String correctAnswer)
Constructs question with text and answer. |
Method Summary | |
---|---|
java.lang.String |
getText()
Returns text of the question. |
boolean |
isCorrectAnswer(java.lang.String answer)
Checks if the answer is correct. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String text
private java.lang.String correctAnswer
Constructor Detail |
---|
public ShortAnswerQuestion(java.lang.String text, java.lang.String correctAnswer)
text
- a text of the questioncorrectAnswer
- a correct answer to the questionMethod Detail |
---|
public java.lang.String getText()
public boolean isCorrectAnswer(java.lang.String answer)
answer
- the answer that needs to be checked
true
if it is correct, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |