public function grade(CodingExecutionResult $result) { $normalGrader = new PhpGradingTool($result); $htmlGrader = new HtmlOutputGradingTool($result); $normalGrader->assertInputContains('layout.twig', 'block(', 'Use the `block(\'sidebar\') function to determine if the child template has any sidebar content'); $htmlGrader->assertOutputDoesNotContain('col-xs-3', 'Make sure the `.col-xs-3` element does not print at all, since there is no sidebar on this page.'); $htmlGrader->assertOutputContains('col-xs-12', 'Change the main content div\'s class to be `col-xs-9` when there is no sidebar content.'); }
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); $normalGrader->assertInputContains('macros.twig', 'printSizingChart(', 'I don\'t see the `printSizingChart` macro in `macros.twig`'); $normalGrader->assertInputContains('macros.twig', 'showXLColumn', 'I don\'t see the `showXLColumn` argument for the `printSizingChart` macro. Add this and use it to hide/show the XL column.'); $normalGrader->assertInputContains('fallCollection.twig', 'printSizingChart', 'You\'ll need to use the `printSizingChart` macro inside `fallCollection.twig'); $normalGrader->assertInputContains('mainCollection.twig', 'printSizingChart', 'You\'ll need to use the `printSizingChart` macro inside `mainCollection.twig'); $normalGrader->assertInputContains('mainCollection.twig', 'import', 'Don\'t forget to `import` `macros.twig` in `mainCollection.twig`.'); $htmlGrader->assertOutputContains('5-15 lbs'); $htmlGrader->assertOutputDoesNotContain('61-85 lbs'); }