-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestion.java
More file actions
77 lines (64 loc) · 1.41 KB
/
Question.java
File metadata and controls
77 lines (64 loc) · 1.41 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
public class Question {
private String question;
private Category category;
private String answer;
private int rowy;
private int colx;
private int value;
private boolean hasLink;
private boolean doubleJeopardy;
public Question(String s, int row, int col) {
question = s;
rowy = row;
colx = col;
hasLink = false;
category = null;
answer = "";
value = 0;
doubleJeopardy = false;
}
public void cleanUp() {
question = question.replace("&", "and");
answer = answer.replace("&", "and");
question = question.replace("<i>", "");
question = question.replace("</i>", "");
answer = answer.replace("<i>", "");
answer = answer.replace("</i>", "");
question = question.replace(""", "\"");
answer = answer.replace(""", "\"");
if (question.contains("href") || answer.contains("href")) {
hasLink = true;
}
}
public int getCol() {
return colx;
}
public int getRow() {
return rowy;
}
public String getQuestion() {
return question;
}
public void setRoundAndValue(boolean b) {
doubleJeopardy = b;
value = rowy*200;
if (doubleJeopardy) {
value*=2;
}
}
public String getAnswer() {
return answer;
}
public Category getCategory() {
return category;
}
public void setCategory(Category c) {
category = c;
}
public void setAnswer(String s) {
answer = s;
}
public void writeToDatabase() {
//TODO: implement
}
}