public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $htmlGrader->assertElementContains('.stock-status', 'Out of Stock');
     $htmlGrader->assertElementContains('.stock-status', '62');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', '{% if', 'Remove the `{% if` statement and replace it with a single line that does the same thing');
 }
Exemple #2
0
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $normalGrader->assertInputContains('fallCollection.twig', 'else', 'Use an `else` with your `for` tag.');
     $normalGrader->assertInputContains('fallCollection.twig', 'No pants for you!');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', '{% if', 'You don\'t need the `{% if` statement that checks for the products anymore!');
 }
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $htmlGrader->assertOutputDoesNotContain('The Black and Tan Trouser');
     $htmlGrader->assertOutputContains('Starfish Halloween Costume');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', '{% if', 'Hide the products with zero quantity, but without a new `{% if ...` statement: add an "if" part to the `{% for ...` tag.');
 }
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $htmlGrader->assertOutputContains('Winter is coming! Get your pants!');
     $htmlGrader->assertElementContains('footer', 'Winter is coming! Get your pants!', 'It looks like the `<footer>` HTML tag is gone. Print the text inside of this tag');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', '<footer>', 'You don\'t need to have the `<footer>` tag inside of `fallCollection.twig`. Instead, only put this `layout.twig`, and make your block only override the contents *inside* of it');
     $normalGrader->assertInputContains('layout.twig', 'You\'re hip, you\'re cool, you\'re a penguin!', 'Oh no! The original caption - `You\'re hip, you\'re cool, you\'re a penguin!` will now be missing from every other template that does *not* override the block. Make this be the default footer content.');
 }
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $normalGrader->assertInputContains('fallCollection.twig', 'extends', '`fallCollection.twig` needs to "extend" `layout.twig`');
     $normalGrader->assertInputContains('fallCollection.twig', 'layout.twig', '`fallCollection.twig` needs to "extend" `layout.twig`');
     $normalGrader->assertInputContains('mainCollection.twig', 'extends', '`mainCollection.twig` needs to "extend" `layout.twig`');
     $normalGrader->assertInputContains('mainCollection.twig', 'layout.twig', '`mainCollection.twig` needs to "extend" `layout.twig`');
     $normalGrader->assertInputContains('layout.twig', '<html', 'Put the entire HTML layout into `layout.twig`');
     $normalGrader->assertInputContains('layout.twig', '</html>', 'Put the entire HTML layout into `layout.twig`');
     $normalGrader->assertInputContains('layout.twig', '<header>', 'The `<header>` belongs in `layout.twig` too, since it\'s repeated on both pages');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', '<html', 'You no longer need the HTML layout (e.g. the `<html>` tag) inside of `fallCollection.twig`');
     $htmlGrader->assertOutputContains('The fall products are coming soon!');
 }
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $htmlGrader->assertOutputContains('pin-striped full suit');
     $normalGrader->assertInputContains('fallCollection.twig', 'include');
     $normalGrader->assertInputContains('_featuredProduct.twig', 'pin-striped full suit');
     $normalGrader->assertInputDoesNotContain('fallCollection.twig', 'pin-striped full suit', 'Now that you\'re including `_featuredProduct.twig`, you should remove the "pin-striped full suit" text from `fallCollection.twig`');
     $normalGrader->assertInputContains('mainCollection.twig', 'include');
 }