Update of /cvsroot/stack/stack-dev/lib/answertests
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv17949/lib/answertests
Modified Files:
Tag: grobner
AnsTestController.php
Added Files:
Tag: grobner
SysEquiv.php
Log Message:
Missed a few lib files.
--- 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()
{
$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.34.8.1
diff -C2 -d -r1.34 -r1.34.8.1
*** AnsTestController.php 30 Oct 2009 16:43:36 -0000 1.34
--- AnsTestController.php 9 Nov 2010 13:47:51 -0000 1.34.8.1
***************
*** 80,83 ****
--- 80,84 ----
'StringSloppy'=>get_string('stackOptions_AnsTest_values_StringSloppy','stack',''),
'RegExp'=>get_string('stackOptions_AnsTest_values_RegExp','stack',''),
+ 'SysEquiv'=>get_string('stackOptions_AnsTest_values_SysEquiv','stack',''),
);
//echo "<br>In Anstest controller: $AnsTest<br>";
***************
*** 190,193 ****
--- 191,199 ----
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
|