|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLectureGame.GameMode.MeasureUpMode
public class MeasureUpMode
Created by IntelliJ IDEA. User: olekrst Date: 22.feb.2007 Time: 16:25:20 This game mode is more a traditional "answer correctly and receive points" type of quiz. Partisipants logging in after the round has started can also partisipate. For method descriptions, see the GameMode interface
GameMode
Field Summary | |
---|---|
private java.util.ArrayList<StudentClient> |
connections
|
private Question |
currentQuestion
|
private DataBaseConnection |
db
|
private NetworkManager |
manager
|
private int |
maxScorePerQuestion
|
private NetworkConnectionKeeper |
netKeeper
|
private int |
questionIndex
|
private Question[] |
questionList
|
private int |
questionState
|
private int |
roundID
|
Constructor Summary | |
---|---|
MeasureUpMode(NetworkConnectionKeeper netKeeper)
|
Method Summary | |
---|---|
int |
checkAns(java.lang.String answer,
StudentClient c)
Checks the answer from the studentclients and returns an int depending on what is expected from the gamemode. |
java.lang.String |
createClientQuestion()
Uses the current question in the round and formats it for sending to the student clients |
java.lang.String |
createMasterQuestion()
Formats a question for sending to the master client. |
int |
getMaxScore()
Returns the maximum possible score per question |
int |
getQuestionState()
Returns an integer referencing the question state in the LG constants class |
java.lang.String |
handleClientQuestionReply(int score,
int roundScore,
int totalPossibleScore)
Formats the results of the question answers from the studentclients |
java.lang.String |
handleEndOfRound()
Formats an end of round string for sending to the masterclient |
java.lang.String |
handleQuestionReply()
Method for creating the reply string which is sendt to the masterclient. |
void |
initiateRound()
Extracts all the questions from the current round from the database |
Question |
nextQuestion()
Iterates to the the next question in the round. |
void |
setQuestionState(int s)
Sets the state of the current question to the state given as an argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private NetworkManager manager
private Question currentQuestion
private Question[] questionList
private DataBaseConnection db
private int questionIndex
private int roundID
private int questionState
private int maxScorePerQuestion
private java.util.ArrayList<StudentClient> connections
private NetworkConnectionKeeper netKeeper
Constructor Detail |
---|
public MeasureUpMode(NetworkConnectionKeeper netKeeper)
Method Detail |
---|
public Question nextQuestion()
GameMode
nextQuestion
in interface GameMode
Question
public java.lang.String createMasterQuestion()
GameMode
createMasterQuestion
in interface GameMode
public java.lang.String createClientQuestion()
GameMode
createClientQuestion
in interface GameMode
StudentClient
,
Question
public void initiateRound()
GameMode
initiateRound
in interface GameMode
DataBaseConnection
public int getMaxScore()
GameMode
getMaxScore
in interface GameMode
Question
public java.lang.String handleClientQuestionReply(int score, int roundScore, int totalPossibleScore)
GameMode
handleClientQuestionReply
in interface GameMode
score
- the score received from answering the last questionroundScore
- total score in the current roundtotalPossibleScore
- overall score
public int checkAns(java.lang.String answer, StudentClient c)
GameMode
checkAns
in interface GameMode
answer
- the answer index represented by a stringc
- the client which replied
public int getQuestionState()
GameMode
getQuestionState
in interface GameMode
LG
public void setQuestionState(int s)
GameMode
setQuestionState
in interface GameMode
s
- question state (see LG constants class)LG
public java.lang.String handleQuestionReply()
GameMode
handleQuestionReply
in interface GameMode
public java.lang.String handleEndOfRound()
GameMode
handleEndOfRound
in interface GameMode
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |