From cd5af0a39cf71fd9c53886badf3ea0384d51fa22 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Sat, 27 Jan 2018 10:35:50 +0100 Subject: svg icon, multiply setting --- tests/behat/preview.feature | 4 ++-- tests/parser_test.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/behat/preview.feature b/tests/behat/preview.feature index 24f53ab..fec1b29 100644 --- a/tests/behat/preview.feature +++ b/tests/behat/preview.feature @@ -1,7 +1,7 @@ @qtype @qtype_algebra -Feature: Preview a Short answer question +Feature: Preview an Algebra question As a teacher - In order to check my Short answer questions will work for students + In order to check my Algebra questions will work for students I need to preview them Background: diff --git a/tests/parser_test.php b/tests/parser_test.php index 5d5eaad..309984c 100644 --- a/tests/parser_test.php +++ b/tests/parser_test.php @@ -26,6 +26,8 @@ defined('MOODLE_INTERNAL') || die(); global $CFG; +require_once($CFG->dirroot . '/question/engine/tests/helpers.php'); +require_once($CFG->dirroot . '/question/type/algebra/tests/helper.php'); require_once($CFG->dirroot . '/question/type/algebra/parser.php'); @@ -61,5 +63,9 @@ class qtype_algebra_parser_test extends advanced_testcase { $this->assertEquals('\sin \left( 4 x_{} \right) + \cos \left( 5 y_{} \right)', $expr->tex()); $expr = $p->parse('sin(6*x) + cos(7*y)'); $this->assertEquals('\sin \left( 6 x_{} \right) + \cos \left( 7 y_{} \right)', $expr->tex()); + $expr = $p->parse('3x y'); + $this->assertEquals('3 x_{} y_{}', $expr->tex()); + $expr = $p->parse('x*y*3'); + $this->assertEquals('x_{} y_{} \times 3 ', $expr->tex()); } } -- cgit v1.2.3