Back to project page dv-quiz.
The source code is released under:
Apache License
If you think the Android project dv-quiz listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dvorakdev.dvquiz.model; /*from www .ja va 2s .c o m*/ import com.activeandroid.Model; import com.activeandroid.annotation.Column; import com.activeandroid.annotation.Table; import com.activeandroid.annotation.Column.ForeignKeyAction; @Table(name = "Answer") public class Answer extends Model { @Override public String toString() { return this.getAnswer(); } public Boolean isNew() { return this.getId() == null; } public Boolean isCorrect() { return this.equals(this.getQuestion().getCorrectAnswer()); } @Column(name = "Question", onDelete = ForeignKeyAction.CASCADE) private Question question; @Column(name = "Answer") private String answer; public Question getQuestion() { return question; } public void setQuestion(Question question) { this.question = question; } public String getAnswer() { return answer; } public void setAnswer(String answer) { this.answer = answer; } }