Fix quiz
This commit is contained in:
parent
8d2d82764f
commit
5a16ea514a
@ -210,7 +210,7 @@ public class JWTLessonTest extends IntegrationTest {
|
|||||||
private void quiz() {
|
private void quiz() {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("question_0_solution", "Solution 1");
|
params.put("question_0_solution", "Solution 1");
|
||||||
params.put("question_1_solution", "Solution 2");
|
params.put("question_1_solution", "Solution 3");
|
||||||
|
|
||||||
checkAssignment(url("/WebGoat/JWT/quiz"), params, true);
|
checkAssignment(url("/WebGoat/JWT/quiz"), params, true);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RestController
|
@RestController
|
||||||
public class JWTQuiz extends AssignmentEndpoint {
|
public class JWTQuiz extends AssignmentEndpoint {
|
||||||
|
|
||||||
private final String[] solutions = {"Solution 1", "Solution 2"};
|
private final String[] solutions = {"Solution 1", "Solution 3"};
|
||||||
private final boolean[] guesses = new boolean[solutions.length];
|
private final boolean[] guesses = new boolean[solutions.length];
|
||||||
|
|
||||||
@PostMapping("/JWT/quiz")
|
@PostMapping("/JWT/quiz")
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
{
|
{
|
||||||
"text": "What is the result of the first code snippet?",
|
"text": "What is the result of the first code snippet?",
|
||||||
"solutions": {
|
"solutions": {
|
||||||
"1": "Throws an exception in line 13",
|
"1": "Throws an exception in line 12",
|
||||||
"2": "Invoked the method removeAllUsers at line 8",
|
"2": "Invoked the method removeAllUsers at line 7",
|
||||||
"3": "Logs an error in line 10"
|
"3": "Logs an error in line 9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"text": "What is the result of the second code snippet?",
|
"text": "What is the result of the second code snippet?",
|
||||||
"solutions": {
|
"solutions": {
|
||||||
"1": "Throws an exception in line 13",
|
"1": "Throws an exception in line 12",
|
||||||
"2": "Invoked the method removeAllUsers at line 8",
|
"2": "Invoked the method removeAllUsers at line 7",
|
||||||
"3": "Logs an error in line 10"
|
"3": "Logs an error in line 9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user