Represents the answer a user gave for a particular question when submitting a quiz.

Group: Database Entities

Implements: Serializable, Relational


Properties

PropertyReturnsDescription
actualAnswerStringThe correct answer for this question, captured at the time the quiz was submitted. An answer counts as correct when it equals the given answer. Null for a survey or poll question, which has no correct answer. Up to 4000 characters.
answerKeyStringIdentifier of the question being answered, as named in the quiz definition. Answers are grouped and reported on by this key. Never null.
givenAnswerStringWhat the member actually answered. Never null, and up to 4000 characters. Compare it against the actual answer to decide whether the question was answered correctly.
idlongThe database identifier of this answer.
quizAttemptQuizAttemptThe quiz attempt this answer was given in, which ties it back to the member and to the module or reward submission the quiz belongs to.

Methods

getId() · getQuizAttempt() · setQuizAttempt(QuizAttempt quizAttempt) · getAnswerKey() · setAnswerKey(String answerKey) · getActualAnswer() · setActualAnswer(String actualAnswer) · getGivenAnswer() · setGivenAnswer(String givenAnswer) · rowId()

getId()

Returns: long

The database identifier of this answer.

getQuizAttempt()

Returns: QuizAttempt

The quiz attempt this answer was given in, which ties it back to the member and to the module or reward submission the quiz belongs to.

setQuizAttempt(QuizAttempt quizAttempt)

Returns: void

Sets the quiz attempt this answer was given in.

ParameterDescription
quizAttemptthe attempt this answer belongs to

getAnswerKey()

Returns: String

Identifier of the question being answered, as named in the quiz definition. Answers are grouped and reported on by this key. Never null.

setAnswerKey(String answerKey)

Returns: void

Sets the identifier of the question being answered.

ParameterDescription
answerKeythe question identifier, which must not be null

getActualAnswer()

Returns: String

The correct answer for this question, captured at the time the quiz was submitted. An answer counts as correct when it equals the given answer. Null for a survey or poll question, which has no correct answer. Up to 4000 characters.

setActualAnswer(String actualAnswer)

Returns: void

Sets the correct answer for this question.

ParameterDescription
actualAnswerthe correct answer, up to 4000 characters, or null if there is none

getGivenAnswer()

Returns: String

What the member actually answered. Never null, and up to 4000 characters. Compare it against the actual answer to decide whether the question was answered correctly.

setGivenAnswer(String givenAnswer)

Returns: void

Sets the answer the member gave.

ParameterDescription
givenAnswerthe given answer, which must not be null, up to 4000 characters

rowId()

Returns: Long

The database identifier of this answer, as required by the Relational interface.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.