diff options
author | Jean-Michel Vedrine <vedrine@vedrine.org> | 2018-01-27 10:35:50 +0100 |
---|---|---|
committer | Jean-Michel Vedrine <vedrine@vedrine.org> | 2018-01-27 10:35:50 +0100 |
commit | cd5af0a39cf71fd9c53886badf3ea0384d51fa22 (patch) | |
tree | 30e89940dbe9c74d23ba98297395b064534182fd /tests | |
parent | 1bff8fd7cbd3904afda224ab1555e1e435528314 (diff) |
svg icon, multiply setting
Diffstat (limited to 'tests')
-rw-r--r-- | tests/behat/preview.feature | 4 | ||||
-rw-r--r-- | tests/parser_test.php | 6 |
2 files changed, 8 insertions, 2 deletions
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()); } } |