aboutsummaryrefslogtreecommitdiff
path: root/question.php
diff options
context:
space:
mode:
authorJean-Michel Vedrine <vedrine@vedrine.org>2014-06-19 14:08:36 +0200
committerJean-Michel Vedrine <vedrine@vedrine.org>2014-06-19 14:10:07 +0200
commita7171d6dacb463ce0cc45beb23a31fe2c1684141 (patch)
treec22952d52d7b1e00ad6389d2c2c35080029e170a /question.php
parent8055f6eddd71cf562d5fb7b6528bc082ef508085 (diff)
CONTRIB-5128 hints not working
Diffstat (limited to 'question.php')
-rw-r--r--question.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/question.php b/question.php
index ab024a7..10978a3 100644
--- a/question.php
+++ b/question.php
@@ -126,6 +126,7 @@ class qtype_algebra_question extends question_graded_by_strategy
* @return top term of the parse tree or a string if an exception is thrown
*/
public function formated_expression($text) {
+ global $CFG;
// Create an array of variable names for the parser from the question if defined.
$varnames=array();
@@ -141,7 +142,12 @@ class qtype_algebra_question extends question_graded_by_strategy
// can be caught and converted into errors.
try {
$exp = $p->parse($text, $varnames);
- return '$$'.$exp->tex().'$$';
+ if ($CFG->qtype_algebra_texdelimiters == 'old') {
+ return '$$'.$exp->tex().'$$';
+ } else {
+ return '\['.$exp->tex().'\]';
+ }
+
} catch (Exception $e) {
return '';
}
@@ -216,6 +222,7 @@ class qtype_algebra_question extends question_graded_by_strategy
* @return boolean true if the response matches the answer, false otherwise
*/
public function test_response_by_sage($response, $answer) {
+ global $CFG;
$request=array(
'host' => $CFG->qtype_algebra_host,
'port' => $CFG->qtype_algebra_port,