diff options
author | Jean-Michel Vedrine <vedrine@vedrine.org> | 2018-02-04 11:13:51 +0100 |
---|---|---|
committer | Jean-Michel Vedrine <vedrine@vedrine.org> | 2018-02-04 11:13:51 +0100 |
commit | c3cc23141194f4c0e56d6802f7e9ff082d21c5fb (patch) | |
tree | dcca1dd671f1b45608cf1570f927be31f2f6efe4 /displayformula.php | |
parent | 6e5d28ec5e338854112daaeb237c55fa6990e30c (diff) |
Display formula using Ajax
Diffstat (limited to 'displayformula.php')
-rw-r--r-- | displayformula.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/displayformula.php b/displayformula.php index 9693af3..6ba12fb 100644 --- a/displayformula.php +++ b/displayformula.php @@ -48,11 +48,22 @@ try { $texexp = ''; } else { $exp = $p->parse($m[2], $vars); - if ($CFG->qtype_algebra_texdelimiters == 'old') { - $texexp = '$$'.$exp->tex().'$$'; - } else { - $texexp = '\['.$exp->tex().'\]'; + $texexp = $exp->tex(); + switch($CFG->qtype_algebra_texdelimiters) { + case 'old': + $texexp = '$$' . $texexp . '$$'; + break; + case 'new': + $texexp = '\\[' . $texexp . '\\]'; + break; + case 'simple'; + $texexp = '$' . $texexp . '$'; + break; + case 'inline': + $texexp = '\\(' . $texexp . '\\)'; + break; } + } } catch (Exception $e) { $validanswer = false; |