|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLectureGame.Core.Question
public class Question
Created by IntelliJ IDEA. User: olekrst Date: 26.jan.2007 Time: 16:40:05 This class is a generalization of a question, as used in the LectureGame.Core.LG
Field Summary | |
---|---|
private java.lang.String[] |
alternatives
|
private java.lang.String |
correctAlternative
|
private java.lang.String |
formattedQuestion
|
private int |
numberOfAlt
|
private java.lang.String |
question
|
private java.lang.String |
timeLimit
|
Constructor Summary | |
---|---|
Question(java.lang.String question,
int numberOfAlt,
java.lang.String[] alternatives,
java.lang.String timeLimit,
java.lang.String correctAlternative)
|
Method Summary | |
---|---|
java.lang.String |
getCorrectAnswer()
Returns the correct alternative, an index of the String array as entered when creating the question |
int |
getTimeLimit()
Returns the timelimit of the question |
java.lang.String |
makeClientQuestion(int questionState)
Creates the question to be sendt to the StudentClient. |
java.lang.String |
makeMasterQuestion(int questionState)
Creates the question to be sendt to the MasterClient. |
private java.lang.String |
makeQuestionRoot()
Creates the root of the question to be sendt to eighter the studenclients or the masterclient. |
void |
testQuestion()
This method is used for testing purposes. prints the question to console. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String question
private int numberOfAlt
private java.lang.String[] alternatives
private java.lang.String timeLimit
private java.lang.String correctAlternative
private java.lang.String formattedQuestion
Constructor Detail |
---|
public Question(java.lang.String question, int numberOfAlt, java.lang.String[] alternatives, java.lang.String timeLimit, java.lang.String correctAlternative)
question
- Question text. example "who am i?"numberOfAlt
- number of answers to choose fromalternatives
- Array of alternatives. example {"me","you","them"}timeLimit
- time given to reply to the question. 0 = the server decidescorrectAlternative
- index number of the alternative in the Array of alternatives that is correct. Can only be oneMethod Detail |
---|
private java.lang.String makeQuestionRoot()
public void testQuestion()
public java.lang.String getCorrectAnswer()
public int getTimeLimit()
public java.lang.String makeClientQuestion(int questionState)
questionState
- the state of the question
public java.lang.String makeMasterQuestion(int questionState)
questionState
- the state of the question
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |