From: Jonathan H. <j_...@us...> - 2007-02-13 14:08:08
|
Update of /cvsroot/stack/stack-dev In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27634 Modified Files: chat.php Log Message: Selects MathML/LaTeX dependant on browser Index: chat.php =================================================================== RCS file: /cvsroot/stack/stack-dev/chat.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** chat.php 8 Feb 2007 10:10:22 -0000 1.2 --- chat.php 13 Feb 2007 14:08:01 -0000 1.3 *************** *** 1,7 **** <?php - header("Content-Type: text/xml"); - echo '<?xml-stylesheet type="text/xsl" href="mathml/mathml.xsl"?>'; ?> --- 1,24 ---- <?php + require_once('./lib/CAS/casText.php'); + require_once('./lib/CAS/maximaCAS.php'); + require_once('./lib/CAS/displayCASText.php'); + require_once('./lib/error.php'); + + //maxima options stuff, should abstact/move + require_once('./scripts/moodlelib.php'); + require_once('./scripts/stackQuestion.php'); + + $string = $_POST['cas']; + + $ct = new casText($string, 's', false, true); + $display = $ct->getDisplayType(); + if ($display == 'MathML') + { + header("Content-Type: text/xml"); + echo '<?xml-stylesheet type="text/xsl" href="mathml/mathml.xsl"?>'; + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">'; + } ?> *************** *** 38,54 **** <?php - /* Test harness for casText */ - - - require_once('./lib/CAS/casText.php'); - require_once('./lib/CAS/maximaCAS.php'); - require_once('./lib/CAS/displayCASText.php'); - require_once('./lib/error.php'); - $string = $_POST['cas']; - - $ct = new casText($string, 's', false, true); - $display = $ct->getDisplayType(); $error = new error(); --- 55,60 ---- *************** *** 81,86 **** * $resultsToDisplay is a array in the format [label] => display string or a boolean false if fails */ ! ! $casError = new error(); $cas = new maximaObject($casCommands, $options, $display); --- 87,91 ---- * $resultsToDisplay is a array in the format [label] => display string or a boolean false if fails */ ! $casError = new error(); $cas = new maximaObject($casCommands, $options, $display); *************** *** 103,107 **** <br /><br /> <form action="chat.php" method="POST"> ! <textarea cols="80" rows="5" name="cas">@ diff(x^5, x) @ \[ @diff(x^3, x)@ \]</textarea><br /><br /> <input type="submit" value="chat" /> </form> --- 108,114 ---- <br /><br /> <form action="chat.php" method="POST"> ! <!--<textarea cols="80" rows="5" name="cas">@ diff(x^5, x) @ \[ @diff(x^3, x)@ \]</textarea><br /><br /> --> ! <textarea cols="80" rows="5" name="cas"><?php print $_POST['cas']; ?></textarea><br /><br /> ! <input type="submit" value="chat" /> </form> |