From: Chris S. <san...@us...> - 2005-11-28 14:10:23
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24899/scripts Modified Files: stackCAS.php stackQuestion.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** stackCAS.php 24 Nov 2005 18:58:17 -0000 1.14 --- stackCAS.php 28 Nov 2005 14:10:01 -0000 1.15 *************** *** 330,334 **** if ('' != $unp['ValidationError']) { $unp['Valid'] = 'false'; ! $unp['AnswerNote'] .= ' ValidationError'; $unp['Ans']['error'] = $unp['ValidationError']; } --- 330,334 ---- if ('' != $unp['ValidationError']) { $unp['Valid'] = 'false'; ! $unp['AnswerNote'] .= ', ValidationError'; $unp['Ans']['error'] = $unp['ValidationError']; } *************** *** 353,357 **** } - return $unp; } --- 353,356 ---- *************** *** 467,476 **** $unp = CASParsePreparse($instr); ! $unp['Ans'] = CASParsePreparse($unp['Ans']); ! if (''==$unp['Ans']['error']) { ! unset($unp['Ans']['error']); } if (''!=$unp['AnswerTestError']) { $unp['Ans']['error']=$unp['AnswerTestError']; --- 466,478 ---- $unp = CASParsePreparse($instr); ! if (array_key_exists('Ans',$unp)) { ! $unp['Ans'] = CASParsePreparse($unp['Ans']); ! if (''==$unp['Ans']['error']) { ! unset($unp['Ans']['error']); ! } } + if (''!=$unp['AnswerTestError']) { $unp['Ans']['error']=$unp['AnswerTestError']; *************** *** 478,481 **** --- 480,485 ---- unset($unp['AnswerTestError']); + + if (array_key_exists('Valid',$unp)) { $unp['Valid'] = strtolower($unp['Valid']); Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** stackQuestion.php 27 Nov 2005 11:30:52 -0000 1.55 --- stackQuestion.php 28 Nov 2005 14:10:01 -0000 1.56 *************** *** 1645,1652 **** $this_attempt=array_merge($this_attempt,$valid_attempt); } ! } return $this_attempt; } --- 1645,1677 ---- $this_attempt=array_merge($this_attempt,$valid_attempt); } ! ! } ! ! ! // Error check the result from the CAS. ! if (array_key_exists('error',$this_attempt['Ans'])) { ! //There is an error in the student's answer! ! $this_attempt['RawAns'] = $RawAns; ! $this_attempt['Valid'] = 'false'; ! $this_attempt['Penalty'] = 0; ! $this_attempt['RawMark'] = 0; ! if ('' == $this_attempt['Ans']['display']) { ! $this_attempt['Ans']['display'] = $RawAns; ! } else { ! $varin = $this_attempt['Ans']['display']; ! $opt = $options['Display']; ! $this_attempt['Ans']['display']=stack_casstring_to_display($varin, $opt); ! } ! $this_attempt['AnswerNote'] = ' CAS error'; ! $this_attempt['FeedBack'] = ' '.$this_attempt['Ans']['error']; ! } else { ! // Convert the display form of the answer. ! $varin = $this_attempt['Ans']['display']; ! $opt = $options['Display']; ! $this_attempt['Ans']['display']=stack_casstring_to_display($varin, $opt); } return $this_attempt; + } *************** *** 1875,1880 **** $this_prattempt = stack_apply_answertest($RawAns,$CorrectAns,$at,$ato,$options,$errors); unset($this_prattempt['Ans']); ! $this_attempt = array_merge($this_attempt,$this_prattempt); ! $this_attempt['RawAns']= $RawAns; // Make sure any output is displayed correctly. --- 1900,1905 ---- $this_prattempt = stack_apply_answertest($RawAns,$CorrectAns,$at,$ato,$options,$errors); unset($this_prattempt['Ans']); ! $this_attempt = array_merge($this_attempt,$this_prattempt); ! $this_attempt['RawAns'] = $RawAns; // Make sure any output is displayed correctly. *************** *** 1899,1919 **** } // end of 'if(potresp) exist'. So, we have $this_attempt marked. - // Error check the result from the CAS. - if (array_key_exists('error',$this_attempt['Ans'])) { - //There is an error in the student's answer! - $this_attempt['RawAns'] = $RawAns; - $this_attempt['Valid'] = 'false'; - $this_attempt['Penalty'] = 0; - $this_attempt['RawMark'] = 0; - $this_attempt['Ans']['display']=$RawAns; - $this_attempt['AnswerNote']= ' CAS error'; - $this_attempt['FeedBack']= ' '.$this_attempt['Ans']['error']; - } else { - // Convert the display form of the answer. - $varin = $this_attempt['Ans']['display']; - $opt = $options['Display']; - $this_attempt['Ans']['display']=stack_casstring_to_display($varin, $opt); - } - } // End of section (3) --- 1924,1927 ---- |