From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713/scripts/install Modified Files: Tag: development_xmlrqp stacktest.php Log Message: Latest version of DOMIT. Dynamic schemas saved to users temp_logfiles directory, as they may need updating over time, and server has write permissions Removed old schema related stuff Fixed bug in import code Index: stacktest.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stacktest.php,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** stacktest.php 16 Aug 2005 14:00:59 -0000 1.5.2.3 --- stacktest.php 25 Aug 2005 15:46:20 -0000 1.5.2.4 *************** *** 1,161 **** ! <?php ! /** ! * Installs the various functions needed by STACK. ! * @package install ! * @subpackage Stack ! */ ! ! ?> ! <html> ! <head> ! </head> ! <hody> ! ! <h1>STACK setup - stage 2 of 2</h1> ! ! <p>This script does the following. ! <ol> ! <li>Creates files containing local settings to trasfer information from stackstd.php ! to Maxima</li> ! <li>Tests the basic connections of STACK with external components. ! It will help you establish your server is working.</li> ! </ol> ! ! <?php ! /** ! * Include the stack settings. ! */ ! require_once('../../stackstd.php'); ! ! /************************************************/ ! /* Create maximalocal.php and CASKeywords.php. */ ! /************************************************/ ! ! echo '<h2>1. Create maximalocal.php and CASKeywords.php.</h2>'; ! echo '<p>This attempts to write these files to the directory <tt>$stack_logfiles='.$stack_logfiles; ! echo ' </tt>If you have problems, please check the settings in stackstd.php, and the file permissions'; ! ! require("{$stack_root}/scripts/maxima/initmaxima.php"); ! echo "<p>Check here for errors.</p>"; ! ! /************************************************/ ! /* Test write to $maximalocal['IMAGE_DIR']. */ ! /************************************************/ ! ! echo "<h2>2. Test write to the directory for dynamically generated plots</h2>"; ! ! echo '<p>The directory <tt>$maximalocal[\'IMAGE_DIR\']='; ! echo $maximalocal['IMAGE_DIR']; ! echo " </tt>is needed by the webserver to store dynamically generated images. If this fails, either edit stackstd.php to point to a suitable directory, or create one with the necessary permissions."; ! ! $fname = "{$maximalocal['IMAGE_DIR']}test.txt"; ! ! if ('win' == $stack_os) { ! $sname = addslashes(str_replace( '/', '\\', $fname)); ! } ! ! $fh = fopen($fname,'w') or die('<font color="red">Cannot write a file to $maximalocal[IMAGE_DIR].</font>'); ! fwrite($fh,"Test write a success!"); ! fclose($fh); ! echo "<br /><font color='green'>Test write a success!</font>"; ! ! // /************************************************/ ! // /* Install sample questions in the DB */ ! // /************************************************/ ! // ! // echo "<h2>4. Install sample questions.</h2>"; ! // ! // if (!$add_sample_questions) { ! // echo "<p><font color='red'>You have opted not to install the sample questions!</font>"; ! // echo "<br .>If you wish to do so, edit stackInstall.php and re-run the script."; ! // die(); ! // } ! // ! ! /************************************************/ ! /* Test write to $maximalocal['IMAGE_DIR']. */ ! /************************************************/ ! ! echo "<h2>3. Test the LaTeX system</h2>"; ! ! $strin = "\[ \sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}. \]"; ! echo "<p>We will attempt to LaTeX the string <pre>$strin</pre>The result is:"; ! ! $strout = stack_latex_to_html($strin); ! ! if ('' != $strout) { ! echo $strout; ! echo "<br /><font color='green'>Output from the LaTeX to HTML conversion above.</font>"; ! } else { ! echo "<font color='red'>No output from the LaTeX to HTML conversion.</font>"; ! } ! ! /************************************************/ ! /* Test call to the CAS. */ ! /************************************************/ ! ! echo "<h2>4. Test the CAS system</h2>"; ! ! $strin = "The derivative of @ x^4/(1+x^4) @ is \[ @ diff(x^4/(1+x^4),x) @ \] ! We can plot them both @plot([x^4/(1+x^4),diff(x^4/(1+x^4),x)],[x,-3,3])@"; ! ! echo "<p>We will attempt to connect to the CAS to process the CAS-enabled text <pre>$strin</pre>The result is:"; ! ! $err =''; ! $locals = NULL; ! $options['Display']='LaTeX'; ! ! $strout = stack_castext_inst($strin,$locals,$options,$err); ! ! // $strout = stack_process_vars($locals,1321321,$options,$err); ! // $strout = stack_maxima_rawsend("diff(cos(x^2),x);\n quit();"); ! ! if ('' != $strout) { ! echo $strout; ! echo "<br /><font color='green'>Output from the CAS above.</font>"; ! } else { ! echo "<font color='red'>No output from the CAS conversion.</font>"; ! } ! ! /***********************************************/ ! /* Creation of schemas */ ! /***********************************************/ ! ! require("{$stack_root}/scripts/stackXML.php"); ! $strout=""; ! ! echo "<h2>5. Create all XML schemas required by STACK</h2>"; ! ! echo "<p>We will attempt to create XML schemas for questions, quizzes, and their respective metadata. The results are:"; ! echo "<br />5.1 Creation of question schema"; ! ! $success = stack_xml_create_question_schema("{$stack_root}/schemas"); ! ! if ($success) { ! echo "<br /><font color='green'>Question metadata written out successfully</font>"; ! } else { ! echo "<br /><font color='red'>Question metadata not written out - check you have permissions to the schemas directory</font>"; ! } ! ! echo "<br />5.2 Creation of quiz schema"; ! ! $strout = stack_xml_create_quiz_schema("{$stack_root}/schemas"); ! ! if ($success) { ! echo "<br /><font color='green'>Quiz metadata written out successfully</font>"; ! } else { ! echo "<br /><font color='red'>Quiz metadata not written out - check you have permissions to the schemas directory</font>"; ! } ! ?> ! ! <h2>Next</h2> ! <p>If you have no errors, you are ready to go to your ! <?php ! /** ! * Echo URL. ! */ ! echo "<a href=\"$stack_web_url\">home page</a></p>"; ! ?> ! ! </body> ! </html> --- 1,322 ---- ! <?php ! ! /** ! ! * Installs the various functions needed by STACK. ! ! * @package install ! ! * @subpackage Stack ! ! */ ! ! ! ! ?> ! ! <html> ! ! <head> ! ! </head> ! ! <hody> ! ! ! ! <h1>STACK setup - stage 2 of 2</h1> ! ! ! ! <p>This script does the following. ! ! <ol> ! ! <li>Creates files containing local settings to trasfer information from stackstd.php ! ! to Maxima</li> ! ! <li>Tests the basic connections of STACK with external components. ! ! It will help you establish your server is working.</li> ! ! </ol> ! ! ! ! <?php ! ! /** ! ! * Include the stack settings. ! ! */ ! ! require_once('../../stackstd.php'); ! ! ! ! /************************************************/ ! ! /* Create maximalocal.php and CASKeywords.php. */ ! ! /************************************************/ ! ! ! ! echo '<h2>1. Create maximalocal.php and CASKeywords.php.</h2>'; ! ! echo '<p>This attempts to write these files to the directory <tt>$stack_logfiles='.$stack_logfiles; ! ! echo ' </tt>If you have problems, please check the settings in stackstd.php, and the file permissions'; ! ! ! ! require("{$stack_root}/scripts/maxima/initmaxima.php"); ! ! echo "<p>Check here for errors.</p>"; ! ! ! ! /************************************************/ ! ! /* Test write to $maximalocal['IMAGE_DIR']. */ ! ! /************************************************/ ! ! ! ! echo "<h2>2. Test write to the directory for dynamically generated plots</h2>"; ! ! ! ! echo '<p>The directory <tt>$maximalocal[\'IMAGE_DIR\']='; ! ! echo $maximalocal['IMAGE_DIR']; ! ! echo " </tt>is needed by the webserver to store dynamically generated images. If this fails, either edit stackstd.php to point to a suitable directory, or create one with the necessary permissions."; ! ! ! ! $fname = "{$maximalocal['IMAGE_DIR']}test.txt"; ! ! ! ! if ('win' == $stack_os) { ! ! $sname = addslashes(str_replace( '/', '\\', $fname)); ! ! } ! ! ! ! $fh = fopen($fname,'w') or die('<font color="red">Cannot write a file to $maximalocal[IMAGE_DIR].</font>'); ! ! fwrite($fh,"Test write a success!"); ! ! fclose($fh); ! ! echo "<br /><font color='green'>Test write a success!</font>"; ! ! ! ! // /************************************************/ ! ! // /* Install sample questions in the DB */ ! ! // /************************************************/ ! ! // ! ! // echo "<h2>4. Install sample questions.</h2>"; ! ! // ! ! // if (!$add_sample_questions) { ! ! // echo "<p><font color='red'>You have opted not to install the sample questions!</font>"; ! ! // echo "<br .>If you wish to do so, edit stackInstall.php and re-run the script."; ! ! // die(); ! ! // } ! ! // ! ! ! ! /************************************************/ ! ! /* Test write to $maximalocal['IMAGE_DIR']. */ ! ! /************************************************/ ! ! ! ! echo "<h2>3. Test the LaTeX system</h2>"; ! ! ! ! $strin = "\[ \sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}. \]"; ! ! echo "<p>We will attempt to LaTeX the string <pre>$strin</pre>The result is:"; ! ! ! ! $strout = stack_latex_to_html($strin); ! ! ! ! if ('' != $strout) { ! ! echo $strout; ! ! echo "<br /><font color='green'>Output from the LaTeX to HTML conversion above.</font>"; ! ! } else { ! ! echo "<font color='red'>No output from the LaTeX to HTML conversion.</font>"; ! ! } ! ! ! ! /************************************************/ ! ! /* Test call to the CAS. */ ! ! /************************************************/ ! ! ! ! echo "<h2>4. Test the CAS system</h2>"; ! ! ! ! $strin = "The derivative of @ x^4/(1+x^4) @ is \[ @ diff(x^4/(1+x^4),x) @ \] ! ! We can plot them both @plot([x^4/(1+x^4),diff(x^4/(1+x^4),x)],[x,-3,3])@"; ! ! ! ! echo "<p>We will attempt to connect to the CAS to process the CAS-enabled text <pre>$strin</pre>The result is:"; ! ! ! ! $err =''; ! ! $locals = NULL; ! ! $options['Display']='LaTeX'; ! ! ! ! $strout = stack_castext_inst($strin,$locals,$options,$err); ! ! ! ! // $strout = stack_process_vars($locals,1321321,$options,$err); ! ! // $strout = stack_maxima_rawsend("diff(cos(x^2),x);\n quit();"); ! ! ! ! if ('' != $strout) { ! ! echo $strout; ! ! echo "<br /><font color='green'>Output from the CAS above.</font>"; ! ! } else { ! ! echo "<font color='red'>No output from the CAS conversion.</font>"; ! ! } ! ! ! ! /***********************************************/ ! ! /* Creation of schemas */ ! ! /***********************************************/ ! ! ! ! require("{$stack_root}/scripts/stackXML.php"); ! ! $strout=""; ! ! ! ! echo "<h2>5. Create all XML schemas required by STACK</h2>"; ! ! ! ! echo "<p>We will attempt to create XML schemas for questions, quizzes, and their respective metadata. The results are:"; ! ! echo "<br />5.1 Creation of question schema"; ! ! ! ! $success = stack_xml_create_question_schema(schemaBaseDir); ! ! ! ! if ($success) { ! ! echo "<br /><font color='green'>Question metadata written out successfully</font>"; ! ! } else { ! ! echo "<br /><font color='red'>Question metadata not written out - check you have permissions to the schemas directory</font>"; ! ! } ! ! ! ! echo "<br />5.2 Creation of quiz schema"; ! ! ! ! $strout = stack_xml_create_quiz_schema(schemaBaseDir); ! ! ! ! if ($success) { ! ! echo "<br /><font color='green'>Quiz metadata written out successfully</font>"; ! ! } else { ! ! echo "<br /><font color='red'>Quiz metadata not written out - check you have permissions to the schemas directory</font>"; ! ! } ! ! ?> ! ! ! ! <h2>Next</h2> ! ! <p>If you have no errors, you are ready to go to your ! ! <?php ! ! /** ! ! * Echo URL. ! ! */ ! ! echo "<a href=\"$stack_web_url\">home page</a></p>"; ! ! ?> ! ! ! ! </body> ! ! </html> ! |