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: pkiddie <pk...@us...> - 2005-08-25 16:06:30
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17646/html Modified Files: admin-menu.txt help_popup.php pagehead.php Log Message: Merging of Paul Kiddie's work into main STACK HEAD branch Index: pagehead.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/pagehead.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pagehead.php 25 Jul 2005 11:24:07 -0000 1.11 --- pagehead.php 25 Aug 2005 16:06:16 -0000 1.12 *************** *** 1,66 **** ! <?php ! /** ! * ! * STACK standard page header. ! * ! * @package frontend ! * @subpackage Stack ! */ ! ! /** ! * ! */ ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ! <html> ! <head> ! <title>STACK - System for Teaching and Assessment using a Computer algebra Kernel</title> ! <link rel="shortcut icon" href="pics/logo_sm.gif" /> ! <style type="text/css"> ! @import url(html/stack.css); ! </style> ! </head> ! <body> ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! <tr align="left" valign="top"> ! <td colspan="2" id="header"> ! <table width="95%" border="0" cellpadding="0" cellspacing="5"> ! <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 ! echo '<br /><font size=-3>'; ! if ($user['loggedin']) { ! echo "<p>Logged in as<br />{$user['username']}.</p>"; ! } else { ! echo "<p>Not logged in.</p>"; ! } ! echo "</font>\n"; ! ?> ! </tr></table> ! </td></tr> ! <tr align="left" valign="top"> ! <td nowrap width="10%" id="navigation"> ! <?php ! require_once("other/ListMenu.php"); ! $username = nsf($user,'username'); ! if ('' !=$stack_basepath) { ! $menupath = '/'.$stack_basepath.'/'; ! } else { ! $menupath = '/'; ! } ! if ('admin' == $username) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); ! } else if ($user['loggedin']) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); ! } else { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! } ! ! $menu->printMenu(); ! ! ?> ! </td> ! ! <td width="90%" id="content"> --- 1,140 ---- ! <?php ! ! /** ! ! * ! ! * STACK standard page header. ! ! * ! ! * @package frontend ! ! * @subpackage Stack ! ! */ ! ! ! ! /** ! ! * ! ! */ ! ! ?> ! ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ! ! <html> ! ! <head> ! ! <title>STACK - System for Teaching and Assessment using a Computer algebra Kernel</title> ! ! <link rel="shortcut icon" href="pics/logo_sm.gif" /> ! ! <style type="text/css"> ! ! @import url(html/stack.css); ! ! </style> ! ! </head> ! ! <body> ! ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! ! <tr align="left" valign="top"> ! ! <td colspan="2" id="header"> ! ! <table width="95%" border="0" cellpadding="0" cellspacing="5"> ! ! <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 ! ! echo '<br /><font size=-3>'; ! ! if (isset($user['loggedin']) && ($user['loggedin'])) { ! ! echo "<p>Logged in as<br />{$user['username']}.</p>"; ! ! } else { ! ! echo "<p>Not logged in.</p>"; ! ! } ! ! echo "</font>\n"; ! ! ?> ! ! </tr></table> ! ! </td></tr> ! ! <tr align="left" valign="top"> ! ! <td nowrap width="10%" id="navigation"> ! ! <?php ! ! require_once("{$stack_root}/other/ListMenu.php"); ! ! $username = @nsf($user,'username'); ! ! if ('' !=$stack_basepath) { ! ! $menupath = '/'.$stack_basepath.'/'; ! ! } else { ! ! $menupath = '/'; ! ! } ! ! if (!empty($username)) ! { ! if ('admin' == $username) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); ! ! } else if ($user['loggedin']) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); ! ! } else { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! ! } ! } ! ! else ! { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! } ! ! ! ! $menu->printMenu(); ! ! ! ! ?> ! ! </td> ! ! ! ! <td width="90%" id="content"> ! Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** admin-menu.txt 14 Jul 2005 11:28:14 -0000 1.13 --- admin-menu.txt 25 Aug 2005 16:06:16 -0000 1.14 *************** *** 4,10 **** .menu_QB|question_bank.php?action=questionbank_screen ..menu_New|question_bank.php?action=edit_new ! ..menu_Import|question_bank.php?action=import .menu_Quizzes|editquiz.php?action=quiz_choose ..menu_New|editquiz.php?action=quiz_new .menu_Reporting|analysis.php .menu_User|user.php --- 4,11 ---- .menu_QB|question_bank.php?action=questionbank_screen ..menu_New|question_bank.php?action=edit_new ! ..menu_Import|import.php?action=import .menu_Quizzes|editquiz.php?action=quiz_choose ..menu_New|editquiz.php?action=quiz_new + ..menu_Import|import.php?action=import .menu_Reporting|analysis.php .menu_User|user.php Index: help_popup.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/help_popup.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** help_popup.php 19 Jul 2005 13:31:32 -0000 1.3 --- help_popup.php 25 Aug 2005 16:06:16 -0000 1.4 *************** *** 1,112 **** ! <?php ! /** ! * Generates help files. ! * This file is used in the help popup windows, for individual fields. ! * ! * This is used by both the student and teacher. ! * ! * @package documentation ! * @subpackage Stack ! */ ! ! ?> ! <head> ! <title>Stack help!</title> ! <style type="text/css"> ! @import url(stack.css); ! </style> ! <script type="text/javascript"> ! window.focus(); ! </script> ! <?php ! /** ! * ! */ ! include('../stackstd.php'); ! // HACK for now. ! $options = stack_options_set(array()); ! $filename = stack_lang_filename($options,'doc/en_doc.php'); ! include($filename); ! ! include("{$stack_root}/html/htmlstyle.html"); ! ! // HACK! ! $lang = 'en'; ! $disp_opt = 'LaTeX'; ! ! ?> ! </head> ! <body> ! ! <?php ! ! $field = $_POST['field']; ! $variable = $_POST['variable']; ! ! if (array_key_exists('field',$_GET)) { ! $field = $_GET['field']; ! } ! ! if (array_key_exists('variable',$_GET)) { ! $variable = $_GET['variable']; ! } ! ! //show_array($_POST); ! //echo $variable; ! ! if ('student' == $field) { ! include('student_input.php'); ! } else if('fact' == $variable) { ! ! //<a href="javascript:HelpPopup('calc_product_rule','fact');">A fact!</a> ! ! // These allow the student to ask for help in the popup window. ! $fn = $stack_root.'/lang/'.$lang.'/doc/student_factsformula.php'; ! ! include($fn); ! ! if (array_key_exists($field,$stackFact)) { ! $name = $stackFact[$field]['name']; ! $fact = $stackFact[$field]['fact']; ! $strout = stack_latex_to_html($fact); ! ! echo "<h2><img src='$stack_web_url/pics/logo_sm.png' /> $name</h2><p>$strout</p>"; ! } ! ! } else if('all' == $field) { ! // Then we would like a lot of documentation. ! // This needs to come after 'fact' ! ! $filename=$variable.'.php'; ! include($filename); ! ! } else { ! if ('stackQuestion' == $variable) { ! $q_field = $stackQuestion[$field]; ! $fn = 'stackQuestion_'.$field;} ! else if ('stackOptions' == $variable) { ! $q_field = $stackOptions[$field]; ! $fn = 'stackOptions_'.$field; } ! else if ('stackQuestionPotResp' == $variable) { ! $q_field = $stackQuestionPotResp[$field]; ! $fn = 'stackQuestion_PR_'.$field; } ! else if ('stackQuiz' == $variable) { ! $q_field = $stackQuiz[$field]; ! $fn = 'stackQuiz_'.$field; ! } ! ! $fd = get_string($fn,'stack',''); ! echo "<h3>$fd</h3>"; ! echo $q_field['doc']; ! echo "<p>"; ! ! echo "Name of field: <font color=orange><tt>$field</tt></font>. ! Type of field: <font color=orange><tt>{$q_field['type']}</tt></font>."; ! if (array_key_exists('required',$q_field)) { ! echo " Required: <font color=orange><tt>{$q_field['required']}</tt></font>."; ! } ! } ! ! ?> ! ! </body></html> --- 1,224 ---- ! <?php ! ! /** ! ! * Generates help files. ! ! * This file is used in the help popup windows, for individual fields. ! ! * ! ! * This is used by both the student and teacher. ! ! * ! ! * @package documentation ! ! * @subpackage Stack ! ! */ ! ! ! ! ?> ! ! <head> ! ! <title>Stack help!</title> ! ! <style type="text/css"> ! ! @import url(stack.css); ! ! </style> ! ! <script type="text/javascript"> ! ! window.focus(); ! ! </script> ! ! <?php ! ! /** ! ! * ! ! */ ! ! include('../stackstd.php'); ! ! // HACK for now. ! ! $options = stack_options_set(array()); ! ! $filename = stack_lang_filename($options,'doc/en_doc.php'); ! ! include($filename); ! ! ! ! include("{$stack_root}/html/htmlstyle.html"); ! ! ! ! // HACK! ! ! $lang = 'en'; ! ! $disp_opt = 'LaTeX'; ! ! ! ! ?> ! ! </head> ! ! <body> ! ! ! ! <?php ! ! ! ! $field = $_POST['field']; ! ! $variable = $_POST['variable']; ! ! ! ! if (array_key_exists('field',$_GET)) { ! ! $field = $_GET['field']; ! ! } ! ! ! ! if (array_key_exists('variable',$_GET)) { ! ! $variable = $_GET['variable']; ! ! } ! ! ! ! //show_array($_POST); ! ! //echo $variable; ! ! ! ! if ('student' == $field) { ! ! include('student_input.php'); ! ! } else if('fact' == $variable) { ! ! ! ! //<a href="javascript:HelpPopup('calc_product_rule','fact');">A fact!</a> ! ! ! ! // These allow the student to ask for help in the popup window. ! ! $fn = $stack_root.'/lang/'.$lang.'/doc/student_factsformula.php'; ! ! ! ! include($fn); ! ! ! ! if (array_key_exists($field,$stackFact)) { ! ! $name = $stackFact[$field]['name']; ! ! $fact = $stackFact[$field]['fact']; ! ! $strout = stack_latex_to_html($fact); ! ! ! ! echo "<h2><img src='$stack_web_url/pics/logo_sm.png' /> $name</h2><p>$strout</p>"; ! ! } ! ! ! ! } else if('all' == $field) { ! ! // Then we would like a lot of documentation. ! ! // This needs to come after 'fact' ! ! ! ! $filename="{$stack_root}/lang/{$lang}/doc/$variable.php"; ! ! include($filename); ! ! ! ! } else { ! ! if ('stackQuestion' == $variable) { ! ! $q_field = $stackQuestion[$field]; ! ! $fn = 'stackQuestion_'.$field;} ! ! else if ('stackOptions' == $variable) { ! ! $q_field = $stackOptions[$field]; ! ! $fn = 'stackOptions_'.$field; } ! ! else if ('stackQuestionPotResp' == $variable) { ! ! $q_field = $stackQuestionPotResp[$field]; ! ! $fn = 'stackQuestion_PR_'.$field; } ! ! else if ('stackQuiz' == $variable) { ! ! $q_field = $stackQuiz[$field]; ! ! $fn = 'stackQuiz_'.$field; ! ! } ! ! ! ! $fd = get_string($fn,'stack',''); ! ! echo "<h3>$fd</h3>"; ! ! echo $q_field['doc']; ! ! echo "<p>"; ! ! ! ! echo "Name of field: <font color=orange><tt>$field</tt></font>. ! ! Type of field: <font color=orange><tt>{$q_field['type']}</tt></font>."; ! ! if (array_key_exists('required',$q_field)) { ! ! echo " Required: <font color=orange><tt>{$q_field['required']}</tt></font>."; ! ! } ! ! } ! ! ! ! ?> ! ! ! ! </body></html> ! |
From: pkiddie <pk...@us...> - 2005-08-25 15:50:47
|
Update of /cvsroot/stack/stack-1-0/other/domit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14042/other/domit Added Files: Tag: development_xmlrqp xml_domit_nodetools.php xml_domit_parseattributes.php xml_domit_xpath.php Log Message: --- NEW FILE: xml_domit_nodetools.php --- <?php /** * nodetools is a class of miscellaneous XML helper methods * @package domit-xmlparser * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License * @author John Heinstein <joh...@nb...> * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page * DOMIT! is Free Software **/ /** attribute parse state, just before parsing an attribute */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE', 0); /** attribute parse state, parsing an attribute key */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY', 1); /** attribute parse state, parsing an attribute value */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE', 2); /** *@global Array Translation table for predefined XML entities */ $GLOBALS['DOMIT_PREDEFINED_ENTITIES'] = array('&' => '&', '<' => '<', '>' => '>', '"' => '"', "'" => '''); /** * A class of miscellaneous XML helper methods * * @package domit-xmlparser * @author John Heinstein <joh...@nb...> */ class nodetools { /** * Parses the attributes string into an array of key / value pairs * @param string The attribute text * @return Array An array of key / value pairs */ function parseAttributes($attrText, $convertEntities = true, $definedEntities = null) { $attrText = trim($attrText); $attrArray = array(); $maybeEntity = false; $total = strlen($attrText); $keyDump = ''; $valueDump = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; $quoteType = ''; if ($definedEntities == null) $defineEntities = array(); for ($i = 0; $i < $total; $i++) { $currentChar = $attrText{$i}; if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE) { if (trim($currentChar != '')) { $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY; } } switch ($currentChar) { case "\t": if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { $valueDump .= $currentChar; } else { $currentChar = ''; } break; case "\x0B": //vertical tab case "\n": case "\r": $currentChar = ''; break; case '=': if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { $valueDump .= $currentChar; } else { $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE; $quoteType = ''; $maybeEntity = false; } break; case '"': if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { if ($quoteType == '') { $quoteType = '"'; } else { if ($quoteType == $currentChar) { if ($convertEntities && $maybeEntity) { $valueDump = strtr($valueDump, DOMIT_PREDEFINED_ENTITIES); $valueDump = strtr($valueDump, $definedEntities); } $attrArray[trim($keyDump)] = $valueDump; $keyDump = $valueDump = $quoteType = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; } else { $valueDump .= $currentChar; } } } break; case "'": if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { if ($quoteType == '') { $quoteType = "'"; } else { if ($quoteType == $currentChar) { if ($convertEntities && $maybeEntity) { $valueDump = strtr($valueDump, $predefinedEntities); $valueDump = strtr($valueDump, $definedEntities); } $attrArray[trim($keyDump)] = $valueDump; $keyDump = $valueDump = $quoteType = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; } else { $valueDump .= $currentChar; } } } break; case '&': //might be an entity $maybeEntity = true; $valueDump .= $currentChar; break; default: if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY) { $keyDump .= $currentChar; } else { $valueDump .= $currentChar; } } } return $attrArray; } //parseAttributes /** * Move a node to the previous index in the childNodes array * @param Object The node to be moved */ function moveUp(&$node) { if (($node->previousSibling != null) && ($node->parentNode != null)) { $parent =& $node->parentNode; $previous =& $node->previousSibling; $node =& $parent->removeChild($node); $parent->insertBefore($node, $previous); } } //moveUp /** * Move a node to the next index in the childNodes array * @param Object The node to be moved */ function moveDown(&$node) { if (($node->nextSibling != null) && ($node->parentNode != null)) { $parent =& $node->parentNode; if ($node->nextSibling->nextSibling == null) { $node =& $parent->removeChild($node); $parent->appendChild($node); } else { $insertionPoint =& $node->nextSibling->nextSibling; $node =& $parent->removeChild($node); $parent->insertBefore($node, $insertionPoint); } } } //moveDown /** * Checks if a node exists on the given path; if so, returns the node, otherwise false * @param Object The calling node * @param string The path * @return mixed The found node, or false */ function &nodeExists(&$callingNode, $path) { $foundNode =& $callingNode->getElementsByPath($path, 1); if ($foundNode == null) return false; return $foundNode; } //nodeExists /** * Generates a heirarchy of nodes based on a path expression * @param string The path expression * @param string The value of a text node to be appended to the last element * @return object The generated nodes */ function &fromPath(&$xmldoc, $path, $text = null) { $pathSegments = explode('/', $path); $parent = null; $lastNode = null; $total = count($pathSegments); for ($i = 0; $i < $total; $i++) { if ($pathSegments[$i] != '') { $currNode =& $xmldoc->createElement($pathSegments[$i]); if ($parent == null) { $parent =& $currNode; } else { $lastNode->appendChild($currNode); } $lastNode =& $currNode; } } if ($text != null) { $currNode =& $xmldoc->createTextNode($text); $lastNode->appendChild($currNode); } return $parent; } //nodeExists } //nodetools ?> --- NEW FILE: xml_domit_xpath.php --- <?php /** * @package domit-xmlparser * @subpackage domit-xmlparser-main * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License * @author John Heinstein <joh...@nb...> * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page * DOMIT! is Free Software **/ if (!defined('DOMIT_INCLUDE_PATH')) { define('DOMIT_INCLUDE_PATH', (dirname(__FILE__) . "/")); } /** Separator for absolute path */ define('DOMIT_XPATH_SEPARATOR_ABSOLUTE', '/'); /** Separator for relative path */ define('DOMIT_XPATH_SEPARATOR_RELATIVE', '//'); [...1007 lines suppressed...] else { //absolute path $this->searchType = DOMIT_XPATH_SEARCH_ABSOLUTE; $this->globalNodeContainer[] =& $this->callingNode->ownerDocument; } } else { //relative path $this->searchType = DOMIT_XPATH_SEARCH_RELATIVE; if ($this->callingNode->uid != $this->callingNode->ownerDocument->uid) { $this->globalNodeContainer[] =& $this->callingNode; } else { $this->globalNodeContainer[] =& $this->callingNode->ownerDocument; } } } //initSearch } //DOMIT_XPath ?> --- NEW FILE: xml_domit_parseattributes.php --- <?php /** * parseAttributes is a function for parsing attribute and attribute-like strings * @package domit-xmlparser * @copyright (C) 2004 John Heinstein. All rights reserved * @license http://www.gnu.org/copyleft/lesser.html LGPL License * @author John Heinstein <joh...@nb...> * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page * DOMIT! is Free Software **/ /** attribute parse state, just before parsing an attribute */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE', 0); /** attribute parse state, parsing an attribute key */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY', 1); /** attribute parse state, parsing an attribute value */ define('DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE', 2); /** *@global Array Translation table for predefined XML entities */ $GLOBALS['DOMIT_PREDEFINED_ENTITIES'] = array('&' => '&', '<' => '<', '>' => '>', '"' => '"', "'" => '''); /** * Parses the attributes string into an array of key / value pairs * @param string The attribute text * @return Array An array of key / value pairs */ function parseAttributes($attrText, $convertEntities = true, $definedEntities = null) { $attrText = trim($attrText); $attrArray = array(); $maybeEntity = false; $total = strlen($attrText); $keyDump = ''; $valueDump = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; $quoteType = ''; if ($definedEntities == null) $defineEntities = array(); for ($i = 0; $i < $total; $i++) { $currentChar = $attrText{$i}; if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE) { if (trim($currentChar != '')) { $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY; } } switch ($currentChar) { case "\t": if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { $valueDump .= $currentChar; } else { $currentChar = ''; } break; case "\x0B": //vertical tab case "\n": case "\r": $currentChar = ''; break; case '=': if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { $valueDump .= $currentChar; } else { $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE; $quoteType = ''; $maybeEntity = false; } break; case '"': if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { if ($quoteType == '') { $quoteType = '"'; } else { if ($quoteType == $currentChar) { if ($convertEntities && $maybeEntity) { $valueDump = strtr($valueDump, DOMIT_PREDEFINED_ENTITIES); $valueDump = strtr($valueDump, $definedEntities); } $attrArray[trim($keyDump)] = $valueDump; $keyDump = $valueDump = $quoteType = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; } else { $valueDump .= $currentChar; } } } break; case "'": if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_VALUE) { if ($quoteType == '') { $quoteType = "'"; } else { if ($quoteType == $currentChar) { if ($convertEntities && $maybeEntity) { $valueDump = strtr($valueDump, $predefinedEntities); $valueDump = strtr($valueDump, $definedEntities); } $attrArray[trim($keyDump)] = $valueDump; $keyDump = $valueDump = $quoteType = ''; $currentState = DOMIT_ATTRIBUTEPARSER_STATE_ATTR_NONE; } else { $valueDump .= $currentChar; } } } break; case '&': //might be an entity $maybeEntity = true; $valueDump .= $currentChar; break; default: if ($currentState == DOMIT_ATTRIBUTEPARSER_STATE_ATTR_KEY) { $keyDump .= $currentChar; } else { $valueDump .= $currentChar; } } } return $attrArray; } //parseAttributes ?> |
From: pkiddie <pk...@us...> - 2005-08-25 15:50:47
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14042 Removed Files: Tag: development_xmlrqp changelog.txt Log Message: --- changelog.txt DELETED --- |
From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713 Modified Files: Tag: development_xmlrqp index.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: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23.2.5 retrieving revision 1.23.2.6 diff -C2 -d -r1.23.2.5 -r1.23.2.6 *** index.php 23 Aug 2005 11:48:09 -0000 1.23.2.5 --- index.php 25 Aug 2005 15:46:20 -0000 1.23.2.6 *************** *** 1,141 **** ! <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. ! * - Added logic to view installation instructions if stackstd.php not dectected ! * @package Stack ! */ ! ! ! /** ! * ! */ ! session_start(); ! ! /////////////////////////////////////////////////////////////// ! // (1) Process Input - this sets $action, $user and $username ! /////////////////////////////////////////////////////////////// ! ! if (file_exists('stackstd.php')) { ! include('stackstd.php'); ! } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions ! include('lang/en/doc/about_install.php'); ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); ! //1. Check that XML schemas are up to date ! if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) ! { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; ! } ! ! /////////////////////////////////////////////////////////////// ! // (2) Take any actions required ! /////////////////////////////////////////////////////////////// ! ! // Note that we need to unset the user before printing the header. ! if ('logout' == $action) { ! $user = NULL; ! session_unregister('user'); ! unset($_SESSION['user']); ! $_GET['expand'] = 0; ! } ! ! include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! ! ////////////////////////////////////////////////////////////// ! // (2) Print the page. ! ////////////////////////////////////////////////////////////// ! ! include('html/pagehead.php'); ! ! if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; ! } ! ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } ! } ! ! if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! echo $errors['user']; ! $action = 'loginscreen'; ! } ! ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! stack_user_update_info($user, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! case 'update_schema': ! stack_xml_update_schema("{$stack_root}/schemas/"); ! break; ! case 'update_db': ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! break; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! --- 1,282 ---- ! <?php ! ! /** ! ! * ! ! * Welcome to STACK. A system for teaching and assessment using a ! ! * computer algebra kernel. ! ! * <br> ! ! * This file is licensed under the GPL License. ! ! * <br> ! ! * A copy of the license is in your STACK distribution called ! ! * license.txt. If you are missing this file you can obtain ! ! * it from: ! ! * http://www.stack.bham.ac.uk/license.txt ! ! * <br> ! ! * Copyright (c) 2005, Christopher James Sangwin ! ! * ! ! * @author Chris Sangwin C.J...@bh... ! ! * @author Laura Naismith L.N...@bh... ! ! * @author Juliette White jv...@jv... ! ! * ! ! * This file contains the front end logic for the main frontend pages ! ! * TO DO: Some of the code in this file needs to be factored out into separate ! ! * algorithms- ideally we should have a function for each action on entry and ! ! * for display. ! ! * - Added logic to view installation instructions if stackstd.php not dectected ! ! * @package Stack ! ! */ ! ! ! ! ! ! /** ! ! * ! ! */ ! ! session_start(); ! ! ! ! /////////////////////////////////////////////////////////////// ! ! // (1) Process Input - this sets $action, $user and $username ! ! /////////////////////////////////////////////////////////////// ! ! ! ! if (file_exists('stackstd.php')) { ! ! include('stackstd.php'); ! ! } else { ! ! //echo "STACK is not correctly installed."; ! ! //View the installation instructions ! ! include('lang/en/doc/about_install.php'); ! ! die(); ! ! } ! ! ! ! $default_action = 'loginscreen'; ! ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! ! include($stack_root.'/frontend_general/process_input.php'); ! ! ! ! //Initialisation ! ! include_once("{$stack_root}/scripts/stackXML.php"); ! ! //1. Check that XML schemas are up to date ! ! if (!stack_xml_check_schema_version(schemaBaseDir)) ! ! { ! ! $action = 'update_schema'; ! ! } ! ! ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! ! { ! ! $action = 'update_db'; ! ! } ! ! ! ! /////////////////////////////////////////////////////////////// ! ! // (2) Take any actions required ! ! /////////////////////////////////////////////////////////////// ! ! ! ! // Note that we need to unset the user before printing the header. ! ! if ('logout' == $action) { ! ! $user = NULL; ! ! session_unregister('user'); ! ! unset($_SESSION['user']); ! ! $_GET['expand'] = 0; ! ! } ! ! ! ! include('frontend_general/loginregister.php'); ! ! $err = nsf($errors,'user'); ! ! $errun = stack_get_errun($err); ! ! $errps = stack_get_errps($err); ! ! ! ! ////////////////////////////////////////////////////////////// ! ! // (2) Print the page. ! ! ////////////////////////////////////////////////////////////// ! ! ! ! include('html/pagehead.php'); ! ! ! ! if ('logout' == $action) { ! ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! ! $action = 'loginscreen'; ! ! } ! ! ! ! if ('welcome' == $action) { ! ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! ! if ('admin' != $user['username']) { ! ! $action = 'choose_quiz'; ! ! } ! ! } ! ! ! ! if ('loginerr' == $action) { ! ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! ! echo $errors['user']; ! ! $action = 'loginscreen'; ! ! } ! ! ! ! switch ($action) { ! ! case 'loginscreen': ! ! stack_display_main_login($username, $errun, $errps); ! ! break; ! ! case 'registration_screen': ! ! include_once($stack_root."/scripts/stackUser.php"); ! ! stack_display_main_register($username, $user, $errors, $err); ! ! break; ! ! case 'update_info': ! ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! ! stack_user_update_info($user, $errors); ! ! } else { ! ! echo '<h1>Update user information</h1>'; ! ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! ! } ! ! break; ! ! case 'error': ! ! echo "There was an error with the login or registration"; ! ! break; ! ! case 'choose_quiz': ! ! $quiz_store = stack_db_quiz_get(); ! ! stack_quiz_student_select($quiz_store, $user); ! ! break; ! ! case 'update_schema': ! ! stack_xml_update_schema(schemaBaseDir); ! ! break; ! ! case 'update_db': ! ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! ! break; ! ! } ! ! ! ! include('html/pagefoot.php'); ! ! ! ! ?> ! ! ! |
From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713/schemas Removed Files: Tag: development_xmlrqp sample_questions.xml sample_questions.xsd stack_question-1.0.xsd stack_quiz-1.0.xsd test_instance test_instance.xml test_instance2.xml test_instance_assessmentItem.xml test_instance_mathquiz.xml 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 --- stack_question-1.0.xsd DELETED --- --- sample_questions.xml DELETED --- --- test_instance_assessmentItem.xml DELETED --- --- test_instance.xml DELETED --- --- test_instance2.xml DELETED --- --- test_instance DELETED --- --- stack_quiz-1.0.xsd DELETED --- --- test_instance_mathquiz.xml DELETED --- --- sample_questions.xsd DELETED --- |
From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0/other/domit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713/other/domit Modified Files: Tag: development_xmlrqp changelog.txt license.txt php_file_utilities.php php_http_connector.php php_http_proxy.php xml_domit_cache.php xml_domit_getelementsbypath.php xml_domit_include.php xml_domit_lite_include.php xml_domit_nodemaps.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: xml_domit_cache.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/Attic/xml_domit_cache.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** xml_domit_cache.php 15 Aug 2005 16:09:23 -0000 1.1.2.2 --- xml_domit_cache.php 25 Aug 2005 15:46:20 -0000 1.1.2.3 *************** *** 1,74 **** ! <?php ! /** ! * @package domit-xmlparser ! * @copyright (C) 2004 John Heinstein. All rights reserved ! * @license http://www.gnu.org/copyleft/lesser.html LGPL License ! * @author John Heinstein <joh...@nb...> ! * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page ! * DOMIT! is Free Software ! **/ ! ! /** Extension for cache files */ ! define ('DOMIT_FILE_EXTENSION_CACHE', 'dch'); ! ! /** ! * A simple caching mechanism for a DOMIT_Document ! */ ! class DOMIT_cache { ! /** ! * Serializes and caches the specified DOMIT! document ! * @param string The name of the xml file to be saved ! * @param Object A reference to the document to be saved ! * @param string The write attributes for the saved document ('w' or 'wb') ! */ ! function toCache($xmlFileName, &$doc, $writeAttributes = 'w') { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! php_file_utilities::putDataToFile($name, serialize($doc), $writeAttributes); ! ! return (file_exists($name) && is_writable($name)); ! } //toCache ! ! /** ! * Unserializes a cached DOMIT! document ! * @param string The name of the xml file to be retrieved ! * @return Object The retrieved document ! */ ! function &fromCache($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! $fileContents =& php_file_utilities::getDataFromFile($name, 'r'); ! $newxmldoc =& unserialize($fileContents); ! ! return $newxmldoc; ! } //fromCache ! ! /** ! * Determines whether a cached version of the specified document exists ! * @param string The name of the xml file to be retrieved ! * @return boolean True if a cache of the specified document exists ! */ ! function cacheExists($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! return file_exists($name); ! } //xmlFileName ! ! /** ! * Removes a cache of the specified document ! * @param string The name of the xml file to be retrieved ! * @return boolean True if a cache has been removed ! */ ! function removeFromCache($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! return unlink($name); ! } //removeFromCache ! } //DOMIT_cache ?> \ No newline at end of file --- 1,74 ---- ! <?php ! /** ! * @package domit-xmlparser ! * @copyright (C) 2004 John Heinstein. All rights reserved ! * @license http://www.gnu.org/copyleft/lesser.html LGPL License ! * @author John Heinstein <joh...@nb...> ! * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page ! * DOMIT! is Free Software ! **/ ! ! /** Extension for cache files */ ! define ('DOMIT_FILE_EXTENSION_CACHE', 'dch'); ! ! /** ! * A simple caching mechanism for a DOMIT_Document ! */ ! class DOMIT_cache { ! /** ! * Serializes and caches the specified DOMIT! document ! * @param string The name of the xml file to be saved ! * @param Object A reference to the document to be saved ! * @param string The write attributes for the saved document ('w' or 'wb') ! */ ! function toCache($xmlFileName, &$doc, $writeAttributes = 'w') { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! php_file_utilities::putDataToFile($name, serialize($doc), $writeAttributes); ! ! return (file_exists($name) && is_writable($name)); ! } //toCache ! ! /** ! * Unserializes a cached DOMIT! document ! * @param string The name of the xml file to be retrieved ! * @return Object The retrieved document ! */ ! function &fromCache($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! require_once(DOMIT_INCLUDE_PATH . 'php_file_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! $fileContents =& php_file_utilities::getDataFromFile($name, 'r'); ! $newxmldoc =& unserialize($fileContents); ! ! return $newxmldoc; ! } //fromCache ! ! /** ! * Determines whether a cached version of the specified document exists ! * @param string The name of the xml file to be retrieved ! * @return boolean True if a cache of the specified document exists ! */ ! function cacheExists($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! return file_exists($name); ! } //xmlFileName ! ! /** ! * Removes a cache of the specified document ! * @param string The name of the xml file to be retrieved ! * @return boolean True if a cache has been removed ! */ ! function removeFromCache($xmlFileName) { ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_utilities.php'); ! ! $name = DOMIT_Utilities::removeExtension($xmlFileName) . '.' . DOMIT_FILE_EXTENSION_CACHE; ! return unlink($name); ! } //removeFromCache ! } //DOMIT_cache ?> \ No newline at end of file Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/Attic/changelog.txt,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** changelog.txt 15 Aug 2005 16:09:23 -0000 1.1.2.2 --- changelog.txt 25 Aug 2005 15:46:20 -0000 1.1.2.3 *************** *** 126,185 **** - loadXML_utf8, parseXML_utf8, and saveXML_utf8 methods have been deprecated - SAXY updated to version 0.84 - fixed a bug with ampersands in the entity translation table ! - DOMIT! class docs and tutorial updated ! ! Version 0.96 (2004/08/27) ! - implemented namespace awareness ! - expandEmptyElementTags method modified so that exceptions to the expansion rule can be specified ! - SAX error codes and messages now available to Document ! - added normalize method to DOMIT_Node ! - added isSupported method to DOMIT_Node ! - added setNamespaceAwareness method to DOMIT_Document ! - added getErrorCode method to DOMIT_Document ! - added getErrorString method to DOMIT_Document ! - added expandEmptyElementTags method to DOMIT_Document ! - added createAttributeNS method to DOMIT_Document ! - added createElementNS method to DOMIT_Document ! - added getElementsByTagNameNS method to DOMIT_Document ! - added getElementByID method to DOMIT_Document ! - added getNamedElementsNS method to DOMIT_Element ! - added getElementsByTagNameNS method to DOMIT_Element ! - added _getElementByID method to DOMIT_Element ! - added getElementByID method to DOMIT_Element ! - added getAttributeNS method to DOMIT_Element ! - added setAttributeNS method to DOMIT_Element ! - added removeAttributeNS method to DOMIT_Element ! - added hasAttributeNS method to DOMIT_Element ! - added getAttributeNodeNS method to DOMIT_Element ! - added setAttributeNodeNS method to DOMIT_Element ! - added startElementNS method to DOMIT_Parser ! - added startNamespaceDeclaration method to DOMIT_Parser ! - added endNamespaceDeclaration method to DOMIT_Parser ! - added reindexNodeMap method to DOMIT_NamedNodeMap ! - added getNamedItemNS method to DOMIT_NamedNodeMap ! - added setNamedItemNS method to DOMIT_NamedNodeMap ! - added removeNamedItemNS method to DOMIT_NamedNodeMap ! - added getKeyNS method to DOMIT_NamedNodeMap ! - SAXY updated to version 0.85 - fixed a bug in the generation of attribute keys ! - DOMIT! class docs and tutorial updated ! ! Version 0.97 (2004/09/08) ! - SAXY updated to version 0.86 ! ! Version 0.98 (2004/09/28) ! - DOMIT! now works with PHP5 ! - added ability to manually set http connection (and proxy) configuration ! - added getElementsByAttribute method to DOMIT_ChildNodes_Interface ! - added _getElementsByAttribute method to DOMIT_ChildNodes_Interface ! - added setConnection method to DOMIT_Document ! - added setAuthorization method to DOMIT_Document ! - added setProxyConnection method to DOMIT_Document ! - added setProxyAuthorization method to DOMIT_Document ! - modified getElementByID - now throws an error if namespace awareness is not turned on ! - removed getDataFromFile and putDataToFile methods and consolidated into php_file_utilities.php ! - SAXY updated to version 0.87 ! - DOMIT! class docs and tutorial updated ! ! Version 0.99 (2004/10/08) ! - fixed critical bug in loadXML method of DOMIT!_Document and DOMIT_Lite_Document - fixed file i/o bug in DOMIT_Cache --- 126,185 ---- - loadXML_utf8, parseXML_utf8, and saveXML_utf8 methods have been deprecated - SAXY updated to version 0.84 - fixed a bug with ampersands in the entity translation table ! - DOMIT! class docs and tutorial updated ! ! Version 0.96 (2004/08/27) ! - implemented namespace awareness ! - expandEmptyElementTags method modified so that exceptions to the expansion rule can be specified ! - SAX error codes and messages now available to Document ! - added normalize method to DOMIT_Node ! - added isSupported method to DOMIT_Node ! - added setNamespaceAwareness method to DOMIT_Document ! - added getErrorCode method to DOMIT_Document ! - added getErrorString method to DOMIT_Document ! - added expandEmptyElementTags method to DOMIT_Document ! - added createAttributeNS method to DOMIT_Document ! - added createElementNS method to DOMIT_Document ! - added getElementsByTagNameNS method to DOMIT_Document ! - added getElementByID method to DOMIT_Document ! - added getNamedElementsNS method to DOMIT_Element ! - added getElementsByTagNameNS method to DOMIT_Element ! - added _getElementByID method to DOMIT_Element ! - added getElementByID method to DOMIT_Element ! - added getAttributeNS method to DOMIT_Element ! - added setAttributeNS method to DOMIT_Element ! - added removeAttributeNS method to DOMIT_Element ! - added hasAttributeNS method to DOMIT_Element ! - added getAttributeNodeNS method to DOMIT_Element ! - added setAttributeNodeNS method to DOMIT_Element ! - added startElementNS method to DOMIT_Parser ! - added startNamespaceDeclaration method to DOMIT_Parser ! - added endNamespaceDeclaration method to DOMIT_Parser ! - added reindexNodeMap method to DOMIT_NamedNodeMap ! - added getNamedItemNS method to DOMIT_NamedNodeMap ! - added setNamedItemNS method to DOMIT_NamedNodeMap ! - added removeNamedItemNS method to DOMIT_NamedNodeMap ! - added getKeyNS method to DOMIT_NamedNodeMap ! - SAXY updated to version 0.85 - fixed a bug in the generation of attribute keys ! - DOMIT! class docs and tutorial updated ! ! Version 0.97 (2004/09/08) ! - SAXY updated to version 0.86 ! ! Version 0.98 (2004/09/28) ! - DOMIT! now works with PHP5 ! - added ability to manually set http connection (and proxy) configuration ! - added getElementsByAttribute method to DOMIT_ChildNodes_Interface ! - added _getElementsByAttribute method to DOMIT_ChildNodes_Interface ! - added setConnection method to DOMIT_Document ! - added setAuthorization method to DOMIT_Document ! - added setProxyConnection method to DOMIT_Document ! - added setProxyAuthorization method to DOMIT_Document ! - modified getElementByID - now throws an error if namespace awareness is not turned on ! - removed getDataFromFile and putDataToFile methods and consolidated into php_file_utilities.php ! - SAXY updated to version 0.87 ! - DOMIT! class docs and tutorial updated ! ! Version 0.99 (2004/10/08) ! - fixed critical bug in loadXML method of DOMIT!_Document and DOMIT_Lite_Document - fixed file i/o bug in DOMIT_Cache Index: xml_domit_include.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/Attic/xml_domit_include.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** xml_domit_include.php 15 Aug 2005 16:09:23 -0000 1.1.2.2 --- xml_domit_include.php 25 Aug 2005 15:46:20 -0000 1.1.2.3 *************** *** 1,14 **** ! <?php ! /** ! * @package domit-xmlparser ! * @copyright (C) 2004 John Heinstein. All rights reserved ! * @license http://www.gnu.org/copyleft/lesser.html LGPL License ! * @author John Heinstein <joh...@nb...> ! * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page ! * DOMIT! is Free Software ! **/ ! ! /** The file system path to the domit library */ ! define('DOMIT_INCLUDE_PATH', (dirname(__FILE__) . "/")); ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_parser.php'); ?> \ No newline at end of file --- 1,14 ---- ! <?php ! /** ! * @package domit-xmlparser ! * @copyright (C) 2004 John Heinstein. All rights reserved ! * @license http://www.gnu.org/copyleft/lesser.html LGPL License ! * @author John Heinstein <joh...@nb...> ! * @link http://www.engageinteractive.com/domit/ DOMIT! Home Page ! * DOMIT! is Free Software ! **/ ! ! /** The file system path to the domit library */ ! define('DOMIT_INCLUDE_PATH', (dirname(__FILE__) . "/")); ! require_once(DOMIT_INCLUDE_PATH . 'xml_domit_parser.php'); ?> \ No newline at end of file Index: license.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/other/domit/Attic/license.txt,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** license.txt 28 Jul 2005 13:23:11 -0000 1.1.2.1 --- license.txt 25 Aug 2005 15:46:20 -0000 1.1.2.2 *************** *** 1,480 **** ! DOMIT! is a non-validating, but lightweight and fast DOM parser for PHP ! ! By John Heinstein ! jhe...@en... ! joh...@nb... ! ! Copyright (C) 2004 John Heinstein ! http://www.engageinteractive.com/domit/ ! All rights reserved. ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! This library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! ! ! GNU LESSER GENERAL PUBLIC LICENSE ! Version 2.1, February 1999 ! ! Copyright (C) 1991, 1999 Free Software Foundation, Inc. ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! Everyone is permitted to copy and distribute verbatim copies ! of this license document, but changing it is not allowed. ! ! [This is the first released version of the Lesser GPL. It also counts ! as the successor of the GNU Library Public License, version 2, hence ! the version number 2.1.] ! ! Preamble ! ! The licenses for most software are designed to take away your ! freedom to share and change it. By contrast, the GNU General Public ! Licenses are intended to guarantee your freedom to share and change ! free software--to make sure the software is free for all its users. ! ! This license, the Lesser General Public License, applies to some ! specially designated software packages--typically libraries--of the ! Free Software Foundation and other authors who decide to use it. You ! can use it too, but we suggest you first think carefully about whether ! this license or the ordinary General Public License is the better ! strategy to use in any particular case, based on the explanations below. ! ! When we speak of free software, we are referring to freedom of use, ! not price. Our General Public Licenses are designed to make sure that ! you have the freedom to distribute copies of free software (and charge ! for this service if you wish); that you receive source code or can get ! it if you want it; that you can change the software and use pieces of ! it in new free programs; and that you are informed that you can do ! these things. ! ! To protect your rights, we need to make restrictions that forbid ! distributors to deny you these rights or to ask you to surrender these ! rights. These restrictions translate to certain responsibilities for ! you if you distribute copies of the library or if you modify it. ! ! For example, if you distribute copies of the library, whether gratis ! or for a fee, you must give the recipients all the rights that we gave ! you. You must make sure that they, too, receive or can get the source ! code. If you link other code with the library, you must provide ! complete object files to the recipients, so that they can relink them ! with the library after making changes to the library and recompiling ! it. And you must show them these terms so they know their rights. ! ! We protect your rights with a two-step method: (1) we copyright the ! library, and (2) we offer you this license, which gives you legal ! permission to copy, distribute and/or modify the library. ! ! To protect each distributor, we want to make it very clear that ! there is no warranty for the free library. Also, if the library is ! modified by someone else and passed on, the recipients should know ! that what they have is not the original version, so that the original ! author's reputation will not be affected by problems that might be ! introduced by others. ! ! Finally, software patents pose a constant threat to the existence of ! any free program. We wish to make sure that a company cannot ! effectively restrict the users of a free program by obtaining a ! restrictive license from a patent holder. Therefore, we insist that ! any patent license obtained for a version of the library must be ! consistent with the full freedom of use specified in this license. ! ! Most GNU software, including some libraries, is covered by the ! ordinary GNU General Public License. This license, the GNU Lesser ! General Public License, applies to certain designated libraries, and ! is quite different from the ordinary General Public License. We use ! this license for certain libraries in order to permit linking those ! libraries into non-free programs. ! ! When a program is linked with a library, whether statically or using ! a shared library, the combination of the two is legally speaking a ! combined work, a derivative of the original library. The ordinary ! General Public License therefore permits such linking only if the ! entire combination fits its criteria of freedom. The Lesser General ! Public License permits more lax criteria for linking other code with ! the library. ! ! We call this license the "Lesser" General Public License because it ! does Less to protect the user's freedom than the ordinary General ! Public License. It also provides other free software developers Less ! of an advantage over competing non-free programs. These disadvantages ! are the reason we use the ordinary General Public License for many ! libraries. However, the Lesser license provides advantages in certain ! special circumstances. ! ! For example, on rare occasions, there may be a special need to ! encourage the widest possible use of a certain library, so that it becomes ! a de-facto standard. To achieve this, non-free programs must be ! allowed to use the library. A more frequent case is that a free ! library does the same job as widely used non-free libraries. In this ! case, there is little to gain by limiting the free library to free ! software only, so we use the Lesser General Public License. ! ! In other cases, permission to use a particular library in non-free ! programs enables a greater number of people to use a large body of ! free software. For example, permission to use the GNU C Library in ! non-free programs enables many more people to use the whole GNU ! operating system, as well as its variant, the GNU/Linux operating ! system. ! ! Although the Lesser General Public License is Less protective of the ! users' freedom, it does ensure that the user of a program that is ! linked with the Library has the freedom and the wherewithal to run ! that program using a modified version of the Library. ! ! The precise terms and conditions for copying, distribution and ! modification follow. Pay close attention to the difference between a ! "work based on the library" and a "work that uses the library". The ! former contains code derived from the library, whereas the latter must ! be combined with the library in order to run. ! ! GNU LESSER GENERAL PUBLIC LICENSE ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ! ! 0. This License Agreement applies to any software library or other ! program which contains a notice placed by the copyright holder or ! other authorized party saying it may be distributed under the terms of ! this Lesser General Public License (also called "this License"). ! Each licensee is addressed as "you". ! ! A "library" means a collection of software functions and/or data ! prepared so as to be conveniently linked with application programs ! (which use some of those functions and data) to form executables. ! ! The "Library", below, refers to any such software library or work ! which has been distributed under these terms. A "work based on the ! Library" means either the Library or any derivative work under ! copyright law: that is to say, a work containing the Library or a ! portion of it, either verbatim or with modifications and/or translated ! straightforwardly into another language. (Hereinafter, translation is ! included without limitation in the term "modification".) ! ! "Source code" for a work means the preferred form of the work for ! making modifications to it. For a library, complete source code means ! all the source code for all modules it contains, plus any associated ! interface definition files, plus the scripts used to control compilation ! and installation of the library. ! ! Activities other than copying, distribution and modification are not ! covered by this License; they are outside its scope. The act of ! running a program using the Library is not restricted, and output from ! such a program is covered only if its contents constitute a work based ! on the Library (independent of the use of the Library in a tool for ! writing it). Whether that is true depends on what the Library does ! and what the program that uses the Library does. ! ! 1. You may copy and distribute verbatim copies of the Library's ! complete source code as you receive it, in any medium, provided that ! you conspicuously and appropriately publish on each copy an ! appropriate copyright notice and disclaimer of warranty; keep intact ! all the notices that refer to this License and to the absence of any ! warranty; and distribute a copy of this License along with the ! Library. ! ! You may charge a fee for the physical act of transferring a copy, ! and you may at your option offer warranty protection in exchange for a ! fee. ! ! 2. You may modify your copy or copies of the Library or any portion ! of it, thus forming a work based on the Library, and copy and ! distribute such modifications or work under the terms of Section 1 ! above, provided that you also meet all of these conditions: ! ! a) The modified work must itself be a software library. ! ! b) You must cause the files modified to carry prominent notices ! stating that you changed the files and the date of any change. ! ! c) You must cause the whole of the work to be licensed at no ! charge to all third parties under the terms of this License. ! ! d) If a facility in the modified Library refers to a function or a ! table of data to be supplied by an application program that uses ! the facility, other than as an argument passed when the facility ! is invoked, then you must make a good faith effort to ensure that, ! in the event an application does not supply such function or ! table, the facility still operates, and performs whatever part of ! its purpose remains meaningful. ! ! (For example, a function in a library to compute square roots has ! a purpose that is entirely well-defined independent of the ! application. Therefore, Subsection 2d requires that any ! application-supplied function or table used by this function must ! be optional: if the application does not supply it, the square ! root function must still compute square roots.) ! ! These requirements apply to the modified work as a whole. If ! identifiable sections of that work are not derived from the Library, ! and can be reasonably considered independent and separate works in ! themselves, then this License, and its terms, do not apply to those ! sections when you distribute them as separate works. But when you ! distribute the same sections as part of a whole which is a work based ! on the Library, the distribution of the whole must be on the terms of ! this License, whose permissions for other licensees extend to the ! entire whole, and thus to each and every part regardless of who wrote ! it. ! ! Thus, it is not the intent of this section to claim rights or contest ! your rights to work written entirely by you; rather, the intent is to ! exercise the right to control the distribution of derivative or ! collective works based on the Library. ! ! In addition, mere aggregation of another work not based on the Library ! with the Library (or with a work based on the Library) on a volume of ! a storage or distribution medium does not bring the other work under ! the scope of this License. ! ! 3. You may opt to apply the terms of the ordinary GNU General Public ! License instead of this License to a given copy of the Library. To do ! this, you must alter all the notices that refer to this License, so ! that they refer to the ordinary GNU General Public License, version 2, ! instead of to this License. (If a newer version than version 2 of the ! ordinary GNU General Public License has appeared, then you can specify ! that version instead if you wish.) Do not make any other change in ! these notices. ! ! Once this change is made in a given copy, it is irreversible for ! that copy, so the ordinary GNU General Public License applies to all ! subsequent copies and derivative works made from that copy. ! ! This option is useful when you wish to copy part of the code of ! the Library into a program that is not a library. ! ! 4. You may copy and distribute the Library (or a portion or ! derivative of it, under Section 2) in object code or executable form ! under the terms of Sections 1 and 2 above provided that you accompany ! it with the complete corresponding machine-readable source code, which ! must be distributed under the terms of Sections 1 and 2 above on a ! medium customarily used for software interchange. ! ! If distribution of object code is made by offering access to copy ! from a designated place, then offering equivalent access to copy the ! source code from the same place satisfies the requirement to ! distribute the source code, even though third parties are not ! compelled to copy the source along with the object code. ! ! 5. A program that contains no derivative of any portion of the ! Library, but is designed to work with the Library by being compiled or ! linked with it, is called a "work that uses the Library". Such a ! work, in isolation, is not a derivative work of the Library, and ! therefore falls outside the scope of this License. ! ! However, linking a "work that uses the Library" with the Library ! creates an executable that is a derivative of the Library (because it ! contains portions of the Library), rather than a "work that uses the ! library". The executable is therefore covered by this License. ! Section 6 states terms for distribution of such executables. ! ! When a "work that uses the Library" uses material from a header file ! that is part of the Library, the object code for the work may be a ! derivative work of the Library even though the source code is not. ! Whether this is true is especially significant if the work can be ! linked without the Library, or if the work is itself a library. The ! threshold for this to be true is not precisely defined by law. ! ! If such an object file uses only numerical parameters, data ! structure layouts and accessors, and small macros and small inline ! functions (ten lines or less in length), then the use of the object ! file is unrestricted, regardless of whether it is legally a derivative ! work. (Executables containing this object code plus portions of the ! Library will still fall under Section 6.) ! ! Otherwise, if the work is a derivative of the Library, you may ! distribute the object code for the work under the terms of Section 6. ! Any executables containing that work also fall under Section 6, ! whether or not they are linked directly with the Library itself. ! ! 6. As an exception to the Sections above, you may also combine or ! link a "work that uses the Library" with the Library to produce a ! work containing portions of the Library, and distribute that work ! under terms of your choice, provided that the terms permit ! modification of the work for the customer's own use and reverse ! engineering for debugging such modifications. ! ! You must give prominent notice with each copy of the work that the ! Library is used in it and that the Library and its use are covered by ! this License. You must supply a copy of this License. If the work ! during execution displays copyright notices, you must include the ! copyright notice for the Library among them, as well as a reference ! directing the user to the copy of this License. Also, you must do one ! of these things: ! ! a) Accompany the work with the complete corresponding ! machine-readable source code for the Library including whatever ! changes were used in the work (which must be distributed under ! Sections 1 and 2 above); and, if the work is an executable linked ! with the Library, with the complete machine-readable "work that ! uses the Library", as object code and/or source code, so that the ! user can modify the Library and then relink to produce a modified ! executable containing the modified Library. (It is understood ! that the user who changes the contents of definitions files in the ! Library will not necessarily be able to recompile the application ! to use the modified definitions.) ! ! b) Use a suitable shared library mechanism for linking with the ! Library. A suitable mechanism is one that (1) uses at run time a ! copy of the library already present on the user's computer system, ! rather than copying library functions into the executable, and (2) ! will operate properly with a modified version of the library, if ! the user installs one, as long as the modified version is ! interface-compatible with the version that the work was made with. ! ! c) Accompany the work with a written offer, valid for at ! least three years, to give the same user the materials ! specified in Subsection 6a, above, for a charge no more ! than the cost of performing this distribution. ! ! d) If distribution of the work is made by offering access to copy ! from a designated place, offer equivalent access to copy the above ! specified materials from the same place. ! ! e) Verify that the user has already received a copy of these ! materials or that you have already sent this user a copy. ! ! For an executable, the required form of the "work that uses the ! Library" must include any data and utility programs needed for ! reproducing the executable from it. However, as a special exception, ! the materials to be distributed need not include anything that is ! normally distributed (in either source or binary form) with the major ! components (compiler, kernel, and so on) of the operating system on ! which the executable runs, unless that component itself accompanies ! the executable. ! ! It may happen that this requirement contradicts the license ! restrictions of other proprietary libraries that do not normally ! accompany the operating system. Such a contradiction means you cannot ! use both them and the Library together in an executable that you ! distribute. ! ! 7. You may place library facilities that are a work based on the ! Library side-by-side in a single library together with other library ! facilities not covered by this License, and distribute such a combined ! library, provided that the separate distribution of the work based on ! the Library and of the other library facilities is otherwise ! permitted, and provided that you do these two things: ! ! a) Accompany the combined library with a copy of the same work ! based on the Library, uncombined with any other library ! facilities. This must be distributed under the terms of the ! Sections above. ! ! b) Give prominent notice with the combined library of the fact ! that part of it is a work based on the Library, and explaining ! where to find the accompanying uncombined form of the same work. ! ! 8. You may not copy, modify, sublicense, link with, or distribute ! the Library except as expressly provided under this License. Any ! attempt otherwise to copy, modify, sublicense, link with, or ! distribute the Library is void, and will automatically terminate your ! rights under this License. However, parties who have received copies, ! or rights, from you under this License will not have their licenses ! terminated so long as such parties remain in full compliance. ! ! 9. You are not required to accept this License, since you have not ! signed it. However, nothing else grants you permission to modify or ! distribute the Library or its derivative works. These actions are ! prohibited by law if you do not accept this License. Therefore, by ! modifying or distributing the Library (or any work based on the ! Library), you indicate your acceptance of this License to do so, and ! all its terms and conditions for copying, distributing or modifying ! the Library or works based on it. ! ! 10. Each time you redistribute the Library (or any work based on the ! Library), the recipient automatically receives a license from the ! original licensor to copy, distribute, link with or modify the Library ! subject to these terms and conditions. You may not impose any further ! restrictions on the recipients' exercise of the rights granted herein. ! You are not responsible for enforcing compliance by third parties with ! this License. ! ! 11. If, as a consequence of a court judgment or allegation of patent ! infringement or for any other reason (not limited to patent issues), ! conditions are imposed on you (whether by court order, agreement or ! otherwise) that contradict the conditions of this License, they do not ! excuse you from the conditions of this License. If you cannot ! distribute so as to satisfy simultaneously your obligations under this ! License and any other pertinent obligations, then as a consequence you ! may not distribute the Library at all. For example, if a patent ! license would not permit royalty-free redistribution of the Library by ! all those who receive copies directly or indirectly through you, then ! the only way you could satisfy both it and this License would be to ! refrain entirely from distribution of the Library. ! ! If any portion of this section is held invalid or unenforceable under any ! particular circumstance, the balance of the section is intended to apply, ! and the section as a whole is intended to apply in other circumstances. ! ! It is not the purpose of this section to induce you to infringe any ! patents or other property right claims or to contest validity of any ! such claims; this section has the sole purpose of protecting the ! integrity of the free software distribution system which is ! implemented by public license practices. Many people have made ! generous contributions to the wide range of software distributed ! through that system in reliance on consistent application of that ! system; it is up to the author/donor to decide if he or she is willing ! to distribute software through any other system and a licensee cannot ! impose that choice. ! ! This section is intended to make thoroughly clear what is believed to ! be a consequence of the rest of this License. ! ! 12. If the distribution and/or use of the Library is restricted in ! certain countries either by patents or by copyrighted interfaces, the ! original copyright holder who places the Library under this License may add ! an explicit geographical distribution limitation excluding those countries, ! so that distribution is permitted only in or among countries not thus ! excluded. In such case, this License incorporates the limitation as if ! written in the body of this License. ! ! 13. The Free Software Foundation may publish revised and/or new ! versions of the Lesser General Public License from time to time. ! Such new versions will be similar in spirit to the present version, ! but may differ in detail to address new problems or concerns. ! ! Each version is given a distinguishing version number. If the Library ! specifies a version number of this License which applies to it and ! "any later version", you have the option of following the terms and ! conditions either of that version or of any later version published by ! the Free Software Foundation. If the Library does not specify a ! license version number, you may choose any version ever published by ! the Free Software Foundation. ! ! 14. If you wish to incorporate parts of the Library into other free ! programs whose distribution conditions are incompatible with these, ! write to the author to ask for permission. For software which is ! copyrighted by the Free Software Foundation, write to the Free ! Software Foundation; we sometimes make exceptions for this. Our ! decision will be guided by the two goals of preserving the free status ! of all derivatives of our free software and of promoting the sharing ! and reuse of software generally. ! ! NO WARRANTY ! ! 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ! WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ! EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ! OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ! KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ! PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ! LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ! THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ! ! 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ! WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ! AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ! FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ! CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ! LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ! RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ! FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ! SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ! DAMAGES. ! ! END OF TERMS AND CONDITIONS --- 1,480 ---- ! DOMIT! is a non-validating, but lightweight and fast DOM parser for PHP ! ! By John Heinstein ! jhe...@en... ! joh...@nb... ! ! Copyright (C) 2004 John Heinstein ! http://www.engageinteractive.com/domit/ ! All rights reserved. ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! This library is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Lesser General Public License for more details. ! ! ! ! GNU LESSER GENERAL PUBLIC LICENSE ! Version 2.1, February 1999 ! ! Copyright (C) 1991, 1999 Free Software Foundation, Inc. ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! Everyone is permitted to copy and distribute verbatim copies ! of this license document, but changing it is not allowed. ! ! [This is the first released version of the Lesser GPL. It also counts ! as the successor of the GNU Library Public License, version 2, hence ! the version number 2.1.] ! ! Preamble ! ! The licenses for most software are designed to take away your ! freedom to share and change it. By contrast, the GNU General Public ! Licenses are intended to guarantee your freedom to share and change ! free software--to make sure the software is free for all its users. ! ! This license, the Lesser General Public License, applies to some ! specially designated software packages--typically libraries--of the ! Free Software Foundation and other authors who decide to use it. You ! can use it too, but we suggest you first think carefully about whether ! this license or the ordinary General Public License is the better ! strategy to use in any particular case, based on the explanations below. ! ! When we speak of free software, we are referring to freedom of use, ! not price. Our General Public Licenses are designed to make sure that ! you have the freedom to distribute copies of free software (and charge ! for this service if you wish); that you receive source code or can get ! it if you want it; that you can change the software and use pieces of ! it in new free programs; and that you are informed that you can do ! these things. ! ! To protect your rights, we need to make restrictions that forbid ! distributors to deny you these rights or to ask you to surrender these ! rights. These restrictions translate to certain responsibilities for ! you if you distribute copies of the library or if you modify it. ! ! For example, if you distribute copies of the library, whether gratis ! or for a fee, you must give the recipients all the rights that we gave ! you. You must make sure that they, too, receive or can get the source ! code. If you link other code with the library, you must provide ! complete object files to the recipients, so that they can relink them ! with the library after making changes to the library and recompiling ! it. And you must show them these terms so they know their rights. ! ! We protect your rights with a two-step method: (1) we copyright the ! library, and (2) we offer you this license, which gives you legal ! permission to copy, distribute and/or modify the library. ! ! To protect each distributor, we want to make it very clear that ! there is no warranty for the free library. Also, if the library is ! modified by someone else and passed on, the recipients should know ! that what they have is not the original version, so that the original ! author's reputation will not be affected by problems that might be ! introduced by others. ! ! Finally, software patents pose a constant threat to the existence of ! any free program. We wish to make sure that a company cannot ! effectively restrict the users of a free program by obtaining a ! restrictive license from a patent holder. Therefore, we insist that ! any patent license obtained for a version of the library must be ! consistent with the full freedom of use specified in this license. ! ! Most GNU software, including some libraries, is covered by the ! ordinary GNU General Public License. This license, the GNU Lesser ! General Public License, applies to certain designated libraries, and ! is quite different from the ordinary General Public License. We use ! this license for certain libraries in order to permit linking those ! libraries into non-free programs. ! ! When a program is linked with a library, whether statically or using ! a shared library, the combination of the two is legally speaking a ! combined work, a derivative of the original library. The ordinary ! General Public License therefore permits such linking only if the ! entire combination fits its criteria of freedom. The Lesser General ! Public License permits more lax criteria for linking other code with ! the library. ! ! We call this license the "Lesser" General Public License because it ! does Less to protect the user's freedom than the ordinary General ! Public License. It also provides other free software developers Less ! of an advantage over competing non-free programs. These disadvantages ! are the reason we use the ordinary General Public License for many ! libraries. However, the Lesser license provides advantages in certain ! special circumstances. ! ! For example, on rare occasions, there may be a special need to ! encourage the widest possible use of a certain library, so that it becomes ! a de-facto standard. To achieve this, non-free programs must be ! allowed to use the library. A more frequent case is that a free ! library does the same job as widely used non-free libraries. In this ! case, there is little to gain by limiting the free library to free ! software only, so we use the Lesser General Public License. ! ! In other cases, permission to use a particular library in non-free ! programs enables a greater number of people to use a large body of ! free software. For example, permission to use the GNU C Library in ! non-free programs enables many more people to use the whole GNU ! operating system, as well as its variant, the GNU/Linux operating ! system. ! ! Although the Lesser General Public License is Less protective of the ! users' freedom, it does ensure that the user of a program that is ! linked with the Library has the freedom and the wherewithal to run ! that program using a modified version of the Library. ! ! The precise terms and conditions for copying, distribution and ! modification follow. Pay close attention to the difference between a ! "work based on the library" and a "work that uses the library". The ! former contains code derived from the library, whereas the latter must ! be combined with the library in order to run. ! ! GNU LESSER GENERAL PUBLIC LICENSE ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ! ! 0. This License Agreement applies to any software library or other ! program which contains a notice placed by the copyright holder or ! other authorized party saying it may be distributed under the terms of ! this Lesser General Public License (also called "this License"). ! Each licensee is addressed as "you". ! ! A "library" means a collection of software functions and/or data ! prepared so as to be conveniently linked with application programs ! (which use some of those functions and data) to form executables. ! ! The "Library", below, refers to any such software library or work ! which has been distributed under these terms. A "work based on the ! Library" means either the Library or any derivative work under ! copyright law: that is to say, a work containing the Library or a ! portion of it, either verbatim or with modifications and/or translated ! straightforwardly into another language. (Hereinafter, translation is ! included without limitation in the term "modification".) ! ! "Source code" for a work means the preferred form of the work for ! making modifications to it. For a library, complete source code means ! all the source code for all modules it contains, plus any associated ! interface definition files, plus the scripts used to control compilation ! and installation of the library. ! ! Activities other than copying, distribution and modification are not ! covered by this License; they are outside its scope. The act of ! running a program using the Library is not restricted, and output from ! such a program is covered only if its contents constitute a work based ! on the Library (independent of the use of the Library in a tool for ! writing it). Whether that is true depends on what the Library does ! and what the program that uses the Library does. ! ! 1. You may copy and distribute verbatim copies of the Library's ! complete source code as you receive it, in any medium, provided that ! you conspicuously and appropriately publish on each copy an ! appropriate copyright notice and disclaimer of warranty; keep intact ! all the notices that refer to this License and to the absence of any ! warranty; and distribute a copy of this License along with the ! Library. ! ! You may charge a fee for the physical act of transferring a copy, ! and you may at your option offer warranty protection in exchange for a ! fee. ! ! 2. You may modify your copy or copies of the Library or any portion ! of it, thus forming a work based on the Library, and copy and ! distribute such modifications or work under the terms of Section 1 ! above, provided that you also meet all of these conditions: ! ! a) The modified work must itself be a software library. ! ! b) You must cause the files modified to carry prominent notices ! stating that you changed the files and the date of any change. ! ! c) You must cause the whole of the work to be licensed at no ! charge to all third parties under the terms of this License. ! ! d) If a facility in the modified Library refers to a function or a ! table of data to be supplied by an application program that uses ! the facility, other than as an argument passed when the facility ! is invoked, then you must make a good faith effort to ensure that, ! in the event an application does not supply such function or ! table, the facility still operates, and performs whatever part of ! its purpose remains meaningful. ! ! (For example, a function in a library to compute square roots has ! a purpose that is entirely well-defined independent of the ! application. Therefore, Subsection 2d requires that any ! application-supplied function or table used by this function must ! be optional: if the application does not supply it, the square ! root function must still compute square roots.) ! ! These requirements apply to the modified work as a whole. If ! identifiable sections of that work are not derived from the Library, ! and can be reasonably considered independent and separate works in ! themselves, then this License, and its terms, do not apply to those ! sections when you distribute them as separate works. But when you ! distribute the same sections as part of a whole which is a work based ! on the Library, the distribution of the whole must be on the terms of ! this License, whose permissions for other licensees extend to the ! entire whole, and thus to each and every part regardless of who wrote ! it. ! ! Thus, it is not the intent of this section to claim rights or contest ! your rights to work written entirely by you; rather, the intent is to ! exercise the right to control the distribution of derivative or ! collective works based on the Library. ! ! In addition, mere aggregation of another work not based on the Library ! with the Library (or with a work based on the Library) on a volume of ! a storage or distribution medium does not bring the other work under ! the scope of this License. ! ! 3. You may opt to apply the terms of the ordinary GNU General Public ! License instead of this License to a given copy of the Library. To do ! this, you must alter all the notices that refer to this License, so ! that they refer to the ordinary GNU General Public License, version 2, ! instead of to this License. (If a newer version than version 2 of the ! ordinary GNU General Public License has appeared, then you can specify ! that version instead if you wish.) Do not make any other change in ! these notices. ! ! Once this change is made in a given copy, it is irreversible for ! that copy, so the ordinary GNU General Public License applies to all ! subsequent copies and derivative works made from that copy. ! ! This option is useful when you wish to copy part of the code of ! the Library into a program that is not a library. ! ! 4. You may copy and distribute the Library (or a portion or ! derivative of it, under Section 2) in object code or executable form ! under the terms of Sections 1 and 2 above provided that you accompany ! it with the complete corresponding machine-readable source code, which ! must be distributed under the terms of Sections 1 and 2 above on a ! medium customarily used for software interchange. ! ! If distribution of object code is made by offering access to copy ! from a designated place, then offering equivalent access to copy the ! source code from the same place satisfies the requirement to ! distribute the source code, even though third parties are not ! compelled to copy the source along with the object code. ! ! 5. A program that contains no derivative of any portion of the ! Library, but is designed to work with the Library by being compiled or ! linked with it, is called a "work that uses the Library". Such a ! work, in isolation, is not a derivative work of the Library, and ! therefore falls outside the scope of this License. ! ! However, linking a "work that uses the Library" with the Library ! creates an executable that is a derivative of the Library (because it ! contains portions of the Library), rather than a "work that uses the ! library". The executable is therefore covered by this License. ! Section 6 states terms for distribution of such executables. ! ! When a "work that uses the Library" uses material from a header file ! that is part of the Library, the object code for the work may be a ! derivative work of the Library even though the source code is not. ! Whether this is true is especially significant if the work can be ! linked without the Library, or if the work is itself a library. The ! threshold for this to be true is not precisely defined by law. ! ! If such an object file uses only numerical parameters, data ! structure layouts and accessors, and small macros and small inline ! functions (ten lines or less in length), then the use of the object ! file is unrestricted, regardless of whether it is legally a derivative ! work. (Executables containing this object code plus portions of the ! Library will still fall under Section 6.) ! ! Otherwise, if the work is a derivative of the Library, you may ! distribute the object code for the work under the terms of Section 6. ! Any executables containing that work also fall under Section 6, ! whether or not they are linked directly with the Library itself. ! ! 6. As an exception to the Sections above, you may also combine or ! link a "work that uses the Library" with the Library to produce a ! work containing portions of the Library, and distribute that work ! under terms of your choice, provided that the terms permit ! modification of the work for the customer's own use and reverse ! engineering for debugging such modifications. ! ! You must give prominent notice with each copy of the work that the ! Library is used in it and that the Library and its use are covered by ! this License. You must supply a copy of this License. If the work ! during execution displays copyright notices, you must include the ! copyright notice for the Library among them, as well as a reference ! directing the user to the copy of this License. Also, you must do one ! of these things: ! ! a) Accompany the work with the complete corresponding ! machine-readable source code for the Library including whatever ! changes were used in the work (which must be distributed under ! Sections 1 and 2 above); and, if the work is an executable linked ! with the Library, with the complete machine-readable "work that ! uses the Library", as object code and/or source code, so that the ! user can modify the Library and then relink to produce a modified ! executable containing the modified Library. (It is understood ! that the user who changes the contents of definitions files in the ! Library will not necessarily be able to recompile the application ! to use the modified definitions.) ! ! b) Use a suitable shared library mechanism for linking with the ! Library. A suitable mechanism is one that (1) uses at run time a ! copy of the library already present on the user's computer system, ! rather than copying library functions into the executable, and (2) ! will operate properly with a modified version of the library, if ! the user installs one, as long as the modified version is ! interface-compatible with the version that the work was made with. ! ! c) Accompany the work with a written offer, valid for at ! least three years, to give the same user the materials ! specified in Subsection 6a, above, for a charge no more ! than the cost of performing this distribution. ! ! d) If distribution of the work is made by offering access to copy ! from a designated place, offer equivalent access to copy the above ! specified materials from the same place. ! ! e) Verify that the user has already received a copy of these ! materials or that you have already sent this user a copy. ! ! For an executable, the required form of the "work that uses the ! Library" must include any data and utility programs needed for ! reproducing the executable from it. However, as a special exception, ! the materials to be distributed need not include anything that is ! normally distributed (in either source or binary form) with the major ! components (compiler, kernel, and so on) of the operating system on ! which the executable runs, unless that component itself accompanies ! the executable. ! ! It may happen that this requirement contradicts the license ! restrictions of other proprietary libraries that do not normally ! accompany the operating system. Such a contradiction means you cannot ! use both them and the Library together in an executable that you ! distribute. ! ! 7. You may place library facilities that are a work based on the ! Library side-by-side in a single library together with other library ! facilities not covered by this License, and distribute such a combined ! library, provided that the separate distribution of the work based on ! the Library and of the other library facilities is otherwise ! permitted, and provided that you do these two things: ! ! a) Accompany the combined library with a copy of the same work ! based on the Library, uncombined with any other library ! facilities. This must be distributed under the terms of the ! Sections above. ! ! b) Give prominent notice with the combined library of the fact ! that part of it is a work based on the Library, and explaining ! where to find the accompanying uncombined form of the same work. ! ! 8. You may not copy, modify, sublicense, link with, or distribute ! th... [truncated message content] |
From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713/scripts Modified Files: Tag: development_xmlrqp stackAuthor.php stackXML.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: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.29.2.13 retrieving revision 1.29.2.14 diff -C2 -d -r1.29.2.13 -r1.29.2.14 *** stackAuthor.php 22 Aug 2005 17:20:18 -0000 1.29.2.13 --- stackAuthor.php 25 Aug 2005 15:46:21 -0000 1.29.2.14 *************** *** 160,163 **** --- 160,393 ---- } + function stack_question_edit_form_rqp($question,&$errors,$PostTo = '') { + global $_PHP_SELF; + + $html = ''; + //show_array($question); + + if (empty($PostTo)) { + $PostTo=$_PHP_SELF; + } + + // Timestamp this edit + $html .= "<form name='stackeditqform' action='$PostTo' method='POST'>\n"; + + $html .=stack_question_edit_form_substance_rqp($question,$errors); + + $html .= "<input type='hidden' name='action' value='' />\n"; + $html .= "<submit name='dummy' value=''>"; + $html .= "</form>\n\n\n"; // form in which questions are edited. + + return $html; + } + + /** + * Build the substance of the form to edit a STACK question. + * This needs to be wrapped in a <form> </form> structure. + * + * @param array $question The STACK question + * @param array &$errors Repository for errors + * @return void + */ + function stack_question_edit_form_substance_rqp($question,&$errors) { + global $stack_stand_alone,$stackQuestion,$stackOptions,$debug,$user; + + $t=time(); + $dts = strftime('%c',$t); // Format the string. + $html = ''; + + if (array_key_exists('questionOptions',$question)) { // option set in question + $question_options = $question['questionOptions']; + } else { + $question_options = array(); + } + $optval = stack_options_formvals_set($question_options); + + // Add all the metadata to the question + + // hidden metadata + $html .= "\n<hr />\n + <input type='hidden' name='questionID' value='".sf($question,'questionID')."' />\n + <input type='hidden' name='questionGUID' value='".sf($question,'questionGUID')."' />\n + <input type='hidden' name='questionDateLastEdited' value='$t' />\n + <input type='hidden' name='questionUserLastEdited' value='".sf($question,'questionUserLastEdited')."' />\n + <input type='hidden' name='questionPublisher' value='".sf($question,'questionPublisher')."' />\n + <input type='hidden' name='type' value='".sf($question,'type')."' />\n + <input type='hidden' name='questionFormat' value='".sf($question,'questionFormat')."' />\n + + <table cellboarder='0' cellpadding='2'> + <tr> <td>".get_string('stackQuestion_questionName','stack','').":</td> + <td><input type='input' name='questionName' value='".sf($question,'questionName')."' size='25' /> (ID: ".sf($question,'questionID').") </td> </tr> + <tr> <td>".get_string('stackQuestion_questionDescription','stack','').":</td> + <td><input type='input' name='questionDescription' value='".sf($question,'questionDescription')."' size='60' /></tr> + <tr> <td>".get_string('stackQuestion_questionKeywords','stack','').":</td> + <td><input type='input' name='questionKeywords' value='".sf($question,'questionKeywords')."' size='60' /></tr> + + </table> "; + + // HACK: the field type in the database does not + // allow these to be edited yet. + // <tr> <td> Last edited by: </td> + // <td> <input type='input' name='questionUserLastEdited' value='".stack_s($question['questionUserLastEdited'])."' size='40' /> on $dts.</td> + // </tr> + + $html .= "\n<hr />\n"; + + // Buttons to go somewhere next + if ($stack_stand_alone) { + $html .= "<a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; + if (''==$errors) { + $html .= "<a href=\"javascript:EditQ('preview')\">Try question</a> \n"; + $html .= "<a href=\"javascript:EditQ('export_xml')\">Export as XML</a> \n"; + if ('admin'==$user['username']) { + $html .= "<a href=\"javascript:EditQ('save')\">Store question</a>\n + <a href=\"javascript:EditQ('save_as')\">Store as a new question </a>\n"; + } + } + $html .= "</p>"; + } + + // Add the meat of the question. + $qfield='questionVarsRaw'; + $html .= "<b>".stack_question_edit_dispquestionfield($qfield)."</b><br />"; + + // Replace all \n's with ;'s + if (array_key_exists($qfield,$question)) { + $strout = str_replace(";","\n",$question[$qfield]); + } else { $strout = ''; } + stack_question_edit_form_field($qfield,$strout,$errors); + $html .= "\n\n<br />\n"; + + $qfield='questionStem'; + $html .= "<b>".stack_question_edit_dispquestionfield($qfield)."</b><br />"; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + + $html .= "<p><table align=top><tr align=top>\n"; + if (array_key_exists('questionPotResp',$question)) { + $html .= " <td><b>".stack_question_edit_dispquestionfield('questionAns')."</b></td>\n"; + $html .= "<td> </td></tr>\n\n<tr align=top>\n <td align=top>"; + $qfield='questionAns'; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + $html .= "</td>\n <td> </td></tr>"; + } else { + // The questionAns and associated fields + + $html .= " <td><b>".stack_question_edit_dispquestionfield('questionAns')."</b></td>\n"; + $html .= " <td><b>".stack_question_edit_dispoptionfield('AnsTest')."</b></td>\n"; + $html .= " <td><b>".stack_question_edit_dispoptionfield('AnsTestOpt')."</b></td>\n"; + $html .= "</tr>\n\n<tr align=top>\n <td align=top>"; + + $qfield='questionAns'; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + $html .= "</td>\n <td align=top>\n"; + + $opt = 'AnsTest'; + $opt_name = "questionOptions[{$opt}]"; + @stack_question_edit_option_form($opt_name,$opt,$optval[$opt]); + $html .= "</td>\n <td align=top>\n"; + + $opt = 'AnsTestOpt'; + $opt_name = "questionOptions[{$opt}]"; + @stack_question_edit_option_form($opt_name,$opt,$optval[$opt],20); + $html .= "</td>\n</tr>"; + + $html .= "<tr align=top><td></td> + <td>({$stackOptions['AnsTest']['default']})</td> + <td>{$stackOptions['AnsTestOpt']['default']}</td></tr>"; + } + + $html .= "<tr align=top>\n"; + $html .= " <td> <b>".stack_question_edit_dispoptionfield('QuVal')."</b></td>\n"; + $html .= " <td> <b>".stack_question_edit_dispoptionfield('Penalty')."</b></td>\n"; + $html .= "<td></td><td></td></tr>\n<tr>\n <td>"; + + $opt = 'QuVal'; + $opt_name = "questionOptions[{$opt}]"; + @stack_question_edit_option_form($opt_name,$opt,$optval[$opt]); + $html .= " ({$stackOptions[$opt]['default']})</td>\n <td>\n"; + + $opt = 'Penalty'; + $opt_name = "questionOptions[{$opt}]"; + @stack_question_edit_option_form($opt_name,$opt,$optval[$opt]); + $html .= " ({$stackOptions[$opt]['default']})</td>\n <td>\n"; + + $html .= "</table></p>\n\n"; + + // Potential responses + $html .= "<br /><a href=\"javascript:EditQ('edit')\">Edit</a> and add \n"; + $html .= '<input type="input" name="questionPotResp[add]" value="0" size="3" />'; + $html .= " potential responses<a href=\"javascript:HelpPopup('all','author_potresp');\"><img align=\"middle\" border=\"0\" height=\"17\" width=\"17\" src=\"pics/help.gif\" /></a> (distractors etc).<br />"; + + if (array_key_exists('questionPotResp',$question)) { + if (array_key_exists('0',$question['questionPotResp'])) { + // Add the AnsKey field + $qfield='questionAnsKey'; + $html .= '<p><b>'.stack_question_edit_dispquestionfield($qfield).'</b><br />'; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + $html .= '</p>'; + + // Add the AnsVars field, isnce this may now be used. + $qfield='questionAnsVarsRaw'; + $html .= '<b>'.stack_question_edit_dispquestionfield($qfield).'</b><br />'; + $strout = ''; + if (array_key_exists($qfield,$question)) { + $strout = str_replace(";","\n",$question[$qfield]); + } + @stack_question_edit_form_field($qfield,$strout,$errors); + $html .= "\n\n<br />\n"; + + $html .= '<p>'; + $npr = count($question['questionPotResp']); + foreach ($question['questionPotResp'] as $key => $potresp) { + $potresp['order']=$key; + @stack_question_edit_potresp($key,$potresp,$npr,$errors); + } + $html .= '</p>'; + + } // end questionPotResp + } else { // This needs its default, non-empty value. + $html .= "<input type='hidden' name='questionAnsKey' value='".stack_s($question['questionAnsKey'])."' />\n"; + } + + $qfield='questionSol'; + $html .= '<b>'.stack_question_edit_dispquestionfield($qfield).'</b><br />'; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + $html .= "\n\n<br />\n"; + + $qfield='questionNote'; + $html .= '<b>'.stack_question_edit_dispquestionfield($qfield).'</b><br />'; + @stack_question_edit_form_field($qfield,$question[$qfield],$errors); + $html .= "\n\n<br />\n"; + + // Buttons to go somewhere next + if ($stack_stand_alone) { + $html .= "<p><a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; + if (''==$errors) { + $html .= "<a href=\"javascript:EditQ('preview')\">Try question</a> \n"; + $html .= "<a href=\"javascript:EditQ('export_xml')\">Export as XML</a> \n"; + if ('admin'==$user['username']) { + $html .= "<a href=\"javascript:EditQ('save')\">Store question</a>\n + <a href=\"javascript:EditQ('save_as')\">Store as a new question</a>\n"; + } + } + $html .= "</p>"; + } + + $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','SyntaxHint','Forbid','Allow','MarkModMethod','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display'); + + stack_options_edit_form($options_headings,$options_list,$optval,'questionOptions'); + + $html .= "\n<hr />\n"; + + //List of metadata to display + $metadata_list = array('questionLanguage','questionLearningContext','questionDifficulty','questionCompetency', + 'questionCompetencyLevel','questionTimeAllocated','questionExcerciseType','questionRights'); + stack_question_metadata_edit_form($question,$metadata_list); //Create all metadata fields on question form + + $html .= "\n<hr />\n"; + + return $html; + } // end of edit_form_table /** Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.20 retrieving revision 1.13.2.21 diff -C2 -d -r1.13.2.20 -r1.13.2.21 *** stackXML.php 23 Aug 2005 10:18:08 -0000 1.13.2.20 --- stackXML.php 25 Aug 2005 15:46:21 -0000 1.13.2.21 *************** *** 56,59 **** --- 56,61 ---- define ('quizSchemaName',"stack_quiz.xsd"); + define ('schemaBaseDir',"{$stack_logfiles}/schemas"); + /** * Writes a single stackQuestion data structure as XML, and returns the containing *************** *** 95,99 **** * @return DOMIT_Element $questionFrag The root assessmentItem node with child question elements */ ! function stack_xml_create_question_frag_new($question) { global $stackQuestion, $stack_ver, $xmlNamespaces; --- 97,101 ---- * @return DOMIT_Element $questionFrag The root assessmentItem node with child question elements */ ! function &stack_xml_create_question_frag_new($question) { global $stackQuestion, $stack_ver, $xmlNamespaces; *************** *** 355,359 **** * @return DOMIT_Element $quizFrag The root mathQuiz node with child quiz elements */ ! function stack_xml_create_quiz_frag_new($quiz) { global $stackQuiz, $xmlNamespaces; --- 357,361 ---- * @return DOMIT_Element $quizFrag The root mathQuiz node with child quiz elements */ ! function &stack_xml_create_quiz_frag_new($quiz) { global $stackQuiz, $xmlNamespaces; *************** *** 564,568 **** * @return DOMIT_Element $quListFrag The root mathQuiz node. */ ! function stack_xml_create_question_list_frag() { $xmlDoc = &new DOMIT_Document(); --- 566,570 ---- * @return DOMIT_Element $quListFrag The root mathQuiz node. */ ! function &stack_xml_create_question_list_frag() { $xmlDoc = &new DOMIT_Document(); *************** *** 599,603 **** //Now must give location of schema from which this instance has been derived from $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); ! $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".questionSchemaName; //Use 'define' above //Used to ensure latest schema version is used --- 601,605 ---- //Now must give location of schema from which this instance has been derived from $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); ! $schemaLocationAttr->nodeValue=schemaBaseDir.'/'.questionSchemaName; //Use 'define' above //Used to ensure latest schema version is used *************** *** 637,641 **** //Now must give location of schema from which this instance has been derived from $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); ! $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".quizSchemaName; //Use 'define' above //Used to ensure latest schema version is used --- 639,643 ---- //Now must give location of schema from which this instance has been derived from $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); ! $schemaLocationAttr->nodeValue=schemaBaseDir.'/'.quizSchemaName; //Use 'define' above //Used to ensure latest schema version is used *************** *** 791,796 **** //In the first instance, check what type of file we are dealing with //Retrieve the document element ! $headElement = $xmlDoc->documentElement; ! //Now retrieve the version number attached to the XML file being imported, and check for equality $importXmlVersion = $headElement->getAttribute('version'); --- 793,798 ---- //In the first instance, check what type of file we are dealing with //Retrieve the document element ! $headElement = &$xmlDoc->documentElement; ! //Now retrieve the version number attached to the XML file being imported, and check for equality $importXmlVersion = $headElement->getAttribute('version'); *************** *** 802,811 **** else { //XML file has a version attached to it, ! $schemaVersion = stack_xml_check_schema_version("{$stack_root}/schemas/"); //Check that XML matches version with schema if ($importXmlVersion==$schemaVersion) { switch ($headElement->nodeName) ! { case('assessmentItem'): { --- 804,813 ---- else { //XML file has a version attached to it, ! $schemaVersion = stack_xml_check_schema_version(schemaBaseDir); //Check that XML matches version with schema if ($importXmlVersion==$schemaVersion) { switch ($headElement->nodeName) ! { case('assessmentItem'): { *************** *** 848,851 **** --- 850,883 ---- /** + * Begins the recursive algorithm responsible for a importing a question XML file into a multidimensional array. Returns + * the final data structure + * + * @param DOMIT_Document $questionXmlDoc The DOM XML document representing the question + * @return array $question A question data structure + */ + function stack_xml_parse_question($questionXmlDoc) + { + $question = array(); + $elements = &$questionXmlDoc->documentElement; + stack_xml_parse_element_into_array($elements,$question['assessmentItem'],'stackQuestion'); + return $question; + } + + /** + * Begins the recursive algorithm responsible for a importing a quiz XML file into a multidimensional array. Returns + * the final data structure + * + * @param DOMIT_Document $quizXmlDoc The DOM XML document representing the quiz + * @return array $quiz A quiz data structure + */ + function stack_xml_parse_quiz($quizXmlDoc) + { + $quiz = array(); + $elements = &$quizXmlDoc->documentElement; + stack_xml_parse_element_into_array($elements,$quiz['mathQuiz'],'stackQuiz'); + return $quiz; + } + + /** * Maps an element from a particular namespace, i.e. dc:keyword, onto the correct stackQuestion or stackQuiz data structure keyword, * i.e. questionKeywords or quizKeywords, when exporting/importing XML *************** *** 899,932 **** /** - * Begins the recursive algorithm responsible for a importing a question XML file into a multidimensional array. Returns - * the final data structure - * - * @param DOMIT_Document $questionXmlDoc The DOM XML document representing the question - * @return array $question A question data structure - */ - function stack_xml_parse_question(&$questionXmlDoc) - { - $question = array(); - $elements = &$questionXmlDoc->documentElement; - stack_xml_parse_element_into_array($elements,$question['assessmentItem'],'stackQuestion'); - return $question; - } - - /** - * Begins the recursive algorithm responsible for a importing a quiz XML file into a multidimensional array. Returns - * the final data structure - * - * @param DOMIT_Document $quizXmlDoc The DOM XML document representing the quiz - * @return array $quiz A quiz data structure - */ - function stack_xml_parse_quiz(&$quizXmlDoc) - { - $quiz = array(); - $elements = &$questionXmlDoc->documentElement; - stack_xml_parse_element_into_array($elements,$quiz['mathQuiz'],'stackQuiz'); - return $quiz; - } - - /** * Actually creates the stackQuestion/stackQuiz data structure as required by validation. Is a recursive function that iterates through * the XML tree specified --- 931,934 ---- *************** *** 936,940 **** * @return string $arrayType The type of data structure: stackQuestion, stackQuiz */ ! function stack_xml_parse_element_into_array(&$element,&$array,$arrayType) { $children = &$element->childNodes; //Retrieve all child nodes --- 938,942 ---- * @return string $arrayType The type of data structure: stackQuestion, stackQuiz */ ! function stack_xml_parse_element_into_array($element,&$array,$arrayType) { $children = &$element->childNodes; //Retrieve all child nodes *************** *** 946,950 **** $node = &$children[$i]; $nodeName = $node->nodeName; - //Check whether node is metadata and if so resolve to equivalent question field $nodeName = stack_xml_map_element_ns($node,$arrayType); --- 948,951 ---- *************** *** 1318,1326 **** $questionFrag->appendChild($headElement); ! //Append root schema node onto DOM object and save ! $dom->appendChild($questionFrag); ! $success = $dom->saveXML($directory."/".quizSchemaName,true); ! ! return $success; } --- 1319,1340 ---- $questionFrag->appendChild($headElement); ! $dirSuccess = true; ! //Before we attempt to write out the schemas, we must create the schemas directory within $stack_logfiles ! if (!file_exists(schemaBaseDir)) ! { ! $dirSuccess = mkdir($directory); ! } ! ! if ($dirSuccess) { //if directory could be created, go on to create XML schema file ! //Append root schema node onto DOM object and save ! $dom->appendChild($questionFrag); ! $success = $dom->saveXML($directory."/".quizSchemaName,true); ! ! return $success; ! } ! ! else { //if directory could not be created - check permissions! ! return $dirSuccess; ! } } *************** *** 1342,1355 **** $questionFrag = &stack_xml_create_question_schema_frag(); - $headElement = &stack_xml_create_enclosing_schema_type('assessmentItem',$xmlElements,TRUE); $questionFrag->appendChild($headElement); ! //Append root schema node onto DOM object and save ! $dom->appendChild($questionFrag); ! $success = $dom->saveXML($directory."/".questionSchemaName,true); ! return $success; } --- 1356,1381 ---- $questionFrag = &stack_xml_create_question_schema_frag(); $headElement = &stack_xml_create_enclosing_schema_type('assessmentItem',$xmlElements,TRUE); $questionFrag->appendChild($headElement); ! $dirSuccess = true; ! //Before we attempt to write out the schemas, we must create the schemas directory within $stack_logfiles ! if (!file_exists(schemaBaseDir)) ! { ! $dirSuccess = mkdir($directory); ! } ! if ($dirSuccess) { ! //Append root schema node onto DOM object and save ! $dom->appendChild($questionFrag); ! $success = $dom->saveXML($directory."/".questionSchemaName,true); ! ! return $success; ! } ! ! else { ! return $dirSuccess; ! } } |
From: pkiddie <pk...@us...> - 2005-08-25 15:46:30
|
Update of /cvsroot/stack/stack-1-0/scripts/rqp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12713/scripts/rqp Modified Files: Tag: development_xmlrqp RQPv1p0Server.php nb_soapfuncs.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: RQPv1p0Server.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/Attic/RQPv1p0Server.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** RQPv1p0Server.php 19 Aug 2005 15:32:49 -0000 1.1.2.6 --- RQPv1p0Server.php 25 Aug 2005 15:46:20 -0000 1.1.2.7 *************** *** 3,7 **** include("nb_soapfuncs.php"); ! include("rqp_util.php"); //Stack/RQP utility functions include("../../stackstd.php"); //Reqd for version info for STACK --- 3,7 ---- include("nb_soapfuncs.php"); ! //include("rqp_util.php"); //Stack/RQP utility functions include("../../stackstd.php"); //Reqd for version info for STACK *************** *** 81,85 **** $si['type'] = "STACK"; - $si['name'] = "STACK"; $si['version'] = $stack_ver['release']; $si['rqpVersion'] = "1.0"; --- 81,84 ---- *************** *** 88,94 **** $si['teacherDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=teacher"; //about $si['adminDocs'] = "{$stack_web_url}scripts/rqp/stackDocs.php?action=admin"; //author - /*$si['serverProperties']=array('rendering' => TRUE, 'implicitCloning' => FALSE, 'explicitCloning' => FALSE, - 'authoring' => TRUE , 'adminOptions' => TRUE, 'teacherOptions' => FALSE , - 'userOptions' => TRUE); */ $si['serverProperties'] = array(array ('key' => 'rendering', 'val' => TRUE), array ('key' => 'implicitCloning', 'val' => FALSE), --- 87,90 ---- *************** *** 191,195 **** function RQP_Render($source, $options, $persistentData, $inputData, $directives, $mimetypes, $namePrefix, $itemBase, $resourceBase, $tempfileBase) { ! $outcomeVars = array(); $stem = ''; --- 187,233 ---- function RQP_Render($source, $options, $persistentData, $inputData, $directives, $mimetypes, $namePrefix, $itemBase, $resourceBase, $tempfileBase) { ! if (empty($source) && $directives[4]['val']==TRUE) ! { ! require_once('../stackAuthor.php'); ! ! $question = ''; ! $errors = ''; ! ! $render['persistentData'] = ''; ! $render['outcomeVars'] = array( array('key' => 'completion', 'val' => 'unknown'), ! array('key' => 'score', 'val' => '0'), ! array('key' => 'rawScore', 'val' => '0'), ! array('key' => 'penalty', 'val' => '0'), ! array('key' => 'valid', 'val' => TRUE), ! array('key' => 'source', 'val' => 'edited sourcce'), ! array('key' => 'options', 'val' => 'options string') ) ; ! $render['onSubmit'] = "</script> ! function EditQ(action) { ! f = document.stackeditqform; ! f.action.value = action; ! f.target = '_self'; ! f.submit(); ! }; ! <script type=".'"'.'text/javascript">'; ! $render['head'] = array(); ! $render['output'] = array( array('key' => 'title', 'val' => ''), //initially question will have no title ! array('key' => 'body', 'val' => stack_question_edit_form_rqp($question,&$errors)), ! array('key' => 'stem', 'val' => ''), ! array('key' => 'feedback', 'val' => ''), ! array('key' => 'response', 'val' => ''), ! array('key' => 'answer', 'val' => ''), ! array('key' => 'solution', 'val' => '') ); ! ! $render['mimetype'] = 'text/html'; ! $render['files'] = array(); ! ! ! //New question - return this form in render op ! //May need to set $questionId initially; ! ! return $render; ! } ! ! /*$outcomeVars = array(); $stem = ''; *************** *** 1009,1013 **** } ! $outcomeVars['answerNote'] = trim($this_attempt['AnswerNote']);*/ --- 1047,1051 ---- } ! $outcomeVars['answerNote'] = trim($this_attempt['AnswerNote']); *************** *** 1049,1058 **** $outcomeVars = soap_encode_array($outcomeVars, 'outcomeVars', 'variable', RQP_URI_NAMESPACE); ! $output = soap_encode_array($output, 'output', 'output', RQP_URI_NAMESPACE); ! return array('templateVars' => $templateVars, 'persistentData' => $persistentData, 'outcomeVars'=> $outcomeVars, 'output' => $output); ! //return new nbSOAPFault("unimplemented", "The RQP_Renderservice has not been implemented yet", ""); // Fill in web method fuctionality here. --- 1087,1096 ---- $outcomeVars = soap_encode_array($outcomeVars, 'outcomeVars', 'variable', RQP_URI_NAMESPACE); ! $output = soap_encode_array($output, 'output', 'output', RQP_URI_NAMESPACE);*/ ! //return array('templateVars' => $templateVars, 'persistentData' => $persistentData, 'outcomeVars'=> $outcomeVars, 'output' => $output); ! return new nbSOAPFault("unimplemented", "The RQP_Renderservice has not been implemented yet", ""); // Fill in web method fuctionality here. Index: nb_soapfuncs.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/Attic/nb_soapfuncs.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** nb_soapfuncs.php 19 Aug 2005 15:32:49 -0000 1.1.2.3 --- nb_soapfuncs.php 25 Aug 2005 15:46:20 -0000 1.1.2.4 *************** *** 129,133 **** $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, 30); stream_set_blocking($sock, false); ! //echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) --- 129,133 ---- $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, 30); stream_set_blocking($sock, false); ! echo "<pre>".htmlentities($request)."</pre>"; // Uncomment this for debugging if($sock == false) *************** *** 144,148 **** fclose($sock); } ! //echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; --- 144,148 ---- fclose($sock); } ! echo "<pre>" . htmlentities($contents) . "</pre>"; // Uncomment this for debugging return $contents; |
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> ! |
From: Chris S. <san...@us...> - 2005-08-23 17:23:45
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27703/scripts/maxima Modified Files: Tag: development_xmlrqp stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.22.2.2 retrieving revision 1.22.2.3 diff -C2 -d -r1.22.2.2 -r1.22.2.3 *** stackmaxima.mac 23 Aug 2005 15:55:08 -0000 1.22.2.2 --- stackmaxima.mac 23 Aug 2005 17:23:37 -0000 1.22.2.3 *************** *** 210,214 **** plot(ex,[ra]) := /*stack_web_plot*/ ! BLOCK([tfn,afn,ufn,lvs,preamble,sysp,sysr,filename], lvs:listofvars(ex), if length(lvs)#1 then --- 210,215 ---- plot(ex,[ra]) := /*stack_web_plot*/ ! BLOCK([tfn,afn,ufn,lvs,ffmt,preamble,sysp,sysr,filename], ! ffmt:"gif", lvs:listofvars(ex), if length(lvs)#1 then *************** *** 216,224 **** filename:CONCAT("stackplot",string(rand(10^8))), tfn:CONCAT(TMP_IMAGE_DIR,filename,".plt"), ! afn:CONCAT("'",IMAGE_DIR,filename,".png","'"), ! if OPT_OUTPUT="MathML" then ! ufn:CONCAT(" <center><img src='",URL_BASE,filename,".png' alt='STACK autogenerated plot' /></center> ") ! else ! ufn:CONCAT(" <html><center><img src='",URL_BASE,filename,".png' alt='STACK autogenerated plot' /></center></html> "), /* Removed on Windows: cd '",IMAGE_DIR,"' */ --- 217,224 ---- filename:CONCAT("stackplot",string(rand(10^8))), 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> "), /* Removed on Windows: cd '",IMAGE_DIR,"' */ *************** *** 226,230 **** set zeroaxis set grid ! set terminal png transparent size 450,300 set output ",afn), --- 226,230 ---- set zeroaxis set grid ! set terminal ",ffmt," transparent size 450,300 set output ",afn), |
From: pkiddie <pk...@us...> - 2005-08-23 16:42:09
|
Update of /cvsroot/stack/stack-1-0/scripts/rqp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16623/scripts/rqp Modified Files: Tag: development_xmlrqp stackDetails.php stackDocs.php Added Files: Tag: development_xmlrqp admindocs-menu.txt studentdocs-menu.txt teacherdocs-menu.txt Log Message: Student documentation fixed in help_popup Admin first/surname fields added Documentation menus added Details tidied --- NEW FILE: admindocs-menu.txt --- // DEMO MENU CONFIGURATION FILE // // level // text // link // target // .menu_QB|question_bank.php?action=questionbank_screen ..menu_New|question_bank.php?action=edit_new ..menu_Import|import.php?action=import .menu_Quizzes|editquiz.php?action=quiz_choose ..menu_New|editquiz.php?action=quiz_new ..menu_Import|import.php?action=import .menu_Reporting|analysis.php .menu_User|user.php .menu_Logout|index.php?action=logout .menu_Help|documentation.php ..menu_Author|documentation.php?action=author_gettingstarted ..menu_Syntax|documentation.php?action=author_commonsyntax ..menu_Qfields|documentation.php?action=author_questionfields ..menu_Options|documentation.php?action=author_options ..menu_AnswerT|documentation.php?action=author_answertest ..menu_TestSuite|documentation.php?action=author_testsuite ..menu_PR|documentation.php?action=author_potresp ..menu_FAF|documentation.php?action=author_factsformula ..menu_FAQ|documentation.php?action=author_faq ..menu_Maxima|documentation.php?action=author_maxima ..menu_CAS_Fn|documentation.php?action=functions .menu_About|documentation.php?action=about_general ..menu_Install|documentation.php?action=about_install ..menu_Develop|documentation.php?action=about_develop ..menu_CAS_OL|chat.php ..menu_CAS_OLML|chat.php ..menu_Forum|http://mantis.york.ac.uk/moodle/course/view.php?id=21|_blank ..menu_Sourceforge|http://sourceforge.net/projects/stack|_blank ..menu_Contact|mailto:ch...@sa... .menu_logo|documentation.php?action=logo Index: stackDetails.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/Attic/stackDetails.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** stackDetails.php 23 Aug 2005 10:18:08 -0000 1.1.2.2 --- stackDetails.php 23 Aug 2005 16:41:58 -0000 1.1.2.3 *************** *** 3,18 **** /** * This simple script returns some specific server information */ require('../../stackstd.php'); ! include("{$stack_root}/html/pagehead.php"); ! ! //print_r($user); ! ! echo 'Properties of the current STACK server<br><br>'; ! echo 'Current STACK version: '.$stack_ver['release'].'<br>'; ! echo 'Administrator:'.'Admin User (not currently in stackstd.php)<br>'; ! echo 'Administrators e-mail: <a href="mailto:'.$stack_mail['admin_email'].'">'.$stack_mail['admin_email'].'</a><br>'; - include("{$stack_root}/html/pagefoot.php"); ?> --- 3,36 ---- /** * This simple script returns some specific server information + * + * As per 'details' field in RQP ServerInformation call + * - administrators name + * - email address + * - URL to STACK server + * - version of STACK in use */ require('../../stackstd.php'); ! echo '<html> ! <head> ! <title>STACK - System for Teaching and Assessment using a Computer algebra Kernel</title> ! </head> ! ! <table> ! <tr><td><img src="'."{$stack_web_url}pics/logo.png".'" width="115" alt="STACK Logo" /></td> ! <td align="left"><h1>STACK</h1></td></tr> ! <tr><td></td><td><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></tr></table> ! <hr/>'; ! ! echo '<br><br><b>Properties of the current STACK server</b><br><br>'; ! echo '<table><tr><td>Current STACK version:</td>'; ! echo '<td>'.$stack_ver['release'].'</td></tr>'; ! echo '<tr><td>Administrator:</td>'; ! echo '<td>'.$stack_adminfirstname.' '.$stack_adminsurname.'</td></tr>'; ! echo '<tr><td>Administrators e-mail:</td>'; ! echo '<td><a href="mailto:'.$stack_mail['admin_email'].'">'.$stack_mail['admin_email'].'</a><br></td></tr>'; ! echo '<tr><td>STACK Web URL:</td>'; ! echo '<td><a href="'.$stack_web_url.'">'.$stack_web_url.'</a></td></tr></table>'; ?> --- NEW FILE: studentdocs-menu.txt --- // DEMO MENU CONFIGURATION FILE // // level // text // link // target // .menu_QB|question_bank.php?action=questionbank_screen ..menu_New|question_bank.php?action=edit_new ..menu_Import|import.php?action=import .menu_Quizzes|editquiz.php?action=quiz_choose ..menu_New|editquiz.php?action=quiz_new ..menu_Import|import.php?action=import .menu_Reporting|analysis.php .menu_User|user.php .menu_Logout|index.php?action=logout .menu_Help|documentation.php ..menu_Author|documentation.php?action=author_gettingstarted ..menu_Syntax|documentation.php?action=author_commonsyntax ..menu_Qfields|documentation.php?action=author_questionfields ..menu_Options|documentation.php?action=author_options ..menu_AnswerT|documentation.php?action=author_answertest ..menu_TestSuite|documentation.php?action=author_testsuite ..menu_PR|documentation.php?action=author_potresp ..menu_FAF|documentation.php?action=author_factsformula ..menu_FAQ|documentation.php?action=author_faq ..menu_Maxima|documentation.php?action=author_maxima ..menu_CAS_Fn|documentation.php?action=functions .menu_About|documentation.php?action=about_general ..menu_Install|documentation.php?action=about_install ..menu_Develop|documentation.php?action=about_develop ..menu_CAS_OL|chat.php ..menu_CAS_OLML|chat.php ..menu_Forum|http://mantis.york.ac.uk/moodle/course/view.php?id=21|_blank ..menu_Sourceforge|http://sourceforge.net/projects/stack|_blank ..menu_Contact|mailto:ch...@sa... .menu_logo|documentation.php?action=logo --- NEW FILE: teacherdocs-menu.txt --- // DEMO MENU CONFIGURATION FILE // // level // text // link // target // .menu_QB|question_bank.php?action=questionbank_screen ..menu_New|question_bank.php?action=edit_new ..menu_Import|import.php?action=import .menu_Quizzes|editquiz.php?action=quiz_choose ..menu_New|editquiz.php?action=quiz_new ..menu_Import|import.php?action=import .menu_Reporting|analysis.php .menu_User|user.php .menu_Logout|index.php?action=logout .menu_Help|documentation.php ..menu_Author|documentation.php?action=author_gettingstarted ..menu_Syntax|documentation.php?action=author_commonsyntax ..menu_Qfields|documentation.php?action=author_questionfields ..menu_Options|documentation.php?action=author_options ..menu_AnswerT|documentation.php?action=author_answertest ..menu_TestSuite|documentation.php?action=author_testsuite ..menu_PR|documentation.php?action=author_potresp ..menu_FAF|documentation.php?action=author_factsformula ..menu_FAQ|documentation.php?action=author_faq ..menu_Maxima|documentation.php?action=author_maxima ..menu_CAS_Fn|documentation.php?action=functions .menu_About|documentation.php?action=about_general ..menu_Install|documentation.php?action=about_install ..menu_Develop|documentation.php?action=about_develop ..menu_CAS_OL|chat.php ..menu_CAS_OLML|chat.php ..menu_Forum|http://mantis.york.ac.uk/moodle/course/view.php?id=21|_blank ..menu_Sourceforge|http://sourceforge.net/projects/stack|_blank ..menu_Contact|mailto:ch...@sa... .menu_logo|documentation.php?action=logo Index: stackDocs.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/Attic/stackDocs.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** stackDocs.php 19 Aug 2005 09:04:57 -0000 1.1.2.1 --- stackDocs.php 23 Aug 2005 16:41:58 -0000 1.1.2.2 *************** *** 6,9 **** --- 6,11 ---- require('../../stackstd.php'); + require_once("{$stack_root}/other/ListMenu.php"); + //Retrieve language from stackstd: $lang = $stack_defaultlang; *************** *** 15,19 **** case('student'): //Retrieve the relevent docs ! include("{$stack_root}/lang/$lang/doc/student_input.php"); break; case('admin'): --- 17,24 ---- case('student'): //Retrieve the relevent docs ! //include("{$stack_root}/lang/$lang/doc/student_input.php"); ! $menu = new ListMenu('/'.$stack_basepath.'/scripts/rqp/studentdocs-menu.txt'); ! $menu->printMenu(); ! break; case('admin'): |
From: pkiddie <pk...@us...> - 2005-08-23 16:42:08
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16623/html Modified Files: Tag: development_xmlrqp help_popup.php Log Message: Student documentation fixed in help_popup Admin first/surname fields added Documentation menus added Details tidied Index: help_popup.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/help_popup.php,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** help_popup.php 19 Jul 2005 13:31:32 -0000 1.3 --- help_popup.php 23 Aug 2005 16:41:58 -0000 1.3.2.1 *************** *** 1,112 **** ! <?php ! /** ! * Generates help files. ! * This file is used in the help popup windows, for individual fields. ! * ! * This is used by both the student and teacher. ! * ! * @package documentation ! * @subpackage Stack ! */ ! ! ?> ! <head> ! <title>Stack help!</title> ! <style type="text/css"> ! @import url(stack.css); ! </style> ! <script type="text/javascript"> ! window.focus(); ! </script> ! <?php ! /** ! * ! */ ! include('../stackstd.php'); ! // HACK for now. ! $options = stack_options_set(array()); ! $filename = stack_lang_filename($options,'doc/en_doc.php'); ! include($filename); ! ! include("{$stack_root}/html/htmlstyle.html"); ! ! // HACK! ! $lang = 'en'; ! $disp_opt = 'LaTeX'; ! ! ?> ! </head> ! <body> ! ! <?php ! ! $field = $_POST['field']; ! $variable = $_POST['variable']; ! ! if (array_key_exists('field',$_GET)) { ! $field = $_GET['field']; ! } ! ! if (array_key_exists('variable',$_GET)) { ! $variable = $_GET['variable']; ! } ! ! //show_array($_POST); ! //echo $variable; ! ! if ('student' == $field) { ! include('student_input.php'); ! } else if('fact' == $variable) { ! ! //<a href="javascript:HelpPopup('calc_product_rule','fact');">A fact!</a> ! ! // These allow the student to ask for help in the popup window. ! $fn = $stack_root.'/lang/'.$lang.'/doc/student_factsformula.php'; ! ! include($fn); ! ! if (array_key_exists($field,$stackFact)) { ! $name = $stackFact[$field]['name']; ! $fact = $stackFact[$field]['fact']; ! $strout = stack_latex_to_html($fact); ! ! echo "<h2><img src='$stack_web_url/pics/logo_sm.png' /> $name</h2><p>$strout</p>"; ! } ! ! } else if('all' == $field) { ! // Then we would like a lot of documentation. ! // This needs to come after 'fact' ! ! $filename=$variable.'.php'; ! include($filename); ! ! } else { ! if ('stackQuestion' == $variable) { ! $q_field = $stackQuestion[$field]; ! $fn = 'stackQuestion_'.$field;} ! else if ('stackOptions' == $variable) { ! $q_field = $stackOptions[$field]; ! $fn = 'stackOptions_'.$field; } ! else if ('stackQuestionPotResp' == $variable) { ! $q_field = $stackQuestionPotResp[$field]; ! $fn = 'stackQuestion_PR_'.$field; } ! else if ('stackQuiz' == $variable) { ! $q_field = $stackQuiz[$field]; ! $fn = 'stackQuiz_'.$field; ! } ! ! $fd = get_string($fn,'stack',''); ! echo "<h3>$fd</h3>"; ! echo $q_field['doc']; ! echo "<p>"; ! ! echo "Name of field: <font color=orange><tt>$field</tt></font>. ! Type of field: <font color=orange><tt>{$q_field['type']}</tt></font>."; ! if (array_key_exists('required',$q_field)) { ! echo " Required: <font color=orange><tt>{$q_field['required']}</tt></font>."; ! } ! } ! ! ?> ! ! </body></html> --- 1,224 ---- ! <?php ! ! /** ! ! * Generates help files. ! ! * This file is used in the help popup windows, for individual fields. ! ! * ! ! * This is used by both the student and teacher. ! ! * ! ! * @package documentation ! ! * @subpackage Stack ! ! */ ! ! ! ! ?> ! ! <head> ! ! <title>Stack help!</title> ! ! <style type="text/css"> ! ! @import url(stack.css); ! ! </style> ! ! <script type="text/javascript"> ! ! window.focus(); ! ! </script> ! ! <?php ! ! /** ! ! * ! ! */ ! ! include('../stackstd.php'); ! ! // HACK for now. ! ! $options = stack_options_set(array()); ! ! $filename = stack_lang_filename($options,'doc/en_doc.php'); ! ! include($filename); ! ! ! ! include("{$stack_root}/html/htmlstyle.html"); ! ! ! ! // HACK! ! ! $lang = 'en'; ! ! $disp_opt = 'LaTeX'; ! ! ! ! ?> ! ! </head> ! ! <body> ! ! ! ! <?php ! ! ! ! $field = $_POST['field']; ! ! $variable = $_POST['variable']; ! ! ! ! if (array_key_exists('field',$_GET)) { ! ! $field = $_GET['field']; ! ! } ! ! ! ! if (array_key_exists('variable',$_GET)) { ! ! $variable = $_GET['variable']; ! ! } ! ! ! ! //show_array($_POST); ! ! //echo $variable; ! ! ! ! if ('student' == $field) { ! ! include('student_input.php'); ! ! } else if('fact' == $variable) { ! ! ! ! //<a href="javascript:HelpPopup('calc_product_rule','fact');">A fact!</a> ! ! ! ! // These allow the student to ask for help in the popup window. ! ! $fn = $stack_root.'/lang/'.$lang.'/doc/student_factsformula.php'; ! ! ! ! include($fn); ! ! ! ! if (array_key_exists($field,$stackFact)) { ! ! $name = $stackFact[$field]['name']; ! ! $fact = $stackFact[$field]['fact']; ! ! $strout = stack_latex_to_html($fact); ! ! ! ! echo "<h2><img src='$stack_web_url/pics/logo_sm.png' /> $name</h2><p>$strout</p>"; ! ! } ! ! ! ! } else if('all' == $field) { ! ! // Then we would like a lot of documentation. ! ! // This needs to come after 'fact' ! ! ! ! $filename="{$stack_root}/lang/{$lang}/doc/$variable.php"; ! ! include($filename); ! ! ! ! } else { ! ! if ('stackQuestion' == $variable) { ! ! $q_field = $stackQuestion[$field]; ! ! $fn = 'stackQuestion_'.$field;} ! ! else if ('stackOptions' == $variable) { ! ! $q_field = $stackOptions[$field]; ! ! $fn = 'stackOptions_'.$field; } ! ! else if ('stackQuestionPotResp' == $variable) { ! ! $q_field = $stackQuestionPotResp[$field]; ! ! $fn = 'stackQuestion_PR_'.$field; } ! ! else if ('stackQuiz' == $variable) { ! ! $q_field = $stackQuiz[$field]; ! ! $fn = 'stackQuiz_'.$field; ! ! } ! ! ! ! $fd = get_string($fn,'stack',''); ! ! echo "<h3>$fd</h3>"; ! ! echo $q_field['doc']; ! ! echo "<p>"; ! ! ! ! echo "Name of field: <font color=orange><tt>$field</tt></font>. ! ! Type of field: <font color=orange><tt>{$q_field['type']}</tt></font>."; ! ! if (array_key_exists('required',$q_field)) { ! ! echo " Required: <font color=orange><tt>{$q_field['required']}</tt></font>."; ! ! } ! ! } ! ! ! ! ?> ! ! ! ! </body></html> ! |
From: pkiddie <pk...@us...> - 2005-08-23 16:42:08
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16623 Modified Files: Tag: development_xmlrqp stackstd.php.dist Log Message: Student documentation fixed in help_popup Admin first/surname fields added Documentation menus added Details tidied Index: stackstd.php.dist =================================================================== RCS file: /cvsroot/stack/stack-1-0/stackstd.php.dist,v retrieving revision 1.19.2.1 retrieving revision 1.19.2.2 diff -C2 -d -r1.19.2.1 -r1.19.2.2 *** stackstd.php.dist 1 Aug 2005 21:56:33 -0000 1.19.2.1 --- stackstd.php.dist 23 Aug 2005 16:41:58 -0000 1.19.2.2 *************** *** 63,66 **** --- 63,68 ---- $stack_stand_alone = TRUE; $stack_adminpswd = ''; + $stack_adminfirstname = ''; + $stack_adminsurname = ''; $stack_defaultlang = 'en'; // Use the two letter country codes. |
From: Chris S. <san...@us...> - 2005-08-23 15:55:16
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2667/scripts Modified Files: Tag: development_xmlrqp stackWin.php Log Message: Index: stackWin.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackWin.php,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** stackWin.php 19 Aug 2005 16:16:45 -0000 1.7.2.1 --- stackWin.php 23 Aug 2005 15:55:08 -0000 1.7.2.2 *************** *** 81,84 **** --- 81,85 ---- global $stack_root,$stack_logfiles,$stack_cas; + $debug = FALSE; $ret = FALSE; *************** *** 103,107 **** // read output from stdout $start_time = stack_microtime_float(); ! while (!feof($pipes[1])) { $out = fgets($pipes[1], 1024); if ('' == $out) { --- 104,110 ---- // read output from stdout $start_time = stack_microtime_float(); ! $continue = TRUE; ! if ($debug) { echo '<pre>'; }; ! while (!feof($pipes[1]) and $continue) { $out = fgets($pipes[1], 1024); if ('' == $out) { *************** *** 110,118 **** } $ret .= $out; ! //echo $out; $now = stack_microtime_float(); // if (($now-$start_time) > 0.3) { // // CTRL+C should be ASCII 3. // //fwrite($pipes[0], chr(3)); // fwrite($pipes[0], chr(27)."[13~"); // fflush($pipes[0]); --- 113,123 ---- } $ret .= $out; ! 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]); *************** *** 121,127 **** fclose($pipes[0]); fclose($pipes[1]); ! //$time_taken = $now-$start_time; ! //echo "Start: $start_time<br >End: $now<br >Taken = $time_taken"; ! } else { --- 126,134 ---- fclose($pipes[0]); fclose($pipes[1]); ! $time_taken = $now-$start_time; ! if ($debug) { ! echo "</pre>"; ! echo "Start: $start_time<br >End: $now<br >Taken = $time_taken"; ! }; } else { |
From: Chris S. <san...@us...> - 2005-08-23 15:55:16
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2667/scripts/maxima Modified Files: Tag: development_xmlrqp stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -C2 -d -r1.22.2.1 -r1.22.2.2 *** stackmaxima.mac 19 Aug 2005 16:16:45 -0000 1.22.2.1 --- stackmaxima.mac 23 Aug 2005 15:55:08 -0000 1.22.2.2 *************** *** 19,22 **** --- 19,24 ---- FPPREC:16; /* Work with 16 digits */ + ASSUME_POS:TRUE; + %E_TO_NUMLOG:TRUE; /* "r" some rational number, and "x" some expression, %E^(r*LOG(x)) => x^r .*/ |
From: pkiddie <pk...@us...> - 2005-08-23 11:48:30
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6251 Modified Files: Tag: development_xmlrqp editquiz.php import.php index.php Log Message: Put default_action back in import.php Took out redeclares of listmenu in import.php and editquiz.php Index: import.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/import.php,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** import.php 22 Aug 2005 17:20:18 -0000 1.1.2.7 --- import.php 23 Aug 2005 11:48:09 -0000 1.1.2.8 *************** *** 32,36 **** session_start(); - require_once("other/ListMenu.php"); include('stackstd.php'); --- 32,35 ---- *************** *** 41,49 **** require_once("{$stack_root}/scripts/stackAuthor.php"); ! //$default_action = 'import'; include('frontend_general/process_input.php'); - //include_once('frontend_general/edit_quiz_util.php'); - $PostTo = 'import.php'; $filter = ''; --- 40,46 ---- require_once("{$stack_root}/scripts/stackAuthor.php"); ! $default_action = 'import'; include('frontend_general/process_input.php'); $PostTo = 'import.php'; $filter = ''; Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.13.2.6 retrieving revision 1.13.2.7 diff -C2 -d -r1.13.2.6 -r1.13.2.7 *** editquiz.php 22 Aug 2005 17:20:18 -0000 1.13.2.6 --- editquiz.php 23 Aug 2005 11:48:09 -0000 1.13.2.7 *************** *** 33,38 **** */ session_start(); - - require_once("other/ListMenu.php"); require_once("stackstd.php"); --- 33,36 ---- Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23.2.4 retrieving revision 1.23.2.5 diff -C2 -d -r1.23.2.4 -r1.23.2.5 *** index.php 23 Aug 2005 10:18:08 -0000 1.23.2.4 --- index.php 23 Aug 2005 11:48:09 -0000 1.23.2.5 *************** *** 1,141 **** ! <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. ! * - Added logic to view installation instructions if stackstd.php not dectected ! * @package Stack ! */ ! ! ! /** ! * ! */ ! session_start(); ! ! /////////////////////////////////////////////////////////////// ! // (1) Process Input - this sets $action, $user and $username ! /////////////////////////////////////////////////////////////// ! ! if (file_exists('stackstd.php')) { ! include('stackstd.php'); ! } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions ! include('lang/en/doc/about_install.php'); ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); ! //1. Check that XML schemas are up to date ! if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) ! { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; ! } ! ! /////////////////////////////////////////////////////////////// ! // (2) Take any actions required ! /////////////////////////////////////////////////////////////// ! ! // Note that we need to unset the user before printing the header. ! if ('logout' == $action) { ! $user = NULL; ! session_unregister('user'); ! unset($_SESSION['user']); ! $_GET['expand'] = 0; ! } ! ! include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! ! ////////////////////////////////////////////////////////////// ! // (2) Print the page. ! ////////////////////////////////////////////////////////////// ! ! include('html/pagehead.php'); ! ! if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; ! } ! ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } ! } ! ! if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! echo $errors['user']; ! $action = 'loginscreen'; ! } ! ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! stack_user_update_info($user, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! case 'update_schema': ! stack_xml_update_schema("{$stack_root}/schemas/"); ! break; ! case 'update_db': ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! break; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! --- 1,141 ---- ! <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. ! * - Added logic to view installation instructions if stackstd.php not dectected ! * @package Stack ! */ ! ! ! /** ! * ! */ ! session_start(); ! ! /////////////////////////////////////////////////////////////// ! // (1) Process Input - this sets $action, $user and $username ! /////////////////////////////////////////////////////////////// ! ! if (file_exists('stackstd.php')) { ! include('stackstd.php'); ! } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions ! include('lang/en/doc/about_install.php'); ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); ! //1. Check that XML schemas are up to date ! if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) ! { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; ! } ! ! /////////////////////////////////////////////////////////////// ! // (2) Take any actions required ! /////////////////////////////////////////////////////////////// ! ! // Note that we need to unset the user before printing the header. ! if ('logout' == $action) { ! $user = NULL; ! session_unregister('user'); ! unset($_SESSION['user']); ! $_GET['expand'] = 0; ! } ! ! include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! ! ////////////////////////////////////////////////////////////// ! // (2) Print the page. ! ////////////////////////////////////////////////////////////// ! ! include('html/pagehead.php'); ! ! if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; ! } ! ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } ! } ! ! if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! echo $errors['user']; ! $action = 'loginscreen'; ! } ! ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! stack_user_update_info($user, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! case 'update_schema': ! stack_xml_update_schema("{$stack_root}/schemas/"); ! break; ! case 'update_db': ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! break; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! |
From: pkiddie <pk...@us...> - 2005-08-23 10:18:18
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383/scripts Modified Files: Tag: development_xmlrqp stackDatabase.php stackXML.php Log Message: Initialisation routines moved to index.php Removed notices about only variables being able to be passed by reference (known PHP bug) Some directory errors in locating stackstd.php Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.34.2.8 retrieving revision 1.34.2.9 diff -C2 -d -r1.34.2.8 -r1.34.2.9 *** stackDatabase.php 19 Aug 2005 19:49:31 -0000 1.34.2.8 --- stackDatabase.php 23 Aug 2005 10:18:08 -0000 1.34.2.9 *************** *** 1680,1694 **** $result = mysql_query($query); ! ! if(0 == $result) { ! include('install/stackUpdateDatabase.php'); ! die(); ! } } - /***** - * Check if updates are necessary - **/ - stack_db_database_update(); - ?> --- 1680,1690 ---- $result = mysql_query($query); ! ! if (0 == $result) { ! return false; ! } ! ! return true; } ?> Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.19 retrieving revision 1.13.2.20 diff -C2 -d -r1.13.2.19 -r1.13.2.20 *** stackXML.php 22 Aug 2005 17:20:18 -0000 1.13.2.19 --- stackXML.php 23 Aug 2005 10:18:08 -0000 1.13.2.20 *************** *** 5,14 **** * @package scripts * @subpackage Stack * <TODO> Echo's should be localised to current language */ require_once("{$stack_root}/other/domit/xml_domit_include.php"); ! //<PDK> sqlToSchemaMapping array maps basic SQL data types used in STAKCK to their respective XML schema data types $sqlToSchemaMapping['CHAR']='string'; $sqlToSchemaMapping['VARCHAR']='string'; --- 5,16 ---- * @package scripts * @subpackage Stack + * - '&'s required to maintain compatibility with PHP4 * <TODO> Echo's should be localised to current language */ + //Include the DOMIT XML library require_once("{$stack_root}/other/domit/xml_domit_include.php"); ! //sqlToSchemaMapping array maps basic SQL data types used in STACK to their respective XML schema data types $sqlToSchemaMapping['CHAR']='string'; $sqlToSchemaMapping['VARCHAR']='string'; *************** *** 97,102 **** global $stackQuestion, $stack_ver, $xmlNamespaces; ! $xmlDoc = new DOMIT_Document(); //Required for some method calls ! $questionFrag = new DOMIT_Element('assessmentItem'); //Construct main body of XML file --- 99,104 ---- global $stackQuestion, $stack_ver, $xmlNamespaces; ! $xmlDoc = &new DOMIT_Document(); //Required for some method calls ! $questionFrag = &new DOMIT_Element('assessmentItem'); //Construct main body of XML file *************** *** 296,300 **** function stack_xml_create_quiz_new($quiz) { ! $xmlDoc = new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); --- 298,302 ---- function stack_xml_create_quiz_new($quiz) { ! $xmlDoc = &new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); *************** *** 357,362 **** global $stackQuiz, $xmlNamespaces; ! $xmlDoc = new DOMIT_Document(); ! $quizFrag = new DOMIT_Element('mathQuiz'); //Iterate through each of the top level fields in the quiz --- 359,364 ---- global $stackQuiz, $xmlNamespaces; ! $xmlDoc = &new DOMIT_Document(); ! $quizFrag = &new DOMIT_Element('mathQuiz'); //Iterate through each of the top level fields in the quiz *************** *** 512,516 **** function stack_xml_create_question_list($questionList) { ! $xmlDoc = new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); --- 514,518 ---- function stack_xml_create_question_list($questionList) { ! $xmlDoc = &new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); *************** *** 564,570 **** function stack_xml_create_question_list_frag() { ! $xmlDoc = new DOMIT_Document(); ! ! $quListFrag = new DOMIT_Element('mathQuiz'); return $quListFrag; --- 566,571 ---- function stack_xml_create_question_list_frag() { ! $xmlDoc = &new DOMIT_Document(); ! $quListFrag = &new DOMIT_Element('mathQuiz'); return $quListFrag; *************** *** 597,605 **** //Now must give location of schema from which this instance has been derived from ! $schemaLocationAttr = new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".questionSchemaName; //Use 'define' above //Used to ensure latest schema version is used ! $schemaVersionAttr = new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; --- 598,606 ---- //Now must give location of schema from which this instance has been derived from ! $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".questionSchemaName; //Use 'define' above //Used to ensure latest schema version is used ! $schemaVersionAttr = &new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; *************** *** 635,643 **** //Now must give location of schema from which this instance has been derived from ! $schemaLocationAttr = new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".quizSchemaName; //Use 'define' above //Used to ensure latest schema version is used ! $schemaVersionAttr = new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; --- 636,644 ---- //Now must give location of schema from which this instance has been derived from ! $schemaLocationAttr = &new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); $schemaLocationAttr->nodeValue="{$stack_root}/schemas/".quizSchemaName; //Use 'define' above //Used to ensure latest schema version is used ! $schemaVersionAttr = &new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; *************** *** 1140,1144 **** $docElement = &$schemaXmlDoc->documentElement; ! $versionAttr = &$docElement->getAttribute('version'); if ($versionAttr==null) --- 1141,1145 ---- $docElement = &$schemaXmlDoc->documentElement; ! $versionAttr = $docElement->getAttribute('version'); if ($versionAttr==null) *************** *** 1223,1227 **** * @return DOMIT_Element $schemaElement The element containing the enclosing type */ ! function stack_xml_create_enclosing_schema_type($name,&$xmlElements,$headElement) { $schemaElement = &new DOMIT_Element('xs:element'); --- 1224,1228 ---- * @return DOMIT_Element $schemaElement The element containing the enclosing type */ ! function &stack_xml_create_enclosing_schema_type($name,&$xmlElements,$headElement) { $schemaElement = &new DOMIT_Element('xs:element'); *************** *** 1305,1309 **** $schema_file_name='stack_quiz-'.$stack_ver['release'].'.xsd'; ! $dom = new DOMIT_Document(); $dom->appendChild($dom->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); --- 1306,1310 ---- $schema_file_name='stack_quiz-'.$stack_ver['release'].'.xsd'; ! $dom = &new DOMIT_Document(); $dom->appendChild($dom->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); *************** *** 1335,1339 **** global $xmlElements, $stack_ver; ! $dom = new DOMIT_Document(); $dom->appendChild($dom->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); --- 1336,1340 ---- global $xmlElements, $stack_ver; ! $dom = &new DOMIT_Document(); $dom->appendChild($dom->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); *************** *** 1362,1369 **** * @return DOMIT_Element $schemaElem The main fragement of the XML schema containing types and vocabularies */ ! function stack_xml_create_question_schema_frag() ! { ! //include('stackstd.php'); //For writing out schema version: use stack version ! //Data structures that must be output in schema format global $stackQuestion, $stackOptions, $stackQuestionPotResp, $stack_ver, $sqlToSchemaMapping, $xmlElements, $namespaces; --- 1363,1368 ---- * @return DOMIT_Element $schemaElem The main fragement of the XML schema containing types and vocabularies */ ! function &stack_xml_create_question_schema_frag() ! { //Data structures that must be output in schema format global $stackQuestion, $stackOptions, $stackQuestionPotResp, $stack_ver, $sqlToSchemaMapping, $xmlElements, $namespaces; *************** *** 1376,1380 **** $types = array(); //Array of metadata types - dublincore, stack, lom etc. - // $xmlElements = array(); //A collection of elements which must be linked together via a 'root' element - in this case: AssessmentItem // Don't export questionID within metadata --- 1375,1378 ---- *************** *** 1980,1984 **** * @return DOMIT_Element $schemaSimpleType A SimpleType schema definition, which may be appended into the schema */ ! function stack_xml_create_schema_vocabulary($name,$values) { $schemaSimpleType = &new DOMIT_Element('xs:simpleType'); --- 1978,1982 ---- * @return DOMIT_Element $schemaSimpleType A SimpleType schema definition, which may be appended into the schema */ ! function &stack_xml_create_schema_vocabulary($name,$values) { $schemaSimpleType = &new DOMIT_Element('xs:simpleType'); *************** *** 2023,2032 **** * @return DOMIT_Element $schemaHeader The XML schema header, which may be appended onto the DOM Document root node */ ! function stack_xml_create_schema_header($namespacesArray) { global $stack_ver; //Retrieve current release of STACK //Contruct the header for the schema ! $schemaHeader = new DOMIT_Element('xs:schema'); //Root element <xs:schema foreach ($namespacesArray as $namespaceKey=>$namespace) //Iterate through each namespace and add to schema header --- 2021,2030 ---- * @return DOMIT_Element $schemaHeader The XML schema header, which may be appended onto the DOM Document root node */ ! function &stack_xml_create_schema_header($namespacesArray) { global $stack_ver; //Retrieve current release of STACK //Contruct the header for the schema ! $schemaHeader = &new DOMIT_Element('xs:schema'); //Root element <xs:schema foreach ($namespacesArray as $namespaceKey=>$namespace) //Iterate through each namespace and add to schema header *************** *** 2039,2043 **** //Used to ensure latest schema version is used ! $schemaVersionAttr = new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; $schemaHeader->setAttributeNode($schemaVersionAttr); --- 2037,2041 ---- //Used to ensure latest schema version is used ! $schemaVersionAttr = &new DOMIT_Attr('version'); $schemaVersionAttr->nodeValue=$stack_ver['release']; $schemaHeader->setAttributeNode($schemaVersionAttr); *************** *** 2060,2071 **** * @return DOMIT_Element $importNode The definition of an import schema node, which may be appended into the schema */ ! function stack_xml_create_schema_import($namespace) { ! $importNode = new DOMIT_Element('xs:import'); ! $importNSAttr = new DOMIT_Attr('namespace'); $importNSAttr->nodeValue=$namespace['namespace']; ! $importLocation = new DOMIT_Attr('schemaLocation'); $importLocation->nodeValue=$namespace['location']; --- 2058,2069 ---- * @return DOMIT_Element $importNode The definition of an import schema node, which may be appended into the schema */ ! function &stack_xml_create_schema_import($namespace) { ! $importNode = &new DOMIT_Element('xs:import'); ! $importNSAttr = &new DOMIT_Attr('namespace'); $importNSAttr->nodeValue=$namespace['namespace']; ! $importLocation = &new DOMIT_Attr('schemaLocation'); $importLocation->nodeValue=$namespace['location']; *************** *** 2087,2091 **** * @return DOMIT_Element $schemaField The schema field. */ ! function stack_xml_create_schema_field($name, $isSqlType, $dataType='TEXT', $minOccurs=0,$maxOccurs=1) { global $sqlToSchemaMapping; //Mapping array required for conversion of SQL->Schema datatype --- 2085,2089 ---- * @return DOMIT_Element $schemaField The schema field. */ ! function &stack_xml_create_schema_field($name, $isSqlType, $dataType='TEXT', $minOccurs=0,$maxOccurs=1) { global $sqlToSchemaMapping; //Mapping array required for conversion of SQL->Schema datatype *************** *** 2152,2156 **** * @return DOMIT_Element $schemaField The schema field. */ ! function stack_xml_create_root_schema_field($name, $isSqlType, $dataType='TEXT', $minOccurs=0,$maxOccurs=1) { global $sqlToSchemaMapping; //Mapping array required for conversion of SQL->Schema datatype --- 2150,2154 ---- * @return DOMIT_Element $schemaField The schema field. */ ! function &stack_xml_create_root_schema_field($name, $isSqlType, $dataType='TEXT', $minOccurs=0,$maxOccurs=1) { global $sqlToSchemaMapping; //Mapping array required for conversion of SQL->Schema datatype *************** *** 2206,2210 **** * @return DOMIT_Element $schemaField The schema field. */ ! function stack_xml_create_schema_field_ns($fieldName, $namespaceId, $minOccurs=0, $maxOccurs=1) { //Return an xml element which can be appended, that is from another namespace --- 2204,2208 ---- * @return DOMIT_Element $schemaField The schema field. */ ! function &stack_xml_create_schema_field_ns($fieldName, $namespaceId, $minOccurs=0, $maxOccurs=1) { //Return an xml element which can be appended, that is from another namespace *************** *** 2269,2273 **** * @return $schemaComplexType The complex type schema definition of a 'keyval' PHP type */ ! function stack_xml_create_field_order() { $schemaFieldOrder = &new DOMIT_Element('xs:attribute'); --- 2267,2271 ---- * @return $schemaComplexType The complex type schema definition of a 'keyval' PHP type */ ! function &stack_xml_create_field_order() { $schemaFieldOrder = &new DOMIT_Element('xs:attribute'); *************** *** 2308,2312 **** * @return $schemaComplexType The complex type schema definition of a 'keyval' PHP type */ ! function stack_xml_create_schema_keyval_type() { $schemaComplexType = &new DOMIT_Element('xs:complexType'); --- 2306,2310 ---- * @return $schemaComplexType The complex type schema definition of a 'keyval' PHP type */ ! function &stack_xml_create_schema_keyval_type() { $schemaComplexType = &new DOMIT_Element('xs:complexType'); *************** *** 2363,2367 **** * @return $schemaVersionElement The version element */ ! function stack_xml_create_schema_version() { $schemaVersionElement = &new DOMIT_Element('xs:attribute'); --- 2361,2365 ---- * @return $schemaVersionElement The version element */ ! function &stack_xml_create_schema_version() { $schemaVersionElement = &new DOMIT_Element('xs:attribute'); |
From: pkiddie <pk...@us...> - 2005-08-23 10:18:17
|
Update of /cvsroot/stack/stack-1-0/scripts/rqp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383/scripts/rqp Modified Files: Tag: development_xmlrqp stackDetails.php Log Message: Initialisation routines moved to index.php Removed notices about only variables being able to be passed by reference (known PHP bug) Some directory errors in locating stackstd.php Index: stackDetails.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/Attic/stackDetails.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** stackDetails.php 19 Aug 2005 09:04:57 -0000 1.1.2.1 --- stackDetails.php 23 Aug 2005 10:18:08 -0000 1.1.2.2 *************** *** 6,12 **** require('../../stackstd.php'); echo 'Properties of the current STACK server<br><br>'; echo 'Current STACK version: '.$stack_ver['release'].'<br>'; ! echo 'Administrator:'.'Admin User<br>'; echo 'Administrators e-mail: <a href="mailto:'.$stack_mail['admin_email'].'">'.$stack_mail['admin_email'].'</a><br>'; ?> --- 6,18 ---- require('../../stackstd.php'); + include("{$stack_root}/html/pagehead.php"); + + //print_r($user); + echo 'Properties of the current STACK server<br><br>'; echo 'Current STACK version: '.$stack_ver['release'].'<br>'; ! echo 'Administrator:'.'Admin User (not currently in stackstd.php)<br>'; echo 'Administrators e-mail: <a href="mailto:'.$stack_mail['admin_email'].'">'.$stack_mail['admin_email'].'</a><br>'; + + include("{$stack_root}/html/pagefoot.php"); ?> |
From: pkiddie <pk...@us...> - 2005-08-23 10:18:17
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383/html Modified Files: Tag: development_xmlrqp pagehead.php Log Message: Initialisation routines moved to index.php Removed notices about only variables being able to be passed by reference (known PHP bug) Some directory errors in locating stackstd.php Index: pagehead.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/pagehead.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** pagehead.php 25 Jul 2005 11:24:07 -0000 1.11 --- pagehead.php 23 Aug 2005 10:18:08 -0000 1.11.2.1 *************** *** 1,66 **** ! <?php ! /** ! * ! * STACK standard page header. ! * ! * @package frontend ! * @subpackage Stack ! */ ! ! /** ! * ! */ ! ?> ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ! <html> ! <head> ! <title>STACK - System for Teaching and Assessment using a Computer algebra Kernel</title> ! <link rel="shortcut icon" href="pics/logo_sm.gif" /> ! <style type="text/css"> ! @import url(html/stack.css); ! </style> ! </head> ! <body> ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! <tr align="left" valign="top"> ! <td colspan="2" id="header"> ! <table width="95%" border="0" cellpadding="0" cellspacing="5"> ! <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 ! echo '<br /><font size=-3>'; ! if ($user['loggedin']) { ! echo "<p>Logged in as<br />{$user['username']}.</p>"; ! } else { ! echo "<p>Not logged in.</p>"; ! } ! echo "</font>\n"; ! ?> ! </tr></table> ! </td></tr> ! <tr align="left" valign="top"> ! <td nowrap width="10%" id="navigation"> ! <?php ! require_once("other/ListMenu.php"); ! $username = nsf($user,'username'); ! if ('' !=$stack_basepath) { ! $menupath = '/'.$stack_basepath.'/'; ! } else { ! $menupath = '/'; ! } ! if ('admin' == $username) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); ! } else if ($user['loggedin']) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); ! } else { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! } ! ! $menu->printMenu(); ! ! ?> ! </td> ! ! <td width="90%" id="content"> --- 1,140 ---- ! <?php ! ! /** ! ! * ! ! * STACK standard page header. ! ! * ! ! * @package frontend ! ! * @subpackage Stack ! ! */ ! ! ! ! /** ! ! * ! ! */ ! ! ?> ! ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ! ! <html> ! ! <head> ! ! <title>STACK - System for Teaching and Assessment using a Computer algebra Kernel</title> ! ! <link rel="shortcut icon" href="pics/logo_sm.gif" /> ! ! <style type="text/css"> ! ! @import url(html/stack.css); ! ! </style> ! ! </head> ! ! <body> ! ! <table width="100%" border="0" cellpadding="0" cellspacing="0"> ! ! <tr align="left" valign="top"> ! ! <td colspan="2" id="header"> ! ! <table width="95%" border="0" cellpadding="0" cellspacing="5"> ! ! <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 ! ! echo '<br /><font size=-3>'; ! ! if (isset($user['loggedin']) && ($user['loggedin'])) { ! ! echo "<p>Logged in as<br />{$user['username']}.</p>"; ! ! } else { ! ! echo "<p>Not logged in.</p>"; ! ! } ! ! echo "</font>\n"; ! ! ?> ! ! </tr></table> ! ! </td></tr> ! ! <tr align="left" valign="top"> ! ! <td nowrap width="10%" id="navigation"> ! ! <?php ! ! require_once("{$stack_root}/other/ListMenu.php"); ! ! $username = @nsf($user,'username'); ! ! if ('' !=$stack_basepath) { ! ! $menupath = '/'.$stack_basepath.'/'; ! ! } else { ! ! $menupath = '/'; ! ! } ! ! if (!empty($username)) ! { ! if ('admin' == $username) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); ! ! } else if ($user['loggedin']) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); ! ! } else { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! ! } ! } ! ! else ! { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! } ! ! ! ! $menu->printMenu(); ! ! ! ! ?> ! ! </td> ! ! ! ! <td width="90%" id="content"> ! |
From: pkiddie <pk...@us...> - 2005-08-23 10:18:16
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383/scripts/install Modified Files: Tag: development_xmlrqp stackUpdateDatabase.php Log Message: Initialisation routines moved to index.php Removed notices about only variables being able to be passed by reference (known PHP bug) Some directory errors in locating stackstd.php Index: stackUpdateDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackUpdateDatabase.php,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -C2 -d -r1.3.2.4 -r1.3.2.5 *** stackUpdateDatabase.php 22 Aug 2005 17:20:18 -0000 1.3.2.4 --- stackUpdateDatabase.php 23 Aug 2005 10:18:08 -0000 1.3.2.5 *************** *** 8,12 **** //<PDK>fresh installation fails to load stackstd, solved in new version ! require_once('../../stackstd.php'); /** This PHP script simply adds new fields to STACK database for question and quiz metadata, --- 8,12 ---- //<PDK>fresh installation fails to load stackstd, solved in new version ! require_once("{$stack_root}/stackstd.php"); /** This PHP script simply adds new fields to STACK database for question and quiz metadata, |
From: pkiddie <pk...@us...> - 2005-08-23 10:18:16
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20383 Modified Files: Tag: development_xmlrqp index.php Log Message: Initialisation routines moved to index.php Removed notices about only variables being able to be passed by reference (known PHP bug) Some directory errors in locating stackstd.php Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23.2.3 retrieving revision 1.23.2.4 diff -C2 -d -r1.23.2.3 -r1.23.2.4 *** index.php 22 Aug 2005 17:20:18 -0000 1.23.2.3 --- index.php 23 Aug 2005 10:18:08 -0000 1.23.2.4 *************** *** 39,44 **** include('stackstd.php'); } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions include('lang/en/doc/about_install.php'); --- 39,43 ---- include('stackstd.php'); } else { ! //echo "STACK is not correctly installed."; //View the installation instructions include('lang/en/doc/about_install.php'); *************** *** 51,59 **** //Initialisation ! include_once('/scripts/stackXML.php'); //1. Check that XML schemas are up to date if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) { ! stack_xml_update_schema("{$stack_root}/schemas/"); } --- 50,65 ---- //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); //1. Check that XML schemas are up to date if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; } *************** *** 122,125 **** --- 128,137 ---- stack_quiz_student_select($quiz_store, $user); break; + case 'update_schema': + stack_xml_update_schema("{$stack_root}/schemas/"); + break; + case 'update_db': + include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); + break; } |
From: pkiddie <pk...@us...> - 2005-08-22 17:20:37
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3139/frontend_general Modified Files: Tag: development_xmlrqp qb_display.php Log Message: Code comments added Schema version checking added to index.php Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/qb_display.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** qb_display.php 14 Jul 2005 18:44:54 -0000 1.5 --- qb_display.php 22 Aug 2005 17:20:18 -0000 1.5.2.1 *************** *** 1,155 **** ! <?php ! ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * This file contains display functions used by question_bank.php ! * ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * @package frontend ! * @subpackage Stack ! * ! */ ! ! /** ! * Displays the main question bank page ! * @param bool $admin TRUE if the user is the admin user, FALSE otherwise ! * @param array $question_bank_filter The question bank filter ! * @return void ! */ ! function stack_display_qb_main($admin, $question_bank_filter) { ! global $stack_root; ! $options = ''; ! include("{$stack_root}/html/qselectform.php"); ! ! if ($admin) { ! stack_db_listquestions('edit',$question_bank_filter); ! } else { ! stack_db_listquestions('try',$question_bank_filter); ! } ! ! echo "<p><a href=\"javascript:SelectQs('export_xml_list');\">Export selected as XML</a> "; ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! } ! ! ! /** ! * Displays the form for editting a question ! * @param array $question The question to edit ! * @param array $errors The question bank filter ! * @return void ! */ ! function stack_display_qb_edit($question, $errors) { ! global $stack_root; ! include_once("{$stack_root}/scripts/stackAuthor.php"); ! include("{$stack_root}/html/qselectform.php"); ! stack_question_edit_form($question,$errors); ! ! echo "<p><a href=\"javascript:HelpPopup('all','author_questionfields');\">Help with question fields.</a>\n ! <a href=\"javascript:HelpPopup('all','author_options');\">Help with options.</a>\n ! <a href=\"javascript:HelpPopup('all','author_answertest');\">Help with answer tests.</a>\n ! <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; ! } ! ! ! /** ! * Displays the edit metadate form ! * @param array $question_bank_filter The question bank filter to apply ! * @return void ! */ ! function stack_display_qb_edit_metadata($question_bank_filter) { ! global $stack_root; ! include("{$stack_root}/html/qselectform.php"); ! ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! } ! ! ! /** ! * Displays the form for importing a file ! * @return void ! */ ! function stack_display_qb_import($errors) { ! echo nsf($errors,'import'); ! echo "Select a file to upload and edit: ! <br /> ! <form enctype='multipart/form-data' action=\"question_bank.php\"' method='POST'><br />\n ! <input type ='file' name='xmlfile' />\n ! <input type ='hidden' name='action' value='uploaded_xml' /> ! <input type ='submit' name='go' value='Upload'> ! </form>\n\n"; ! } ! ! /** ! * Displays the imported questions ! * @param array $quiz The imported quiz ! * @return void ! */ ! function stack_display_qb_show_imported($quiz) { ! ! echo "<h2>Details of questions uploaded</h2>"; ! echo '<table><thead><tr>'; ! echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; ! echo '</tr></thead><tbody>'; ! ! $errs = NULL; ! ! foreach ($quiz as $key => $qu) { ! ! stack_question_validate($quiz[$key],$errs[$key]); ! $qu['questionID'] = stack_db_question_add($qu); ! echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; ! $errc = FALSE; ! if (nsf($errs,$key)) { ! if (is_array($errs[$key])) { ! $errc = TRUE; ! } ! } ! if ($errc) { ! echo "<td><font color=\"red\">Invalid question</font></td>"; ! echo "</tr></tbody></table>\n\n"; ! echo stack_question_errstr($errs[$key]); ! echo "\n\n<table><thead><tr>"; ! echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; ! echo '</tr></thead><tbody>'; ! } else { ! echo "<td><font color=\"greed\">Valid question</font></td>"; ! } ! echo "</tr>\n"; ! } ! ! echo "</tbody></table>\n"; ! echo "<h2>Current database of questions</h2>"; ! } ! ! ! /** ! * Displays the preview of a question ! * @return void ! */ ! function stack_display_qb_preview($questionInst) { ! echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> ! <td align='left'> ! ! <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); ! echo ")</td><td align='right'>"; ! echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; ! } ! ! ?> --- 1,192 ---- ! <?php ! ! ! ! /** ! ! * ! ! * Welcome to STACK. A system for teaching and assessment using a ! ! * computer algebra kernel. ! ! * <br> ! ! * This file is licensed under the GPL License. ! ! * <br> ! ! * A copy of the license is in your STACK distribution called ! ! * license.txt. If you are missing this file you can obtain ! ! * it from: ! ! * http://www.stack.bham.ac.uk/license.txt ! ! * <br> ! ! * Copyright (c) 2005, Christopher James Sangwin ! ! * ! ! * This file contains display functions used by question_bank.php ! ! * - Removed import references - now factored out to import.php ! ! * ! ! * ! ! * @author Chris Sangwin C.J...@bh... ! ! * @author Laura Naismith L.N...@bh... ! ! * @author Juliette White jv...@jv... ! ! * ! ! * @package frontend ! ! * @subpackage Stack ! ! * ! ! */ ! ! ! ! /** ! ! * Displays the main question bank page ! ! * @param bool $admin TRUE if the user is the admin user, FALSE otherwise ! ! * @param array $question_bank_filter The question bank filter ! ! * @return void ! ! */ ! ! function stack_display_qb_main($admin, $question_bank_filter) { ! ! global $stack_root; ! ! $options = ''; ! ! include("{$stack_root}/html/qselectform.php"); ! ! ! ! if ($admin) { ! ! stack_db_listquestions('edit',$question_bank_filter); ! ! } else { ! ! stack_db_listquestions('try',$question_bank_filter); ! ! } ! ! ! ! echo "<p><a href=\"javascript:SelectQs('export_xml_list');\">Export selected as XML</a> "; ! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! ! } ! ! ! ! ! ! /** ! ! * Displays the form for editting a question ! ! * @param array $question The question to edit ! ! * @param array $errors The question bank filter ! ! * @return void ! ! */ ! ! function stack_display_qb_edit($question, $errors) { ! ! global $stack_root; ! ! include_once("{$stack_root}/scripts/stackAuthor.php"); ! ! include("{$stack_root}/html/qselectform.php"); ! ! stack_question_edit_form($question,$errors); ! ! ! ! echo "<p><a href=\"javascript:HelpPopup('all','author_questionfields');\">Help with question fields.</a>\n ! ! <a href=\"javascript:HelpPopup('all','author_options');\">Help with options.</a>\n ! ! <a href=\"javascript:HelpPopup('all','author_answertest');\">Help with answer tests.</a>\n ! ! <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; ! ! } ! ! ! ! ! ! /** ! ! * Displays the edit metadate form ! ! * @param array $question_bank_filter The question bank filter to apply ! ! * @return void ! ! */ ! ! function stack_display_qb_edit_metadata($question_bank_filter) { ! ! global $stack_root; ! ! include("{$stack_root}/html/qselectform.php"); ! ! ! ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! ! } ! ! /** ! ! * Displays the preview of a question ! ! * @return void ! ! */ ! ! function stack_display_qb_preview($questionInst) { ! ! echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> ! ! <td align='left'> ! ! ! ! <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); ! ! echo ")</td><td align='right'>"; ! ! echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; ! ! } ! ! ! ! ?> ! |
From: pkiddie <pk...@us...> - 2005-08-22 17:20:37
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3139 Modified Files: Tag: development_xmlrqp editquiz.php import.php index.php question_bank.php Log Message: Code comments added Schema version checking added to index.php Index: import.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/import.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** import.php 19 Aug 2005 14:05:14 -0000 1.1.2.6 --- import.php 22 Aug 2005 17:20:18 -0000 1.1.2.7 *************** *** 1,122 **** <?php ! ! ! /** Provides the front end interactions for the import functionality, and then returns the user to the correct page, i.e. if they ! ! are uploading a question,quiz or list of questions ! ! */ ! ! session_start(); - require_once("other/ListMenu.php"); - include('stackstd.php'); - - require_once("{$stack_root}/html/trypopupform.html"); - require_once("{$stack_root}/frontend_general/editquiz_display.php"); - require_once("{$stack_root}/html/helpform.php"); - require_once("{$stack_root}/html/quizjava.html"); - require_once("{$stack_root}/scripts/stackAuthor.php"); ! ! ! ! ! /////////////////////////////////////////////////////////////// ! ! // (1) Process Input - this sets $action, $user and $username ! ! /////////////////////////////////////////////////////////////// ! ! $default_action = 'import'; ! include('frontend_general/process_input.php'); - - //include_once('frontend_general/edit_quiz_util.php'); $PostTo = 'import.php'; - $filter = ''; - $quizid = NULL; - - include('html/pagehead.php'); ! ! ! if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { ! stack_display_editquiz_error_not_admin($user); - include('html/pagefoot.php'); - die(); - } ! $upload_successful = FALSE; ! $errors = ''; ! if ($action == 'uploaded_xml') { ! if (array_key_exists('xmlfile',$_FILES)) { ! if (is_uploaded_file($_FILES['xmlfile']['tmp_name'])) { ! if (findtype($_FILES['xmlfile']['name'])=='xml') { //Only allow the uploading of XML files ! include_once("{$stack_root}/scripts/stackXML.php"); ! $imported = stack_xml_parse_file($_FILES['xmlfile']['tmp_name'],$errors); //Returns an array version of imported XML ! ! //Incorrect XML file input, no [mathQuiz] or [assessmentItem] head element ! if (!$imported) { ! $upload_successful = FALSE; ! echo("<font color=\"red\">The XML file uploaded is not a question, question list or quiz</font><br />"); ! echo("<b>Further information: $errors</b><br /><br />"); ! } ! else { ! $upload_successful = TRUE; ! } ! } ! ! else ! { ! echo("<font color=\"red\">The selected file is not an XML file</font><br /><br />"); ! } ! } ! else { ! echo("<font color=\"red\">You have not selected an XML file to upload</font><br /><br />"); } - } } ! ! switch ($action) { ! case 'uploaded_xml': ! if ($upload_successful) { ! stack_display_parse_imported($imported); ! break; ! } ! ! else { ! $action='import'; ! } ! ! case 'import': ! stack_display_import($errors); ! break; } /** ! * This function returns the file extension of the file uploaded. * * @param string $file The filename of the file uploaded --- 1,113 ---- <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * Provides the front end interactions for the import functionality, and then returns the user to the ! * correct page, i.e. if they are uploading a question,quiz or list of questions ! * <TODO> Returning the user to the correct page ! * <TODO> Errors should be placed into 'localised' documentation ! * <TODO> Is this right quiz GUID behaviour? ! * <TODO> Error errc and errs behaviour ! * <TODO> Quiz validation always returns true - stub function stack_quiz_validate ! * ! * @package frontend ! * @subpackage Stack ! */ session_start(); require_once("other/ListMenu.php"); include('stackstd.php'); require_once("{$stack_root}/html/trypopupform.html"); require_once("{$stack_root}/frontend_general/editquiz_display.php"); require_once("{$stack_root}/html/helpform.php"); require_once("{$stack_root}/html/quizjava.html"); require_once("{$stack_root}/scripts/stackAuthor.php"); ! //$default_action = 'import'; include('frontend_general/process_input.php'); //include_once('frontend_general/edit_quiz_util.php'); $PostTo = 'import.php'; $filter = ''; $quizid = NULL; include('html/pagehead.php'); ! if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { //Only allow import where logged in user is admin stack_display_editquiz_error_not_admin($user); include('html/pagefoot.php'); die(); } ! $upload_successful = FALSE; ! $errors = ''; ! if ($action == 'uploaded_xml') { ! if (array_key_exists('xmlfile',$_FILES)) { ! if (is_uploaded_file($_FILES['xmlfile']['tmp_name'])) { //Check a file has actually been uploaded ! if (findtype($_FILES['xmlfile']['name'])=='xml') { //Only allow the uploading of files with 'xml' extension ! include_once("{$stack_root}/scripts/stackXML.php"); ! $imported = stack_xml_parse_file($_FILES['xmlfile']['tmp_name'],$errors); //Returns an array corresponding to imported XML ! ! //Incorrect XML file input, no [mathQuiz] or [assessmentItem] head element ! if (!$imported) { ! $upload_successful = FALSE; ! echo("<font color=\"red\">The XML file uploaded is not a question, question list or quiz</font><br />"); ! echo("<b>Further information: $errors</b><br /><br />"); ! } ! ! //Import is an array of values ! else { ! $upload_successful = TRUE; ! } ! } ! else { //extension is not XML ! echo("<font color=\"red\">The selected file is not an XML file</font><br /><br />"); } } ! ! else { //no file selected to upload ! echo("<font color=\"red\">You have not selected an XML file to upload</font><br /><br />"); ! } } + } + + //Provides front-end logic depending on POST variable '$action' + switch ($action) { + case 'uploaded_xml': + if ($upload_successful) { + stack_display_parse_imported($imported); + break; + } + + else { //!upload_successful + $action='import'; + } + + case 'import': //initial import page + stack_display_import(); + break; + } /** ! * Returns the extension of the uploaded file * * @param string $file The filename of the file uploaded *************** *** 132,206 **** /** - * Displays the form for importing a file ! * @return void - */ ! ! function stack_display_import($errors) { ! ! echo nsf($errors,'import'); echo "Select an XML file to upload and edit: - <br /> - <form enctype='multipart/form-data' action=\"import.php\"' method='POST'><br />\n - <input type ='file' name='xmlfile' />\n - <input type ='hidden' name='action' value='uploaded_xml' /> - <input type ='submit' name='go' value='Upload'> - </form>\n\n"; } - - /** ! ! * Displays the imported questions ! ! * @param array $quiz The imported quiz ! * @return void - */ - function stack_display_parse_imported($imported) { global $stackQuiz; - //show_array($imported); ! //First decide what has been imported ! //If it is a quiz/list of questions ! if (array_key_exists('mathQuiz',$imported)) { $quiz = $imported['mathQuiz']; - $isQuiz=false; ! //Now check for quiz level components, like a GUID foreach($stackQuiz as $arrayKey=>$quizField) { ! //show_array($arrayKey); ! //show_array($imported); ! if (array_key_exists($arrayKey,$quiz)) { - //print_r("true"); $isQuiz = true; ! break; } } ! //At this point we are ready to decide if its a quiz or list of questions if ($isQuiz) { stack_display_show_imported_quiz($quiz); } ! else { ! //No quiz level metadata/options, thus is a list of questions $quiz=$imported['mathQuiz']['assessmentItem']; stack_display_show_imported_qulist($quiz); --- 123,178 ---- /** * Displays the form for importing a file ! * * @return void */ ! function stack_display_import() { echo "Select an XML file to upload and edit: <br /> <form enctype='multipart/form-data' action=\"import.php\"' method='POST'><br />\n <input type ='file' name='xmlfile' />\n <input type ='hidden' name='action' value='uploaded_xml' /> <input type ='submit' name='go' value='Upload'> </form>\n\n"; } /** ! * Parses the head element in order to detect what has just been uploaded - a quiz, question, or list of questions. ! * A quiz will have <mathQuiz> element and mathQuiz level metadata and options ! * A list of questions will have a <mathQuiz> element without mathQuiz level metadata and options ! * A question will have an <assessmentItem> element. ! * ! * @param array $imported The imported XML file in array format * @return void */ function stack_display_parse_imported($imported) { global $stackQuiz; ! //1. Decide what has been imported ! if (array_key_exists('mathQuiz',$imported)) //If it is a quiz/list of questions { $quiz = $imported['mathQuiz']; $isQuiz=false; ! ! //Check for quiz level components, like a GUID foreach($stackQuiz as $arrayKey=>$quizField) { ! if (array_key_exists($arrayKey,$quiz)) //If one quiz level metadata element exists, then it must be a quiz { $isQuiz = true; ! break; //no need to keep iterating } } ! //We are ready to decide if its a quiz or list of questions if ($isQuiz) { stack_display_show_imported_quiz($quiz); } ! else //!isQuiz { ! //List of questions $quiz=$imported['mathQuiz']['assessmentItem']; stack_display_show_imported_qulist($quiz); *************** *** 208,226 **** } ! //Just double check it is a question ! else if (array_key_exists('assessmentItem',$imported)) { $question = $imported['assessmentItem']; - stack_display_show_imported_question($question); } ! else ! { ! echo("No valid data could be read from this file"); } - } function stack_display_show_imported_quiz($quiz) { --- 180,204 ---- } ! else if (array_key_exists('assessmentItem',$imported)) //A single question { $question = $imported['assessmentItem']; stack_display_show_imported_question($question); } ! else //If neither <mathQuiz> or <assessmentItem> is head element ! { //do not continue to parse array ! echo("<font color=\"red\">The XML file uploaded is not a question, question list or quiz</font><br />"); ! echo("<b>Further information: $errors</b><br /><br />"); ! $action='import'; } } + /** + * Performs the actual import of a quiz file into STACK, and provided the front-end interaction + * to show a successful/unsuccessful import + * + * @param array $quiz A mathQuiz array + * @return void + */ function stack_display_show_imported_quiz($quiz) { *************** *** 232,241 **** echo '</tr></thead><tbody>'; - //Validate quiz $errs = NULL; $errc = FALSE; ! stack_quiz_validate($quiz,$errs); ! stack_xml_reinstate_quiz_meta_defaults($quiz); //Reinstate any default (empty) metadata fields /*if (nsf($errs,$key)) { --- 210,218 ---- echo '</tr></thead><tbody>'; $errs = NULL; $errc = FALSE; ! stack_quiz_validate($quiz,$errs); // Validate quiz (TODO) ! stack_xml_reinstate_quiz_meta_defaults($quiz); // Reinstate any default (empty) metadata fields /*if (nsf($errs,$key)) { *************** *** 245,257 **** }*/ ! //Add quiz to database, retrieve its new quizID, to add each question to the quiz ! //Each quiz should have a unique ID, so will generate a new one here if (array_key_exists('quizGUID',$quiz)) { $quiz['quizGUID']=stack_generate_guid($stack_web_url) ; } ! $quiz['quizid'] = stack_db_quiz_update($quiz); //retrieve the quiz id to add questions to that quiz ! //Show quiz details on screen screen echo "<tr>\n <td>".sf($quiz,'quizid')."</td> <td>".sf($quiz,'quizName')." </td> <td>".sf($quiz,'quizDescription')." </td> <td>".sf($quiz,'quizKeywords')." </td>"; --- 222,234 ---- }*/ ! //Each imported quiz should have a unique GUID; generate a new one here if (array_key_exists('quizGUID',$quiz)) { $quiz['quizGUID']=stack_generate_guid($stack_web_url) ; } ! //Add quiz to database & retrieve its new quizID to add question to respective quiz ! $quiz['quizid'] = stack_db_quiz_update($quiz); ! //Show quiz details on screen echo "<tr>\n <td>".sf($quiz,'quizid')."</td> <td>".sf($quiz,'quizName')." </td> <td>".sf($quiz,'quizDescription')." </td> <td>".sf($quiz,'quizKeywords')." </td>"; *************** *** 272,276 **** echo "</tbody></table>\n"; //end of quiz table ! echo "<h2>Details of questions uploaded</h2>"; echo '<table><thead><tr>'; echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; --- 249,253 ---- echo "</tbody></table>\n"; //end of quiz table ! echo "<h2>Details of questions uploaded</h2>"; //Start of questions within quiz table echo '<table><thead><tr>'; echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; *************** *** 279,288 **** $errs = NULL; ! $quizQuestions = $quiz['assessmentItem']; //now point to assessment items only ! foreach ($quizQuestions as $key => $qu) { stack_question_validate($quizQuestions[$key],$errs[$key]); ! stack_xml_reinstate_question_meta_defaults($qu); //Reinstate any missing metadata in order to all fields to database ! $qu['questionID'] = stack_db_question_add($qu); echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; $errc = FALSE; --- 256,265 ---- $errs = NULL; ! $quizQuestions = $quiz['assessmentItem']; //Point to assessmentItems only ! foreach ($quizQuestions as $key => $qu) { //Iterate through each question stack_question_validate($quizQuestions[$key],$errs[$key]); ! stack_xml_reinstate_question_meta_defaults($qu); //Reinstate any missing question metadata ! $qu['questionID'] = stack_db_question_add($qu); //Add question to db, and retrieve its new ID echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; $errc = FALSE; *************** *** 305,314 **** //For each valid question we must also add the question to the database ! stack_db_quiz_add_question($quiz['quizid'],$qu['questionID']); } echo "</tr>\n"; } ! echo "</tbody></table>\n"; //<TODO: Chris to implement these links> --- 282,291 ---- //For each valid question we must also add the question to the database ! stack_db_quiz_add_question($quiz['quizid'],$qu['questionID']); //For each question, add link from quiz to question } echo "</tr>\n"; } ! echo "</tbody></table>\n"; //end of question table //<TODO: Chris to implement these links> *************** *** 317,320 **** --- 294,304 ---- } + /** + * Performs the actual import of a question list file into STACK, and provide the front-end interaction + * to show a successful/unsuccessful import + * + * @param array $quiz A mathQuiz array + * @return void + */ function stack_display_show_imported_qulist($quiz) { *************** *** 326,330 **** $errs = NULL; ! foreach ($quiz as $key => $qu) { stack_question_validate($quiz[$key],$errs[$key]); --- 310,314 ---- $errs = NULL; ! foreach ($quiz as $key => $qu) { //Iterate through each question stack_question_validate($quiz[$key],$errs[$key]); *************** *** 359,362 **** --- 343,353 ---- } + /** + * Performs the actual import of a question file into STACK, and provide the front-end interaction + * to show a successful/unsuccessful import + * + * @param array $quiz A mathQuiz array + * @return void + */ function stack_display_show_imported_question($question) { *************** *** 368,372 **** echo '</tr></thead><tbody>'; - //show_array($question); stack_question_validate($question,$errs); stack_xml_reinstate_question_meta_defaults($question); //Reinstate any missing metadata in order to all fields to database --- 359,362 ---- *************** *** 396,403 **** echo "<p><a href=\"javascript:void(0);\">Edit imported question</a> "; echo "<p><a href=\"javascript:void(0);\">View list of questions</a> "; - } - - ?> --- 386,390 ---- Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.13.2.5 retrieving revision 1.13.2.6 diff -C2 -d -r1.13.2.5 -r1.13.2.6 *** editquiz.php 19 Aug 2005 19:49:31 -0000 1.13.2.5 --- editquiz.php 22 Aug 2005 17:20:18 -0000 1.13.2.6 *************** *** 23,26 **** --- 23,28 ---- * algorithms- ideally we should have a function for each action on entry and * for display. + * - Automatically generated quiz metadata added + * <TODO> 'Export XML' link when editing quiz * @package frontend * @subpackage Stack *************** *** 99,104 **** if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { - //show_array($_POST); - //How do we preserve hidden metadata in the quiz?? $quiz_source = 'post'; $quiz = stack_get_quiz('post', $quizid); --- 101,104 ---- *************** *** 145,149 **** if ('quiz_new' == $action) { $quiz['quizid'] = $quizid; ! //<TODO> Automatically generated quiz metadata $quiz['quizGUID'] = stack_generate_guid($stack_web_url); $quiz['quizFormat'] = 'text/xml; charset="utf-8"'; --- 145,150 ---- if ('quiz_new' == $action) { $quiz['quizid'] = $quizid; ! ! //Automatically generated quiz metadata added $quiz['quizGUID'] = stack_generate_guid($stack_web_url); $quiz['quizFormat'] = 'text/xml; charset="utf-8"'; Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.8.2.9 retrieving revision 1.8.2.10 diff -C2 -d -r1.8.2.9 -r1.8.2.10 *** question_bank.php 19 Aug 2005 19:49:31 -0000 1.8.2.9 --- question_bank.php 22 Aug 2005 17:20:18 -0000 1.8.2.10 *************** *** 22,25 **** --- 22,26 ---- * algorithms- ideally we should have a function for each action on entry and * for display. + * - Removed all references to import quiz * @package frontend * @subpackage Stack *************** *** 65,70 **** // export_xml_db Export single question as xml from the database. // export_xml_list Export the list of selected questions as a single XML file - // import Present a form to add file name to upload. - // uploaded_xml Deal with an uploaded file. // edit_metadata Edit all the meta data fields in the question bank. // questionbank_screen Begin again. --- 66,69 ---- *************** *** 131,155 **** // bank. This is not needed by all actions, but it is harmless to set it. $question_bank_filter = stack_get_questionbank_filter(); - - $upload_successful = FALSE; - if ('uploaded_xml' == $action) { - if (array_key_exists('xmlfile',$_FILES)) { - if (is_uploaded_file($_FILES['xmlfile']['tmp_name'])) { - - //$pq = file_get_contents($_FILES['xmlfile']['tmp_name']); - include_once("{$stack_root}/scripts/stackXML.php"); - $qu = stack_xml_parse_question_file($_FILES['xmlfile']['tmp_name']); - // If a single question has been uploaded, edit it, if multiple - // questions store them in the database - if (array_key_exists('assessmentItem',$qu)) { - $question = $qu['assessmentItem']; - $action = 'edit'; - } else if (array_key_exists('mathQuiz',$qu)) { - $quiz = $qu['mathQuiz']['assessmentItem']; - $upload_successful = TRUE; - } - } - } - } if ('export_xml' == $action) { --- 130,133 ---- *************** *** 213,227 **** $action = 'questionbank_screen'; break; - case 'uploaded_xml': - if ($upload_successful) { - stack_display_qb_show_imported($quiz); - } else { - echo '<p>Could not extract a question or quiz from your uploaded file. Please edit your file carefully and try again.</p>'; - } - $action = 'questionbank_screen'; - break; - case 'import': - stack_display_qb_import($errors); - break; case 'export_xml': if (NULL == $questions_to_export) { --- 191,194 ---- Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23.2.2 retrieving revision 1.23.2.3 diff -C2 -d -r1.23.2.2 -r1.23.2.3 *** index.php 16 Aug 2005 15:51:35 -0000 1.23.2.2 --- index.php 22 Aug 2005 17:20:18 -0000 1.23.2.3 *************** *** 22,25 **** --- 22,26 ---- * algorithms- ideally we should have a function for each action on entry and * for display. + * - Added logic to view installation instructions if stackstd.php not dectected * @package Stack */ *************** *** 49,52 **** --- 50,60 ---- include($stack_root.'/frontend_general/process_input.php'); + //Initialisation + include_once('/scripts/stackXML.php'); + //1. Check that XML schemas are up to date + if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) + { + stack_xml_update_schema("{$stack_root}/schemas/"); + } /////////////////////////////////////////////////////////////// |
From: pkiddie <pk...@us...> - 2005-08-22 17:20:37
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3139/scripts Modified Files: Tag: development_xmlrqp stackAuthor.php stackQuiz.php stackXML.php Log Message: Code comments added Schema version checking added to index.php Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.5.2.9 retrieving revision 1.5.2.10 diff -C2 -d -r1.5.2.9 -r1.5.2.10 *** stackQuiz.php 19 Aug 2005 22:13:15 -0000 1.5.2.9 --- stackQuiz.php 22 Aug 2005 17:20:18 -0000 1.5.2.10 *************** *** 8,13 **** */ ! /** ! * */ // 'Unique quiz ID - local mySQL value' --- 8,12 ---- */ ! /* the stackQuiz data structure */ // 'Unique quiz ID - local mySQL value' *************** *** 407,412 **** } - - //<TODO: to be implemented> /** --- 406,409 ---- Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.18 retrieving revision 1.13.2.19 diff -C2 -d -r1.13.2.18 -r1.13.2.19 *** stackXML.php 19 Aug 2005 14:05:14 -0000 1.13.2.18 --- stackXML.php 22 Aug 2005 17:20:18 -0000 1.13.2.19 *************** *** 5,8 **** --- 5,9 ---- * @package scripts * @subpackage Stack + * <TODO> Echo's should be localised to current language */ *************** *** 54,93 **** /** - * Writes a single stackQuestion data structure to an XML string. - * - * @see stack_xml_create_question_frag() - * @param array $question A stackQuestion data structure - * @return string The XML string representing the question - */ - /*function stack_xml_create_question($question) { - // Takes a $stackQuestion array, and returns an XML string - global $stackQuestion; - - // Don't export questionID - if (array_key_exists('questionID',$question)) { - unset($question['questionID']); - } - - // Make sure the question is validated. - stack_question_validate($question,$errors); - - // Can't have numbered fields in the XML - // (1) Remove keyvals fields - foreach($stackQuestion as $qfield => $attribs) { - if ('keyval' == $attribs['type'] and array_key_exists($qfield,$question)) { - unset($question[$qfield]); - } - } - - $xml = "<assessmentItem>\n"; - - // loop through question fields and escape any special characters - $xml .= stack_xml_create_question_frag($question,4); - $xml .= "</assessmentItem>\n"; - - return $xml; - }*/ - - /** * Writes a single stackQuestion data structure as XML, and returns the containing * XML document to the calling function --- 55,58 ---- *************** *** 800,808 **** } ! //This function is called when Question->Import is selected. ! //In this case, the user is either: ! //1. Uploading a XML file containing a single question ! //2. An XML file with an array of questions. ! //Either return a question, or quiz data structure, then detect the head element? function stack_xml_parse_file($fileName,&$errors) { --- 765,781 ---- } ! /** ! * Loads the file specified by $fileName and establishes: ! * 1. Whether the file is XML (success=false if is not XML) ! * 2. Whether the XML file to be imported is an older version, in which case use the old parsing engine ! * 3. Whether the XML file is a <mathQuiz> or <assessmentItem>. ! * ! * If the XML file is a mathQuiz or assessmentItem with a version number, use the respective parse function to return an array ! * representing the XML file ! * ! * @param string $fileName The file to parse ! * @param string $errors Respository for errors ! * @return array Array corresponding to imported XML file. False if XML is invalid, with associated error ! */ function stack_xml_parse_file($fileName,&$errors) { *************** *** 873,892 **** } ! //This function simply maps from an element in a particular namespace onto the correct stackQuestion/stackQuiz data structure field, ! //and returns that field ! //Probably could be more efficient - multiple passes through array function stack_xml_map_element_ns(&$element,$arrayType) { global $stackQuestion, $stackQuiz; switch($arrayType) { case('stackQuestion'): { ! foreach($stackQuestion as $arrayKey=>$questionField) { if((!empty($questionField['type']) && $questionField['type']=='meta')) { ! //show_array($questionField); if ((!empty($questionField['metatag']) && ($questionField['metatag']==$element->localName))) { return $arrayKey; --- 846,872 ---- } ! /** ! * Maps an element from a particular namespace, i.e. dc:keyword, onto the correct stackQuestion or stackQuiz data structure keyword, ! * i.e. questionKeywords or quizKeywords, when exporting/importing XML ! * ! * @param DOMIT_Element $element The element to map onto the corresponding data structure ! * @param string $arrayType The data structure this array belongs to (to correctly map) ! * @return string $arrayKey The name of the mapped element, if one is found. Else, the original name of the element ! */ function stack_xml_map_element_ns(&$element,$arrayType) { global $stackQuestion, $stackQuiz; + //Which data structure does this element belong to - the stackQuiz or stackQuestion? switch($arrayType) { case('stackQuestion'): { ! foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through all fields { + //Only search through fields that are metadata if((!empty($questionField['type']) && $questionField['type']=='meta')) { ! //If element has same local name as a particular field in the data structure, then we have matched up if ((!empty($questionField['metatag']) && ($questionField['metatag']==$element->localName))) { return $arrayKey; *************** *** 914,922 **** } ! //If unsuccessful at resolving ! return $element->nodeName; } ! //Recursive function which creates the stackQuestion/stackQuiz data structure required by the parsing engine function stack_xml_parse_element_into_array(&$element,&$array,$arrayType) { --- 894,938 ---- } ! return $element->nodeName; //If unsuccessful at resolving } ! /** ! * Begins the recursive algorithm responsible for a importing a question XML file into a multidimensional array. Returns ! * the final data structure ! * ! * @param DOMIT_Document $questionXmlDoc The DOM XML document representing the question ! * @return array $question A question data structure ! */ ! function stack_xml_parse_question(&$questionXmlDoc) ! { ! $question = array(); ! $elements = &$questionXmlDoc->documentElement; ! stack_xml_parse_element_into_array($elements,$question['assessmentItem'],'stackQuestion'); ! return $question; ! } ! ! /** ! * Begins the recursive algorithm responsible for a importing a quiz XML file into a multidimensional array. Returns ! * the final data structure ! * ! * @param DOMIT_Document $quizXmlDoc The DOM XML document representing the quiz ! * @return array $quiz A quiz data structure ! */ ! function stack_xml_parse_quiz(&$quizXmlDoc) ! { ! $quiz = array(); ! $elements = &$questionXmlDoc->documentElement; ! stack_xml_parse_element_into_array($elements,$quiz['mathQuiz'],'stackQuiz'); ! return $quiz; ! } ! ! /** ! * Actually creates the stackQuestion/stackQuiz data structure as required by validation. Is a recursive function that iterates through ! * the XML tree specified ! * ! * @param DOMIT_Element $element The head XML element ! * @param string $array The array which to dump the information onto ! * @return string $arrayType The type of data structure: stackQuestion, stackQuiz ! */ function stack_xml_parse_element_into_array(&$element,&$array,$arrayType) { *************** *** 924,930 **** $noChildren = count($children); //Count the number of children ! for ($i = 0; $i < $noChildren; $i++) { ! $mapFromNS=false; $node = &$children[$i]; $nodeName = $node->nodeName; --- 940,946 ---- $noChildren = count($children); //Count the number of children ! for ($i = 0; $i < $noChildren; $i++) { //Now iterate through each child ! //$mapFromNS=false; $node = &$children[$i]; $nodeName = $node->nodeName; *************** *** 933,938 **** $nodeName = stack_xml_map_element_ns($node,$arrayType); ! //} //We will have a nodeName at this point, whether the actual element or resolved from namespace ! //If node has children if ($node->childNodes!=null) --- 949,953 ---- $nodeName = stack_xml_map_element_ns($node,$arrayType); ! //We will have a nodeName at this point, whether the actual element or resolved from namespace //If node has children if ($node->childNodes!=null) *************** *** 954,961 **** //Need to check that these nodes are direct children of the current node for ($j = 0; $j < $length; $j++) { //Get the item $item = $nodeList->item($j); ! if ($item->parentNode->nodeName!=$node->parentNode->nodeName) //where they are not { $length=1; --- 969,977 ---- //Need to check that these nodes are direct children of the current node for ($j = 0; $j < $length; $j++) { + //Get the item $item = $nodeList->item($j); ! if ($item->parentNode->nodeName!=$node->parentNode->nodeName) //where they are not direct children { $length=1; *************** *** 985,990 **** } } ! ! //If there are multiple elements of the same name //Deal with arrays of values: for example potential responses and questionVar/answerVar --- 1001,1005 ---- } } ! //If there are multiple elements of the same name //Deal with arrays of values: for example potential responses and questionVar/answerVar *************** *** 1037,1041 **** } ! //If node has not got children else { --- 1052,1056 ---- } ! //If node has not got any children else { *************** *** 1045,1072 **** } - function stack_xml_parse_question(&$questionXmlDoc) - { - global $namespaces, $stackQuestion; - $question = array(); - - $elements = &$questionXmlDoc->documentElement; - - stack_xml_parse_element_into_array($elements,$question['assessmentItem'],'stackQuestion'); - - return $question; - } - - function stack_xml_parse_quiz(&$questionXmlDoc) - { - global $namespaces, $stackQuiz; - $quiz = array(); - - $elements = &$questionXmlDoc->documentElement; - - stack_xml_parse_element_into_array($elements,$quiz['mathQuiz'],'stackQuiz'); - - return $quiz; - } - /** * Parses a single stackQuestion XML string back into an array. --- 1060,1063 ---- *************** *** 1124,1128 **** } - //<PDK> /** * Checks the version of the question and quiz schemas with the version number held in the stackstd.php file --- 1115,1118 ---- *************** *** 1189,1193 **** * */ - function stack_xml_update_schema($directory) { --- 1179,1182 ---- *************** *** 1991,1995 **** * @return DOMIT_Element $schemaSimpleType A SimpleType schema definition, which may be appended into the schema */ - function stack_xml_create_schema_vocabulary($name,$values) { --- 1980,1983 ---- *************** *** 2433,2442 **** /** ! * This function iterates through the specified array and removes metadata whose value is the system default * ! * @see stack_xml_create_question_schema() ! * @param array $&array The array to search, by reference ! * @param string $value The value to search for in that array ! * @return bool True if the value being searched for exists, False otherwise */ function stack_xml_remove_question_meta_defaults(&$question) --- 2421,2429 ---- /** ! * This function iterates through the specified array and removes metadata whose value is the system default. This is called ! * just before the export of the 'question' * ! * @param array $question question data structure ! * @return void */ function stack_xml_remove_question_meta_defaults(&$question) *************** *** 2467,2470 **** --- 2454,2464 ---- } + /** + * This function iterates through the specified array and reinstates metadata whose value is the system default. This is called + * after a question has been imported + * + * @param array $question question data structure + * @return void + */ function stack_xml_reinstate_question_meta_defaults(&$question) { *************** *** 2490,2499 **** /** ! * This function iterates through the specified array and removes metadata whose value is the system default * ! * @see stack_xml_create_question_schema() ! * @param array $&array The array to search, by reference ! * @param string $value The value to search for in that array ! * @return bool True if the value being searched for exists, False otherwise */ function stack_xml_remove_quiz_meta_defaults(&$quiz) --- 2484,2492 ---- /** ! * This function iterates through the specified array and removes metadata whose value is the system default. This is called ! * just before the export of the 'question' * ! * @param array $quiz question data structure ! * @return void */ function stack_xml_remove_quiz_meta_defaults(&$quiz) *************** *** 2524,2535 **** } function stack_xml_reinstate_quiz_meta_defaults(&$quiz) { global $stackQuiz; ! foreach ($stackQuiz as $arrayKey=>$quizField) //Iterate through the master stackQuestion fields { if (!array_key_exists($arrayKey,$quiz)) //Where the field ocurrs in stackQuiz, but not the imported quiz ! { //and is metadata if(!empty($quizField['type']) && ($quizField['type']=='meta')) { --- 2517,2535 ---- } + /** + * This function iterates through the specified array and reinstates quiz metadata whose value is the system default (thus + * has been removed). This is called just after the import of the 'quiz' + * + * @param array $quiz question data structure + * @return void + */ function stack_xml_reinstate_quiz_meta_defaults(&$quiz) { global $stackQuiz; ! foreach ($stackQuiz as $arrayKey=>$quizField) //Iterate through the master stackQuestion fields { if (!array_key_exists($arrayKey,$quiz)) //Where the field ocurrs in stackQuiz, but not the imported quiz ! { //and is metadata if(!empty($quizField['type']) && ($quizField['type']=='meta')) { *************** *** 2545,2552 **** } } - - if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) - { - stack_xml_update_schema("{$stack_root}/schemas/"); - } ?> --- 2545,2547 ---- Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.29.2.12 retrieving revision 1.29.2.13 diff -C2 -d -r1.29.2.12 -r1.29.2.13 *** stackAuthor.php 19 Aug 2005 22:13:15 -0000 1.29.2.12 --- stackAuthor.php 22 Aug 2005 17:20:18 -0000 1.29.2.13 *************** *** 4,7 **** --- 4,9 ---- * loaded when an edit page needs to be generated. * + * - Caters for question and quiz metadata + * * @package scripts * @subpackage Stack *************** *** 170,175 **** global $stack_stand_alone,$stackQuestion,$stackOptions,$debug,$user; - //show_array($question); - //<PDK> Now datetime $t=time(); $dts = strftime('%c',$t); // Format the string. --- 172,175 ---- *************** *** 182,187 **** $optval = stack_options_formvals_set($question_options); ! // Add all the metadata to the question. ! // <PDK> Added hidden metadata here echo "\n<hr />\n <input type='hidden' name='questionID' value='".sf($question,'questionID')."' />\n --- 182,188 ---- $optval = stack_options_formvals_set($question_options); ! // Add all the metadata to the question ! ! // hidden metadata echo "\n<hr />\n <input type='hidden' name='questionID' value='".sf($question,'questionID')."' />\n *************** *** 189,195 **** <input type='hidden' name='questionDateLastEdited' value='$t' />\n <input type='hidden' name='questionUserLastEdited' value='".sf($question,'questionUserLastEdited')."' />\n ! <input type='hidden' name='questionPublisher' value='".sf($question,'questionPublisher')."' />\n ! <input type='hidden' name='type' value='".sf($question,'type')."' />\n ! <input type='hidden' name='questionFormat' value='".sf($question,'questionFormat')."' />\n <table cellboarder='0' cellpadding='2'> --- 190,196 ---- <input type='hidden' name='questionDateLastEdited' value='$t' />\n <input type='hidden' name='questionUserLastEdited' value='".sf($question,'questionUserLastEdited')."' />\n ! <input type='hidden' name='questionPublisher' value='".sf($question,'questionPublisher')."' />\n ! <input type='hidden' name='type' value='".sf($question,'type')."' />\n ! <input type='hidden' name='questionFormat' value='".sf($question,'questionFormat')."' />\n <table cellboarder='0' cellpadding='2'> *************** *** 358,362 **** echo "\n<hr />\n"; ! //List of metadata tags $metadata_list = array('questionLanguage','questionLearningContext','questionDifficulty','questionCompetency', 'questionCompetencyLevel','questionTimeAllocated','questionExcerciseType','questionRights'); --- 359,363 ---- echo "\n<hr />\n"; ! //List of metadata to display $metadata_list = array('questionLanguage','questionLearningContext','questionDifficulty','questionCompetency', 'questionCompetencyLevel','questionTimeAllocated','questionExcerciseType','questionRights'); *************** *** 365,369 **** echo "\n<hr />\n"; - } // end of edit_form_table --- 366,369 ---- *************** *** 700,704 **** // Hidden metadata, ! //<PDK> Bodge here - why are tags one more level deep than they should? echo "<input type='hidden' name='quiz[quizDateLastEdited]' value='$t' />\n --- 700,704 ---- // Hidden metadata, ! // Why are tags one more level deep than they should be echo "<input type='hidden' name='quiz[quizDateLastEdited]' value='$t' />\n *************** *** 782,789 **** stack_options_edit_form($options_headings,$options_list,$optval,$fieldname); ! // Check if quiz has metadata set ! // $fieldname = 'quiz' ! $metadata_list = array('quizLanguage','quizLearningContext','quizDifficulty','quizCompetency', ! 'quizCompetencyLevel','quizTimeAllocated','quizExcerciseType','quizRights'); stack_quiz_metadata_edit_form($quiz, $metadata_list); --- 782,789 ---- stack_options_edit_form($options_headings,$options_list,$optval,$fieldname); ! // Check if quiz has metadata set ! // $fieldname = 'quiz' ! $metadata_list = array('quizLanguage','quizLearningContext','quizDifficulty','quizCompetency', ! 'quizCompetencyLevel','quizTimeAllocated','quizExcerciseType','quizRights'); stack_quiz_metadata_edit_form($quiz, $metadata_list); *************** *** 931,939 **** } - //<PDK> Added new function for stackQuestion fields /** ! * Generates a portion of HTML which allows the editing of a particular metadata field. * ! * Checks that specified field is of type meta and that an array of values is present. If so, draw a list * box with all the fields. As these fields contain optional data - they default to 'unspecified'. * If an array of values is not present, we default to text box entry. --- 931,938 ---- } /** ! * Generates a portion of HTML which allows the editing of a particular question metadata field. * ! * Checks that specified field is of type 'meta' and whether an array of values is present. If so, draw a list * box with all the fields. As these fields contain optional data - they default to 'unspecified'. * If an array of values is not present, we default to text box entry. *************** *** 1000,1005 **** echo " <td> $defval </td>\n</tr>\n"; } - - //print_r($question); echo "\n</table>\n\n\n"; --- 999,1002 ---- *************** *** 1009,1013 **** * Generates a portion of HTML which allows the editing of a particular quiz metadata field. * ! * Checks that specified field is of type meta and that an array of values is present. If so, draw a list * box with all the fields. As these fields contain optional data - they default to 'unspecified'. * If an array of values is not present, we default to text box entry. --- 1006,1010 ---- * Generates a portion of HTML which allows the editing of a particular quiz metadata field. * ! * Checks that specified field is of type 'meta' and whether an array of values is present. If so, draw a list * box with all the fields. As these fields contain optional data - they default to 'unspecified'. * If an array of values is not present, we default to text box entry. |
From: pkiddie <pk...@us...> - 2005-08-22 17:20:34
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3139/scripts/install Modified Files: Tag: development_xmlrqp stackInstall.php stackUpdateDatabase.php Log Message: Code comments added Schema version checking added to index.php Index: stackUpdateDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackUpdateDatabase.php,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** stackUpdateDatabase.php 17 Aug 2005 16:48:46 -0000 1.3.2.3 --- stackUpdateDatabase.php 22 Aug 2005 17:20:18 -0000 1.3.2.4 *************** *** 7,14 **** <?php ! //<PDK> edited here as fresh installation fails to load stackstd require_once('../../stackstd.php'); ! /** This PHP script simply adds new fields to mySQL for metadata. This affects both questions and quizzes */ // v1.1 - Changed questionUserLastEdited, quizUserLastEdited field to text type --- 7,15 ---- <?php ! //<PDK>fresh installation fails to load stackstd, solved in new version require_once('../../stackstd.php'); ! /** This PHP script simply adds new fields to STACK database for question and quiz metadata, ! * and refines some existing fields */ // v1.1 - Changed questionUserLastEdited, quizUserLastEdited field to text type Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** stackInstall.php 1 Aug 2005 21:56:33 -0000 1.13.2.1 --- stackInstall.php 22 Aug 2005 17:20:18 -0000 1.13.2.2 *************** *** 15,19 **** // To install, add comments to this line. ! //die(); --- 15,19 ---- // To install, add comments to this line. ! die(); |