Represents the answer a user gave for a particular question when submitting a quiz.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| actualAnswer | 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. |
| answerKey | String | Identifier of the question being answered, as named in the quiz definition. Answers are grouped and reported on by this key. Never null. |
| givenAnswer | 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. |
| id | long | The database identifier of this answer. |
| quizAttempt | 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. |
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.
| Parameter | Description |
|---|---|
quizAttempt | the 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.
| Parameter | Description |
|---|---|
answerKey | the 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.
| Parameter | Description |
|---|---|
actualAnswer | the 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.
| Parameter | Description |
|---|---|
givenAnswer | the 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.