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'); }
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)'); }
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.'); }
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')); }
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.'); }