Class DefaultQuestion
- java.lang.Object
-
- net.starype.quiz.api.game.question.DefaultQuestion
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultQuestion.Builder
-
Constructor Summary
Constructors Constructor Description DefaultQuestion(java.lang.String rawText, java.lang.String rawAnswer, AnswerEvaluator answerEvaluator, QuestionDifficulty difficulty, java.util.Set<QuestionTag> tags)
-
Method Summary
Modifier and Type Method Description java.util.Optional<java.lang.Double>
evaluateAnswer(Answer answer)
QuestionDifficulty
getDifficulty()
java.lang.String
getDisplayableCorrectAnswer()
java.util.UUID
getId()
java.lang.String
getRawQuestion()
java.util.Set<QuestionTag>
getTags()
void
registerTag(QuestionTag tag)
void
unregisterTag(QuestionTag tag)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.starype.quiz.api.game.question.Question
isTagAttached
-
-
-
-
Constructor Detail
-
DefaultQuestion
public DefaultQuestion(java.lang.String rawText, java.lang.String rawAnswer, AnswerEvaluator answerEvaluator, QuestionDifficulty difficulty, java.util.Set<QuestionTag> tags)
-
-
Method Detail
-
getTags
public java.util.Set<QuestionTag> getTags()
-
registerTag
public void registerTag(QuestionTag tag)
- Specified by:
registerTag
in interfaceQuestion
-
unregisterTag
public void unregisterTag(QuestionTag tag)
- Specified by:
unregisterTag
in interfaceQuestion
-
getDifficulty
public QuestionDifficulty getDifficulty()
- Specified by:
getDifficulty
in interfaceQuestion
-
getRawQuestion
public java.lang.String getRawQuestion()
- Specified by:
getRawQuestion
in interfaceQuestion
-
getDisplayableCorrectAnswer
public java.lang.String getDisplayableCorrectAnswer()
- Specified by:
getDisplayableCorrectAnswer
in interfaceQuestion
-
evaluateAnswer
public java.util.Optional<java.lang.Double> evaluateAnswer(Answer answer)
- Specified by:
evaluateAnswer
in interfaceQuestion
-
-