Skip to content

Commit 6236659

Browse files
Move answers into JavaScript
Signed-off-by: David A. Wheeler <[email protected]>
1 parent 34f3a30 commit 6236659

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/labs/assert.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212

1313
<!-- See create_labs.md for how to create your own lab! -->
1414

15-
<!-- Sample expected answer -->
16-
<script id="expected0" type="plain/text">
17-
if (bindingResult.hasErrors()) {
18-
return "form";
19-
}
20-
</script>
21-
22-
<!-- Full pattern of correct answer -->
23-
<script id="correct0" type="plain/text">
24-
\s* if \( bindingResult \. hasErrors \( \) \) \{
25-
return "form" ;
26-
\} \s*
27-
</script>
28-
2915
</head>
3016
<body>
3117
<!-- For GitHub Pages formatting: -->

docs/labs/assert.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ info =
6060
text: "The answer needs to end with `}` (closing brace)."
6161
},
6262
],
63+
expected: [
64+
` if (bindingResult.hasErrors()) {
65+
return "form";
66+
}`
67+
],
68+
correct: [
69+
String.raw`\s* if \( bindingResult \. hasErrors \( \) \) \{
70+
return "form" ;
71+
\} \s*`,
72+
],
6373
successes: [
6474
[ "if ( bindingResult.hasErrors() ) {\n return \"form\";\n}\n" ],
6575
[ "if ( bindingResult . hasErrors ( ) ) { return \"form\" ; }\n" ],

0 commit comments

Comments
 (0)