Added a basic backend with stub functions to work against.

bodgemaster
BodgeMaster 2022-02-20 18:42:25 +01:00
parent 22e0139466
commit 81ffecec6a
1 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,58 @@
package linux.general.hackyquizbot;
public class QuizBackend {
public static String[] getCategories() {
return null;
}
public static Question getRandomQuestionForCategory(String category) {
return null;
}
public static int getScoreForUser(String discordUserID) {
return 0;
}
public static class Question {
public Question(String question, String[] answers) {
}
/**
* @return the full question text including multiple choice options
*/
public String getQuestionTextWithOptions() {
return null;
}
/**
* @return a character array containing all the valid answers
*/
public char[] getValidResponses() {
return null;
}
/**
* This is used to send the users reply back to the backend. Can be called
* multiple times to add answers for questions with multiple possible answers.
*
* @param discordUserID
* @param answer
*/
public void addAnswer(String discordUserID, char answer) {
}
/**
* Used to balance easy and difficult questions. Difficult questions will have a
* higher value so if someone gets a bunch of them they will get less questions
* overall.
*
* @return
*/
public int getQuestionScoreValue() {
return 0;
}
}
}