-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnswerKey.java
33 lines (30 loc) · 926 Bytes
/
AnswerKey.java
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
//AnswerKey stores questions and answers for all practice tests and unit tests
//Answers the user inputs to questions are also stored here and are used in calculating scores, rewards, and progress
public class AnswerKey
{
public String question = "";
public int correctAnswerIndex;
public String[] answers;
public int userAnswer = -1;
public int correctAnswer = -2;
public AnswerKey()
{
}
public AnswerKey(String question, int correctAnswerIndex, String... answers)
{
this.question = question;
this.correctAnswerIndex = correctAnswerIndex;
this.answers = answers;
}
public AnswerKey(String question, int userAnswer, int correctAnswer)
{
this.question = question;
this.userAnswer = userAnswer;
this.correctAnswer = correctAnswer;
}
public AnswerKey(int userAnswer, int correctAnswer)
{
this.userAnswer = userAnswer;
this.correctAnswer = correctAnswer;
}
}