|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlecturequiz.server.service.LectureQuizService
public class LectureQuizService
Constructor Summary | |
---|---|
LectureQuizService()
|
Method Summary | |
---|---|
int |
authenticate(java.lang.String username,
java.lang.String password,
boolean auth)
Authenticate and create a session. |
int |
endQuiz()
Ends the quiz the calling user is running |
int |
getAvailableGameModes(javax.xml.ws.Holder<java.util.List<GameModeInfo>> gameModes)
Get a list of supported game modes on the server |
int |
getAvailableQuizzes(javax.xml.ws.Holder<java.util.List<QuizInfo>> quizzes)
Get a list of the available quizzes |
int |
getCurrentGameStatus(javax.xml.ws.Holder<GameStatus> gameStatus)
Get the status of the current game Can only be called by teacher clients. |
int |
getCurrentQuestion(javax.xml.ws.Holder<QuestionInfo> info)
Returns the current question in the quiz |
int |
getGameModeInfo(java.lang.String quizCode,
javax.xml.ws.Holder<GameModeInfo> info)
Returns the running game mode of the supplied quiz code |
int |
getOverallStatistics(javax.xml.ws.Holder<java.util.List<StatisticsEntry>> stats)
Get the overall statistics from the entire game |
int |
getQuestion(int id,
javax.xml.ws.Holder<FullQuestionInfo> info)
|
int |
getQuestionList(javax.xml.ws.Holder<java.util.List<FullQuestionInfo>> info)
Returns a list of all questions stored in the database. |
int |
getQuestionStatistics(javax.xml.ws.Holder<java.util.List<StatisticsEntry>> stats)
Get statistics for the last question answered |
int |
getQuiz(int id,
javax.xml.ws.Holder<FullQuizInfo> quizInfo)
Retrieve a full quiz with all questions and answers, used for editing Can only be called by teachers and admins |
int |
getServiceVersion(javax.xml.ws.Holder<java.lang.String> version)
Get the version of lecture quiz this server is running |
int |
joinQuiz(java.lang.String quizCode,
java.util.List<ParameterEntry> parameters)
Attempt to join a quiz with the supplied quiz code |
int |
newQuiz(java.lang.String gameMode,
int quizId,
java.lang.String quizCode,
java.util.List<ParameterEntry> parameters)
Start a new quiz on the server. |
int |
saveQuiz(FullQuizInfo quizInfo)
Saves a quiz |
int |
startNextQuestion(javax.xml.ws.Holder<QuestionInfo> info)
Starts the next question. |
int |
submitAnswer(int answerId)
Submits an answer to the current quiz. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LectureQuizService()
Method Detail |
---|
public int authenticate(java.lang.String username, java.lang.String password, boolean auth)
username
- The username to be used in the game.password
- A password to authenticate with.auth
- Set to true if the user should try to authenticate with the password,
otherwise just check for username availability and log in as a normal student.
public int getAvailableQuizzes(javax.xml.ws.Holder<java.util.List<QuizInfo>> quizzes)
quizzes
- OUT: An ArrayList of QuizInfo objects populated by
this function in the form of a Hoderpublic int getAvailableGameModes(javax.xml.ws.Holder<java.util.List<GameModeInfo>> gameModes)
gameModes
-
public int newQuiz(java.lang.String gameMode, int quizId, java.lang.String quizCode, java.util.List<ParameterEntry> parameters)
gameMode
- ID of the game mode to use with this quizquizId
- ID of the quiz to startquizCode
- The code clients should supplement to join this quizparameters
- Custom parameters sent to the game mode on creation. Can be null.
public int startNextQuestion(javax.xml.ws.Holder<QuestionInfo> info)
info
- OUT: The question information of the question to be displayed is placed in this object.
public int getCurrentQuestion(javax.xml.ws.Holder<QuestionInfo> info)
info
- OUT: The question information is placed in this object.
public int getGameModeInfo(java.lang.String quizCode, javax.xml.ws.Holder<GameModeInfo> info)
quizCode
- the code of the quiz to checkinfo
- the game mode info is stored in this object
public int joinQuiz(java.lang.String quizCode, java.util.List<ParameterEntry> parameters)
quizCode
- A code that identifies the quiz you want to joinparameters
- Custom parameters sent to the game mode on join. Can be null.
public int submitAnswer(int answerId)
answerId
- The ID of the answer.
public int endQuiz()
public int getQuestionStatistics(javax.xml.ws.Holder<java.util.List<StatisticsEntry>> stats)
stats
- the statistics are places in this holder
public int getOverallStatistics(javax.xml.ws.Holder<java.util.List<StatisticsEntry>> stats)
stats
- The statistics are placed in this holder
public int getCurrentGameStatus(javax.xml.ws.Holder<GameStatus> gameStatus)
public int getQuiz(int id, javax.xml.ws.Holder<FullQuizInfo> quizInfo)
id
- ID of the quiz to retrievequizInfo
- The quiz information will be placed in this object
public int getQuestionList(javax.xml.ws.Holder<java.util.List<FullQuestionInfo>> info)
info
- A list of FullQuestionInfo objects. The questions are stored in
these objects. Be aware that only the correct answer is added to the list
of answers in this section to increase performance.
public int getQuestion(int id, javax.xml.ws.Holder<FullQuestionInfo> info)
id
- info
-
public int saveQuiz(FullQuizInfo quizInfo)
quizInfo
- the information about the quiz to save. If the
FullQuizInfo.id is 0 a new quiz is created. A user with the role of teacher
can only save his own quiz. Any question with the id of 0 is
also created, answers should then be listed with ids of 0-n and correctAnswer
should point to these ids.
public int getServiceVersion(javax.xml.ws.Holder<java.lang.String> version)
version
- The version number is put into this variable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |