File tree Expand file tree Collapse file tree 2 files changed +30
-28
lines changed Expand file tree Collapse file tree 2 files changed +30
-28
lines changed Original file line number Diff line number Diff line change 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 ( 1 + 2 + 16 > s - > s3 - > rrec . length )
18- return 0 ;
19- </ script >
20- <!--
21- -->
22- < script id ="expected1 " type ="plain/text ">
23- if ( 1 + 2 + payload + 16 > s - > s3 - > rrec . length )
24- return 0 ;
25- </ script >
26-
27- <!-- Full pattern of correct answer -->
28- < script id ="correct0 " type ="plain/text ">
29- \s *
30- if \( ( NINETEEN > FULL_LENGTH | FULL_LENGTH < NINETEEN ) \)
31- RETURN0
32- \s *
33- </ script >
34- < script id ="correct1 " type ="plain/text ">
35- \s *
36- if \( ( PAYLOAD_LENGTH > FULL_LENGTH | FULL_LENGTH < PAYLOAD_LENGTH ) \)
37- RETURN0
38- \s *
39- </ script >
40-
4115</ head >
4216< body >
4317<!-- For GitHub Pages formatting: -->
Original file line number Diff line number Diff line change @@ -54,6 +54,34 @@ info =
5454 {
5555 term : "RETURN0" ,
5656 value : String . raw `(RETURN0|\{ RETURN0 \})`
57- }
58- ]
57+ } ,
58+ ] ,
59+ expected : [
60+ `if (1 + 2 + 16 > s->s3->rrec.length)
61+ return 0;` ,
62+ `if (1 + 2 + payload + 16 > s->s3->rrec.length)
63+ return 0;`
64+ ] ,
65+ correct : [
66+ String . raw ` \s*
67+ if \( (NINETEEN > FULL_LENGTH|FULL_LENGTH < NINETEEN) \)
68+ RETURN0 \s*` ,
69+ String . raw ` \s*
70+ if \( (PAYLOAD_LENGTH > FULL_LENGTH|FULL_LENGTH < PAYLOAD_LENGTH) \)
71+ RETURN0 \s*` ,
72+ ] ,
73+ successes : [
74+ [
75+ ` if ( s -> s3 -> rrec . length < 19 )
76+ return 0 ;` ,
77+ ` if ( s -> s3 -> rrec . length < payload + 19 )
78+ return 0;`
79+ ] ,
80+ [
81+ `if(s->s3->rrec.length<19)
82+ return 0 ;` ,
83+ `if(s->s3->rrec.length<payload+19)
84+ return 0;`
85+ ] ,
86+ ] ,
5987}
You can’t perform that action at this time.
0 commit comments