Skip to content

Commit 2b44977

Browse files
authored
Merge pull request #58 from NationalSecurityAgency/answer_hint_sample_data
added answer hint to sample data; upgraded spring
2 parents 5e4060e + a180a4a commit 2b44977

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

java-backend-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.4.1</version>
8+
<version>3.4.3</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>skill-tree</groupId>

java-backend-example/src/main/java/skills/examples/data/InitSkillServiceWithData.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ private List<String> loadQuizzes(RestTemplate rest) {
226226
} else {
227227
questionDefRequest.setQuestionType("SingleChoice");
228228
}
229+
if (q.getAnswerHint() != null) {
230+
questionDefRequest.setAnswerHint(q.getAnswerHint());
231+
}
229232
List<QuizAnswerDefRequest> answers = new ArrayList<>();
230233
for (Answer a : q.getAnswers()){
231234
answers.add(new QuizAnswerDefRequest(setDescPrefix(a.getText()), a.isCorrect()));

java-backend-example/src/main/java/skills/examples/data/model/Question.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class Question {
2424
private String question;
2525
private String questionType;
2626
private List<Answer> answers;
27+
private String answerHint;
2728

2829
public String getQuestion() {
2930
return question;
@@ -49,11 +50,20 @@ public void setQuestionType(String questionType) {
4950
this.questionType = questionType;
5051
}
5152

53+
public String getAnswerHint() {
54+
return answerHint;
55+
}
56+
57+
public void setAnswerHint(String answerHint) {
58+
this.answerHint = answerHint;
59+
}
60+
5261
@Override
5362
public String toString() {
5463
return "Question{" +
5564
"question='" + question + '\'' +
5665
", questionType='" + questionType + '\'' +
66+
", answerHint='" + answerHint + '\'' +
5767
", answers=" + answers +
5868
'}';
5969
}

java-backend-example/src/main/java/skills/examples/data/serviceRequestModel/QuizQuestionDefRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
public class QuizQuestionDefRequest {
2121
private String question;
2222
private String questionType;
23+
private String answerHint;
2324
private List<QuizAnswerDefRequest> answers;
2425

2526
public String getQuestion() {
@@ -38,6 +39,14 @@ public void setQuestionType(String questionType) {
3839
this.questionType = questionType;
3940
}
4041

42+
public String getAnswerHint() {
43+
return answerHint;
44+
}
45+
46+
public void setAnswerHint(String answerHint) {
47+
this.answerHint = answerHint;
48+
}
49+
4150
public List<QuizAnswerDefRequest> getAnswers() {
4251
return answers;
4352
}
@@ -51,6 +60,7 @@ public String toString() {
5160
return "QuizQuestionDefRequest{" +
5261
"question='" + question + '\'' +
5362
", questionType='" + questionType + '\'' +
63+
", answerHint='" + answerHint + '\'' +
5464
", answers=" + answers +
5565
'}';
5666
}

java-backend-example/src/main/resources/quiz.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,13 @@
571571
"questions": [
572572
{
573573
"question": "Please describe 3 basic goals during the chess opening?",
574+
"answerHint": "Consider the first 10 moves, what are you trying to achieve?",
574575
"questionType": "TextInput",
575576
"answers": []
576577
},
577578
{
578579
"question": "What is the overall goal of a chess game?",
580+
"answerHint": "Think about the king's safety",
579581
"answers": [
580582
{
581583
"text": "Stalemate",

0 commit comments

Comments
 (0)