From: Chris S. <san...@us...> - 2011-01-20 18:20:11
|
Update of /cvsroot/stack/stack-dev/lib/answertests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10765 Modified Files: AnsTestController.php Added Files: SysEquiv.php Log Message: Addition of Grobner packages. Chris --- NEW FILE: SysEquiv.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Jonathan Hart (j.p...@bh...) * * @package stackAnswertest */ global $config; require_once $config->get('docroot').'/lib/items/CasString.php'; require_once $config->get('docroot').'/lib/CAS/maximaConnector.php'; require_once 'AnsTest.php'; /** * detailed description * * @author * @version * @copyright */ class SysEquiv extends AnsTest { // Attributes // Associations // Operations /** * constant * The name of the cas function this answer test uses. */ const casFunction = 'ATSysEquiv'; /** * * * @param string $sAnsKey * @param string $tAnsKey * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); } /** * * * @return bool * @access public */ public function doAnsTest() { $this->maximaPreferences->updateOption('Simplify', 'false'); $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$this->tAnsKey, self::casFunction); $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; if($this->ATMark == '1') { //echo '<strong>Returning true</strong>'; return true; } else { //echo '<strong>Returning false</strong>'; return false; } } } ?> Index: AnsTestController.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/AnsTestController.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AnsTestController.php 30 Oct 2009 16:43:36 -0000 1.34 --- AnsTestController.php 20 Jan 2011 18:20:03 -0000 1.35 *************** *** 64,68 **** 'SameType'=>get_string('stackOptions_AnsTest_values_SameType','stack',''), 'SubstEquiv'=>get_string('stackOptions_AnsTest_values_SubstEquiv','stack',''), ! 'Expanded'=>get_string('stackOptions_AnsTest_values_Expanded','stack',''), 'FacForm'=>get_string('stackOptions_AnsTest_values_FacForm','stack',''), 'SingleFrac'=>get_string('stackOptions_AnsTest_values_SingleFrac','stack',''), --- 64,68 ---- 'SameType'=>get_string('stackOptions_AnsTest_values_SameType','stack',''), 'SubstEquiv'=>get_string('stackOptions_AnsTest_values_SubstEquiv','stack',''), ! 'SysEquiv'=>get_string('stackOptions_AnsTest_values_SysEquiv','stack',''), 'Expanded'=>get_string('stackOptions_AnsTest_values_Expanded','stack',''), 'FacForm'=>get_string('stackOptions_AnsTest_values_FacForm','stack',''), 'SingleFrac'=>get_string('stackOptions_AnsTest_values_SingleFrac','stack',''), *************** *** 190,193 **** --- 190,198 ---- break; + case 'SysEquiv': + require_once 'SysEquiv.php'; + $this->AT = new SysEquiv($sAns, $tAns, $maximaPreferences, $AnsTestOption); + break; + // The following two are only used in the module ODE and should not be available for questions. // CJS, 30/10/9 *************** *** 381,383 **** } ! ?> \ No newline at end of file --- 386,388 ---- } ! ?> \ No newline at end of file |