|
5 | 5 | * @author Anthony
|
6 | 6 | */
|
7 | 7 | public class QuizSettings {
|
8 |
| - private int numQuestions; |
9 |
| - private boolean timerOn; |
10 |
| - private int timerDuration; |
11 |
| - private boolean multipleChoiceOn; |
12 |
| - private boolean textEntryOn; |
13 |
| - private boolean trueFalseOn; |
| 8 | + private final int numQuestions; |
| 9 | + private final boolean timerOn; |
| 10 | + private final int timerDuration; |
| 11 | + private final boolean multipleChoiceOn; |
| 12 | + private final boolean textEntryOn; |
| 13 | + private final boolean trueFalseOn; |
14 | 14 |
|
15 | 15 | /**
|
16 | 16 | * Constructor for quiz settings.
|
@@ -45,52 +45,35 @@ public boolean timerIsReasonable() {
|
45 | 45 | return ((1 <= this.timerDuration && this.timerDuration <= 60) || !(this.timerOn));
|
46 | 46 | }
|
47 | 47 |
|
48 |
| - /** GETTERS AND SETTERS **/ |
| 48 | + /** |
| 49 | + * Gets the number of questions. |
| 50 | + * @return the number of questions |
| 51 | + */ |
49 | 52 | public int getNumQuestions() {
|
50 | 53 | return numQuestions;
|
51 | 54 | }
|
52 | 55 |
|
53 |
| - public void setNumQuestions(int numQuestions) { |
54 |
| - this.numQuestions = numQuestions; |
55 |
| - } |
56 |
| - |
57 |
| - public boolean isTimerOn() { |
58 |
| - return timerOn; |
59 |
| - } |
60 |
| - |
61 |
| - public void setTimerOn(boolean timerOn) { |
62 |
| - this.timerOn = timerOn; |
63 |
| - } |
64 |
| - |
65 |
| - public int getTimerDuration() { |
66 |
| - return timerDuration; |
67 |
| - } |
68 |
| - |
69 |
| - public void setTimerDuration(int timerDuration) { |
70 |
| - this.timerDuration = timerDuration; |
71 |
| - } |
72 |
| - |
| 56 | + /** |
| 57 | + * Gets the multiple choice boolean value. |
| 58 | + * @return true if multiple choice is on |
| 59 | + */ |
73 | 60 | public boolean isMultipleChoiceOn() {
|
74 | 61 | return multipleChoiceOn;
|
75 | 62 | }
|
76 | 63 |
|
77 |
| - public void setMultipleChoiceOn(boolean multipleChoiceOn) { |
78 |
| - this.multipleChoiceOn = multipleChoiceOn; |
79 |
| - } |
80 |
| - |
| 64 | + /** |
| 65 | + * Gets the text entry boolean value. |
| 66 | + * @return true if text entry is on |
| 67 | + */ |
81 | 68 | public boolean isTextEntryOn() {
|
82 | 69 | return textEntryOn;
|
83 | 70 | }
|
84 | 71 |
|
85 |
| - public void setTextEntryOn(boolean textEntryOn) { |
86 |
| - this.textEntryOn = textEntryOn; |
87 |
| - } |
88 |
| - |
| 72 | + /** |
| 73 | + * Gets the true/false boolean value. |
| 74 | + * @return true if true/false is on |
| 75 | + */ |
89 | 76 | public boolean isTrueFalseOn() {
|
90 | 77 | return trueFalseOn;
|
91 | 78 | }
|
92 |
| - |
93 |
| - public void setTrueFalseOn(boolean trueFalseOn) { |
94 |
| - this.trueFalseOn = trueFalseOn; |
95 |
| - } |
96 | 79 | }
|
0 commit comments