Ejemplo n.º 1
0
 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');
 }
Ejemplo n.º 2
0
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $normalGrader->assertInputContains('fallCollection.twig', '{%', 'Make sure to use the "do" something tag `{%` with the `for` tag');
     $normalGrader->assertInputContains('fallCollection.twig', 'for', 'Use the `for` tag to loop');
     $htmlGrader->assertElementContains('h3', 'The Black and Tan Trouser');
     $htmlGrader->assertElementContains('h3', 'Antarctic Snow Pants (in leopard seal print)');
 }
Ejemplo n.º 3
0
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $normalGrader->assertInputContains('fallCollection.twig', 'collectionTitle');
     $htmlGrader->assertElementContains('h1', 'Fall in love and look your best in the snow.');
 }
Ejemplo n.º 4
0
 public function grade(CodingExecutionResult $result)
 {
     $normalGrader = new PhpGradingTool($result);
     $htmlGrader = new HtmlOutputGradingTool($result);
     $normalGrader->assertInputContains('fallCollection.twig', 'saleStartsAt');
     $normalGrader->assertInputContains('fallCollection.twig', 'F jS', 'Make sure you use the `F jS` (e.g. January 5th) format for the date');
     $htmlGrader->assertElementContains('h3', $this->getSaleStartsAt()->format('F jS'));
 }
Ejemplo n.º 5
0
 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.');
 }