Apply formatting
This will make sure we have a consistent style across our project and the PRs are only concerned with actual changes and no longer about style.
This commit is contained in:
@@ -28,13 +28,13 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class HttpBasics extends Lesson {
|
||||
@Override
|
||||
public Category getDefaultCategory() {
|
||||
return Category.GENERAL;
|
||||
}
|
||||
@Override
|
||||
public Category getDefaultCategory() {
|
||||
return Category.GENERAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "1.http-basics.title";//first lesson in general
|
||||
}
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "1.http-basics.title"; // first lesson in general
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,16 +34,16 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@AssignmentHints({"http-basics.hints.http_basics_lesson.1"})
|
||||
public class HttpBasicsLesson extends AssignmentEndpoint {
|
||||
|
||||
@PostMapping("/HttpBasics/attack1")
|
||||
@ResponseBody
|
||||
public AttackResult completed(@RequestParam String person) {
|
||||
if (!person.isBlank()) {
|
||||
return success(this)
|
||||
.feedback("http-basics.reversed")
|
||||
.feedbackArgs(new StringBuilder(person).reverse().toString())
|
||||
.build();
|
||||
} else {
|
||||
return failed(this).feedback("http-basics.empty").build();
|
||||
}
|
||||
@PostMapping("/HttpBasics/attack1")
|
||||
@ResponseBody
|
||||
public AttackResult completed(@RequestParam String person) {
|
||||
if (!person.isBlank()) {
|
||||
return success(this)
|
||||
.feedback("http-basics.reversed")
|
||||
.feedbackArgs(new StringBuilder(person).reverse().toString())
|
||||
.build();
|
||||
} else {
|
||||
return failed(this).feedback("http-basics.empty").build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,19 +36,22 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@AssignmentPath("HttpBasics/attack2")
|
||||
public class HttpBasicsQuiz extends AssignmentEndpoint {
|
||||
|
||||
@PostMapping("/HttpBasics/attack2")
|
||||
@ResponseBody
|
||||
public AttackResult completed(@RequestParam String answer, @RequestParam String magic_answer, @RequestParam String magic_num) {
|
||||
if ("POST".equalsIgnoreCase(answer) && magic_answer.equals(magic_num)) {
|
||||
return success(this).build();
|
||||
} else {
|
||||
if (!"POST".equalsIgnoreCase(answer)) {
|
||||
return failed(this).feedback("http-basics.incorrect").build();
|
||||
}
|
||||
if (!magic_answer.equals(magic_num)) {
|
||||
return failed(this).feedback("http-basics.magic").build();
|
||||
}
|
||||
}
|
||||
return failed(this).build();
|
||||
@PostMapping("/HttpBasics/attack2")
|
||||
@ResponseBody
|
||||
public AttackResult completed(
|
||||
@RequestParam String answer,
|
||||
@RequestParam String magic_answer,
|
||||
@RequestParam String magic_num) {
|
||||
if ("POST".equalsIgnoreCase(answer) && magic_answer.equals(magic_num)) {
|
||||
return success(this).build();
|
||||
} else {
|
||||
if (!"POST".equalsIgnoreCase(answer)) {
|
||||
return failed(this).feedback("http-basics.incorrect").build();
|
||||
}
|
||||
if (!magic_answer.equals(magic_num)) {
|
||||
return failed(this).feedback("http-basics.magic").build();
|
||||
}
|
||||
}
|
||||
return failed(this).build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user