Skip to content

Commit 6624ef8

Browse files
authored
Merge pull request #732 from isaacphysics/improvement/customise-coords
Add new coordinate question properties
2 parents baf0023 + 3e54174 commit 6624ef8

File tree

2 files changed

+162
-0
lines changed

2 files changed

+162
-0
lines changed

src/main/java/uk/ac/cam/cl/dtg/isaac/dos/IsaacCoordinateQuestion.java

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ public class IsaacCoordinateQuestion extends IsaacQuestionBase {
2121
private Integer numberOfDimensions;
2222

2323
private Boolean ordered; // If true, the order of the coordinates in a choice matters.
24+
2425
private List<String> placeholderValues;
26+
private Boolean useBrackets;
27+
private String separator;
28+
private String[] suffixes;
29+
private String buttonText;
30+
2531
private Integer significantFiguresMin;
2632
private Integer significantFiguresMax;
2733

@@ -94,4 +100,80 @@ public List<String> getPlaceholderValues() {
94100
public void setPlaceholderValues(List<String> placeholderValues) {
95101
this.placeholderValues = placeholderValues;
96102
}
103+
104+
/**
105+
* Gets whether to use brackets around the coordinates.
106+
*
107+
* @return true or null if brackets should be used, false otherwise.
108+
*/
109+
public Boolean getUseBrackets() {
110+
return useBrackets;
111+
}
112+
113+
/**
114+
* Sets whether to use brackets around the coordinates.
115+
*
116+
* @param useBrackets
117+
* - whether to use brackets around the coordinates
118+
*/
119+
public void setUseBrackets(final Boolean useBrackets) {
120+
this.useBrackets = useBrackets;
121+
}
122+
123+
/**
124+
* Gets the separator to use between values.
125+
*
126+
* @return separator to use between values, or null to default to comma.
127+
*/
128+
public String getSeparator() {
129+
return separator;
130+
}
131+
132+
/**
133+
* Sets the separator to use between values.
134+
*
135+
* @param separator
136+
* - separator to use between values
137+
*/
138+
public void setSeparator(final String separator) {
139+
this.separator = separator;
140+
}
141+
142+
/**
143+
* Gets the suffixes to use after each value.
144+
*
145+
* @return the suffixes to use after each value.
146+
*/
147+
public String[] getSuffixes() {
148+
return suffixes;
149+
}
150+
151+
/**
152+
* Sets the suffixes to use after each value.
153+
*
154+
* @param suffixes
155+
* - suffixes to use after each value
156+
*/
157+
public void setSuffixes(final String[] suffixes) {
158+
this.suffixes = suffixes;
159+
}
160+
161+
/**
162+
* Gets the text to display on the button used to add additional coordinates.
163+
*
164+
* @return the button text, or null to use default text.
165+
*/
166+
public String getButtonText() {
167+
return buttonText;
168+
}
169+
170+
/**
171+
* Sets the text to display on the button used to add additional coordinates.
172+
*
173+
* @param buttonText
174+
* - button text
175+
*/
176+
public void setButtonText(final String buttonText) {
177+
this.buttonText = buttonText;
178+
}
97179
}

src/main/java/uk/ac/cam/cl/dtg/isaac/dto/IsaacCoordinateQuestionDTO.java

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public class IsaacCoordinateQuestionDTO extends IsaacQuestionBaseDTO {
1212
private Boolean ordered;
1313

1414
private List<String> placeholderValues;
15+
private Boolean useBrackets;
16+
private String separator;
17+
private String[] suffixes;
18+
private String buttonText;
1519

1620
public Integer getNumberOfCoordinates() {
1721
return numberOfCoordinates;
@@ -44,4 +48,80 @@ public List<String> getPlaceholderValues() {
4448
public void setPlaceholderValues(List<String> placeholderValues) {
4549
this.placeholderValues = placeholderValues;
4650
}
51+
52+
/**
53+
* Gets whether to use brackets around the coordinates.
54+
*
55+
* @return true or null if brackets should be used, false otherwise.
56+
*/
57+
public Boolean getUseBrackets() {
58+
return useBrackets;
59+
}
60+
61+
/**
62+
* Sets whether to use brackets around the coordinates.
63+
*
64+
* @param useBrackets
65+
* - whether to use brackets around the coordinates
66+
*/
67+
public void setUseBrackets(final Boolean useBrackets) {
68+
this.useBrackets = useBrackets;
69+
}
70+
71+
/**
72+
* Gets the separator to use between values.
73+
*
74+
* @return separator to use between values, or null to default to comma.
75+
*/
76+
public String getSeparator() {
77+
return separator;
78+
}
79+
80+
/**
81+
* Sets the separator to use between values.
82+
*
83+
* @param separator
84+
* - the separator to use between values
85+
*/
86+
public void setSeparator(final String separator) {
87+
this.separator = separator;
88+
}
89+
90+
/**
91+
* Gets the suffixes to use after each value.
92+
*
93+
* @return suffixes to use after each value.
94+
*/
95+
public String[] getSuffixes() {
96+
return suffixes;
97+
}
98+
99+
/**
100+
* Sets the suffixes to use after each value.
101+
*
102+
* @param suffixes
103+
* - suffixes to use after each value
104+
*/
105+
public void setSuffixes(final String[] suffixes) {
106+
this.suffixes = suffixes;
107+
}
108+
109+
/**
110+
* Gets the text to display on the button used to add additional coordinates.
111+
*
112+
* @return the button text, or null to use default text.
113+
*/
114+
public String getButtonText() {
115+
return buttonText;
116+
}
117+
118+
/**
119+
* Sets the text to display on the button used to add additional coordinates.
120+
*
121+
* @param buttonText
122+
* - button text
123+
*/
124+
public void setButtonText(final String buttonText) {
125+
this.buttonText = buttonText;
126+
}
47127
}

0 commit comments

Comments
 (0)