1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package week5;
/**
* Class for 2-choice questions
*
* Note: for 3+-choice questions one can use MCQuestion.
*
* @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;
}
}
|