diff options
author | Camil Staps | 2015-03-05 16:48:34 +0100 |
---|---|---|
committer | Camil Staps | 2015-03-05 16:48:34 +0100 |
commit | cefdb190155230e388c2135bec59d5ab52ff5a16 (patch) | |
tree | 25eadf04e9c44f199201ce8b35f48b4096f88acd /Week5/src/week5/TCQuestion.java | |
parent | Framework week5 (diff) |
Finished week 5
Diffstat (limited to 'Week5/src/week5/TCQuestion.java')
-rw-r--r-- | Week5/src/week5/TCQuestion.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Week5/src/week5/TCQuestion.java b/Week5/src/week5/TCQuestion.java new file mode 100644 index 0000000..6ba1aa7 --- /dev/null +++ b/Week5/src/week5/TCQuestion.java @@ -0,0 +1,41 @@ +package week5; + +/** + * Class for 2-choice questions + * + * Note: for 3+-choice questions one can use MCQuestion. + * + * @author Thijs Heijligenberg, s4451414 + * @author Camil Staps, s4498062 + */ +public class TCQuestion extends MCQuestion { + + /** + * Construct a new TCQuestion instance + * + * @param question the question + * @param answer1 the first answer + * @param answer2 the second answer + * @param correctAnswer 0 if answer1 is correct, 1 if answer2 is correct + * @param weight the weight for this question + */ + public TCQuestion (String question, String answer1, String answer2, int correctAnswer, int weight) { + super(question, new String[] {answer1, answer2}, correctAnswer, weight); + } + + /** See the javadoc on the constructor above */ + public TCQuestion (String question, String answer1, String answer2, int correctAnswer) { + super(question, new String[] {answer1, answer2}, correctAnswer); + } + + /** + * For TCQuestions we don't need to randomize the answers. + * + * @return the new question + */ + @Override + public Question duplicate() { + return this; + } + +} |