|
From: Chris S. <san...@us...> - 2011-11-21 19:14:38
|
Update of /cvsroot/stack/stack-dev/lib/items
In directory vz-cvs-3.sog:/tmp/cvs-serv20062/lib/items
Modified Files:
InstantiatedItem.php PotentialResponse.php StudentAns.php
Log Message:
Important changes to improve robustness to student errors.
Index: PotentialResponse.php
===================================================================
RCS file: /cvsroot/stack/stack-dev/lib/items/PotentialResponse.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** PotentialResponse.php 29 Nov 2010 18:06:51 -0000 1.50
--- PotentialResponse.php 21 Nov 2011 19:14:36 -0000 1.51
***************
*** 976,979 ****
}
-
- ?>
\ No newline at end of file
--- 976,977 ----
Index: StudentAns.php
===================================================================
RCS file: /cvsroot/stack/stack-dev/lib/items/StudentAns.php,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** StudentAns.php 13 Oct 2010 12:15:19 -0000 1.47
--- StudentAns.php 21 Nov 2011 19:14:36 -0000 1.48
***************
*** 267,271 ****
if ($casCommands === false)
{
! //Errors have occured. Error log contains details
$valid = $this->errorLog->getLastError();
}
--- 267,271 ----
if ($casCommands === false)
{
! //Errors have occurred. Error log contains details
$valid = $this->errorLog->getLastError();
}
***************
*** 403,408 ****
}
! /*commands are send with insert stars on and strict syntax off, the least strict settings
! * this is to allow us to send all students answers through at the same time to the cas
* regardless of their individual settings. If strict syntax is turned on, any problems should be
* caught at the syntax checking phase.
--- 403,408 ----
}
! /*commands are sent with insert stars on and strict syntax off, the least strict settings
! * this is to allow us to send all students answers through at the same time to the CAS
* regardless of their individual settings. If strict syntax is turned on, any problems should be
* caught at the syntax checking phase.
***************
*** 478,481 ****
--- 478,482 ----
$i = 0;
+
foreach($validLabels as $vLabel)
{
***************
*** 502,505 ****
--- 503,513 ----
//echo "<pre>";print_r($errs);echo "</pre>";
+ if (strpos($displayResults["caschat$i"],'CAS Error')) {
+
+ $errText = '<span class="errorMsg">'.get_string('stackCas_invalidCommand','stack','').' </span><span class="SyntaxExample">'.$this->studentAnswers[$vLabel]->getRawAns().'</span>';
+ $this->studentAnswers[$vLabel]->setFeedback($errText);
+ $this->studentAnswers[$vLabel]->setStatus('invalid');
+ }
+
if($errs["caschat$i"] == NULL)
{
***************
*** 513,518 ****
{
// Automatically translate Maxima's "division by zero" error for internationalisation
! if (strpos($errText,'Division') === FALSE)
! { } else {
$errText = get_string('DivisionZero', 'stack', '');
}
--- 521,525 ----
{
// Automatically translate Maxima's "division by zero" error for internationalisation
! if (strpos($errText,'Division') !== FALSE or strpos($errText,'0 to a negative exponent') !== FALSE){
$errText = get_string('DivisionZero', 'stack', '');
}
***************
*** 803,805 ****
}
- ?>
\ No newline at end of file
--- 810,811 ----
Index: InstantiatedItem.php
===================================================================
RCS file: /cvsroot/stack/stack-dev/lib/items/InstantiatedItem.php,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** InstantiatedItem.php 30 Sep 2010 16:56:15 -0000 1.82
--- InstantiatedItem.php 21 Nov 2011 19:14:36 -0000 1.83
***************
*** 909,911 ****
}
- ?>
\ No newline at end of file
--- 909,910 ----
|