You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(486) |
Jul
(201) |
Aug
(194) |
Sep
(87) |
Oct
(72) |
Nov
(72) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(41) |
Mar
(22) |
Apr
(4) |
May
(12) |
Jun
|
Jul
|
Aug
(42) |
Sep
(21) |
Oct
(14) |
Nov
(10) |
Dec
|
2007 |
Jan
(14) |
Feb
(34) |
Mar
(61) |
Apr
(54) |
May
(140) |
Jun
(184) |
Jul
(164) |
Aug
(130) |
Sep
(241) |
Oct
(175) |
Nov
(148) |
Dec
(96) |
2008 |
Jan
(5) |
Feb
(38) |
Mar
(30) |
Apr
(46) |
May
(25) |
Jun
(22) |
Jul
(5) |
Aug
(17) |
Sep
(2) |
Oct
(100) |
Nov
(83) |
Dec
(33) |
2009 |
Jan
(127) |
Feb
(43) |
Mar
(86) |
Apr
(34) |
May
(50) |
Jun
(168) |
Jul
(48) |
Aug
(66) |
Sep
(38) |
Oct
(75) |
Nov
(113) |
Dec
(72) |
2010 |
Jan
(123) |
Feb
(68) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(131) |
Jul
(56) |
Aug
(79) |
Sep
(69) |
Oct
(17) |
Nov
(166) |
Dec
(32) |
2011 |
Jan
(21) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris S. <san...@us...> - 2005-11-19 16:04:49
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26165/scripts Modified Files: stackQuestion.php Log Message: Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** stackQuestion.php 19 Nov 2005 15:33:54 -0000 1.52 --- stackQuestion.php 19 Nov 2005 16:04:39 -0000 1.53 *************** *** 1388,1391 **** --- 1388,1392 ---- if ('AlgEquiv_quiet' == $atest) { $this_attempt['FeedBack'] = ''; + $this_attempt['Valid'] = 'true'; } } else if ('cas-var' == $stackAnswerTest[$atest]['imp']) { *************** *** 1639,1643 **** } - show_array($this_attempt); return $this_attempt; } --- 1640,1643 ---- |
From: Chris S. <san...@us...> - 2005-11-19 16:04:47
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26165/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** stackmaxima.mac 17 Nov 2005 21:54:19 -0000 1.49 --- stackmaxima.mac 19 Nov 2005 16:04:39 -0000 1.50 *************** *** 420,424 **** /* coefl:map('first,rest(coeffs(SA,x))) */ - /* A general all purpose function Takes two objects and returns true if they are equal, and false otherwise --- 420,423 ---- *************** *** 468,471 **** --- 467,472 ---- */ + + ATAlgEquivfun(SA,SB) := block([KEEPFLOAT,RawMark,FeedBack,AnswerNote,ret], RawMark:0, FeedBack:"", AnswerNote:"", |
From: Chris S. <san...@us...> - 2005-11-19 16:04:47
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26165/lang/en/doc Modified Files: en_doc.php Log Message: Index: en_doc.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/en_doc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** en_doc.php 17 Nov 2005 21:54:19 -0000 1.14 --- en_doc.php 19 Nov 2005 16:04:39 -0000 1.15 *************** *** 353,357 **** $stackAnswerTest['AlgEquiv_quiet']['doc']="This is identical to the answer test ! AlgEquiv, except that any feedback is ignored. Useful inside potential respons trees"; $stackAnswerTest['CASEqual']['doc']="This is test if the CAS returns TRUE --- 353,359 ---- $stackAnswerTest['AlgEquiv_quiet']['doc']="This is identical to the answer test ! AlgEquiv, except that the Valid field and any FeedBack is ignored. Hence, one ! can compare two expressions of different types without feedback or rendering ! the whole attempt as invalid. This is most useful inside potential response trees"; $stackAnswerTest['CASEqual']['doc']="This is test if the CAS returns TRUE |
From: Chris S. <san...@us...> - 2005-11-19 15:34:03
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20480/scripts Modified Files: stackCAS.php stackDatabase.php stackQuestion.php stackWin.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** stackDatabase.php 27 Oct 2005 14:39:22 -0000 1.54 --- stackDatabase.php 19 Nov 2005 15:33:54 -0000 1.55 *************** *** 973,977 **** FROM questionAttempts WHERE questionID=$questionID AND questionSeedInst=$seed AND userID=$user ! ORDER BY TimeStamp"; $result= stack_db_query($query); --- 973,977 ---- FROM questionAttempts WHERE questionID=$questionID AND questionSeedInst=$seed AND userID=$user ! ORDER BY attemptID"; $result= stack_db_query($query); Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** stackCAS.php 17 Nov 2005 21:54:19 -0000 1.12 --- stackCAS.php 19 Nov 2005 15:33:54 -0000 1.13 *************** *** 8,71 **** /** - * Maxima-specific function used to produce the code - * to process a list of local variables. - * - * @param array $locvars List of local variables to be instantiated - * @param int $t Timestamp identifier used to match CAS input and output - * @param int $seed The random number generation seed - * @param array $options - * @return string The command to send to the CAS - */ - function CASCodeInstantiate($locvars, $t, $seed, $options) { - global $stackOptionsCAS; - // Generates Maxima specific code - // We will use a maxima block. - // block([v1,...,vk], state1,...statej) - - $loclistA = ''; - $loclistB = ''; - $loclistC = ''; - $cs ='cab:block([ random_seed'; - - // Now we will add options - foreach ($stackOptionsCAS as $optname => $opt) { - $optkey = $opt['CAS_KEY']; - switch ($opt['CAS_TYPE']) { - case 'string': - $loclistA.= ', '.$optkey; - $loclistC.= ', '.$optkey.':"'.$options[$optname].'"'; - break; - case 'ex': - $loclistA.= ', '.$optkey; - $loclistC.= ', '.$optkey.':'.$options[$optname]; - break; - case 'fun': - $loclistC.= ', '.$optkey.'('.$options[$optname].')'; - break; - } - } - - // We know $locvars is non-empty, as we have put $answer into it! - foreach ($locvars as $lk => $locv) { - $key = $locv['key']; - $val = str_replace('?','qmchar',$locv["value"]); - $loclistA.= ','.$key; - $loclistB.= ", print(\"$lk=[ error= [\"), cte(\"$key\",errcatch($key:$val)) "; - } - - $cs .= $loclistA.'], random_seed:'.$seed.$loclistC; - - $cs .= ", print(\"[TimeStamp= [ $t ], Locals= [ \") "; - $cs .= $loclistB; - - $cs .= ', print("] ]") '; - $cs .= ", return(true) ); \n"; - - //echo "<pre>".$cs."</pre>"; - return($cs); - } - - - /** * Maxima-specific function used to parse CAS output into an array. * --- 8,11 ---- *************** *** 150,171 **** return($unp); } ! /** ! * Maxima-specific function used to produce the CAS command ! * to apply a specific answer test. * ! * @param string $exp1 The first expression (nominally the student's answer) ! * @param string $exp2 The second expression (nominally the teacher's answer) ! * @param int $t Timestamp identifier used to match CAS input and output ! * @param string $display The desired output format (a Stack Option) ! * @param string $test The answer test to apply * @return string The command to send to the CAS */ ! function CASAnsTestCmd($exp1, $exp2, $t, $options, $test) { ! // Generates the CAS command to mark a question ! global $stackAnswerTest,$stackOptionsCAS; ! ! $exp1 = str_replace('?','qmchar',$exp1); ! $exp2 = str_replace('?','qmchar',$exp2); $loclistA = ''; --- 90,110 ---- return($unp); } ! ! /** ! * Maxima-specific function used to produce the code ! * to process a list of local variables. * ! * @param array $locvars List of local variables to be instantiated ! * @param int $t Timestamp identifier used to match CAS input and output ! * @param int $seed The random number generation seed ! * @param array $options * @return string The command to send to the CAS */ ! function CASCodeInstantiate($locvars, $t, $seed, $options) { ! global $stackOptionsCAS; ! // Generates Maxima specific code ! // We will use a maxima block. ! // block([v1,...,vk], state1,...statej) $loclistA = ''; *************** *** 191,265 **** } } - - $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, "; - $cas_cmd .= " simp:false, "; - $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; - $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; - $cas_cmd .= " simp:".$options['Simplify'].", "; - $fname = $stackAnswerTest[$test]['function']; - $cas_cmd .= " print(\" AnswerTestError = [ \"), str:$fname(ans,$exp2), print(\" ], \"), print(str), return(true)); \n"; - - return $cas_cmd; - } - - - /** - * Maxima-specific function used to parse the CAS output from - * an answer test into an array. - * - * @param string $instr the raw CAS output - * @return array containing fields ['AnsValue'] and ['AnsDisplay'] - */ - function CASAnsTestParse($instr) { ! $unp = CASParsePreparse($instr); ! $unp['Ans'] = CASParsePreparse($unp['Ans']); ! ! if (''==$unp['Ans']['error']) { ! unset($unp['Ans']['error']); ! } ! ! if (array_key_exists('Valid',$unp)) { ! $unp['Valid'] = strtolower($unp['Valid']); ! } ! ! if ('false' == strtolower($unp['ValidationValid'])) { ! $unp['Valid'] = 'false'; ! $unp['AnswerNote'] = $unp['ValidationNote']; ! $unp['FeedBack'] = $unp['ValidationFeedBack']; ! } ! unset($unp['ValidationValid']); ! unset($unp['ValidationNote']); ! unset($unp['ValidationFeedBack']); ! ! if ('' != $unp['ValidationError']) { ! $unp['Valid'] = 'false'; ! $unp['AnswerNote'] = 'ValidationError'; ! $unp['Ans']['error'] = $unp['ValidationError']; ! } ! unset($unp['ValidationError']); ! unset($unp['AnswerTestError']); ! ! // Sort out translations of the feedback. ! if (array_key_exists('FeedBack',$unp)) { ! $strin = str_replace("\n","",$unp['FeedBack'] ); ! $strin = str_replace('\\','\\\\',$strin); ! $strin = str_replace('$','\$',$strin); ! $strin = str_replace("<QUOT>",'"',$strin); ! ! //echo "STRIN: <pre>$strin</pre><br>"; ! ob_start(); ! eval($strin); ! $strin = ob_get_contents(); ! ob_end_clean(); ! ! $unp['FeedBack'] = $strin; ! } ! return $unp; } ! /** --- 130,154 ---- } } ! // We know $locvars is non-empty, as we have put $answer into it! ! foreach ($locvars as $lk => $locv) { ! $key = $locv['key']; ! $val = str_replace('?','qmchar',$locv["value"]); ! $loclistA.= ','.$key; ! $loclistB.= ", print(\"$lk=[ error= [\"), cte(\"$key\",errcatch($key:$val)) "; ! } ! $cs .= $loclistA.'], random_seed:'.$seed.$loclistC; ! $cs .= ", print(\"[TimeStamp= [ $t ], Locals= [ \") "; ! $cs .= $loclistB; + $cs .= ', print("] ]") '; + $cs .= ", return(true) ); \n"; + + //echo "<pre>".$cs."</pre>"; + return($cs); } ! /** *************** *** 358,375 **** } /** ! * Directly perform an answer test * * @param string $exp1 A CAS expression, nominally the student's - * @param string $exp2 A CAS expression, nominally the teachers's - * @param string $test Which AnswerTest to apply. * @param array $options * @return array $this_attempt An array structure, which is used to build the student's attempt. */ ! function CPProcessAnsTest($exp1,$exp2,$test,$options,&$err) { // create a StackResponse object - $t = time(); ! $varCommand = CASAnsTestCmd($exp1, $exp2, $t, $options, $test); if ($varCommand != '') { --- 247,372 ---- } + + + /** + * Maxima-specific function used to validate the answer, + * and display the result. + * + * @param string $exp1 The first expression (nominally the student's answer) + * @param string $options + * @return string The command to send to the CAS + */ + function CAS_Validate_Ans_Expr($exp1, $options) { + // Generates the CAS command to mark a question + global $stackAnswerTest,$stackOptionsCAS; + + $exp1 = str_replace('?','qmchar',$exp1); + $exp2 = str_replace('?','qmchar',$exp2); + + $loclistA = ''; + $loclistB = ''; + $loclistC = ''; + $cs ='cab:block([ random_seed'; + + // Now we will add options + foreach ($stackOptionsCAS as $optname => $opt) { + $optkey = $opt['CAS_KEY']; + switch ($opt['CAS_TYPE']) { + case 'string': + $loclistA.= ', '.$optkey; + $loclistC.= ', '.$optkey.':"'.$options[$optname].'"'; + break; + case 'ex': + $loclistA.= ', '.$optkey; + $loclistC.= ', '.$optkey.':'.$options[$optname]; + break; + case 'fun': + $loclistC.= ', '.$optkey.'('.$options[$optname].')'; + break; + } + } + + // Ensure that the student's answer is not automatically simplified + + $cas_cmd .= " cab:block([ ans,str{$loclistA}] {$loclistC}, "; + $cas_cmd .= " simp:false, "; + $cas_cmd .= " print(\"[ Timestamp = [ 0 ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; + $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; + $cas_cmd .= " print(\" ], \"), print(str), return(true)); \n"; + + //echo "<pre>".$cas_cmd."</pre>"; + return $cas_cmd; + } + + + /** + * Maxima-specific function used to parse the CAS output from + * the validation call into an array. + * + * @param string $instr the raw CAS output + * @return array containing fields + */ + function CAS_Validate_Ans_Parse($instr) { + + $unp = CASParsePreparse($instr); + $unp['Ans'] = CASParsePreparse($unp['Ans']); + + if (''==$unp['Ans']['error']) { + unset($unp['Ans']['error']); + } + + if (array_key_exists('Valid',$unp)) { + $unp['Valid'] = strtolower($unp['Valid']); + } + + if ('false' == strtolower($unp['ValidationValid'])) { + $unp['Valid'] = 'false'; + $unp['AnswerNote'] = $unp['ValidationNote']; + $unp['FeedBack'] = $unp['ValidationFeedBack']; + } + unset($unp['ValidationValid']); + unset($unp['ValidationNote']); + unset($unp['ValidationFeedBack']); + + if ('' != $unp['ValidationError']) { + $unp['Valid'] = 'false'; + $unp['AnswerNote'] .= ' ValidationError'; + $unp['Ans']['error'] = $unp['ValidationError']; + } + unset($unp['ValidationError']); + unset($unp['AnswerTestError']); + + // Sort out translations of the feedback. + if (array_key_exists('FeedBack',$unp)) { + $strin = str_replace("\n","",$unp['FeedBack'] ); + $strin = str_replace('\\','\\\\',$strin); + $strin = str_replace('$','\$',$strin); + $strin = str_replace("<QUOT>",'"',$strin); + + //echo "STRIN: <pre>$strin</pre><br>"; + + ob_start(); + eval($strin); + $strin = ob_get_contents(); + ob_end_clean(); + + $unp['FeedBack'] = $strin; + } + + + return $unp; + } + /** ! * Directly validate an expression using the CAS * * @param string $exp1 A CAS expression, nominally the student's * @param array $options * @return array $this_attempt An array structure, which is used to build the student's attempt. */ ! function CAS_Validate_Ans($exp1,$options) { // create a StackResponse object ! $varCommand = CAS_Validate_Ans_Expr($exp1, $options); if ($varCommand != '') { *************** *** 380,391 **** $varResponse = strstr($varResponse,"[ Timestamp"); ! $parsed = CASAnsTestParse($varResponse); ! //show_array($parsed); ! ! // If we have errors, we need to add blank fields. ! if (!array_key_exists('AnswerNote',$parsed)) { ! $parsed['AnswerNote'] = ''; ! } ! if (!array_key_exists('FeedBack',$parsed)) { $parsed['FeedBack'] = ''; --- 377,383 ---- $varResponse = strstr($varResponse,"[ Timestamp"); ! $parsed = CAS_Validate_Ans_Parse($varResponse); ! unset($parsed['Timestamp']); ! if (!array_key_exists('FeedBack',$parsed)) { $parsed['FeedBack'] = ''; *************** *** 408,411 **** --- 400,533 ---- } } + + return $parsed; + + } + + + + /** + * Maxima-specific function used to produce the CAS command + * to apply a specific answer test. + * + * @param string $exp1 The first expression (nominally the student's answer) + * @param string $exp2 The second expression (nominally the teacher's answer) + * @param int $t Timestamp identifier used to match CAS input and output + * @param string $display The desired output format (a Stack Option) + * @param string $test The answer test to apply + * @return string The command to send to the CAS + */ + function CASAnsTestCmd($exp1, $exp2, $t, $options, $test) { + // Generates the CAS command to mark a question + global $stackAnswerTest,$stackOptionsCAS; + + $exp1 = str_replace('?','qmchar',$exp1); + $exp2 = str_replace('?','qmchar',$exp2); + + $loclistA = ''; + $loclistB = ''; + $loclistC = ''; + $cs ='cab:block([ random_seed'; + + // Now we will add options + foreach ($stackOptionsCAS as $optname => $opt) { + $optkey = $opt['CAS_KEY']; + switch ($opt['CAS_TYPE']) { + case 'string': + $loclistA.= ', '.$optkey; + $loclistC.= ', '.$optkey.':"'.$options[$optname].'"'; + break; + case 'ex': + $loclistA.= ', '.$optkey; + $loclistC.= ', '.$optkey.':'.$options[$optname]; + break; + case 'fun': + $loclistC.= ', '.$optkey.'('.$options[$optname].')'; + break; + } + } + + $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, "; + $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; + $fname = $stackAnswerTest[$test]['function']; + $cas_cmd .= " print(\" AnswerTestError = [ \"), str:$fname(ans,$exp2), print(\" ], \"), print(str), return(true)); \n"; + + //echo "<pre>".$cas_cmd."</pre>"; + return $cas_cmd; + } + + + /** + * Maxima-specific function used to parse the CAS output from + * an answer test into an array. + * + * @param string $instr the raw CAS output + * @return array containing fields ['AnsValue'] and ['AnsDisplay'] + */ + function CASAnsTestParse($instr) { + + $unp = CASParsePreparse($instr); + $unp['Ans'] = CASParsePreparse($unp['Ans']); + + if (''==$unp['Ans']['error']) { + unset($unp['Ans']['error']); + } + + if (''!=$unp['AnswerTestError']) { + $unp['Ans']['error']=$unp['AnswerTestError']; + } + unset($unp['AnswerTestError']); + + if (array_key_exists('Valid',$unp)) { + $unp['Valid'] = strtolower($unp['Valid']); + } + + // Sort out translations of the feedback. + if (array_key_exists('FeedBack',$unp)) { + $strin = str_replace("\n","",$unp['FeedBack'] ); + $strin = str_replace('\\','\\\\',$strin); + $strin = str_replace('$','\$',$strin); + $strin = str_replace("<QUOT>",'"',$strin); + + //echo "STRIN: <pre>$strin</pre><br>"; + + ob_start(); + eval($strin); + $strin = ob_get_contents(); + ob_end_clean(); + + $unp['FeedBack'] = $strin; + } + + return $unp; + + } + + + /** + * Directly perform an answer test + * + * @param string $exp1 A CAS expression, nominally the student's + * @param string $exp2 A CAS expression, nominally the teachers's + * @param string $test Which AnswerTest to apply. + * @param array $options + * @return array $this_attempt An array structure, which is used to build the student's attempt. + */ + function CPProcessAnsTest($exp1,$exp2,$test,$options,&$err) { + // create a StackResponse object + $t = time(); + + $varCommand = CASAnsTestCmd($exp1, $exp2, $t, $options, $test); + + if ($varCommand != '') { + // send to CAS + $varResponse = stack_maxima_rawsend($varCommand); + + // Chop off the part up till the first input group. + $varResponse = strstr($varResponse,"[ Timestamp"); + + $parsed = CASAnsTestParse($varResponse); + //show_array($parsed); + } return $parsed; Index: stackWin.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackWin.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** stackWin.php 17 Nov 2005 21:54:19 -0000 1.14 --- stackWin.php 19 Nov 2005 15:33:54 -0000 1.15 *************** *** 122,126 **** if ($debug) { echo "<b>Input</b> <pre>$strin</pre>"; ! echo '<pre>'; }; while (!feof($pipes[1]) and $continue) { $out = fgets($pipes[1], 1024); --- 122,126 ---- if ($debug) { echo "<b>Input</b> <pre>$strin</pre>"; ! echo "<b>Output</b> <pre>"; }; while (!feof($pipes[1]) and $continue) { $out = fgets($pipes[1], 1024); *************** *** 132,143 **** if ($debug) { echo $out; } $now = stack_microtime_float(); - // if (($now-$start_time) > 0.3) { - // // CTRL+C should be ASCII 3. - // //fwrite($pipes[0], chr(3)); - // $continue = FALSE; - // echo "STOP!"; - // fwrite($pipes[0], chr(27)."[13~"); - // fflush($pipes[0]); - // } } fclose($pipes[0]); --- 132,135 ---- Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** stackQuestion.php 17 Nov 2005 21:54:19 -0000 1.51 --- stackQuestion.php 19 Nov 2005 15:33:54 -0000 1.52 *************** *** 47,51 **** $stackOptions['AllowInputTool']['type'] = 'list'; $stackOptions['AllowInputTool']['values'] = array('Form box','Form box + JOME'); ! $stackOptions['AllowInputTool']['default'] = 'Form box + JOME'; // 'Syntax Hint'; --- 47,51 ---- $stackOptions['AllowInputTool']['type'] = 'list'; $stackOptions['AllowInputTool']['values'] = array('Form box','Form box + JOME'); ! $stackOptions['AllowInputTool']['default'] = 'Form box'; // 'Syntax Hint'; *************** *** 64,68 **** $stackOptions['MultiplicationSign']['type'] = 'list'; $stackOptions['MultiplicationSign']['values'] = array('(none)','cross','dot'); ! $stackOptions['MultiplicationSign']['default'] = '(none)'; $stackOptions['MultiplicationSign']['CAS_KEY'] = 'make_multsgn'; $stackOptions['MultiplicationSign']['CAS_TYPE'] = 'fun'; --- 64,68 ---- $stackOptions['MultiplicationSign']['type'] = 'list'; $stackOptions['MultiplicationSign']['values'] = array('(none)','cross','dot'); ! $stackOptions['MultiplicationSign']['default'] = 'dot'; $stackOptions['MultiplicationSign']['CAS_KEY'] = 'make_multsgn'; $stackOptions['MultiplicationSign']['CAS_TYPE'] = 'fun'; *************** *** 1567,1571 **** $this_attempt['RawAns'] = ''; $this_attempt['RawMark'] = 0; ! $this_attempt['Penalty'] = 0; $this_attempt['Valid'] = 'true'; $this_attempt['AnswerNote'] = ''; --- 1567,1571 ---- $this_attempt['RawAns'] = ''; $this_attempt['RawMark'] = 0; ! $this_attempt['Penalty'] = NULL; $this_attempt['Valid'] = 'true'; $this_attempt['AnswerNote'] = ''; *************** *** 1628,1631 **** --- 1628,1643 ---- } + + // Now send the RawAns to the CAS to validate and display it. + if ('true' === $this_attempt['Valid']) { + + $valid_attempt = CAS_Validate_Ans($RawAns,$options); + if (is_array($valid_attempt)) { + $this_attempt=array_merge($this_attempt,$valid_attempt); + } + + } + + show_array($this_attempt); return $this_attempt; } *************** *** 1730,1742 **** } - // (3.4) Start to build $this_attempt - - $this_attempt['Ans'] = $all_locs_Inst[$anstrack0]; - $this_attempt['RawMark'] = 0; - $this_attempt['Penalty'] = NULL; - $this_attempt['FeedBack'] = ''; - $this_attempt['AnswerNote'] = ''; - $this_attempt['RawAns'] = $RawAns; - if (array_key_exists('error',$this_attempt['Ans'])) { if ( '' == trim($this_attempt['Ans']['error']) ) { --- 1742,1745 ---- *************** *** 1808,1812 **** // Add any penalty if (array_key_exists('Penalty',$potresp[$branch])) { ! $this_attempt['Penalty'] += $potresp[$branch]['Penalty']; } // If there is no penalty set, we use the default, *AT THE END* --- 1811,1815 ---- // Add any penalty if (array_key_exists('Penalty',$potresp[$branch])) { ! $this_attempt['Penalty'] = $potresp[$branch]['Penalty']; } // If there is no penalty set, we use the default, *AT THE END* *************** *** 1862,1866 **** } ! $this_attempt = array_merge($this_attempt,stack_apply_answertest($RawAns,$CorrectAns,$at,$ato,$options,$errors)); $this_attempt['RawAns']= $RawAns; --- 1865,1871 ---- } ! $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; |
From: Chris S. <san...@us...> - 2005-11-19 15:34:02
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20480 Modified Files: index.php quiz.php Log Message: Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** quiz.php 17 Nov 2005 21:54:19 -0000 1.47 --- quiz.php 19 Nov 2005 15:33:54 -0000 1.48 *************** *** 706,710 **** // (1) Pose the question ! stack_question_inst_displayq($qInst); --- 706,710 ---- // (1) Pose the question ! stack_question_inst_displayq($qInst); Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** index.php 27 Oct 2005 12:25:16 -0000 1.34 --- index.php 19 Nov 2005 15:33:54 -0000 1.35 *************** *** 177,181 **** $quiz_store = stack_db_subject_quiz_list_student($subjectID); stack_quiz_student_select($subjectID,$quiz_store, $user); ! echo "\n<font size='-1'>\n".get_string('quiz_version_info2','stack','')."\n</font>\n"; echo $subject['subjectHTMLFoot']; } --- 177,183 ---- $quiz_store = stack_db_subject_quiz_list_student($subjectID); stack_quiz_student_select($subjectID,$quiz_store, $user); ! if ('guest'==$user['username']) { ! echo "\n<p><font size='-1'>\n".get_string('quiz_version_info2','stack','')."\n</font></p>\n"; ! } echo $subject['subjectHTMLFoot']; } |
From: Chris S. <san...@us...> - 2005-11-17 21:54:30
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101 Modified Files: chat_mathml.php quiz.php stackConfig.php.dist Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: chat_mathml.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/chat_mathml.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** chat_mathml.php 29 Aug 2005 18:41:03 -0000 1.9 --- chat_mathml.php 17 Nov 2005 21:54:19 -0000 1.10 *************** *** 50,53 **** --- 50,54 ---- header("Content-Type: text/xml"); echo '<?xml-stylesheet type="text/xsl" href="mathml/mathml.xsl"?>'; + $stack_latex['command'] = "ttm -r -L"; } *************** *** 91,95 **** if (isset($_SESSION['chat_history'])) { ! $chat_history=$_SESSION['chat_history']; } else { --- 92,97 ---- if (isset($_SESSION['chat_history'])) { ! //$chat_history=$_SESSION['chat_history']; ! $chat_history = ''; } else { *************** *** 139,142 **** --- 141,145 ---- $out = stack_castext_inst($in,$locals,$options,$errors); + $out = str_replace(" "," ",$out); $this_ch = array( 'in'=>$in, 'out'=>$out); Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** quiz.php 27 Oct 2005 12:48:48 -0000 1.46 --- quiz.php 17 Nov 2005 21:54:19 -0000 1.47 *************** *** 19,24 **** include($stack_root.'/frontend_general/process_input.php'); - - ////////////////////////////////////////////////////////// // (2) Assign default values to quiz specific variables. --- 19,22 ---- *************** *** 671,705 **** if ($focus) { ! echo "\n<a href=\"javascript:takeaction('unfocus',0);\">".get_string('UnFocus','stack','')."</a> "; if ($focus_on>0) { $qnn=$focus_on-1; ! echo "<a href=\"javascript:takeaction('focus',$qnn);\">".get_string('Previous','stack','')."</a> "; } foreach ($quizInst as $qk => $dum) { $qnn = $qk+1; ! echo "<a href=\"javascript:takeaction('focus',$qk);\">$qnn</a> "; } if ($focus_on<$qk) { $qnn=$focus_on+1; ! echo "<a href=\"javascript:takeaction('focus',$qnn);\">".get_string('Next','stack','')."</a> "; } } else { //unfocus if ('solutions' != $action and 'review' != $action) { ! echo "\n<a href=\"javascript:takeaction('focus',$key);\">".get_string('Focus','stack','')."</a> "; } ! echo "\n<a href='#top'>".get_string('Top','stack','')."</a>  "; foreach ($quizInst as $qk => $dum) { $qnn = $qk+1; ! echo "<a href='#q$qnn'>$qnn</a> "; } ! echo "\n<a href='#bottom'>".get_string('Bottom','stack','')."</a>  "; } if ('solutions' != $action and 'review' != $action) { ! echo"\n<a href=\"javascript:takeaction('validate',0);\">".get_string('Validate','stack','')."</a>  ! <a href=\"javascript:takeaction('mark_question',$key);\">".get_string('MarkThisQ','stack','')."</a>  "; } --- 669,703 ---- if ($focus) { ! echo "\n<a href=\"javascript:takeaction('unfocus',0);\">".get_string('UnFocus','stack','')."</a> \n"; if ($focus_on>0) { $qnn=$focus_on-1; ! echo "<a href=\"javascript:takeaction('focus',$qnn);\">".get_string('Previous','stack','')."</a> \n"; } foreach ($quizInst as $qk => $dum) { $qnn = $qk+1; ! echo "<a href=\"javascript:takeaction('focus',$qk);\">$qnn</a> \n"; } if ($focus_on<$qk) { $qnn=$focus_on+1; ! echo "<a href=\"javascript:takeaction('focus',$qnn);\">".get_string('Next','stack','')."</a> \n"; } } else { //unfocus if ('solutions' != $action and 'review' != $action) { ! echo "\n<a href=\"javascript:takeaction('focus',$key);\">".get_string('Focus','stack','')."</a> \n"; } ! echo "\n<a href='#top'>".get_string('Top','stack','')."</a> \n "; foreach ($quizInst as $qk => $dum) { $qnn = $qk+1; ! echo "<a href='#q$qnn'>$qnn</a> \n"; } ! echo "\n<a href='#bottom'>".get_string('Bottom','stack','')."</a> \n "; } if ('solutions' != $action and 'review' != $action) { ! echo"\n<a href=\"javascript:takeaction('validate',0);\">".get_string('Validate','stack','')."</a> \n ! <a href=\"javascript:takeaction('mark_question',$key);\">".get_string('MarkThisQ','stack','')."</a> \n "; } Index: stackConfig.php.dist =================================================================== RCS file: /cvsroot/stack/stack-1-0/stackConfig.php.dist,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stackConfig.php.dist 30 Aug 2005 09:42:42 -0000 1.5 --- stackConfig.php.dist 17 Nov 2005 21:54:19 -0000 1.6 *************** *** 69,76 **** if ('win' == $stack_os) { ! $stack_latex['command'] = "tth -r -L"; ! //$stack_latex['command'] = '"c:\Program Files\Maxima-5.9.1\bin\tth.exe" -r -L'; } else { ! $stack_latex['command'] = "/usr/local/bin/tth -r -L"; } --- 69,78 ---- if ('win' == $stack_os) { ! $stack_latex['command'] = "tth -r -L"; ! //$stack_latex['command'] = '"c:\Program Files\Maxima-5.9.1\bin\tth.exe" -r -L'; ! $stack_latex['command-mathml'] = "ttm -r -L"; } else { ! $stack_latex['command'] = "/usr/local/bin/tth -r -L"; ! $stack_latex['command-mathml'] = "/usr/local/bin/ttm -r -L"; } |
From: Chris S. <san...@us...> - 2005-11-17 21:54:28
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/scripts Modified Files: stackAuthor.php stackCAS.php stackQuestion.php stackUnix.php stackUtility.php stackWin.php Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** stackAuthor.php 8 Nov 2005 09:41:40 -0000 1.48 --- stackAuthor.php 17 Nov 2005 21:54:19 -0000 1.49 *************** *** 392,396 **** $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','',get_string('stackOptions_edit_out','stack')); ! $options_list = array('InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','Simplify','Forbid','Allow','MarkModMethod','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display'); stack_options_edit_form($options_headings,$options_list,$optval,'questionOptions',$prefix,$remoteCaller); --- 392,396 ---- $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','',get_string('stackOptions_edit_out','stack')); ! $options_list = array('InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','Simplify','Forbid','Allow','MarkModMethod','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','MultiplicationSign'); stack_options_edit_form($options_headings,$options_list,$optval,'questionOptions',$prefix,$remoteCaller); *************** *** 881,885 **** $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','','','',get_string('stackOptions_edit_out','stack'),'',''); ! $options_list = array('InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','AnsTest','AnsTestOpt','QuVal','Penalty','Forbid','Allow','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','Complex no','Language'); $fieldname = 'quiz'.'[quizOptions]'; --- 881,885 ---- $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','','','',get_string('stackOptions_edit_out','stack'),'',''); ! $options_list = array('InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','AnsTest','AnsTestOpt','QuVal','Penalty','Forbid','Allow','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','MultiplicationSign','Complex no','Language'); $fieldname = 'quiz'.'[quizOptions]'; *************** *** 1302,1306 **** $options_headings = array('',get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','','','',get_string('stackOptions_edit_out','stack'),'',''); ! $options_list = array('QuizMode','InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','AnsTest','AnsTestOpt','QuVal','Penalty','Forbid','Allow','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','Complex no','Language'); $fieldname = 'subject'.'[subjectOptions]'; --- 1302,1306 ---- $options_headings = array('',get_string('stackOptions_edit_inmeth','stack'),'','','','',get_string('stackOptions_edit_resppro','stack'),'','','','','','','','',get_string('stackOptions_edit_out','stack'),'',''); ! $options_list = array('QuizMode','InsertStars','InformalSyntax','AllowInputTool','Floats','SyntaxHint','AnsTest','AnsTestOpt','QuVal','Penalty','Forbid','Allow','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','MultiplicationSign','Complex no','Language'); $fieldname = 'subject'.'[subjectOptions]'; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** stackQuestion.php 8 Nov 2005 19:39:42 -0000 1.50 --- stackQuestion.php 17 Nov 2005 21:54:19 -0000 1.51 *************** *** 61,64 **** --- 61,70 ---- $stackOptions['Display']['CAS_TYPE'] = 'string'; + // 'MultiplicationSign' + $stackOptions['MultiplicationSign']['type'] = 'list'; + $stackOptions['MultiplicationSign']['values'] = array('(none)','cross','dot'); + $stackOptions['MultiplicationSign']['default'] = '(none)'; + $stackOptions['MultiplicationSign']['CAS_KEY'] = 'make_multsgn'; + $stackOptions['MultiplicationSign']['CAS_TYPE'] = 'fun'; // 'Complex j'; *************** *** 1383,1389 **** $this_attempt['FeedBack'] = ''; } ! } ! ! if ('cas-var' == $stackAnswerTest[$atest]['imp']) { $errs = validate_casstring($atest_ops); --- 1389,1393 ---- $this_attempt['FeedBack'] = ''; } ! } else if ('cas-var' == $stackAnswerTest[$atest]['imp']) { $errs = validate_casstring($atest_ops); *************** *** 1404,1408 **** return($this_attempt); } ! } // Clean up the CAS dependent scripts here --- 1408,1416 ---- return($this_attempt); } ! } else { // We need to send the expression to the CAS to get the displayed form. ! ! $this_attempt = CPProcessAnsTest($sa,$sa,'AlgEquiv',$options,$errors); ! ! } // Clean up the CAS dependent scripts here *************** *** 1487,1491 **** } else if ('String' == $atest) { ! $this_attempt['Ans'] = $eans; // Apply a strict string check if (trim($sa) == trim($ta)) { --- 1495,1499 ---- } else if ('String' == $atest) { ! // Apply a strict string check if (trim($sa) == trim($ta)) { *************** *** 1496,1500 **** } else if ('True' == $atest) { ! $this_attempt['Ans'] = $eans; $this_attempt['Result'] = TRUE; --- 1504,1508 ---- } else if ('True' == $atest) { ! $this_attempt['Result'] = TRUE; *************** *** 1503,1507 **** $sa = str_replace("\n",'',$sa); $sa = str_replace("\t",'',$sa); - $this_attempt['Ans'] = array('value'=> $sa, 'display'=> $sa); $ta = str_replace(' ','',strtolower(trim($ta))); --- 1511,1514 ---- *************** *** 1517,1521 **** } else if ('RegExp' == $atest) {// ereg(pattern,string) - $this_attempt['Ans'] = $eans; // Apply a regular expression check --- 1524,1527 ---- *************** *** 2196,2205 **** if ('Form box + JOME' == $options['AllowInputTool']) { ! $ret .= "  <a href=\"javascript:openMathInput('$ffn');\">".get_string('InputTool','stack','')."</a>"; } if ('' != trim($options['SyntaxHint'])) { $hint = htmlspecialchars($options['SyntaxHint']); ! $ret .= "<br /><font size='-1'><em>".get_string('SyntaxHint','stack','').": </em> <tt>{$hint}</tt></font>\n"; } --- 2202,2211 ---- if ('Form box + JOME' == $options['AllowInputTool']) { ! $ret .= " \n <a href=\"javascript:openMathInput('$ffn');\">".get_string('InputTool','stack','')."</a>"; } if ('' != trim($options['SyntaxHint'])) { $hint = htmlspecialchars($options['SyntaxHint']); ! $ret .= "<br /><font size='-1'><em>".get_string('SyntaxHint','stack','').": </em> \n<tt>{$hint}</tt></font>\n"; } Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** stackUtility.php 27 Oct 2005 12:34:36 -0000 1.37 --- stackUtility.php 17 Nov 2005 21:54:19 -0000 1.38 *************** *** 518,522 **** $strin = $wrap.$varin.$wrap; ! $strout = stack_latex_to_html($strin); } else if ('LaTeX Source' == $display) { --- 518,522 ---- $strin = $wrap.$varin.$wrap; ! $strout = stack_latex_to_html($strin,$display); } else if ('LaTeX Source' == $display) { *************** *** 534,537 **** --- 534,538 ---- $strout=$wrap.$varin.$wrap; + } else { // ie ('String' == $display) if ('#NONE#' == $wrap) { *************** *** 789,793 **** $displayed= '\ensuremath{'.$locdisplay.'}'; } else if ('MathML' == $display) { ! $displayed= ' <html>'.$locdisplay.'</html> '; } else { // ('String'==$display) $displayed = '\ensuremath{'.$locdisplay.'}'; --- 790,794 ---- $displayed= '\ensuremath{'.$locdisplay.'}'; } else if ('MathML' == $display) { ! $displayed= '<html>'.$locdisplay.'</html>'; } else { // ('String'==$display) $displayed = '\ensuremath{'.$locdisplay.'}'; *************** *** 840,844 **** // (3) Now LaTeX the result if ('LaTeX Source' != $display) { ! $strin= stack_latex_to_html($strin); } --- 841,845 ---- // (3) Now LaTeX the result if ('LaTeX Source' != $display) { ! $strin= stack_latex_to_html($strin,$display); } *************** *** 985,991 **** if ($stack_stand_alone) { // Then print a header ! //header("Content-Type: text/xml"); ! /* echo '<?xml-stylesheet type="text/xsl" href="mathml/mathml.xsl"?>'; */ ! include("{$stack_root}/html/prehead.html"); echo "<body>\n"; --- 986,992 ---- if ($stack_stand_alone) { // Then print a header ! // For MathML ! //header("Content-Type: text/xml"); ! //include("{$stack_root}/html/mathml_prehead.html"); include("{$stack_root}/html/prehead.html"); echo "<body>\n"; *************** *** 1019,1023 **** } echo "</font></em></p>"; ! } --- 1020,1024 ---- } echo "</font></em></p>"; ! echo "</body>\n</html>\n"; } Index: stackUnix.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUnix.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** stackUnix.php 29 Aug 2005 15:35:23 -0000 1.19 --- stackUnix.php 17 Nov 2005 21:54:19 -0000 1.20 *************** *** 32,36 **** 2 => array('pipe', 'w')); ! $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); fflush($pipes[0]); --- 32,40 ---- 2 => array('pipe', 'w')); ! if ('MathML'==$display) { ! $TeXProcess = proc_open($stack_latex['command-mathml'],$descriptors, $pipes); ! } else { ! $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); ! } fflush($pipes[0]); *************** *** 64,67 **** --- 68,75 ---- } + if ('MathML'==$display) { + $ret = str_replace(" "," ",$ret); + } + return $ret; Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** stackCAS.php 9 Nov 2005 14:02:37 -0000 1.11 --- stackCAS.php 17 Nov 2005 21:54:19 -0000 1.12 *************** *** 191,196 **** } } ! $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, "; $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; --- 191,197 ---- } } ! $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, "; + $cas_cmd .= " simp:false, "; $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; Index: stackWin.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackWin.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** stackWin.php 17 Sep 2005 11:31:05 -0000 1.13 --- stackWin.php 17 Nov 2005 21:54:19 -0000 1.14 *************** *** 19,23 **** * @return string|boolean The converted HTML string or FALSE if there was an error. */ ! function stack_latex_to_html($strin) { global $stack_logfiles,$stack_latex,$stack_root; --- 19,23 ---- * @return string|boolean The converted HTML string or FALSE if there was an error. */ ! function stack_latex_to_html($strin,$display='LaTeX') { global $stack_logfiles,$stack_latex,$stack_root; *************** *** 32,36 **** 2 => array('pipe', 'w')); ! $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); fflush($pipes[0]); --- 32,40 ---- 2 => array('pipe', 'w')); ! if ('MathML'==$display) { ! $TeXProcess = proc_open($stack_latex['command-mathml'],$descriptors, $pipes); ! } else { ! $TeXProcess = proc_open($stack_latex['command'],$descriptors, $pipes); ! } fflush($pipes[0]); *************** *** 62,65 **** --- 66,73 ---- } + if ('MathML'==$display) { + $ret = str_replace(" "," ",$ret); + } + //$ret = '<pre>'.$strin."</pre>\n"; return $ret; |
From: Chris S. <san...@us...> - 2005-11-17 21:54:27
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/scripts/maxima Modified Files: stackmaxima.mac stacktex.lisp Added Files: multiply_cross.lisp multiply_dot.lisp Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** stackmaxima.mac 15 Nov 2005 09:38:01 -0000 1.48 --- stackmaxima.mac 17 Nov 2005 21:54:19 -0000 1.49 *************** *** 36,40 **** set_plot_option([run_viewer,false]); set_plot_option([plot_format, gnuplot]); ! set_plot_option([nticks, 20]); set_plot_option([adapt_depth, 20]); --- 36,40 ---- set_plot_option([run_viewer,false]); set_plot_option([plot_format, gnuplot]); ! set_plot_option([nticks, 50]); set_plot_option([adapt_depth, 20]); *************** *** 86,89 **** --- 86,96 ---- make_complexJ(OPT_COMPLEXJ) := if OPT_COMPLEXJ=j then (j:%i,load("complexj.lisp")); + /* Makes multiplication signs look correct */ + make_multsgn(OPT_MULTSGN) := block( + if OPT_MULTSGN=cross then load("multiply_cross.lisp"), + if OPT_MULTSGN=dot then load("multiply_dot.lisp") + ); + + /* ARRGH! */ /* texput("<<",[" {\\color{red} ", " } ", " " ],matchfix); */ *************** *** 153,157 **** str:mathml(expr,false), /* string display */ ! if str="String" then str:string(expr), /* If no correct options have been set */ if str="" then str:string(expr), --- 160,164 ---- str:mathml(expr,false), /* string display */ ! if OPT_OUTPUT="String" then str:string(expr), /* If no correct options have been set */ if str="" then str:string(expr), *************** *** 245,249 **** tfn:concat(TMP_IMAGE_DIR,filename,".plt"), afn:concat("'",IMAGE_DIR,filename,".",ffmt,"'"), ! ufn:concat(" <center><img src='",URL_BASE,filename,".",ffmt,"' alt='STACK autogenerated plot' /></center> "), if OPT_OUTPUT#"MathML" then ufn:concat(" <html>",ufn,"</html> "), --- 252,256 ---- tfn:concat(TMP_IMAGE_DIR,filename,".plt"), afn:concat("'",IMAGE_DIR,filename,".",ffmt,"'"), ! ufn:concat("<center><img src='",URL_BASE,filename,".",ffmt,"' alt='STACK autogenerated plot' /></center>"), if OPT_OUTPUT#"MathML" then ufn:concat(" <html>",ufn,"</html> "), *************** *** 638,642 **** RawMark:0, FeedBack:"", AnswerNote:"Not number", keepfloat:true, /* See pg 23 */ ! ex:trigreduce(trigexpand(trigrat(SA-SB))), if numberp(ex) then if ex>0 then --- 645,649 ---- RawMark:0, FeedBack:"", AnswerNote:"Not number", keepfloat:true, /* See pg 23 */ ! ex:ev(float(trigreduce(trigexpand(trigrat(SA-SB)))),simp), if numberp(ex) then if ex>0 then *************** *** 652,656 **** RawMark:0, FeedBack:"", AnswerNote:"Not number", keepfloat:true, /* See pg 23 */ ! ex:trigreduce(trigexpand(trigrat(SA-SB))), if numberp(ex) then if ex>=0 then --- 659,663 ---- RawMark:0, FeedBack:"", AnswerNote:"Not number", keepfloat:true, /* See pg 23 */ ! ex:ev(float(trigreduce(trigexpand(trigrat(SA-SB)))),simp), if numberp(ex) then if ex>=0 then *************** *** 1364,1366 **** --- 1371,1374 ---- /* Stack expects some output */ + simp:false; print("[ Stack-Maxima started ]"); --- NEW FILE: multiply_cross.lisp --- ;; Customize Maxima's TEX() function. ;; Make %i print at a "j" ;; Chris Sangwin 19 August Jan 2005. ;; Useful files: ;; \Maxima-5.9.0\share\maxima\5.9.0\share\utils\mactex-utilities.lisp ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp (defprop mtimes "\\times " texsym) Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stacktex.lisp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stacktex.lisp 21 Jun 2005 14:52:25 -0000 1.2 --- stacktex.lisp 17 Nov 2005 21:54:19 -0000 1.3 *************** *** 20,23 **** --- 20,27 ---- (append l r)) + ;; Define an explicit multipliction + ;;(defprop mtimes "\\times " texsym) + ;;(defprop mtimes "\\cdot " texsym) + ;; To use the LaTeX matrix style using the array environment, define tex-matrix as ;; Chris Sangwin 24/1/2004 --- NEW FILE: multiply_dot.lisp --- ;; Customize Maxima's TEX() function. ;; Make %i print at a "j" ;; Chris Sangwin 19 August Jan 2005. ;; Useful files: ;; \Maxima-5.9.0\share\maxima\5.9.0\share\utils\mactex-utilities.lisp ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp (defprop mtimes "\\cdot " texsym) |
From: Chris S. <san...@us...> - 2005-11-17 21:54:27
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/lang/en/doc Modified Files: author_testsuite.php en_doc.php Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** author_testsuite.php 15 Nov 2005 09:38:01 -0000 1.20 --- author_testsuite.php 17 Nov 2005 21:54:19 -0000 1.21 *************** *** 239,242 **** --- 239,248 ---- $testsuite[] = stack_testsuite_construct('Num_tol_absolute','3.14','pi',0,'0.001',''); + $testsuite[] = stack_testsuite_construct('Num_SAns>=TAns','1','1',1,'',''); + $testsuite[] = stack_testsuite_construct('Num_SAns>=TAns','2','1',1,'',''); + $testsuite[] = stack_testsuite_construct('Num_SAns>=TAns','1','2.1',0,'',''); + $testsuite[] = stack_testsuite_construct('Num_SAns>=TAns','pi','3',1,'',''); + + /* ********************************************************** */ /* Get incoming data, process this, print the form and set up */ Index: en_doc.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/en_doc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** en_doc.php 8 Nov 2005 19:39:42 -0000 1.13 --- en_doc.php 17 Nov 2005 21:54:19 -0000 1.14 *************** *** 244,247 **** --- 244,256 ---- Note, this only works in LaTeX display mode."; + $stackOptions['MultiplicationSign']['doc']="This option allows the display of multiplication + signs within CAS generated expressions to be customized. + If you would like an implicit multiplication sign, then choose + the option <tt>(none)</tt>. For a tradictional cross, choose <tt>cross</tt> and for a + centre dot, such as + <table align='center' cellspacing='0' cellpadding='2'><tr><td nowrap='nowrap' align='center'> + 2·x</td></tr></table> + then choose <tt>dot</tt>."; + $stackOptions['Floats']['doc']="If set to TRUE, then any answer of the student which has a floating point number will be rejected as invalid. Student's sometimes use *************** *** 365,371 **** and false otherwise."; ! $stackAnswerTest['Num_SAns>TAns']['doc']="Is SAns>TAns? Both are assumed to be numbers."; ! $stackAnswerTest['Num_SAns>=TAns']['doc']="Is SAns>=TAns? Both are assumed to be numbers."; $stackAnswerTest['String']['doc']="This is a string match, ignoring leading and --- 374,384 ---- and false otherwise."; ! $stackAnswerTest['Num_SAns>TAns']['doc']="Is SAns>TAns? Both are assumed to be numbers. ! The Answer test fully simplifies the <tt>SAns</tt> and converts this to a float is possible. ! This is needed to cope with expressions involving sums of surds, pi etc,"; ! $stackAnswerTest['Num_SAns>=TAns']['doc']="Is SAns>=TAns? Both are assumed to be numbers. ! The Answer test fully simplifies the <tt>SAns</tt> and converts this to a float is possible. ! This is needed to cope with expressions involving sums of surds, pi etc,"; $stackAnswerTest['String']['doc']="This is a string match, ignoring leading and |
From: Chris S. <san...@us...> - 2005-11-17 21:54:27
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/lang/en Modified Files: stack.php Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/stack.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** stack.php 9 Nov 2005 12:22:42 -0000 1.40 --- stack.php 17 Nov 2005 21:54:19 -0000 1.41 *************** *** 280,300 **** ! $string['stackOptions_InsertStars'] = "Insert *s where needed"; ! $string['stackOptions_InformalSyntax'] = 'Allow informal syntax'; ! $string['stackOptions_AllowInputTool'] = 'Input tools'; ! $string['stackOptions_SyntaxHint'] = 'Syntax Hint'; ! $string['stackOptions_Display'] = 'Display'; ! $string['stackOptions_Complex no'] = 'Complex no'; ! $string['stackOptions_Floats'] = 'Forbid floats'; ! $string['stackOptions_Simplify'] = 'Auto simplify'; ! $string['stackOptions_Language'] = 'Language'; ! $string['stackOptions_QuVal'] = 'Question value'; ! $string['stackOptions_MarkModMethod'] = 'Mark modification method'; ! $string['stackOptions_Penalty'] = 'Question penalty'; ! $string['stackOptions_Forbid'] = 'Forbidden words'; ! $string['stackOptions_Allow'] = 'Allowed words'; ! $string['stackOptions_AnsTest'] = 'Answer test'; ! $string['stackOptions_AnsTestOpt'] = 'Answer test options'; ! $string['stackOptions_TeacherEmail'] = "Teacher's email"; $string['stackOptions_FeedBackGenericCorrect'] = 'Feedback: correct'; $string['stackOptions_FeedBackGenericCorrect_def'] = "<font color='green'>Correct answer, well done.</font>"; --- 280,301 ---- ! $string['stackOptions_InsertStars'] = "Insert *s where needed"; ! $string['stackOptions_InformalSyntax'] = 'Allow informal syntax'; ! $string['stackOptions_AllowInputTool'] = 'Input tools'; ! $string['stackOptions_SyntaxHint'] = 'Syntax Hint'; ! $string['stackOptions_Display'] = 'Display'; ! $string['stackOptions_Complex no'] = 'Complex no'; ! $string['stackOptions_MultiplicationSign'] = 'Multiplication sign'; ! $string['stackOptions_Floats'] = 'Forbid floats'; ! $string['stackOptions_Simplify'] = 'Auto simplify'; ! $string['stackOptions_Language'] = 'Language'; ! $string['stackOptions_QuVal'] = 'Question value'; ! $string['stackOptions_MarkModMethod'] = 'Mark modification method'; ! $string['stackOptions_Penalty'] = 'Question penalty'; ! $string['stackOptions_Forbid'] = 'Forbidden words'; ! $string['stackOptions_Allow'] = 'Allowed words'; ! $string['stackOptions_AnsTest'] = 'Answer test'; ! $string['stackOptions_AnsTestOpt'] = 'Answer test options'; ! $string['stackOptions_TeacherEmail'] = "Teacher's email"; $string['stackOptions_FeedBackGenericCorrect'] = 'Feedback: correct'; $string['stackOptions_FeedBackGenericCorrect_def'] = "<font color='green'>Correct answer, well done.</font>"; |
From: Chris S. <san...@us...> - 2005-11-17 21:54:27
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22101/html Modified Files: mathml_prehead.html pagehead.php Log Message: Lots of small changes - switching simplification off finally. Changes to help MathML, add the multiplication sign option. Index: pagehead.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/pagehead.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pagehead.php 11 Oct 2005 09:57:44 -0000 1.14 --- pagehead.php 17 Nov 2005 21:54:19 -0000 1.15 *************** *** 28,32 **** <tr align="left" valign="top"> <td align="left"><h1>STACK</h1> ! <font size='+2'>S</font><em>ystem for </em><font size='+2'>T</font><em>eaching and </em><font size='+2'>A</font><em>ssessment using a </em><font size='+2'>C</font><em>omputer algebra </em><font size='+2'>K</font><em>ernel</em></em></td> <td align="right"> <?php --- 28,32 ---- <tr align="left" valign="top"> <td align="left"><h1>STACK</h1> ! <font size='+2'>S</font><em>ystem for </em><font size='+2'>T</font><em>eaching and </em><font size='+2'>A</font><em>ssessment using a </em><font size='+2'>C</font><em>omputer algebra </em><font size='+2'>K</font><em>ernel</em></td> <td align="right"> <?php *************** *** 34,40 **** if (isset($user['loggedin']) && ($user['loggedin'])) { $a = $user['username']; ! echo '<p>'.get_string('FE_pagehead_loggedin','stack',$a).'</p>'; } else { ! echo '<p>'.get_string('FE_pagehead_notloggedin','stack','').'</p>'; } echo "</font>\n"; --- 34,40 ---- if (isset($user['loggedin']) && ($user['loggedin'])) { $a = $user['username']; ! echo get_string('FE_pagehead_loggedin','stack',$a).'<br />'; } else { ! echo get_string('FE_pagehead_notloggedin','stack',''); } echo "</font>\n"; Index: mathml_prehead.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/mathml_prehead.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mathml_prehead.html 4 Apr 2005 17:28:04 -0000 1.2 --- mathml_prehead.html 17 Nov 2005 21:54:19 -0000 1.3 *************** *** 1,4 **** ! <?xml version="1.0" ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" ! "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> --- 1,18 ---- ! <?xml-stylesheet type="text/xsl" href="mathml/mathml.xsl"?> ! <!-- ! pref:renderer="techexplorer-plugin" ! pref:renderer="techexplorer" ! pref:renderer="mathplayer" ! pref:renderer="css" ! pref:renderer="mathplayer-dl" ! --> ! <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html" /> + <title><?php echo $title ?></title> + <link rel="shortcut icon" href="pics/logo_sm.gif" /> + </head> + <style type="text/css"> + @import url(html/stack.css); + </style> |
From: Chris S. <san...@us...> - 2005-11-15 09:38:23
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24976/lang/en/doc Modified Files: author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** author_testsuite.php 10 Nov 2005 09:50:08 -0000 1.19 --- author_testsuite.php 15 Nov 2005 09:38:01 -0000 1.20 *************** *** 171,174 **** --- 171,175 ---- $testsuite[] = stack_testsuite_construct('PartFrac','3*(1/(x+1) + 1/(x+2))','3*(2*x+3)/((x+1)*(x+2))',1,'x',''); $testsuite[] = stack_testsuite_construct('PartFrac','1/(n+1)+1/(1-n)','1/(n+1)-1/(n-1)',1,'n',''); + $testsuite[] = stack_testsuite_construct('PartFrac','3*(1/(n+1)+1/(1-n))','3/(n+1)-3/(n-1)',1,'n',''); $testsuite[] = stack_testsuite_construct('PartFrac','3*x*(1/(x+1) + 2/(x+2))','-12/(x+2)-3/(x+1)+9',0,'x','Incorrect algebraic factors, but algebraically equivalent'); $testsuite[] = stack_testsuite_construct('PartFrac','(3*x+3)*(1/(x+1) + 2/(x+2))','9-6/(x+2)',0,'x',''); |
From: Chris S. <san...@us...> - 2005-11-15 09:38:09
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24976/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** stackmaxima.mac 10 Nov 2005 09:42:11 -0000 1.47 --- stackmaxima.mac 15 Nov 2005 09:38:01 -0000 1.48 *************** *** 829,847 **** ansnote: "ATPartFrac_single_fraction", fb:StackAddFeedback("","ATPartFrac_single_fraction") ! ) ! else if topOp = "+" or topOp = "-" or topOp = "*" then block([sExprPartFrac,oldsimp], oldsimp:simp, simp:true, val: "true", ! sExprPartFrac:ev(partfrac(sExpr,wrt),simp), ! if sExprPartFrac=expand(sExpr) or sExprPartFrac=sExpr then block( rawmk: string(1), ansnote:"ATPartFrac_true" ) ! else block( rawmk: string(0), ansnote:"ATPartFrac_false" ), - fb:StackAddFeedback("","ATPartFrac_true"), simp:oldsimp ), --- 829,869 ---- ansnote: "ATPartFrac_single_fraction", fb:StackAddFeedback("","ATPartFrac_single_fraction") ! ), ! if topOp = "*" then block([tExprPartFrac,sExprexpand,oldsimp], oldsimp:simp, simp:true, val: "true", ! tExprPartFrac:ev(partfrac(tExpr,wrt),simp), ! sExprexpand:expand(sExpr), ! if tExprPartFrac=sExprexpand or tExprPartFrac=sExpr or sameDenoms(sExprexpand,tExprPartFrac) then ! block( ! rawmk: string(1), ! ansnote:"ATPartFrac_true_*" ! ) ! else block( ! rawmk: string(0), ! ansnote:"ATPartFrac_false_*" ! ), ! simp:oldsimp ! ), ! if topOp = "+" or topOp = "-" then block([tExprPartFrac,oldsimp,val], ! oldsimp:simp, ! simp:true, ! val: "true", ! tExprPartFrac:ev(partfrac(tExpr,wrt),simp), ! if tExprPartFrac=expand(sExpr) or tExprPartFrac=sExpr then ! block( rawmk: string(1), ansnote:"ATPartFrac_true" ) ! else if sameDenoms(sExpr,tExprPartFrac) then ! block( ! rawmk: string(1), ! ansnote:"ATPartFrac_true_nonstd" ! ) ! else block( rawmk: string(0), ansnote:"ATPartFrac_false" ), simp:oldsimp ), *************** *** 976,1071 **** )$ - /*********************/ - /* Calculus question */ - /*********************/ - - /* An answer test for integration questions.*/ - /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ - ATInt(sa,sbl) := - block([old_simp,KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont,ans,ex], - old_simp:simp, simp:true, RawMark:0, FeedBack:"", AnswerNote:"", - /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ - if listp(sbl) then (var:sbl[2], sb:diff(sbl[1],var), cont:TRUE) else - ( cont:FALSE, FeedBack:StackAddFeedback("","ATInt_error_list"), AnswerNote:"ATInt_error_list"), - - /* SA should be only an expression. */ - if expressionp(sa)=false then - return(StackReturnOb("false","0","ATInt_SA_not_expression",StackAddFeedback("","ATAlgEquiv_SA_not_expression"))), - - KEEPFLOAT:TRUE, /* See pg 23 */ - if cont then - (ans : int(sb,var), - da:diff(sa,var), - db:diff(sb,var), - ex:trigreduce(trigexpand(trigrat(sa-ans))), - dd:float(ex), - dc:numberp(dd) and dd#0.0, - if Stack_Test(da,sb) then - if dc then - (RawMark:0, FeedBack:StackAddFeedback("","ATInt_const_int"), AnswerNote:"ATInt_const_int") - else - if Stack_Test(sa,ans) then - (RawMark:0, FeedBack:StackAddFeedback("","ATInt_const"), AnswerNote:"ATInt_const") - else - (RawMark:1, AnswerNote:"Correct") - else - if Stack_Test(sa,db) then - (RawMark:0, FeedBack:StackAddFeedback("","ATInt_diff"), AnswerNote:"ATInt_diff") - else - (RawMark:0, FeedBack:StackAddFeedback("","ATInt_generic",StackDISP(sb,"$$"),StackDISP(var,"$"),StackDISP(da,"$$")), AnswerNote:"ATInt_generic") - ), /* End of cont loop */ - simp:old_simp, - return(StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack)) - )$ - - /* An answer test for differentiation questions.*/ - /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ - ATDiff(sa,sbl) := - block([old_simp,KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont], - old_simp:simp, simp:true, RawMark:0, FeedBack:"", AnswerNote:"", - /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ - if listp(sbl) then (var:sbl[2], sb:sbl[1], cont:TRUE) else - ( cont:FALSE, FeedBack:StackAddFeedback("","ATDiff_error_list"), AnswerNote:"ATDiff_error_list"), - - /* SA should be only an expression. */ - if expressionp(sa)=false then - return(StackReturnOb("false","0","ATDiff_SA_not_expression",StackAddFeedback("","ATAlgEquiv_SA_not_expression"))), - - KEEPFLOAT:TRUE, /* See pg 23 */ - if cont then - ( - if Stack_Test(sa,sb) then - (RawMark:1, AnswerNote:"Correct") - else - if Stack_Test(diff(sa,var),int(sb,var)) then - (RawMark:0, AnswerNote:"ATDiff_int",FeedBack:StackAddFeedback("","ATDiff_int")) - ), /* End of cont loop */ - simp:old_simp, - return(StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack)) - )$ - - /*******************************************************************************/ - /* Very specific maxima functions */ - /*******************************************************************************/ - - - /* A function for one particular type of question! */ - - /* fntrans_unpack(ex) */ - /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ - /* That is to say, the result of applying some kind of grpahical transformation to f. */ - /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ - /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ - fntrans_unpack(ex):=block([f,l,aa,bb,cc,dd], - l:ex, - if atom(l) then return([FALSE,aa,bb,cc,dd]), - if op(l)="+" then (dd:part(l,2),l:part(l,1)) else dd:0, - if atom(l) then return([FALSE,aa,bb,cc,dd]), - if op(l)="*" then (aa:part(l,1),l:part(l,2)) else aa:1, - if op(l)=f then (l:part(l,1),bb:coeff(l,x,1),cc:coeff(l,x,0)) else return([FALSE,aa,bb,cc,dd]), - /* if atom(l) then return([FALSE,aa,bb,cc,dd]), */ - return([TRUE,aa,bb,cc,dd]) - )$ - /*****************************************************************/ --- 998,1001 ---- *************** *** 1153,1156 **** --- 1083,1112 ---- + /* When checking the form of a partial fraction, we need to ensure that the + *form* of the demoninators are the same. That is to say that the sets + of expressions on the denominators are equal, up to +/-1. For example, + we could have 1/(n+1)+1/(1-n) or 1/(n+1)-1/(n-1). This makes life harder! + */ + sameDenoms(SA,TA) := block([k,ret,sAargs,sAset,tAargs,tAset,dTA,dTB], + tAargs:args(TA), + tAset:set(), + /* Create a set of +-1*denoms in the teacher's expression */ + for k:1 thru length(tAargs) do block( + dTA : ev(expand(denom(tAargs[k])),simp), + dTB : ev(expand(-1*denom(tAargs[k])),simp), + tAset : union(set(dTA,dTB),tAset) + ), + /* Create a set of +-1*denoms in the student's expression */ + sAargs:args(SA), + sAset:set(), + for k:1 thru length(sAargs) do block( + dTA : ev(expand(denom(sAargs[k])),simp), + dTB : ev(expand(-1*denom(sAargs[k])),simp), + sAset : union(set(dTA,dTB),sAset) + ), + ret:setequality(sAset,tAset), + return(ret) + )$ + /* **************Numerator Same Test*************************** */ *************** *** 1168,1240 **** false ); - - - - - /* **************************PartFrac Test***************************** */ - /* requires: Student Answer */ - /* Teachers Question */ - /* Respect To which the fractions are parted */ - /* returns: StackReturnOb */ - /* CASE 1: topOp is divisor - single fraction */ - /* CASE 2: CORRECT answer - true */ - /* CASE 3: Different Variables - diff vars */ - /* CASE 4: Different amount of parts - Diff parts */ - /* CASE 5: Different Numerator - ret factored expression */ - /* CASE 6: Different Denominator - ret sDenom and tDenom */ - /* ******************************************************************** */ - - isPartFrac(sExpr, tExpr, wrt):= - block([val, rawmk, ansnote, fb], - rawmk: 0, fb: "", ansnote: "", ret: StackReturnOb(val,rawmk,ansnote,fb), - if factor( expand( sExpr ) ) = factor( expand( tExpr ) ) then - block( [topOp, list], - topOp: op(sExpr), list: args(sExpr), - if topOp = "//" then block( - val: "false", - rawmk : string(0), - ansnote: "ATPartFrac_single_fraction", - fb:"AtPartFrac_single_Fraction" - ) - else if topOp = "+" or topOp = "-" or topOp = "*" then block( - val: "true", - rawmk: string(1), - ansnote: "ATPartFrac_true", - fb: "AtPartFrac_true" - ), - ret: StackReturnOb(val,rawmk,ansnote,fb), - return(ret) - ) - else if sameVars(sExpr, tExpr) # true then - block( - val: "true", - rawmk: string(0), - ansnote : "ATPartFrac_diff_variables", - fb:"AtPartFrac_diff_variables" - ) - else - - block( - - [sDeg,tDeg], - sDeg: deg(denom(factor(sExpr))), - tDeg: deg(denom(factor(tExpr))), - sNDeg: deg(num(factor(sExpr))), - tNDeg: deg(num(factor(tExpr))), - if tNDeg # sNDeg then - block( - val:"true", - rawmk: string(0), - ansnote: "ATPartFrac_denom_ret", - fb: Sconcat("AtPartFrac_denom_ret ", denom(factor(sExpr)), " " , denom(factor(tExpr))) - ) - else - if sDeg = 2 then - quadTest(sExpr,tExpr,wrt) - else if sDeg = 3 then - tripTest(sExpr, tExpr, wrt) - - )); - /* **********************QUAD TEST***************************** */ --- 1124,1127 ---- *************** *** 1384,1387 **** --- 1271,1365 ---- ); + /*********************/ + /* Calculus question */ + /*********************/ + + /* An answer test for integration questions.*/ + /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ + ATInt(sa,sbl) := + block([old_simp,KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont,ans,ex], + old_simp:simp, simp:true, RawMark:0, FeedBack:"", AnswerNote:"", + /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ + if listp(sbl) then (var:sbl[2], sb:diff(sbl[1],var), cont:TRUE) else + ( cont:FALSE, FeedBack:StackAddFeedback("","ATInt_error_list"), AnswerNote:"ATInt_error_list"), + + /* SA should be only an expression. */ + if expressionp(sa)=false then + return(StackReturnOb("false","0","ATInt_SA_not_expression",StackAddFeedback("","ATAlgEquiv_SA_not_expression"))), + + KEEPFLOAT:TRUE, /* See pg 23 */ + if cont then + (ans : int(sb,var), + da:diff(sa,var), + db:diff(sb,var), + ex:trigreduce(trigexpand(trigrat(sa-ans))), + dd:float(ex), + dc:numberp(dd) and dd#0.0, + if Stack_Test(da,sb) then + if dc then + (RawMark:0, FeedBack:StackAddFeedback("","ATInt_const_int"), AnswerNote:"ATInt_const_int") + else + if Stack_Test(sa,ans) then + (RawMark:0, FeedBack:StackAddFeedback("","ATInt_const"), AnswerNote:"ATInt_const") + else + (RawMark:1, AnswerNote:"Correct") + else + if Stack_Test(sa,db) then + (RawMark:0, FeedBack:StackAddFeedback("","ATInt_diff"), AnswerNote:"ATInt_diff") + else + (RawMark:0, FeedBack:StackAddFeedback("","ATInt_generic",StackDISP(sb,"$$"),StackDISP(var,"$"),StackDISP(da,"$$")), AnswerNote:"ATInt_generic") + ), /* End of cont loop */ + simp:old_simp, + return(StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack)) + )$ + + /* An answer test for differentiation questions.*/ + /* sa is the students' ansewer, sbl is a list consisting of (1) the integrand, and (2) the variable */ + ATDiff(sa,sbl) := + block([old_simp,KEEPFLOAT,RawMark,FeedBack,AnswerNote,str,da,db,dd,dc,sb,var,cont], + old_simp:simp, simp:true, RawMark:0, FeedBack:"", AnswerNote:"", + /* SBL is a list: the teacher's answer, the variable, and whether formative feedback is to be provided. */ + if listp(sbl) then (var:sbl[2], sb:sbl[1], cont:TRUE) else + ( cont:FALSE, FeedBack:StackAddFeedback("","ATDiff_error_list"), AnswerNote:"ATDiff_error_list"), + + /* SA should be only an expression. */ + if expressionp(sa)=false then + return(StackReturnOb("false","0","ATDiff_SA_not_expression",StackAddFeedback("","ATAlgEquiv_SA_not_expression"))), + + KEEPFLOAT:TRUE, /* See pg 23 */ + if cont then + ( + if Stack_Test(sa,sb) then + (RawMark:1, AnswerNote:"Correct") + else + if Stack_Test(diff(sa,var),int(sb,var)) then + (RawMark:0, AnswerNote:"ATDiff_int",FeedBack:StackAddFeedback("","ATDiff_int")) + ), /* End of cont loop */ + simp:old_simp, + return(StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack)) + )$ + + /*******************************************************************************/ + /* Very specific maxima functions */ + /*******************************************************************************/ + + + /* A function for one particular type of question! */ + + /* fntrans_unpack(ex) */ + /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ + /* That is to say, the result of applying some kind of grpahical transformation to f. */ + /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ + /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ + fntrans_unpack(ex):=block([f,l,aa,bb,cc,dd], + l:ex, + if atom(l) then return([FALSE,aa,bb,cc,dd]), + if op(l)="+" then (dd:part(l,2),l:part(l,1)) else dd:0, + if atom(l) then return([FALSE,aa,bb,cc,dd]), + if op(l)="*" then (aa:part(l,1),l:part(l,2)) else aa:1, + if op(l)=f then (l:part(l,1),bb:coeff(l,x,1),cc:coeff(l,x,0)) else return([FALSE,aa,bb,cc,dd]), + /* if atom(l) then return([FALSE,aa,bb,cc,dd]), */ + return([TRUE,aa,bb,cc,dd]) + )$ /* Stack expects some output */ |
From: Chris S. <san...@us...> - 2005-11-10 09:50:16
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7582/lang/en/doc Modified Files: author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** author_testsuite.php 10 Nov 2005 09:42:10 -0000 1.18 --- author_testsuite.php 10 Nov 2005 09:50:08 -0000 1.19 *************** *** 42,46 **** $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); $testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); --- 42,46 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); $testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); |
From: Chris S. <san...@us...> - 2005-11-10 09:45:15
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6212/lang/en/doc Modified Files: author_gettingstarted.php Log Message: Index: author_gettingstarted.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_gettingstarted.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** author_gettingstarted.php 10 Nov 2005 09:31:25 -0000 1.11 --- author_gettingstarted.php 10 Nov 2005 09:45:07 -0000 1.12 *************** *** 498,510 **** </li> ! <li><b>Matrices</b><br />Currently matrices mimic the procedure in (1). They ! should probably be more like (5), since it is perfectly possible ! to have a matrix with entries which are lists, sets, etc etc. eg ! <pre> ! matrix([matrix([1,2],[3,4]),2],[x>3,set(4,x^2)]); ! </pre> ! </li> ! </ol> ! </p> <?php --- 498,509 ---- </li> ! <li><b>Matrices</b><br />Matrices have to be the same dimensions, ! otherwise the attempt is valid but incorrect. In Maxima, rows of ! matrices are Maxima <em>lists</em>. Hence, the test applies ! itself recursively to compare corresponding rows. It is ! perfectly possible to have a matrix with entries which are lists, ! sets, etc etc. eg <pre> ! matrix([matrix([1,2],[3,4]),2],[x>3,set(4,x^2)]); </pre> </li> ! </ol> </p> <?php |
From: Chris S. <san...@us...> - 2005-11-10 09:42:18
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5569/lang/en/doc Modified Files: author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** author_testsuite.php 10 Nov 2005 09:31:25 -0000 1.17 --- author_testsuite.php 10 Nov 2005 09:42:10 -0000 1.18 *************** *** 38,84 **** // AlgEquiv Answer tests. ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','x^2-2*x+1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','4^(-1/2)','1/2',1,'','Numbers'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x','sqrt(x^2)',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','abs(x)','sqrt(x^2)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x-1','(x^2-1)/(x+1)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^2','x^2-2*x+1',1,'','Polynomials and rational function'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)*(x^2+x+1)','x^3-1',1,'x',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^(-2)','1/(x^2-2*x+1)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1/n-1/(n+1)','1/(n*(n+1))',1,'x',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)','cos(-x)',1,'','Trig functions'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)^2+sin(x)^2','1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(x)^2-1','cos(2*x)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','EXP(%i*%pi)','-1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','LOG(a^2*b)','2*LOG(a)+LOG(b)',1,'','Logarithms'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x','[1,2,3]',0,'','Lists'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,x>4}','{4<x,1}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2,3],[2,3,3])',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,5])',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1','x=1',0,'','Equations'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x=1','x=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1=x','x=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x=2','x=1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1','x>1',0,'','Inequalities'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>2','x>1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x<1','x>1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1<x','x>1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>=1','x>=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>=1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','2*x>=x^2','x^2<=2*x',1,'',''); --- 38,86 ---- // AlgEquiv Answer tests. ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','x^2-2*x+1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(-1/2)','1/2',1,'','Numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x','sqrt(x^2)',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','abs(x)','sqrt(x^2)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x-1','(x^2-1)/(x+1)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^2','x^2-2*x+1',1,'','Polynomials and rational function'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)*(x^2+x+1)','x^3-1',1,'x',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^(-2)','1/(x^2-2*x+1)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/n-1/(n+1)','1/(n*(n+1))',1,'x',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)','cos(-x)',1,'','Trig functions'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)^2+sin(x)^2','1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(x)^2-1','cos(2*x)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','EXP(%i*%pi)','-1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','LOG(a^2*b)','2*LOG(a)+LOG(b)',1,'','Logarithms'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x','[1,2,3]',0,'','Lists'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,x>4}','{4<x,1}',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2,3],[2,3,3])',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,5])',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([x>4,{1,x^2}],[[1,2],[1,3]])','matrix([4-x<0,{x^2,1}],[[1,2],[1,3]])',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([x>4,{1,x^2}],[[1,2],[1,3]])','matrix([4-x<0,{x^2,1}],[[1,2],[1,4]])',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1','x=1',0,'','Equations'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x=1','x=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1=x','x=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x=2','x=1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1','x>1',0,'','Inequalities'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>2','x>1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x<1','x>1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1<x','x>1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>=1','x>=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>=1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','2*x>=x^2','x^2<=2*x',1,'',''); |
From: Chris S. <san...@us...> - 2005-11-10 09:42:18
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5569/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** stackmaxima.mac 10 Nov 2005 08:57:16 -0000 1.46 --- stackmaxima.mac 10 Nov 2005 09:42:11 -0000 1.47 *************** *** 586,590 **** if retnew[2]=0 then block( ret[4]:concat(ret[4],retnew[4]), - SA[k]:texcolor("red",SA[k]), AddFeedBack:true ) --- 586,589 ---- |
From: Chris S. <san...@us...> - 2005-11-10 09:31:38
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3423/lang/en/doc Modified Files: author_gettingstarted.php author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** author_testsuite.php 9 Nov 2005 13:56:56 -0000 1.16 --- author_testsuite.php 10 Nov 2005 09:31:25 -0000 1.17 *************** *** 38,83 **** // AlgEquiv Answer tests. ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','x^2-2*x+1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(-1/2)','1/2',1,'','Numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x','sqrt(x^2)',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','abs(x)','sqrt(x^2)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x-1','(x^2-1)/(x+1)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^2','x^2-2*x+1',1,'','Polynomials and rational function'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)*(x^2+x+1)','x^3-1',1,'x',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^(-2)','1/(x^2-2*x+1)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/n-1/(n+1)','1/(n*(n+1))',1,'x',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)','cos(-x)',1,'','Trig functions'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)^2+sin(x)^2','1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(x)^2-1','cos(2*x)',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','EXP(%i*%pi)','-1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','LOG(a^2*b)','2*LOG(a)+LOG(b)',1,'','Logarithms'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x','[1,2,3]',0,'','Lists'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2,3],[2,3,3])',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,5])',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1','x=1',0,'','Equations'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x=1','x=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1=x','x=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x=2','x=1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1','x>1',0,'','Inequalities'); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>2','x>1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x<1','x>1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1<x','x>1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>=1','x>=1',1,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>=1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','2*x>=x^2','x^2<=2*x',1,'',''); --- 38,84 ---- // AlgEquiv Answer tests. ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','x^2-2*x+1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','4^(-1/2)','1/2',1,'','Numbers'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','4^(1/2)','sqrt(4)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','0.5','1/2',1,'','Mix of floats and rational numbers'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','0.333333333333333','1/3',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','SQRT(-1)','%I',1,'','Powers and roots'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x^(1/2)','sqrt(x)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x','sqrt(x^2)',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','abs(x)','sqrt(x^2)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x-1','(x^2-1)/(x+1)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^2','x^2-2*x+1',1,'','Polynomials and rational function'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)*(x^2+x+1)','x^3-1',1,'x',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^(-2)','1/(x^2-2*x+1)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1/n-1/(n+1)','1/(n*(n+1))',1,'x',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)','cos(-x)',1,'','Trig functions'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','cos(x)^2+sin(x)^2','1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(x)^2-1','cos(2*x)',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','EXP(%i*%pi)','-1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','LOG(a^2*b)','2*LOG(a)+LOG(b)',1,'','Logarithms'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x','[1,2,3]',0,'','Lists'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,x>4}','{4<x,1}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2,3],[2,3,3])',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,5])',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1','x=1',0,'','Equations'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x=1','x=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1=x','x=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x=2','x=1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1','x>1',0,'','Inequalities'); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>2','x>1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x<1','x>1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','1<x','x>1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>=1','x>=1',1,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','x>1','x>=1',0,'',''); ! //$testsuite[] = stack_testsuite_construct('AlgEquiv','2*x>=x^2','x^2<=2*x',1,'',''); Index: author_gettingstarted.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_gettingstarted.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** author_gettingstarted.php 9 Nov 2005 14:04:36 -0000 1.10 --- author_gettingstarted.php 10 Nov 2005 09:31:25 -0000 1.11 *************** *** 452,456 **** The "types" of the teacher's and student's answer should match. If not, then the attempt is <em>invalid</em>, rather than <em>incorrect</em>, and ! feedback is give. Eg, if the teacher types in an equation, but the student an expression the test will say so.</p> --- 452,456 ---- The "types" of the teacher's and student's answer should match. If not, then the attempt is <em>invalid</em>, rather than <em>incorrect</em>, and ! feedback is given. Eg, if the teacher types in an equation, but the student an expression the test will say so.</p> |
From: Chris S. <san...@us...> - 2005-11-10 08:57:24
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28377/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** stackmaxima.mac 9 Nov 2005 13:53:08 -0000 1.45 --- stackmaxima.mac 10 Nov 2005 08:57:16 -0000 1.46 *************** *** 506,527 **** )$ - Stack_Matrix_Test(SA,SB) := - block([KEEPFLOAT,TRIGEXPAND,SAr,SAc,SBr,SBc,ZM], - SAr : length(SA), - SAc : length(SA[1]), - SBr : length(SB), - SBc : length(SB[1]), - TRIGEXPAND:TRUE, /* See pg 80 */ - LOGEXPAND:SUPER, - KEEPFLOAT:TRUE, /* See pg 23 */ - if matrixp(SA)#TRUE then return(FALSE), - if matrixp(SB)#TRUE then return(FALSE), - if (SAr#SBr) THEN return(FALSE), - if (SAc#SBc) THEN return(FALSE), - ev(ZM:MATRIXMAP(trigreduce,(SA-SB)),simp,nouns,fullratsimp), - if (ZM = ZEROMATRIX(SBr,SBc)) then return(TRUE), - return(FALSE) - )$ - /* An answer test based on two lists for SA and SB */ ATList(SA,SB):= --- 506,509 ---- *************** *** 548,555 **** ) ), ! print(AddFeedBack), ! if AddFeedBack=true then ret[3]:concat("(","ATList_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATList_wrongentries",StackDISP(SA,"\$\$")),ret[4]), return(ret) )$ --- 530,537 ---- ) ), ! if AddFeedBack=true then block( ret[3]:concat("(","ATList_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATList_wrongentries",StackDISP(SA,"\$\$")),ret[4]) ! ), return(ret) )$ *************** *** 581,585 **** /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! block([RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,ZM], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ --- 563,567 ---- /* An answer test based on two matrices for SA and SB */ ATMatrix(SA,SB):= ! block([RawMark,FeedBack,AnswerNote,str,SAr,SAc,SBr,SBc,k,AddFeedBack], RawMark:1, FeedBack:"", AnswerNote:"", /* Get sizes of matrices */ *************** *** 595,606 **** FeedBack:"", /* Check they are equal */ ! ZM:ev(matrixmap(trigreduce,(SA-SB)),simp,fullratsimp), ! if (ZM = zeromatrix(SBr,SBc)) then ! return([true,1,AnswerNote,FeedBack]), ! /* Can we give feedback on which are wrong */ ! /* StackDISP(expr,st) */ ! ev(for SAr:1 thru SBr do for SAc:1 thru SBc do if ZM[SAr,SAc]#0 then SA[SAr,SAc]:texcolor("red",SA[SAr,SAc]),simp), ! FeedBack:StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"$$")), ! return([true,0,"ATMatrix_wrongentries",FeedBack]) )$ --- 577,598 ---- FeedBack:"", /* Check they are equal */ ! ret:[true,1,"",""], ! AddFeedBack:false, ! for k:1 thru SAr do block( ! retnew:ATAlgEquivfun(SA[k],SB[k]), ! ret[1]:ret[1] and retnew[1], ! ret[2]:ret[2]*retnew[2], ! ret[3]:concat(ret[3]," ",retnew[3]), ! if retnew[2]=0 then block( ! ret[4]:concat(ret[4],retnew[4]), ! SA[k]:texcolor("red",SA[k]), ! AddFeedBack:true ! ) ! ), ! if AddFeedBack=true then block( ! ret[3]:concat("(","ATMatrix_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"\$\$")),ret[4]) ! ), ! return(ret) )$ |
From: Chris S. <san...@us...> - 2005-11-09 14:04:44
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22197/lang/en/doc Modified Files: author_gettingstarted.php Log Message: Index: author_gettingstarted.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_gettingstarted.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** author_gettingstarted.php 9 Nov 2005 13:00:35 -0000 1.9 --- author_gettingstarted.php 9 Nov 2005 14:04:36 -0000 1.10 *************** *** 433,437 **** <li><b>Matrices</b><br /> ! The basic syntax for a matric is <pre> p:matrix([1,2],[3,4]) --- 433,437 ---- <li><b>Matrices</b><br /> ! The basic syntax for a matrix is <pre> p:matrix([1,2],[3,4]) |
From: Chris S. <san...@us...> - 2005-11-09 14:02:47
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21584/scripts Modified Files: stackCAS.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** stackCAS.php 9 Nov 2005 13:56:56 -0000 1.10 --- stackCAS.php 9 Nov 2005 14:02:37 -0000 1.11 *************** *** 192,196 **** } ! $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, simp:false,"; $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; --- 192,196 ---- } ! $cas_cmd = "cab:block([ ans,str{$loclistA}] {$loclistC}, "; $cas_cmd .= " print(\"[ Timestamp = [ $t ], Ans= [ error = [\"), cte(\"ans\",errcatch(ans:$exp1)),"; $cas_cmd .= " print(\" ValidationError = [ \"), str:stack_validate(ans), print(str),"; |
From: Chris S. <san...@us...> - 2005-11-09 13:57:06
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20009/lang/en/doc Modified Files: author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** author_testsuite.php 9 Nov 2005 11:57:28 -0000 1.15 --- author_testsuite.php 9 Nov 2005 13:56:56 -0000 1.16 *************** *** 193,196 **** --- 193,197 ---- $testsuite[] = stack_testsuite_construct('SA_expanded','1/0','0',0,'',''); + $testsuite[] = stack_testsuite_construct('SA_expanded','x>2','x^2-2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('SA_expanded','x^2-1','0',1,'',''); $testsuite[] = stack_testsuite_construct('SA_expanded','(x-1)*(x+1)','0',0,'',''); |
From: Chris S. <san...@us...> - 2005-11-09 13:57:06
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20009/scripts Modified Files: stackCAS.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** stackCAS.php 9 Nov 2005 11:57:29 -0000 1.9 --- stackCAS.php 9 Nov 2005 13:56:56 -0000 1.10 *************** *** 219,223 **** } ! $unp['Valid'] = strtolower($unp['Valid']); if ('false' == strtolower($unp['ValidationValid'])) { --- 219,225 ---- } ! if (array_key_exists('Valid',$unp)) { ! $unp['Valid'] = strtolower($unp['Valid']); ! } if ('false' == strtolower($unp['ValidationValid'])) { |
From: Chris S. <san...@us...> - 2005-11-09 13:56:55
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20619/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** stackmaxima.mac 8 Nov 2005 19:39:42 -0000 1.41 --- stackmaxima.mac 9 Nov 2005 11:57:29 -0000 1.42 *************** *** 365,368 **** --- 365,369 ---- /* Reduces an inequality to either ? > 0 or ? >=0 */ ineqreduce(ex) := block( + if atom(ex) then return(ex), if op(ex)="=" then ex:ev(part(ex,1) - part(ex,2),simp,trigreduce) = 0, if op(ex)=">" then ex:ev(part(ex,1) - part(ex,2),simp,trigreduce) > 0, *************** *** 425,431 **** )$ ! /* An answer test based on Stack_Test for the a> flag. */ ! ATAlgEquiv(SA,SB) := ! block([KEEPFLOAT,RawMark,FeedBack,AnswerNote,str], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ --- 426,460 ---- )$ ! /* An general, all purpose answer test based maximum simplifiaction. ! This function is a wraper for AtAlgEquivfun(SA,SB) ! */ ! ATAlgEquiv(SA,SB) :=block([ret,oldsimp], ! oldsimp:simp, ! simp:true, ! /* Turn on simplification and error catch */ ! SA:errcatch(ev(SA,simp,fullratsimp,nouns)), ! if SA=[] then (simp:oldsimp, return(StackReturnOb("false","0","Error simplifing SAns",""))), ! SA:SA[1], ! SB:errcatch(ev(SB,simp,fullratsimp,nouns)), ! if SB=[] then (simp:oldsimp, return(StackReturnOb("false","0","Error simplifing TAns",""))), ! SB:SB[1], ! /* Start recursive process */ ! ret:ATAlgEquivfun(SA,SB), ! /* Send back result */ ! simp:oldsimp, ! return(StackReturnOb(string(ret[1]),string(ret[2]),ret[3],ret[4])) ! )$ ! ! /* ATAlgEquiv_fun is a recursive "thing" comparing function. It is designed to ! cope with a variety of different objects, eg lists of inequalities etc. ! ! Returns [valid,RawMark,AnswerNote,FeedBack] ! where valid = true/false ! RawMark = 1 or 0 ! AnswerNote = "string", ! FeedBack = StackFeedback ! */ ! ! ATAlgEquivfun(SA,SB) := block([KEEPFLOAT,RawMark,FeedBack,AnswerNote,ret], RawMark:0, FeedBack:"", AnswerNote:"", KEEPFLOAT:TRUE, /* See pg 23 */ *************** *** 433,437 **** if matrixp(SB) then if matrixp(SA)#TRUE then ! return(StackReturnOb("false","0","ATAlgEquiv_SA_not_matrix",StackAddFeedback("","ATAlgEquiv_SA_not_matrix"))) else return(ATMatrix(SA,SB)), --- 462,466 ---- if matrixp(SB) then if matrixp(SA)#TRUE then ! return([false,0,"ATAlgEquiv_SA_not_matrix",StackAddFeedback("","ATAlgEquiv_SA_not_matrix")]) else return(ATMatrix(SA,SB)), *************** *** 439,443 **** if listp(SB) then if listp(SA)#TRUE then ! return(StackReturnOb("false","0","ATAlgEquiv_SA_not_list",StackAddFeedback("","ATAlgEquiv_SA_not_list"))) else return(ATList(SA,SB)), --- 468,472 ---- if listp(SB) then if listp(SA)#TRUE then ! return([false,0,"ATAlgEquiv_SA_not_list",StackAddFeedback("","ATAlgEquiv_SA_not_list")]) else return(ATList(SA,SB)), *************** *** 445,457 **** if equationp(SB) then if equationp(SA)#TRUE then ! return(StackReturnOb("false","0","ATAlgEquiv_SA_not_equation",StackAddFeedback("","ATAlgEquiv_SA_not_equation"))) else return(ATEquation(SA,SB)), /* Did the student type in an equation, but the teacher did not? */ ! if equationp(SA) then return(StackReturnOb("false","0","ATAlgEquiv_SA_not_equation",StackAddFeedback("","ATAlgEquiv_TA_not_equation"))), /* Are we dealing with an equation? */ if inequalityp(SB) then if inequalityp(SA)#TRUE then ! return(StackReturnOb("false","0","ATAlgEquiv_SA_not_inequality",StackAddFeedback("","ATAlgEquiv_SA_not_inequality"))) else return(ATInequality(SA,SB)), --- 474,486 ---- if equationp(SB) then if equationp(SA)#TRUE then ! return([false,0,"ATAlgEquiv_SA_not_equation",StackAddFeedback("","ATAlgEquiv_SA_not_equation")]) else return(ATEquation(SA,SB)), /* Did the student type in an equation, but the teacher did not? */ ! if equationp(SA) then return([false,0,"ATAlgEquiv_SA_not_equation",StackAddFeedback("","ATAlgEquiv_TA_not_equation")]), /* Are we dealing with an equation? */ if inequalityp(SB) then if inequalityp(SA)#TRUE then ! return([false,0,"ATAlgEquiv_SA_not_inequality",StackAddFeedback("","ATAlgEquiv_SA_not_inequality")]) else return(ATInequality(SA,SB)), *************** *** 459,463 **** if setp(SB) then if setp(SA)#TRUE then ! return(StackReturnOb("false","0","ATAlgEquiv_SA_not_set",StackAddFeedback("","ATAlgEquiv_SA_notset"))) else return(ATSet(SA,SB)), --- 488,492 ---- if setp(SB) then if setp(SA)#TRUE then ! return([false,0,"ATAlgEquiv_SA_not_set",StackAddFeedback("","ATAlgEquiv_SA_not_set")]) else return(ATSet(SA,SB)), *************** *** 465,470 **** if Stack_Test(SA,SB) then RawMark:1, ! str:StackReturnOb("true",STRING(RawMark),AnswerNote,FeedBack), ! return(str) )$ --- 494,499 ---- if Stack_Test(SA,SB) then RawMark:1, ! ret:[true,RawMark,AnswerNote,FeedBack], ! return(ret) )$ *************** *** 489,509 **** /* An answer test based on two lists for SA and SB */ ATList(SA,SB):= ! block([KEEPFLOAT,DEMOIVRE,TRIGEXPAND,RawMark,FeedBack,AnswerNote,str,SAl,SBl,ZM], /* Get sizes of matrices */ SAl : length(SA), SBl : length(SB), if (SAl#SBl) THEN ! return(StackReturnOb("true","0","ATList_wronglen",StackAddFeedback("","ATList_wronglen",StackDISP(SBl,"\$"),StackDISP(SAl,"\$")))), ! /* Convert them to matrices and check they are equal */ ! SA:matrix(SA), ! SB:matrix(SB), ! ZM:MATRIXMAP(trigreduce,(SA-SB)), ! ZM:FULLRATSIMP(ZM), ! if (ZM = ZEROMATRIX(1,SBl)) then ! return(StackReturnOb("true","1","","")), ! /* Can we give feedback on which are wrong */ ! /* StackDISP(expr,st) */ ! FOR SAr:1 THRU SBl DO IF ZM[1,SAr]#0 THEN SA[1,SAr]:texcolor("red",SA[1,SAr]), ! return(StackReturnOb("true","0","ATList_wrongentries",StackAddFeedback("","ATList_wrongentries",StackDISP(SA[1],"\$\$")))) )$ --- 518,548 ---- /* An answer test based on two lists for SA and SB */ ATList(SA,SB):= ! block([AddFeedBack,SAl,SBl,ret,retnew,k], /* Get sizes of matrices */ + SAN :SA, SAl : length(SA), SBl : length(SB), if (SAl#SBl) THEN ! return([true,0,"ATList_wronglen",StackAddFeedback("","ATList_wronglen",StackDISP(SBl,"\$"),StackDISP(SAl,"\$"))]), ! ! /* Apply ATAlgEquivfun to each element pair */ ! ret:[true,1,"",""], ! AddFeedBack:false, ! for k:1 thru SAl do block( ! retnew:ATAlgEquivfun(SA[k],SB[k]), ! ret[1]:ret[1] and retnew[1], ! ret[2]:ret[2]*retnew[2], ! ret[3]:concat(ret[3]," ",retnew[3]), ! if retnew[2]=0 then block( ! ret[4]:concat(ret[4],retnew[4]), ! SA[k]:texcolor("red",SA[k]), ! AddFeedBack:true ! ) ! ), ! print(AddFeedBack), ! if AddFeedBack=true then ! ret[3]:concat("(","ATList_wrongentries",ret[3],")"), ! ret[4]:concat(StackAddFeedback("","ATList_wrongentries",StackDISP(SA,"\$\$")),ret[4]), ! return(ret) )$ *************** *** 516,520 **** if Stack_Test(SA1,SB1) or Stack_Test(SA1,SB2) then RawMark:1, ! return(StackReturnOb("true",STRING(RawMark),"","")) )$ --- 555,559 ---- if Stack_Test(SA1,SB1) or Stack_Test(SA1,SB2) then RawMark:1, ! return([true,RawMark,"",""]) )$ *************** *** 528,532 **** if (op(SA)=op(SB) and Stack_Test(SA1,SB1)) then RawMark:1, ! return(StackReturnOb("true",STRING(RawMark),"","")) )$ --- 567,571 ---- if (op(SA)=op(SB) and Stack_Test(SA1,SB1)) then RawMark:1, ! return([true,RawMark,"",""]) )$ *************** *** 543,559 **** FeedBack:StackAddFeedback("","ATMatrix_wrongsz",StackDISP(SBr,"\$"),StackDISP(SBc,"\$"),StackDISP(SAr,"\$"),StackDISP(SAc,"\$")), if (SAr#SBr) THEN ! return(StackReturnOb("true","0","ATMatrix_wrongsz rows",FeedBack)), if (SAc#SBc) THEN ! return(StackReturnOb("true","0","ATMatrix_wrongsz columns",FeedBack)), FeedBack:"", /* Check they are equal */ ZM:ev(matrixmap(trigreduce,(SA-SB)),simp,fullratsimp), if (ZM = zeromatrix(SBr,SBc)) then ! return(StackReturnOb("true","1",AnswerNote,FeedBack)), /* Can we give feedback on which are wrong */ /* StackDISP(expr,st) */ ev(for SAr:1 thru SBr do for SAc:1 thru SBc do if ZM[SAr,SAc]#0 then SA[SAr,SAc]:texcolor("red",SA[SAr,SAc]),simp), FeedBack:StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"$$")), ! return(StackReturnOb("true","0","ATMatrix_wrongentries",FeedBack)) )$ --- 582,598 ---- FeedBack:StackAddFeedback("","ATMatrix_wrongsz",StackDISP(SBr,"\$"),StackDISP(SBc,"\$"),StackDISP(SAr,"\$"),StackDISP(SAc,"\$")), if (SAr#SBr) THEN ! return([true,0,"ATMatrix_wrongsz rows",FeedBack]), if (SAc#SBc) THEN ! return([true,0,"ATMatrix_wrongsz columns",FeedBack]), FeedBack:"", /* Check they are equal */ ZM:ev(matrixmap(trigreduce,(SA-SB)),simp,fullratsimp), if (ZM = zeromatrix(SBr,SBc)) then ! return([true,1,AnswerNote,FeedBack]), /* Can we give feedback on which are wrong */ /* StackDISP(expr,st) */ ev(for SAr:1 thru SBr do for SAc:1 thru SBc do if ZM[SAr,SAc]#0 then SA[SAr,SAc]:texcolor("red",SA[SAr,SAc]),simp), FeedBack:StackAddFeedback("","ATMatrix_wrongentries",StackDISP(SA,"$$")), ! return([true,0,"ATMatrix_wrongentries",FeedBack]) )$ *************** *** 567,571 **** FeedBack:StackAddFeedback("","ATSet_wrongsz",StackDISP(SBl,"$"),StackDISP(SAl,"$")), if (SAl#SBl) then ! return(StackReturnOb("true","0","ATSet_wrongsz",FeedBack)), FeedBack:"", /* Check they are equal */ --- 606,610 ---- FeedBack:StackAddFeedback("","ATSet_wrongsz",StackDISP(SBl,"$"),StackDISP(SAl,"$")), if (SAl#SBl) then ! return([true,0,"ATSet_wrongsz",FeedBack]), FeedBack:"", /* Check they are equal */ *************** *** 573,582 **** SB:map(ineqreduce,map(trigsimp,SB)), if (subsetp(SA,SB) and subsetp(SB,SA)) then ! return(StackReturnOb("true","1",AnswerNote,FeedBack)), /* Can we give feedback on which are wrong */ FeedBack:StackAddFeedback("","ATSet_wrongentries",StackDISP(setdifference(SA,SB),"$$")), ! return(StackReturnOb("true","0","ATSet_wrongentries",FeedBack)) )$ /* An answer test based on the Maxima's notion of equals. */ --- 612,624 ---- SB:map(ineqreduce,map(trigsimp,SB)), if (subsetp(SA,SB) and subsetp(SB,SA)) then ! return([true,1,AnswerNote,FeedBack]), /* Can we give feedback on which are wrong */ FeedBack:StackAddFeedback("","ATSet_wrongentries",StackDISP(setdifference(SA,SB),"$$")), ! return([true,0,"ATSet_wrongentries",FeedBack]) )$ + /******************************************************************/ + + /* An answer test based on the Maxima's notion of equals. */ |
From: Chris S. <san...@us...> - 2005-11-09 13:56:51
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20619/lang/en/doc Modified Files: author_testsuite.php Log Message: Index: author_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_testsuite.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** author_testsuite.php 8 Nov 2005 19:39:42 -0000 1.14 --- author_testsuite.php 9 Nov 2005 11:57:28 -0000 1.15 *************** *** 60,63 **** --- 60,65 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,4]','[1,2,3]',0,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); *************** *** 165,168 **** --- 167,171 ---- $testsuite[] = stack_testsuite_construct('PartFrac','3/(x+1) + 3/(x+2)','3*(2*x+3)/((x+1)*(x+2))',1,'x','2 answers to the same question'); $testsuite[] = stack_testsuite_construct('PartFrac','3*(1/(x+1) + 1/(x+2))','3*(2*x+3)/((x+1)*(x+2))',1,'x',''); + $testsuite[] = stack_testsuite_construct('PartFrac','1/(n+1)+1/(1-n)','1/(n+1)-1/(n-1)',1,'n',''); $testsuite[] = stack_testsuite_construct('PartFrac','3*x*(1/(x+1) + 2/(x+2))','-12/(x+2)-3/(x+1)+9',0,'x','Incorrect algebraic factors, but algebraically equivalent'); $testsuite[] = stack_testsuite_construct('PartFrac','(3*x+3)*(1/(x+1) + 2/(x+2))','9-6/(x+2)',0,'x',''); |