From: Juliette W. <jv...@us...> - 2005-06-13 13:04:34
|
Update of /cvsroot/stack/stack-1-0/doc/dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7154/doc/dev Added Files: Tag: frontend_dev Rosetta.pdf testsuite.php todo.php Log Message: Tweaked the menus. Moved couple of files into separate directory. First sweep at tidying up documentation - note that some of the links previously within pages (using anchors) may need to be removed. --- NEW FILE: todo.php --- <h1>STACK version 1.0</h1> <p>This is the first release of the STACK computer aided assessment system. This is a ToDo list, of features to add etc. <?php $todo = array(); $item['title'] = 'Calculus and algebra refreshers booklets'; $item['notes'] = 'Put the questions from the algebra and calculus refreshers into STACK (Santiago)'; $todo[] = $item; $item['title'] = 'HTML'; $item['notes'] = 'Use TtH\'s <pre>\begin{html}...\end{html}</pre> commands rather than the current system.'; $todo[] = $item; $item['title'] = 'Time and dates in general'; $item['notes'] = 'This includes analysis scripts. Time stamps in various places. Quiz due dates etc.'; $todo[] = $item; $item['title'] = 'Marking efficiency'; $item['notes'] = 'When a question has potential responses it should be marked as a batch process, not by repeated use of a CAS process. This will reduce overheads.'; $todo[] = $item; $item['title'] = 'Upload questions on install'; $item['notes'] = 'Upload questions from the demo files on a *new* install of stack.'; $todo[] = $item; $item['title'] = 'Quiz level options'; $item['notes'] = 'We need to do <ol> <li>Mode: practice, assessed, strict</li> <li>Order lists</li> <li>(Due date)</li> </ol>'; $todo[] = $item; $item['title'] = 'Error trapping.'; $item['notes'] = ''; $todo[] = $item; $item['title'] = 'Answer test requests'; $item['notes'] = 'Add answer tests for > and >='; $todo[] = $item; $item['title'] = 'Language support.'; $item['notes'] = 'Very much like the Moodle model. All strings should come from a language database.'; $todo[] = $item; $item['title'] = 'Hints.'; $item['notes'] = 'Add a mechanism where a "hint" may be "purchased" for a mark penalty.'; $todo[] = $item; $item['title'] = 'Add concept of "type" to stackQuestion datatype.'; $item['notes'] = 'Each response should be of a certain "type". The type of an answer affects the way the system deals with it. This includes <ul> <li>The way the question is displayed.</li> <li>The way the answer is entered by the student.</li> <li>The way the answer is validated by the system.</li> <li>The way the answer is marked.</li> </ul> For example <ol> <li>Casstring: This is the default type.<br /> Answers are entered using the cas syntax, currently using an answer box and plain text input. This answers are evaluated by the cas, and echoed back to the student. This will not be in the form they entered.</li> <li>String <br />If passed to the CAS, the answer variable will be a CAS string. <br>\verb$ans1 = "x^2+2", rather than ans1 = x^2+2.$ <br>Hence, it will need to be explicitly passed by the CAS routines if it is to be evaluated correctly.</li> <li>Numbers <br />Of various types....</li> <li>Survey <br>Mathematical support for the question, but the interaction not "marked".</li> <li>Human marked <br>Interaction not "marked" automatically, but a mark can be added later.</li> </ol>'; $todo[] = $item; $item['title'] = 'Multi interaction (part) questions'; $item['notes'] = ''; $todo[] = $item; //show_array($todo); echo "<ol>\n"; foreach($todo as $key => $val) { echo "<li><b>{$val['title']}</b>"; echo "<br .>{$val['notes']}\n"; echo "</li>\n"; } echo "</ol>\n"; ?> --- NEW FILE: Rosetta.pdf --- %PDF-1.2 9 0 obj << /Type/Font /Subtype/Type1 /Name/F1 /FontDescriptor 8 0 R /BaseFont/PNBBBY+CMBX12 /FirstChar 33 /LastChar 196 /Widths[342.6 581 937.5 562.5 937.5 875 312.5 437.5 437.5 562.5 875 312.5 375 312.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 562.5 312.5 312.5 342.6 875 531.3 531.3 875 849.5 799.8 812.5 862.3 738.4 707.2 884.3 879.6 419 581 880.8 675.9 1067.1 879.6 844.9 768.5 844.9 839.1 625 782.4 864.6 849.5 1162 849.5 849.5 687.5 312.5 581 312.5 562.5 312.5 312.5 546.9 625 500 625 513.3 343.8 562.5 625 312.5 343.8 593.8 312.5 937.5 625 562.5 625 593.8 459.5 443.8 437.5 625 593.8 812.5 593.8 593.8 500 562.5 1125 562.5 562.5 562.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 675.9 937.5 875 787 750 879.6 812.5 875 812.5 875 0 0 812.5 656.3 625 625 937.5 937.5 312.5 343.8 562.5 562.5 562.5 562.5 562.5 849.5 500 574.1 [...3131 lines suppressed...] 0000199638 00000 n 0000199937 00000 n 0000200236 00000 n 0000201612 00000 n 0000200632 00000 n 0000200931 00000 n 0000201230 00000 n 0000201529 00000 n 0000201996 00000 n 0000202019 00000 n 0000202041 00000 n trailer << /Size 221 /Root 2 0 R /Info 1 0 R >> startxref 202162 %%EOF --- NEW FILE: testsuite.php --- <?php /** * This file runs a testsuite against a particular answer test. * */ session_start(); require_once('../stackstd.php'); /** * Construct a test suite array object. */ function stack_testsuite_construct($at,$sa,$ta,$mark,$atops='',$notes=''){ $ts = array('AnswerTest'=>$at, 'SAns'=>$sa, 'TAns'=>$ta, 'AnsTestOpt'=>$atops, 'ExpectedScore'=> $mark, 'Notes' =>$notes,); return $ts; } // 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',0,'','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','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,'',''); // Integration test $testsuite[] = stack_testsuite_construct('Int','1/0','x^2-2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Int','1/0','x^2-2*x+1',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3+1','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3+c','x^3/3',1,'x',''); $testsuite[] = stack_testsuite_construct('Int','2*x','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','sin(2*x)','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','(t-1)^5/5+c','(t-1)^5/5',1,'t',''); // Differentiation test $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'',''); $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','3*x^2','3*x^2',1,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+1','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+c','3*x^2',0,'x',''); // Factored form $testsuite[] = stack_testsuite_construct('FacForm','1/0','x^2-2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('FacForm','1/0','x^2-2*x+1',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2*(x-1)','2*x-2',1,'x','Linear integer factors'); $testsuite[] = stack_testsuite_construct('FacForm','2*x-2','2*x-2',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2*(x+1)','2*x-2',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2*x+2','2*x-2',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2*(x+0.5)','2*x+1',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','t*(2*x+1)','t*(2*x+1)',1,'x','Linear factors'); $testsuite[] = stack_testsuite_construct('FacForm','t*x+t','t*(x+1)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2*x*(x-3)','2*x^2-6*x',1,'x','Quadratic, with no const'); $testsuite[] = stack_testsuite_construct('FacForm','2*(x^2-3*x)','2*x*(x-3)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','x*(2*x-6)','2*x*(x-3)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(x+2)*(x+3)','(x+2)*(x+3)',1,'x','Quadratic'); $testsuite[] = stack_testsuite_construct('FacForm','(x+2)*(2*x+6)','2*(x+2)*(x+3)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(z*x+z)*(2*x+6)','2*z*(x+1)*(x+3)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(x+t)*(x-t)','x^2-t^2',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','t^2-1','(t-1)*(t+1)',0,'t',''); $testsuite[] = stack_testsuite_construct('FacForm','(2-x)*(3-x)','(x-2)*(x-3)',1,'x','These are delicate cases!'); $testsuite[] = stack_testsuite_construct('FacForm','(1-x)^2','(x-1)^2',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','-(1-x)^2','-(x-1)^2',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','4*(1-x/2)^2','(x-2)^2',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(x-1)*(x^2+x+1)','x^3-1',1,'x','Cubics'); $testsuite[] = stack_testsuite_construct('FacForm','(1-x)*(2-x)*(3-x)','-x^3+6*x^2-11*x+6',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(x^2-3*x+2)*(3-x)','-x^3+6*x^2-11*x+6',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(sin(x)+1)*(sin(x)-1)','sin(x)^2-1',0,'sin(x)','Not polynomials in a variable'); $testsuite[] = stack_testsuite_construct('FacForm','7','7',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','24*(x-1/4)','24*x-6',1,'x','Factors over other fields'); $testsuite[] = stack_testsuite_construct('FacForm','(x-sqrt(2))*(x+sqrt(2))','x^2-2',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(%i*x-2*%i)','%i*(x-2)',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','%i*(x-2)','(%i*x-2*%i)',1,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','(x-%i)*(x+%i)','x^2+1',1,'x',''); //$testsuite[] = stack_testsuite_construct('FacForm','(x-1)*(x+(1+sqrt(3)*%i)/2)*(x+(1-sqrt(3)*%i)/2)','x^3-1',1,'x',''); $testsuite[] = stack_testsuite_construct('SA_factored','1/0','0',0,'x',''); $testsuite[] = stack_testsuite_construct('SA_factored','2*(x-2)','0',1,'x','Linear integer factors'); $testsuite[] = stack_testsuite_construct('SA_factored','2*x-2','0',0,'x',''); $testsuite[] = stack_testsuite_construct('SA_factored','2*(x+0.5)','0',0,'x',''); $testsuite[] = stack_testsuite_construct('SA_factored','(2-x)*(3-x)','0',1,'x','These are delicate cases!'); $testsuite[] = stack_testsuite_construct('SA_factored','(1-x)^2','(x-1)^2',1,'x',''); $testsuite[] = stack_testsuite_construct('SA_expanded','1/0','0',1,'',''); $testsuite[] = stack_testsuite_construct('SA_expanded','x^2-1','0',1,'',''); $testsuite[] = stack_testsuite_construct('SA_expanded','(x-1)*(x+1)','0',0,'',''); $AnswerTestlist = array('AlgEquiv','Diff','Int','FacForm','SA_factored','SA_expanded'); //$AnswerTestlist = array('Int'); //$AnswerTestlist = array('FacForm','SA_factored'); // Now perform the tests, and display the results. $disp = 'LaTeX'; $errors = array(); echo "<h1>Test suite for the AnswerTests</h1>\n"; foreach( $AnswerTestlist as $atest) { echo "<h2>$atest</h2>\n"; echo $stackAnswerTest[$atest]['doc']; $all_passed = TRUE; echo "<table border='1' cellpadding='2'>\n\n"; // (4) Sort out and display the output echo "<tr> <th> pass? </th> <th> TAns </th> <th> SAns </th> <th> Ans </th> <th> Errors </th> <th> RawMark </th> <th> Expected </th> <th> FeedBack </th> <th> AnswerNote </th></tr>"; foreach ($testsuite as $ts) { // (0) Check this is the required AnswerTest. if ($ts['AnswerTest'] == $atest) { $err = ''; // (1) Apply the AnswerTest $this_attempt = stack_apply_answertest($ts['SAns'],$ts['TAns'],$ts['AnswerTest'],$ts['AnsTestOpt'],$disp,$err); // (2) Process $this_attempt $dispans = ''; $errans = ''; if (array_key_exists('Ans',$this_attempt)) { if (array_key_exists('display',$this_attempt['Ans'])) { $dispans=$this_attempt['Ans']['display']; } if (array_key_exists('error',$this_attempt['Ans'])) { $errans='<font color="red">'.$this_attempt['Ans']['error'].'</font>'; } } if (array_key_exists('Valid',$this_attempt)) { if ('false' == $this_attempt['Valid']) { $errans .= ' <font color="red">[invalid]</font>'; } } if (''!=$dispans) { $locs = array(); $dispans = stack_castext_to_display('$$'.$dispans.'$$', $locs , $disp,$errors); // Remove <br clear="all" /> from the beginning. if ('<br clear="all" />'==substr($dispans,0,18)) { $dispans = substr($dispans,18); } } $feedback = ''; if (array_key_exists('FeedBack',$this_attempt)) { $locs = array(); $feedback = stack_castext_to_display($this_attempt['FeedBack'], $locs , $disp,$errors); } if (array_key_exists('RawMark',$this_attempt)) { $rawmark = $this_attempt['RawMark']; } else { $rawmark = NULL; } if ( $ts['ExpectedScore'] == $rawmark ) { $outcome = '<font color="green">pass</font>'; } else { $all_passed = FALSE; $outcome = '<font color="red">fail</font>'; } // (3) Echo notes. echo "<tr>\n"; echo " <td colspan = \"9\">{$ts['Notes']}</td>\n"; echo "</tr>\n"; // (4) Construct the row. echo " <td> $outcome </td>\n"; echo " <td nowrap=\"nowrap\">".stack_s($ts['TAns'])." </td>\n "; echo " <td nowrap=\"nowrap\">".stack_s($ts['SAns'])." </td>\n "; echo " <td> $dispans </td>\n "; echo " <td> $errans </td>\n "; echo " <td> $rawmark </td>\n "; echo " <td> {$ts['ExpectedScore']} </td>\n"; echo " <td> $feedback </td>\n "; if (array_key_exists('AnswerNote',$this_attempt)) { echo " <td> {$this_attempt['AnswerNote']} </td>\n "; } else { echo " <td>   </td>\n "; } echo "</tr>\n"; } // End of check for which AnswerTest this is. } echo "</table></p>\n\n"; // (7) Overall, did all the tests pass if ( $all_passed ) { echo '<h2><font color="green">All tests passed!</font></h2>'; } else { echo '<h2><font color="red">Not all tests passed!</font></h2>'; } echo "<hr />\n"; } ?> |