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-10 03:11:36
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31794/scripts Modified Files: Tag: development_xmlrqp stackXML.php Log Message: Changed file name of schemas Writing out quiz XML files Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.8 retrieving revision 1.13.2.9 diff -C2 -d -r1.13.2.8 -r1.13.2.9 *** stackXML.php 8 Aug 2005 11:50:29 -0000 1.13.2.8 --- stackXML.php 8 Aug 2005 22:10:24 -0000 1.13.2.9 *************** *** 99,110 **** // 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]); - // } - //} $xmlDoc = new DOMIT_Document(); --- 99,102 ---- *************** *** 112,127 **** $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); ! $questionFrag = &stack_xml_create_instance_header($xmlNamespaces,'assessmentItem'); ! //$metaElement = &new DOMIT_Element(); ! //Now construct the main body of the XML file ! //1. The metadata ! //Iterate through the question fields, then picking out the respective fields - and only write out if they contain a metatag //For this we need to iterate through both the question and stackQuestion structures. //Then we retrieve the actual data within the question structure foreach($stackQuestion as $qfield => $attribs) { if ('meta' == $attribs['type'] && array_key_exists($qfield,$question)) { switch ($attribs['metatype']) { --- 104,133 ---- $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); ! $questionFrag = &stack_xml_create_question_frag($question); ! //Retrieve document element, then add the instance headers to it ! $questionFrag = &stack_xml_create_instance_header($xmlNamespaces,'assessmentItem'); ! $xmlDoc->appendChild($questionFrag); ! ! return $xmlDoc; ! } ! ! function stack_xml_create_question_frag($question) ! { ! $xmlDoc = new DOMIT_Document(); ! ! $questionFrag = new DOMIT_Element('assessmentItem'); ! ! //Iterate through the question fields, then picking out the respective fields - and only write out if they contain a metatag //For this we need to iterate through both the question and stackQuestion structures. //Then we retrieve the actual data within the question structure foreach($stackQuestion as $qfield => $attribs) { + + //Now construct the main body of the XML file + //1. The metadata if ('meta' == $attribs['type'] && array_key_exists($qfield,$question)) { + //Detect the metadata type switch ($attribs['metatype']) { *************** *** 152,199 **** } ! $metaElement->setText($question[$qfield]); //Add the contents of the metadata to that tag $questionFrag->appendChild($metaElement); } ! } ! ! $xmlDoc->appendChild($questionFrag); ! ! //2. Question variables themselves ! //Iterate through stackQuestion again - dont look at metadata terms, only question, options, and potresp ! foreach($stackQuestion as $qfield => $attribs) { ! if ('meta' != $attribs['type'] && array_key_exists($qfield,$question)) { ! if (is_array($question[$qfield])) { ! //Now we must detect what type it is - other/keyval ! switch($attribs['type']) { ! case ('keyval'): ! { ! //Then write out a keyval type ! print_r($qfield); ! } ! ! case ('other'): ! { ! } ! ! default: { } } } } ! } ! ! return $xmlDoc; } - //Takes the assessmentItem fragment, constructs a filename and saves it out to XML //Returns true if file was successfully written out, false otherwise --- 158,267 ---- } ! $metaElement->setText($question[$qfield]); //Add the contents of the field to metadata tag $questionFrag->appendChild($metaElement); } ! ! //We are interested in questionOptions and questionPotResp - other 'other' fields will not get written ! else if ('other' == $attribs['type'] && array_key_exists($qfield,$question)) { ! //If the field is a potential response ! if($qfield=='questionPotResp') ! { ! //Iterate through those reponses ! foreach ($question[$qfield] as $potResp) { ! //Create a potential response element ! $potRespElem = &$xmlDoc->createElementNS('',$qfield); ! ! //Iterate through fields of a potential response ! foreach ($potResp as $potRespKey => $potRespField) { ! //Create a potential response field element ! $potRespFieldElem = &$xmlDoc->createElementNS('',$potRespKey); ! ! if (is_array($potRespField)) //Test for true/false branches { ! foreach ($potRespField as $branchKey => $branchField) { + $potRespBranchElem = &$xmlDoc->createElementNS('',$branchKey) ; + $potRespBranchElem->setText($branchField); + + $potRespFieldElem->appendChild($potRespBranchElem); } } + + else //Otherwise is not a branched element, so just write field text + { + $potRespFieldElem->setText($potRespField); + } + + $potRespElem->appendChild($potRespFieldElem);//Append each field to a single response element } + $questionFrag->appendChild($potRespElem); //Append each potential response to main question fragment + + } + } + + //If the field is a list of question options + else if ($qfield=='questionOptions') + { + //Write head element + $questionElement = &$xmlDoc->createElementNS('',$qfield); + + foreach ($question[$qfield] as $optionField => $option) { + + $optionElement = &$xmlDoc->createElementNS('',$optionField); + $optionElement->setText($option); + + $questionElement->appendChild($optionElement); + } + } + else + { + echo("The field $qfield cannot be written out"); + } + $questionFrag->appendChild($questionElement); } ! //All other elements ! else if (array_key_exists($qfield,$question)) { ! ! //Write head element ! $questionElement = &$xmlDoc->createElementNS('',$qfield); ! ! if (is_array($question[$qfield])) ! { ! //Is it of type keyval? ! if ($attribs['type']=='keyval') ! { ! foreach ($question[$qfield] as $keyvalType) { ! $keyElement = &$xmlDoc->createElementNS('',"key"); ! $keyElement->setText($keyvalType['key']); ! ! $valElement = &$xmlDoc->createElementNS('',"val"); ! $valElement->setText($keyvalType['value']); ! ! $questionElement->appendChild($keyElement); ! $questionElement->appendChild($valElement); ! } ! } ! } ! ! else ! { ! //Just a simple type - string etc, so just append the text to the node ! $questionElement->setText($question[$qfield]); ! } ! ! $questionFrag->appendChild($questionElement); ! ! } } ! return $questionFrag; ! } //Takes the assessmentItem fragment, constructs a filename and saves it out to XML //Returns true if file was successfully written out, false otherwise *************** *** 219,222 **** --- 287,346 ---- } + //Retrieve the list of questions which correspond to a particular quiz + //Then call stack_xml_create_question_new, to create each individual assessmentItem + //Wrap around a mathQuiz container + function stack_xml_create_quiz_new($quiz) + { + //foreach() + //stack_xml_create_question_frag($question); + + } + + //Writes a quiz to an XML file + function stack_xml_write_quiz_new($quiz,$directory) + { + //<TODO> How about using Quiz name? + $xml_file_name = 'stack_quiz_'.time().'.xml'; + + $xmlDoc = stack_xml_create_quiz_new($quiz); + + $success = $xmlDoc->saveXML($directory."/".$xml_file_name,true); + + if (!$success) + { + return null; + } + + return $xml_file_name; + } + + if (!$xml_file_handle) { + // error condition + echo "File could not be opened for writing."; + } else { + $xml = "<?xml version=\"1.0\"?>\n"; + $xml .= "<mathQuiz>\n"; + + $errors = NULL; + foreach ($quiz as $questionID) + { + $question = stack_db_getquestion($questionID); + stack_question_validate($question,$errors); + unset($question['questionID']); + $quizQ['assessmentItem'][]= $question; + } + + $xml .= stack_xml_create_question_frag($quizQ,4); + + $xml .= '</mathQuiz>'; + + fputs($xml_file_handle, $xml); + // close xml file + fclose($xml_file_handle); + } + + return $xml_file_name; + + } /** * Creates a XML schema header based upon a XML namespaces datastructure, defined in the following manner: |
From: pkiddie <pk...@us...> - 2005-08-08 11:50:43
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25209/scripts Modified Files: Tag: development_xmlrqp stackXML.php Log Message: Version checking of schemas. Beginning XML generation Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.7 retrieving revision 1.13.2.8 diff -C2 -d -r1.13.2.7 -r1.13.2.8 *** stackXML.php 5 Aug 2005 10:44:32 -0000 1.13.2.7 --- stackXML.php 8 Aug 2005 11:50:29 -0000 1.13.2.8 *************** *** 37,40 **** --- 37,54 ---- $namespaces['lom']['location'] = 'imsmd_v1p2.xsd'; + //$Xml instance namespace data structure + //As above... + $xmlNamespaces['dc']['namespace'] = 'http://purl.org/dc/elements/1.1/'; //Dublin core namespace + $xmlNamespaces['dc']['id'] = 'dc'; //The ID prepended to our elements that use DC //The actual location of the dublin core schema + + $xmlNamespaces['lom']['namespace'] = 'http://www.imsglobal.org/xsd/imsmd_v1p2';//etc. + $xmlNamespaces['lom']['id'] = 'lom'; + + //Different namespace here - schema instance + $xmlNamespaces['xsi']['namespace'] = 'http://www.w3.org/2001/XMLSchema-instance'; //Schema instance - required for XML files that reflect + $xmlNamespaces['xsi']['id'] = 'xsi'; //Particular schema + $xmlNamespaces['xsi']['location'] = 'c:/Program Files/EasyPHP1-8/www/stack-1-0/schemas/stack-question-1.0.xsd'; //Actual location of our schema + + /** * Writes a single stackQuestion data structure to an XML string. *************** *** 76,80 **** function stack_xml_create_question_new($question) { ! global $stackQuestion, $stack_ver, $namespaces; // Don't export questionID --- 90,94 ---- function stack_xml_create_question_new($question) { ! global $stackQuestion, $stack_ver, $xmlNamespaces; // Don't export questionID *************** *** 88,120 **** // 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]); ! } ! } $xmlDoc = new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here ! $questionFrag = new DOMIT_Element('assessmentItem'); ! $questionVersionAttr = new DOMIT_Attr('version'); ! $questionVersionAttr->nodeValue = $stack_ver['release']; ! $questionFrag->setAttributeNode($questionVersionAttr); //Now construct the main body of the XML file //1. The metadata //Iterate through the question fields, then picking out the respective fields - and only write out if they contain a metatag ! if (is_array($question)) { ! foreach($question as $tag => $qfield) ! { ! print_r($question); ! if (!empty($qfield['type']) && $qfield['type']=='meta') ! { ! switch ($qfield['metatype']) { case('dublincore'): { ! $metaElement =&$xmlDoc->createElementNS($namespaces['dc']['namespace'],"{$namespaces['dc']['id']}:{$qfield['metatag']}"); break; } --- 102,132 ---- // 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]); ! // } ! //} $xmlDoc = new DOMIT_Document(); $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here + $xmlDoc->appendChild($xmlDoc->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); ! $questionFrag = &stack_xml_create_instance_header($xmlNamespaces,'assessmentItem'); ! //$metaElement = &new DOMIT_Element(); //Now construct the main body of the XML file //1. The metadata //Iterate through the question fields, then picking out the respective fields - and only write out if they contain a metatag ! //For this we need to iterate through both the question and stackQuestion structures. ! //Then we retrieve the actual data within the question structure ! foreach($stackQuestion as $qfield => $attribs) { ! if ('meta' == $attribs['type'] && array_key_exists($qfield,$question)) { ! ! switch ($attribs['metatype']) { case('dublincore'): { ! $metaElement =&$xmlDoc->createElementNS($xmlNamespaces['dc']['namespace'],"{$xmlNamespaces['dc']['id']}:{$attribs['metatag']}"); break; } *************** *** 122,126 **** case('lom'): { ! $metaElement =&$xmlDoc->createElementNS($namespaces['lom']['namespace'],"{$namespaces['lom']['id']}:{$qfield['metatag']}"); break; } --- 134,138 ---- case('lom'): { ! $metaElement =&$xmlDoc->createElementNS($xmlNamespaces['lom']['namespace'],"{$xmlNamespaces['lom']['id']}:{$attribs['metatag']}"); break; } *************** *** 128,132 **** case('stack'): { ! $metaElement =&$xmlDoc->createElementNS('',"$tag"); break; } --- 140,144 ---- case('stack'): { ! $metaElement =&$xmlDoc->createElementNS('',"{$attribs['metatag']}"); break; } *************** *** 134,184 **** case('default'): { ! $metaElement =&$xmlDoc->createElementNS('',"$tag"); break; } ! ! $questionFrag->appendChild($metaElement); } ! } } - } $xmlDoc->appendChild($questionFrag); return $xmlDoc; } - function stack_xml_create_question_frag_new($question) - { - if (is_array($question)) { - foreach($question as $tag => $data) { - if (is_array($data)) { - - print_r($data); - // Deal with arrays of numbered attributes. - if (array_key_exists('0',$data)) { - $pad = str_pad('',$depth); - $xml .= $pad."<$tag>\n"; - foreach ($data as $key => $orderdata) { // Do for each one. - $xml .= $pad." <{$tag}_ord order=\"$key\">\n".stack_xml_create_question_frag($orderdata,$depth+6)."$pad </{$tag}_ord>\n"; - } - $xml .= $pad."</$tag>\n"; - } else { - // Just a regular open tag. - $pad = str_pad('',$depth); - $xml .= $pad."<$tag>\n".stack_xml_create_question_frag($data,$depth+4)."$pad</$tag>\n"; - } - } else { // We need a closed tag. - if ('' != trim($data) ) { - $pad = str_pad('',$depth); - $xml .= $pad."<$tag>".stack_s($data)."</$tag>\n"; - } - } - } - } - } - //Takes the assessmentItem fragment, constructs a filename and saves it out to XML //Returns true if file was successfully written out, false otherwise --- 146,199 ---- case('default'): { ! $metaElement =&$xmlDoc->createElementNS('',"{$attribs['metatag']}"); break; } ! } ! $metaElement->setText($question[$qfield]); //Add the contents of the metadata to that tag ! $questionFrag->appendChild($metaElement); } } $xmlDoc->appendChild($questionFrag); + + //2. Question variables themselves + //Iterate through stackQuestion again - dont look at metadata terms, only question, options, and potresp + foreach($stackQuestion as $qfield => $attribs) { + if ('meta' != $attribs['type'] && array_key_exists($qfield,$question)) { + + if (is_array($question[$qfield])) + { + //Now we must detect what type it is - other/keyval + switch($attribs['type']) + { + case ('keyval'): + { + //Then write out a keyval type + print_r($qfield); + } + + case ('other'): + { + } + + default: + { + } + } + } + + + + } + + + } + return $xmlDoc; } //Takes the assessmentItem fragment, constructs a filename and saves it out to XML //Returns true if file was successfully written out, false otherwise *************** *** 192,196 **** } ! $xmlDoc = &stack_xml_create_question_new($question); $success = $xmlDoc->saveXML($directory."/".$xml_file_name,true); --- 207,211 ---- } ! $xmlDoc = stack_xml_create_question_new($question); $success = $xmlDoc->saveXML($directory."/".$xml_file_name,true); *************** *** 205,208 **** --- 220,264 ---- /** + * Creates a XML schema header based upon a XML namespaces datastructure, defined in the following manner: + * $namespaces['xs']['namespace'] = Uri where external schema is located + * $namespaces['xs']['id'] = Id of which elements which are defined from this schema are prepended with + * + * Also adds a version to the schema, based upon the current release of STACK. + * + * @see stack_xml_create_question_schema() + * @param array $namespacesArray The above Xmlnamespaces data structure + * @param string $rootElem The name of the root Xml element + * @return DOMIT_Element $schemaHeader The XML schema header, which may be appended onto the DOM Document root node + */ + function stack_xml_create_instance_header($namespacesArray,$rootName) + { + global $stack_ver; //Retrieve current release of STACK + + //Contruct the header for the schema + $schemaHeader = new DOMIT_Element($rootName); + + foreach ($namespacesArray as $namespaceKey=>$namespace) //Iterate through each namespace and add to schema header + { + $namespaceAttr = &new DOMIT_Attr('xmlns:'.$namespaceKey); + $namespaceAttr->nodeValue=$namespace['namespace']; + + $schemaHeader->setAttributeNode($namespaceAttr); + } + + //Now must give location of schema from which this instance has been derived from + $schemaLocationAttr = new DOMIT_Attr('xsi:noNamespaceSchemaLocation'); + $schemaLocationAttr->nodeValue=$namespacesArray['xsi']['location']; + + //Used to ensure latest schema version is used + $schemaVersionAttr = new DOMIT_Attr('version'); + $schemaVersionAttr->nodeValue=$stack_ver['release']; + + $schemaHeader->setAttributeNode($schemaLocationAttr); + $schemaHeader->setAttributeNode($schemaVersionAttr); + + return $schemaHeader; + } + + /** * Takes a stackQuestion array, and returns an XML string fragment. * *************** *** 382,431 **** //<PDK> /** ! * Checks the schema version reflecting questions against the version held in the stackQuestion data structure * ! * Loads the question metadata schema and checks the 'version' attribute for equality. * * @param string $questionSchemaLocation The location of the question metadata schema for which this XML file should reflect * @return bool $latestVersion True if the schema is the latest version, False otherwise */ ! function stack_schema_check_question_version($questionSchemaLocation) { ! global $stackQuestion; ! $latestVersion = false; ! if (is_array($stackQuestion)) { ! /*if($stackQuestion['version']!=schema version) { ! $latestVersion = false; } else { ! $latestVersion = true; ! }*/ } - } - - /** - * Checks the schema version reflecting quiz metadata against the version held in the stackQuiz data structure - * - * Loads the quiz metadata schema and checks the 'version' attribute for equality. - * - * @param string $quizSchemaLocation The location of the quiz metadata schema for which this XML file should reflect - * @return bool $latestVersion True if the schema is the latest version, False otherwise - */ - function stack_xml_check_quiz_schema_version($quizSchemaLocation) - { - global $stackQuiz; - $latestVersion = false; ! if (is_array($stackQuiz)) { ! /*if($stackQuiz['version']!=/*schema version) { ! $latestVersion = false; ! } ! ! else { ! $latestVersion = true; ! }*/ } } --- 438,477 ---- //<PDK> /** ! * Checks the version of the specified schema with the version held in the stackstd.php file * ! * Loads the question metadata schema and checks the 'version' attribute in stackstd.php for equality. * * @param string $questionSchemaLocation The location of the question metadata schema for which this XML file should reflect * @return bool $latestVersion True if the schema is the latest version, False otherwise + * + * <TODO> Depending on logic - can then issue an update to the old schema */ ! function stack_schema_check_version($schemaLocation) { ! global $stack_ver; ! $schemaXmlDoc = &new DOMIT_Document(); ! $success = $schemaXmlDoc->loadXML($schemaLocation); ! ! if ($success) { ! //Retrieve the root element - the document element; ! $docElement = &$schemaXmlDoc->$documentElement; ! ! $versionAttr = &$docElement->getAttribute('version'); ! ! if(($versionAttr->nodeValue)==$stack_ver['release']) { ! ! return true; } else { ! return false; ! } } ! else { ! echo("The schema file $schemaLocation could not be opened. Please contact the developers!<br>"); } } *************** *** 518,522 **** //File name of schema has version number of STACK clearly identified ! $schema_file_name='stack_quiz_metadata-'.$stack_ver['release'].'.xsd'; $dom = new DOMIT_Document(); --- 564,568 ---- //File name of schema has version number of STACK clearly identified ! $schema_file_name='stack_quiz-'.$stack_ver['release'].'.xsd'; $dom = new DOMIT_Document(); *************** *** 551,555 **** //File name of schema has version number of STACK clearly identified ! $schema_file_name='stack_question_metadata-'.$stack_ver['release'].'.xsd'; $dom = new DOMIT_Document(); --- 597,601 ---- //File name of schema has version number of STACK clearly identified ! $schema_file_name='stack_question-'.$stack_ver['release'].'.xsd'; $dom = new DOMIT_Document(); *************** *** 1540,1570 **** } - /** - * Checks the schema version reflecting questions against the version held in the stackQuestion data structure - * - * Loads the question metadata schema and checks the 'version' attribute for equality. - * - * @param string $questionSchemaLocation The location of the question metadata schema for which this XML file should reflect - * @return bool $latestVersion True if the schema is the latest version, False otherwise - */ - function stack_schema_check_version($schemaLocation) - { - global $stackQuestion, $stack_ver; - $stackVer = $stack_ver['release']; - - $latestVersion = false; - - if (is_array($stackQuestion)) - { - /*if($stackVer!=schema version) { - $latestVersion = false; - } - - else { - $latestVersion = true; - }*/ - } - } - //stack_xml_create_question_schema(); //stack_xml_create_quiz_schema(); --- 1586,1589 ---- |
From: pkiddie <pk...@us...> - 2005-08-05 10:45:13
|
Update of /cvsroot/stack/stack-1-0/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27968/schemas Modified Files: Tag: development_xmlrqp test_instance_assessmentItem.xml Log Message: Index: test_instance_assessmentItem.xml =================================================================== RCS file: /cvsroot/stack/stack-1-0/schemas/Attic/test_instance_assessmentItem.xml,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_instance_assessmentItem.xml 4 Aug 2005 12:10:00 -0000 1.1.2.1 --- test_instance_assessmentItem.xml 5 Aug 2005 10:44:31 -0000 1.1.2.2 *************** *** 1,144 **** <?xml version="1.0"?> ! <assessmentItem version="1.0" xmlns:p1="http://purl.org/dc/elements/1.1/" xmlns:p2="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/Program%20Files/EasyPHP1-8/www/stack-1-0/schemas/test.xsd"> ! <!--Element dublincore is optional--> ! <dublincore> ! <p1:identifier>string by default</p1:identifier> ! <p1:title>string by default</p1:title> ! <p1:description>string by default</p1:description> ! <p1:creator>string by default</p1:creator> ! <p1:publisher>string by default</p1:publisher> ! <p1:type>string by default</p1:type> ! <p1:format>string by default</p1:format> ! <p1:language>string by default</p1:language> ! <p1:rights>string by default</p1:rights> ! <p1:date>string by default</p1:date> ! </dublincore> ! <!--Element lom is optional--> ! <lom> ! <p2:keyword> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:keyword> ! <p2:context> ! <p2:source> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:source> ! <p2:value> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:value> ! </p2:context> ! <p2:difficulty> ! <p2:source> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:source> ! <p2:value> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:value> ! </p2:difficulty> ! <p2:typicallearningtime> <p2:datetime>string</p2:datetime> ! <p2:description> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! <p2:langstring xml:lang="en-US"> ! <!--Attribute xml:lang is optional--> ! </p2:langstring> ! </p2:description> ! </p2:typicallearningtime> ! </lom> ! <!--Element stack is optional--> ! <stack> ! <!--Element competency is optional--> <competency>string</competency> - <!--Element competencylevel is optional--> <competencylevel>string</competencylevel> - <!--Element excercisetype is optional--> <excercisetype>string</excercisetype> - </stack> - <!--Element question is optional--> - <question> - <!--Element questionVarsRaw is optional--> <questionVarsRaw>string</questionVarsRaw> - <!--Element questionVars is optional--> <questionVars> <key>string</key> <val>string</val> </questionVars> - <!--Element questionStem is optional--> <questionStem>string</questionStem> - <!--Element questionAns is optional--> <questionAns>string</questionAns> - <!--Element questionAnsKey is optional--> <questionAnsKey>string</questionAnsKey> - <!--Element questionAnsVarsRaw is optional--> <questionAnsVarsRaw>string</questionAnsVarsRaw> - <!--Element questionAnsVars is optional--> <questionAnsVars> <key>string</key> <val>string</val> </questionAnsVars> - <!--Element questionSol is optional--> <questionSol>string</questionSol> - <!--Element questionNote is optional--> <questionNote>string</questionNote> - </question> - <!--Element questionOptions is optional--> - <questionOptions> - <!--Element InsertStars is optional--> <InsertStars>FALSE</InsertStars> - <!--Element InformalSyntax is optional--> <InformalSyntax>FALSE</InformalSyntax> - <!--Element AllowInputTool is optional--> <AllowInputTool>Form box + JOME</AllowInputTool> - <!--Element SyntaxHint is optional--> <SyntaxHint>string</SyntaxHint> - <!--Element Display is optional--> <Display>LaTeX Source</Display> - <!--Element Language is optional--> <Language>nl</Language> - <!--Element QuVal is optional--> <QuVal>-1E4</QuVal> - <!--Element MarkModMethod is optional--> <MarkModMethod>Last Answer</MarkModMethod> - <!--Element Penalty is optional--> <Penalty>-1E4</Penalty> - <!--Element Forbid is optional--> <Forbid>string</Forbid> - <!--Element Allow is optional--> <Allow>string</Allow> - <!--Element AnsTest is optional--> <AnsTest>True</AnsTest> - <!--Element AnsTestOpt is optional--> <AnsTestOpt>string</AnsTestOpt> - <!--Element TeacherEmail is optional--> <TeacherEmail>string</TeacherEmail> - <!--Element FeedBackGenericCorrect is optional--> <FeedBackGenericCorrect>string</FeedBackGenericCorrect> - <!--Element FeedBackGenericIncorrect is optional--> <FeedBackGenericIncorrect>string</FeedBackGenericIncorrect> - <!--Element FeedBackGenericPCorrect is optional--> <FeedBackGenericPCorrect>string</FeedBackGenericPCorrect> - <!--Element ShowSol is optional--> <ShowSol>After correct answer</ShowSol> - </questionOptions> <!--Element questionPotResp is optional, maxOccurs=unbounded--> <questionPotResp> --- 1,60 ---- <?xml version="1.0"?> ! <assessmentItem version="1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/Program%20Files/EasyPHP1-8/www/stack-1-0/schemas/test.xsd"> ! <dc:identifier>string by default</dc:identifier> ! <dc:title>string by default</dc:title> ! <dc:description>string by default</dc:description> ! <dc:creator>string by default</dc:creator> ! <dc:publisher>string by default</dc:publisher> ! <dc:type>string by default</dc:type> ! <dc:format>string by default</dc:format> ! <dc:language>string by default</dc:language> ! <dc:rights>string by default</dc:rights> ! <dc:date>string by default</dc:date> ! <lom:keyword></lom:keyword> ! <lom:context></lom:context> ! <lom:difficulty></lom:difficulty> ! <lom:typicallearningtime> <p2:datetime>string</p2:datetime> ! </lom:typicallearningtime> <competency>string</competency> <competencylevel>string</competencylevel> <excercisetype>string</excercisetype> <questionVarsRaw>string</questionVarsRaw> <questionVars> <key>string</key> <val>string</val> + <key>string</key> + <val>string</val> </questionVars> <questionStem>string</questionStem> <questionAns>string</questionAns> <questionAnsKey>string</questionAnsKey> <questionAnsVarsRaw>string</questionAnsVarsRaw> <questionAnsVars> <key>string</key> <val>string</val> + <key>string</key> + <val>string</val> </questionAnsVars> <questionSol>string</questionSol> <questionNote>string</questionNote> <InsertStars>FALSE</InsertStars> <InformalSyntax>FALSE</InformalSyntax> <AllowInputTool>Form box + JOME</AllowInputTool> <SyntaxHint>string</SyntaxHint> <Display>LaTeX Source</Display> <Language>nl</Language> <QuVal>-1E4</QuVal> <MarkModMethod>Last Answer</MarkModMethod> <Penalty>-1E4</Penalty> <Forbid>string</Forbid> <Allow>string</Allow> <AnsTest>True</AnsTest> <AnsTestOpt>string</AnsTestOpt> <TeacherEmail>string</TeacherEmail> <FeedBackGenericCorrect>string</FeedBackGenericCorrect> <FeedBackGenericIncorrect>string</FeedBackGenericIncorrect> <FeedBackGenericPCorrect>string</FeedBackGenericPCorrect> <ShowSol>After correct answer</ShowSol> <!--Element questionPotResp is optional, maxOccurs=unbounded--> <questionPotResp> |
From: pkiddie <pk...@us...> - 2005-08-05 10:45:13
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27968/scripts Modified Files: Tag: development_xmlrqp stackXML.php Log Message: Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.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 *** stackXML.php 4 Aug 2005 12:09:43 -0000 1.13.2.6 --- stackXML.php 5 Aug 2005 10:44:32 -0000 1.13.2.7 *************** *** 25,28 **** --- 25,40 ---- $xmlElements = array(); + //$namespaces data structure + $namespaces['xs']['namespace'] = 'http://www.w3.org/2001/XMLSchema'; //Default namespace + $namespaces['xs']['id'] = 'xs'; //REQUIRED FOR SCHEMA + + $namespaces['dc']['namespace'] = 'http://purl.org/dc/elements/1.1/'; //Dublin core namespace + $namespaces['dc']['id'] = 'dc'; //The ID prepended to our elements that use DC + $namespaces['dc']['location'] = 'dc.xsd'; //The actual location of the dublin core schema + + $namespaces['lom']['namespace'] = 'http://www.imsglobal.org/xsd/imsmd_v1p2';//etc. + $namespaces['lom']['id'] = 'lom'; + $namespaces['lom']['location'] = 'imsmd_v1p2.xsd'; + /** * Writes a single stackQuestion data structure to an XML string. *************** *** 61,64 **** --- 73,207 ---- } + //Creates an AssessmentItem fragment, and returns the head DOMIT_Element + function stack_xml_create_question_new($question) + { + global $stackQuestion, $stack_ver, $namespaces; + + // 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]); + } + } + + $xmlDoc = new DOMIT_Document(); + $xmlDoc->setNamespaceAwareness(true); //We need namespace awareness here + + $questionFrag = new DOMIT_Element('assessmentItem'); + $questionVersionAttr = new DOMIT_Attr('version'); + $questionVersionAttr->nodeValue = $stack_ver['release']; + + $questionFrag->setAttributeNode($questionVersionAttr); + + //Now construct the main body of the XML file + //1. The metadata + //Iterate through the question fields, then picking out the respective fields - and only write out if they contain a metatag + if (is_array($question)) { + foreach($question as $tag => $qfield) + { + print_r($question); + if (!empty($qfield['type']) && $qfield['type']=='meta') + { + switch ($qfield['metatype']) + { + case('dublincore'): + { + $metaElement =&$xmlDoc->createElementNS($namespaces['dc']['namespace'],"{$namespaces['dc']['id']}:{$qfield['metatag']}"); + break; + } + + case('lom'): + { + $metaElement =&$xmlDoc->createElementNS($namespaces['lom']['namespace'],"{$namespaces['lom']['id']}:{$qfield['metatag']}"); + break; + } + + case('stack'): + { + $metaElement =&$xmlDoc->createElementNS('',"$tag"); + break; + } + + case('default'): + { + $metaElement =&$xmlDoc->createElementNS('',"$tag"); + break; + } + + $questionFrag->appendChild($metaElement); + } + + + } + } + } + + $xmlDoc->appendChild($questionFrag); + + return $xmlDoc; + } + + function stack_xml_create_question_frag_new($question) + { + if (is_array($question)) { + foreach($question as $tag => $data) { + if (is_array($data)) { + + print_r($data); + // Deal with arrays of numbered attributes. + if (array_key_exists('0',$data)) { + $pad = str_pad('',$depth); + $xml .= $pad."<$tag>\n"; + foreach ($data as $key => $orderdata) { // Do for each one. + $xml .= $pad." <{$tag}_ord order=\"$key\">\n".stack_xml_create_question_frag($orderdata,$depth+6)."$pad </{$tag}_ord>\n"; + } + $xml .= $pad."</$tag>\n"; + } else { + // Just a regular open tag. + $pad = str_pad('',$depth); + $xml .= $pad."<$tag>\n".stack_xml_create_question_frag($data,$depth+4)."$pad</$tag>\n"; + } + } else { // We need a closed tag. + if ('' != trim($data) ) { + $pad = str_pad('',$depth); + $xml .= $pad."<$tag>".stack_s($data)."</$tag>\n"; + } + } + } + } + } + + //Takes the assessmentItem fragment, constructs a filename and saves it out to XML + //Returns true if file was successfully written out, false otherwise + function stack_xml_write_question_new($question,$directory) + { + //Create question filename + if ($question['questionName'] != '') { + $xml_file_name = $question['questionName'].".xml"; + } else { + $xml_file_name = 'stack_'.$question['questionID'].".xml"; + } + + $xmlDoc = &stack_xml_create_question_new($question); + + $success = $xmlDoc->saveXML($directory."/".$xml_file_name,true); + + if (!$success) + { + return null; + } + + return $xml_file_name; + } + /** * Takes a stackQuestion array, and returns an XML string fragment. *************** *** 442,446 **** //Data structures that must be output in schema format ! global $stackQuestion, $stackOptions, $stackQuestionPotResp, $stack_ver, $sqlToSchemaMapping, $xmlElements; $xmlElements = array(); //Empty existing array --- 585,589 ---- //Data structures that must be output in schema format ! global $stackQuestion, $stackOptions, $stackQuestionPotResp, $stack_ver, $sqlToSchemaMapping, $xmlElements, $namespaces; $xmlElements = array(); //Empty existing array *************** *** 450,465 **** include($filename); - //$namespaces data structure - $namespaces['xs']['namespace'] = 'http://www.w3.org/2001/XMLSchema'; //Default namespace - $namespaces['xs']['id'] = 'xs'; //REQUIRED FOR SCHEMA - - $namespaces['dc']['namespace'] = 'http://purl.org/dc/elements/1.1/'; //Dublin core namespace - $namespaces['dc']['id'] = 'dc'; //The ID prepended to our elements that use DC - $namespaces['dc']['location'] = 'dc.xsd'; //The actual location of the dublin core schema - - $namespaces['lom']['namespace'] = 'http://www.imsglobal.org/xsd/imsmd_v1p2';//etc. - $namespaces['lom']['id'] = 'lom'; - $namespaces['lom']['location'] = 'imsmd_v1p2.xsd'; - $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 --- 593,596 ---- |
From: pkiddie <pk...@us...> - 2005-08-05 10:45:08
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27968 Modified Files: Tag: development_xmlrqp question_bank.php Log Message: Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** question_bank.php 28 Jul 2005 13:18:27 -0000 1.8.2.1 --- question_bank.php 5 Aug 2005 10:44:25 -0000 1.8.2.2 *************** *** 152,156 **** include_once("{$stack_root}/scripts/stackXML.php"); stack_question_validate($question,$errors); ! $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); $questions_to_export = TRUE; } --- 152,156 ---- include_once("{$stack_root}/scripts/stackXML.php"); stack_question_validate($question,$errors); ! $name = stack_xml_write_question_new($question, "{$stack_root}/tmp/"); $questions_to_export = TRUE; } |
From: LastRenshai <las...@us...> - 2005-08-05 09:14:14
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12739/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** stackmaxima.mac 29 Jul 2005 15:59:32 -0000 1.23 --- stackmaxima.mac 5 Aug 2005 09:13:44 -0000 1.24 *************** *** 644,649 **** ret: quadTest(sExpr,tExpr,wrt) else if sDeg = 3 then ! ret: tripTest(sExpr, tExpr, wrt)) ) ), if (quiet) then FeedBack:"", --- 644,652 ---- ret: quadTest(sExpr,tExpr,wrt) else if sDeg = 3 then ! ret: tripTest(sExpr, tExpr, wrt) ! else ! ret: singTest(sExpr, tExpr) ) + ) ), if (quiet) then FeedBack:"", *************** *** 749,752 **** --- 752,756 ---- /* quadTest(sExpr, tExpr, wrt) */ /* sameVars(expr1, expr2) */ + /* singTest(sExpr, tExpr) */ /* tripTest(sExpr, tExpr, wrt) */ /* ***************************** */ *************** *** 950,956 **** if list1=list2 then true else false ! ); ! ! /* ****************3rd Degree Partial Fraction***************** */ --- 954,991 ---- if list1=list2 then true else false ! ); ! ! ! /* ****************1st Degree Partial Fraction***************** */ ! /* Use: Degree of Expression is 1, expressions not equivalent */ ! /* Requires: SExpr - Students Expression */ ! /* TExpr - Teachers Expression */ ! /* Returns: StackReturnOb */ ! /* CASE 1: different Numerators - factored sExpr */ ! /* CASE 2: diff denominators - sDenom and tDenom */ ! /* CASE 3: Other wise - Factored sExpr */ ! /* ************************************************************ */ ! ! singTest(sExpr, tExpr):= ! ( [val, rawmk, ansnote, fb], ! tE: factor(tExpr), ! sE: factor(sExpr), ! if (isDenomSame(sE,tE) = false) then ! BLOCK( ! val:"true", ! rawmk: String(0), ! ansnote: "ATPartFrac_denom_ret", ! fb: StackAddFeedback("","ATPartFrac_denom_ret", StackDISP(denom(sE),"\$"), StackDISP(denom(tE),"\$")) ! ) ! else ! BLOCK( ! val:"true", ! rawmk: String(0), ! ansnote: "ATPartFrac_ret_expression", ! fb: StackAddFeedback("", "ATPartFrac_ret_expression", StackDISP(sE,"\$")) ! ), ! ret: StackReturnOb(val, rawmk, ansnote, fb), ! RETURN(ret) ! ); /* ****************3rd Degree Partial Fraction***************** */ |
From: pkiddie <pk...@us...> - 2005-08-04 12:10:28
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22588/scripts/install Modified Files: Tag: development_xmlrqp stacktest.php Log Message: STACK now writes out its question and quiz schemas. All functions are commented. Example schemas and diagrams included. One time creation of schemas is now located in 'stackTest.php' Index: stacktest.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stacktest.php,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** stacktest.php 28 Jul 2005 13:18:27 -0000 1.5.2.1 --- stacktest.php 4 Aug 2005 12:09:43 -0000 1.5.2.2 *************** *** 130,172 **** echo "<br />5.1 Creation of question schema"; ! $strout = stack_schema_write_question($stack_root); ! if ('' != $strout) { ! echo "<br /><font color='green'>Question metadata written to $strout.</font>"; } else { ! echo "<br /><font color='red'>No output from the CAS conversion.</font>"; } echo "<br />5.2 Creation of quiz schema"; - $strout = ''; - - if ('' != $strout) { - echo "<br /><font color='green'>Question metadata written to $strout.</font>"; - } else { - echo "<br /><font color='red'>No output from the CAS conversion.</font>"; - } - - echo "<br />5.3 Creation of question metadata"; - - //Write the question metadata to the root of the webserver - //$strout = stack_schema_write_metadata($stack_root); - $strout = stack_schema_write_question_metadata($stack_root); - - if ('' != $strout) { - echo "<br /><font color='green'>Question metadata written to $strout.</font>"; - } else { - echo "<br /><font color='red'>No output from the CAS conversion.</font>"; - } - - echo "<br />5.4 Creation of quiz metadata"; ! $strout = stack_schema_write_quiz_metadata($stack_root); ! if ('' != $strout) { ! echo "<br /><font color='green'>Question metadata written to $strout.</font>"; } else { ! echo "<br /><font color='red'>No output from the CAS conversion.</font>"; } - ?> --- 130,150 ---- 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>"; } ?> |
From: pkiddie <pk...@us...> - 2005-08-04 12:10:26
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22588 Modified Files: Tag: development_xmlrqp changelog.txt Log Message: STACK now writes out its question and quiz schemas. All functions are commented. Example schemas and diagrams included. One time creation of schemas is now located in 'stackTest.php' Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/changelog.txt,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** changelog.txt 3 Aug 2005 17:02:19 -0000 1.1.2.4 --- changelog.txt 4 Aug 2005 12:09:42 -0000 1.1.2.5 *************** *** 18,27 **** - STACK Readme updated with new installation documentation directory ! - Stakc installation script: checks for presence of stack_std before allowing user to access their stack web site etc. ! - Points to right stackInstall.php script ! - Stackstd file: checks for the presence of library scripts before loading them, thus allows us to load stackstd.php with ! fewer errors during installation script - Some documentation additions. Known issues: --- 18,29 ---- - STACK Readme updated with new installation documentation directory ! - Stakc installation script: checks for presence of stack_std before allowing user to access their stack web site etc. ! - Points to right stackInstall.php script ! - Stackstd file: checks for the presence of library scripts before loading them, thus allows us to load stackstd.php with ! fewer errors during installation script - Some documentation additions. + - Rather than STACK not correctly installed, how about showing the installation documentation - use of index.php for this, check + for the presence of a completed installatio Known issues: *************** *** 34,43 **** stackQuestion as expected. - AnsTest values to be written out in schema. ! ! Issues when running STACK with IIS instead of Apache: ! - Must give read+execute access to the cmd.exe file from the IUSR_Guest account in order to open processes. Not the best solution - is a ! potentially serious security hole ! - Must give full permissions to the stack-1-0 directory by using the IIS snap-in in Computer Management - also must add 'index.php' to list ! of default web pages - various mYSQL issues: cannot use the latest version of mySQL with PHP4 over iis due to the use of more secure authentication: - tmp directory within stack-1-0 - to make writable, the IUSR_Guest account must have full control of it. --- 36,45 ---- stackQuestion as expected. - AnsTest values to be written out in schema. ! ! Issues when running STACK with IIS instead of Apache: ! - Must give read+execute access to the cmd.exe file from the IUSR_Guest account in order to open processes. Not the best solution - is a ! potentially serious security hole ! - Must give full permissions to the stack-1-0 directory by using the IIS snap-in in Computer Management - also must add 'index.php' to list ! of default web pages - various mYSQL issues: cannot use the latest version of mySQL with PHP4 over iis due to the use of more secure authentication: - tmp directory within stack-1-0 - to make writable, the IUSR_Guest account must have full control of it. *************** *** 51,56 **** - Importing an individual question, a list of questions and a quiz - Import tag needs to go on quiz UI - - Rather than STACK not correctly installed, how about showing the installation documentation - use of index.php for this, check - - for the presence of a completed installation - RQP faults encapsulated within SOAP specific faults. --- 53,57 ---- - Importing an individual question, a list of questions and a quiz - Import tag needs to go on quiz UI - RQP faults encapsulated within SOAP specific faults. + - Remove minOcurrs and maxOcurrs on root 'type' nodes |
From: pkiddie <pk...@us...> - 2005-08-04 12:10:21
|
Update of /cvsroot/stack/stack-1-0/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22588/schemas Added Files: Tag: development_xmlrqp assessmentItem.jpg mathQuiz.jpg stack_question_metadata-1.0.xsd stack_quiz_metadata-1.0.xsd test_instance_assessmentItem.xml test_instance_mathquiz.xml Removed Files: Tag: development_xmlrqp test.xsd Log Message: STACK now writes out its question and quiz schemas. All functions are commented. Example schemas and diagrams included. One time creation of schemas is now located in 'stackTest.php' --- NEW FILE: stack_quiz_metadata-1.0.xsd --- <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" version="1.0"> <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd" /> <xs:import namespace="http://www.imsglobal.org/xsd/imsmd_v1p2" schemaLocation="imsmd_v1p2.xsd" /> <xs:element name="dublincore" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element ref="dc:identifier" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>This is a globally unique identifer for the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:title" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The name of the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:description" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The description the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:creator" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Shows who edited the question last.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:publisher" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The server URL responsible for making the question available. Internal variable</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:type" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Nature of genre of content of resource. Internal variable: most likely text for question</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:format" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Digital manifestation of resource. Internal variable: most likely stackQuestion/(version number)</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:language" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>language of content of resource. User defined, maybe default to users current Windows/Linux language setting</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:rights" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Rights management statement for the resource, or reference to a service providing such information</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:date" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>An automatic time stamp showing when the question was last edited.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lom" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element ref="lom:keyword" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Keywords, for searching over banks of questions. Note that any question with the keyword 'demo' will appear as a demo question for guest users and students to try and edit.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="lom:context" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Describes the educational context of the intended target audience of the resource. User defined list type</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="lom:difficulty" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>How difficult it is to work through the resource for the given target audience. Percieved difficulty, user defined list type</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="lom:typicallearningtime" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>An approximate time it takes to work with the resource. User defined, list type</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="stack" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="competency" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>Mathematical competancies a resource trains. User defined, list type</xs:documentation> </xs:annotation> </xs:element> <xs:element name="competencylevel" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>Mathematical skills a resource requires/trains. User defined, list type</xs:documentation> </xs:annotation> </xs:element> <xs:element name="excercisetype" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>Type of interactive elements used in the context of the excercise. User defined, list type</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="question" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="questionVarsRaw" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This field is a string which contains a list of assignments of the form <br /> <tt> key = value </tt><br /> where each <tt>key</tt> is the name of a variable local to the question, and <tt>value</tt> is an expression in Maxima's language. When a question is instantiated, this list is passed to the CAS, and evaluated in order. The value obtained for each <tt>key</tt> will be stored and used later, for example in the question marking routines. The keys need not be unique, although only the last value will be available for use later. <p><b>Maxima's assignments <tt>a:3</tt></b><br /> Computer algebra systems each use a different syntax to denote the assignment of a value to a variable. For example, Maple and Derive use <tt>:=</tt>. Mathematica uses <tt>=</tt> or <tt>:=</tt>, depending on when the assignment is to take place. Maxima uses the form <tt>key:value</tt>, which is unusual and not intuitive. Maxima reserves <tt>:=</tt> to denote <em>function</em> definition, eg <tt>f(x):=x^2</tt>. Hence, in STACK we add an abstraction layer to enforce a syntax where every expression must be of the form <tt> key = value </tt>.</p> <p>Examples are included in the authoring guide.</p> <p><b>Notes</b> <ul> <li>Items are separated by either a newline or ;</li> <li>If you type a string not in the form <tt> key = value</tt>, a variable name such as <tt>dumvar3</tt> will be assigned automatically to keep track of the command in the list of question variables.</li> <li>These raw values are internalized as a PHP array, in this case stored in <tt>questionVars</tt>. Hence, the field may change when you edit the question.</li> <li>If a student uses a variable which has been assigned a value, the value will be used instead during the marking procedure. Hence, if you ask the student for an expression such as <tt>x^2-n</tt> in a question, it would be better not to use <tt>n</tt> here in case a student literally types this expression. </ul></p></xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionVars" minOccurs="0" maxOccurs="1" type="keyval"> <xs:annotation> <xs:documentation>This field is an array which holds the actual parsed values of the text given in the field <tt>questionVarsRaw</tt>. Internally in PHP this is stored as a numbered array, each entry of which is of the form <tt>array('key' => $var_name, 'value' => $value)</tt>.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionStem" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is the string, ie the question, which the student actually sees. This is of the nominal data type <tt>castext</tt>, so that it may depend on the <tt>questionVars</tt>. The student will of course see the instantiated versions.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionAns" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>Each question must have a non-empty answer, whether or not this is actually used by the various marking schemes. This answer must be a CAS specific string, ie. it is assumed to be of type <tt>casstring</tt>. If you want the answer to be a string, use quotes, for example <tt>"hello world"</tt></xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionAnsKey" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>If there are any <tt>questionPotResp</tt> in the question, which is to say a list of potential responses. This field will be used. When generating feedback to a question, based upon the student's answer, we have to refer to the student's answer using a variable name. This field allows such a local variable name to be set. All fields of the <tt>questionPotResp</tt> and the <tt>questionAnsVars</tt> may refer to this. The <tt>questionSol</tt>, that is the worked solution, may <em>not</em> refer to the student's answer. This field is required, and a default value is assigned to a blank question. This will only appear when potential responses are added.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionAnsVarsRaw" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This field is treated in exactly the same way as the <tt>questionVarsRaw</tt> field above. When a student has responded to a question, this list of variables will be processed. They may depend on <ol> <li> The <tt>questionVarsInst</tt>, that is to say the instantiated question variables.</li> <li> The <tt>questionAnsKey</tt>, so that feedback may be given in terms of the student's answer.</li> </ol></xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionAnsVars" minOccurs="0" maxOccurs="1" type="keyval"> <xs:annotation> <xs:documentation>See <tt>questionVars</tt>.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionSol" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This castext is only displayed when the student asks to see the worked solution to a question. Note: the Worked solution may not depend on the <tt>questionAnsVars</tt> field</xs:documentation> </xs:annotation> </xs:element> <xs:element name="questionNote" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This allows a teacher to leave an intelligent "note to self" about which instances of variables a student has been given. The whole list of variables can be inspected, but some will only be intermediates. This is useful for giving the student a hint, or for analysis of incorrect answers.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="insertstars"> <xs:restriction base="xs:string"> <xs:enumeration value="TRUE" /> <xs:enumeration value="FALSE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="informalsyntax"> <xs:restriction base="xs:string"> <xs:enumeration value="TRUE" /> <xs:enumeration value="FALSE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="allowinputtool"> <xs:restriction base="xs:string"> <xs:enumeration value="Form box" /> <xs:enumeration value="Form box + JOME" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="display"> <xs:restriction base="xs:string"> <xs:enumeration value="String" /> <xs:enumeration value="LaTeX" /> <xs:enumeration value="MathML" /> <xs:enumeration value="LaTeX Source" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="language"> <xs:restriction base="xs:string"> <xs:enumeration value="en" /> <xs:enumeration value="es" /> <xs:enumeration value="nl" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="markmodmethod"> <xs:restriction base="xs:string"> <xs:enumeration value="Penalty" /> <xs:enumeration value="Last Answer" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="anstest"> <xs:restriction base="xs:string"> <xs:enumeration value="AlgEquiv" /> <xs:enumeration value="CASEqual" /> <xs:enumeration value="Num_tol_relative" /> <xs:enumeration value="Num_tol_absolute" /> <xs:enumeration value="String" /> <xs:enumeration value="StringSloppy" /> <xs:enumeration value="RegExp" /> <xs:enumeration value="FacForm" /> <xs:enumeration value="SA_factored" /> <xs:enumeration value="SA_expanded" /> <xs:enumeration value="PartFrac" /> <xs:enumeration value="Diff" /> <xs:enumeration value="Int" /> <xs:enumeration value="SA_True" /> <xs:enumeration value="True" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="showsol"> <xs:restriction base="xs:string"> <xs:enumeration value="Always" /> <xs:enumeration value="Never" /> <xs:enumeration value="On request" /> <xs:enumeration value="After correct answer" /> </xs:restriction> </xs:simpleType> <xs:element name="questionOptions" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="InsertStars" minOccurs="0" maxOccurs="1" type="insertstars"> <xs:annotation> <xs:documentation>If set to TRUE, the system will automatically insert *'s into a student's answer, (actually any casstring) when it is validated. So, for example <tt>2(1-4x)</tt> will be changed to <tt>2*(1-4*x)</tt>.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="InformalSyntax" minOccurs="0" maxOccurs="1" type="informalsyntax"> <xs:annotation> <xs:documentation>If set to TRUE, the system will automatically insert *'s into a student's answer, (actually any casstring) and it will not throw an error. Note however, that this is actually very hard to define robustly, since <tt> x(x+1) </tt> means apply the function <tt>x</tt> to the argument </tt>(x+1)</tt>, whereas <tt>sin(x)</tt> would be fine. How does one distinguish between the two? The system currently assumes a single letter is a variable, and otherwise this is a function to be applied. So <tt> tx(x-1) </tt> will not mean <tt> t*x*(x-1)</tt></xs:documentation> </xs:annotation> </xs:element> <xs:element name="AllowInputTool" minOccurs="0" maxOccurs="1" type="allowinputtool"> <xs:annotation> <xs:documentation>The default is just to have a form box for the student's entry. If set to 'Form box + JOME, the system will allow the use of the JOME mathematical input tool, to help student enter their answers. There are a variety of such tools, and others could easily be substituted, although it is likely an implementation needs only one. Furthermore, there will need to be javascript in the page, and so on. Hence, the file <tt>inputtool.inc</tt> and the function <tt>stack_question_inst_try_formfrag</tt> allow this to be integrated into the system. More than one input tool per implementation is not supported.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="SyntaxHint" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>A syntax hint allows the teacher to give the student a pro-forma in the input box. This can include '?' characters (which the CAS treats as the special variable <tt>qmchar</tt>). The syntax hint will appear in the answer box, whenever this is left blank by the student. For example, rather than having to type <pre>matrix([1,2],[3,4])</pre> the teacher may want to provide an answer box which already contains the string <pre>matrix([?,?],[?,?])</pre> instead. The student then need only to edit this, to replace ?'s with their values. This helps reduce syntax error problems with more difficult syntax issues. The ? may also be used to give partial credit. Of course it could also be used for general expressions such as <pre>x^2+?*x+1</pre> </xs:documentation> </xs:annotation> </xs:element> <xs:element name="Display" minOccurs="0" maxOccurs="1" type="display"> <xs:annotation> <xs:documentation>This determines how strings are displayed by the system. The <tt>String</tt> representation is exactly the CAS string. LaTeX uses the CAS's tex() function, and then passes the result through TTH. MathML is not implemented in all CAS systems. The "LaTeX Source" option generates LaTeX code, but does not process it. This can be cut and pasted into other LaTeX documents.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Language" minOccurs="0" maxOccurs="1" type="language"> <xs:annotation> <xs:documentation>This determines the language used for STACK.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="QuVal" minOccurs="0" maxOccurs="1" type="xs:float"> <xs:annotation> <xs:documentation>This is the number of marks available for the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="MarkModMethod" minOccurs="0" maxOccurs="1" type="markmodmethod"> <xs:annotation> <xs:documentation>This allows the teacher to specify how different marks for repeated attempts at this question are treated. The mark modification method is a function which applies to the list of raw marks, and returns a mark for this attempt. There are two mark modification methods. <ul> <li><b>Penalty</b><br /> This is the default method, which has been tried for many years using the AiM system. For each incorrect attempt, which is valid and the student asks to be marked, a penalty is accumulated. The AttemptMark is the AccumulatedPenalty for that attempt, subtracted from the RawMark. The mark for this attempt is the maximum AttemptMark. Thus a mark cannot 'go down'. This prevents a student for being penalized for continuing to try to gain credit. </li> <li><b>Last Answer</b><br /> This is the RawMark for this attempt, and disregards all penalties and previous answers. Note, this is different from setting the penalty to be zero, and using the penalty scheme above. With this method if a student leaves an incorrect answer in place they will not be given credit for any previous correct attempt. </li> </ul></xs:documentation> </xs:annotation> </xs:element> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:float"> <xs:annotation> <xs:documentation>This is the penalty applied to each different incorrect attempt, which is valid, and which the student has asked to be marked. This is subtracted from the basic question value of 1, and so must lie within the range 0 to 1, to make any sense.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Forbid" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is a comma separated list of text strings which are forbidden in a student's answer. If one of these strings is present then the student's attempt will be considered invalid, and no penalties will be given. The Forbid option works in a slightly different way from other options. The "default" values are <em>added</em> to the options entered at the question level, not over-written. So to forbid <tt>diff</tt> for a whole quiz, just set it at the quiz level. And so on. To allow a word forbidden at a higher level, use Allow.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Allow" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>See Forbid above.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnsTest" minOccurs="0" maxOccurs="1" type="anstest"> <xs:annotation> <xs:documentation>This determines which answer test will be applied to the pair consisting of the student's and teacher's answers. See the specific documentation.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnsTestOpt" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This allows an option to be passed to the <tt>AnswerTest</tt>. Not all <tt>AnswerTest</tt>'s require one. See the specific documentation. This option is considered to be a CASString, and so if non-empty must be a valid CASString.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="TeacherEmail" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is the email address that appears on the page for students to email help</xs:documentation> </xs:annotation> </xs:element> <xs:element name="FeedBackGenericCorrect" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is the string displayed to the student when their answer gets full marks, in addition to anything from the response processing tree or answer tests.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="FeedBackGenericIncorrect" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is the string displayed to the student when their answer gets full marks, in addition to anything from the response processing tree or answer tests.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="FeedBackGenericPCorrect" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is the string displayed to the student when their answer gets full marks, in addition to anything from the response processing tree or answer tests.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ShowSol" minOccurs="0" maxOccurs="1" type="showsol"> <xs:annotation> <xs:documentation>This determines when any worked solution is available.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="anstest"> <xs:restriction base="xs:string"> <xs:enumeration value="AlgEquiv" /> <xs:enumeration value="CASEqual" /> <xs:enumeration value="Num_tol_relative" /> <xs:enumeration value="Num_tol_absolute" /> <xs:enumeration value="String" /> <xs:enumeration value="StringSloppy" /> <xs:enumeration value="RegExp" /> <xs:enumeration value="FacForm" /> <xs:enumeration value="SA_factored" /> <xs:enumeration value="SA_expanded" /> <xs:enumeration value="PartFrac" /> <xs:enumeration value="Diff" /> <xs:enumeration value="Int" /> <xs:enumeration value="SA_True" /> <xs:enumeration value="True" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="rawmarkmod"> <xs:restriction base="xs:string"> <xs:enumeration value="=" /> <xs:enumeration value="+" /> <xs:enumeration value="-" /> <xs:enumeration value="=AT" /> </xs:restriction> </xs:simpleType> <xs:element name="questionPotResp" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="SAns" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is a CAS expression which we consider nominally to be the response of the student. The default value of this is the field <tt><font color="orange">questionAnsKey</font></tt>. The AnswerTest will be applied with this against the value in <tt><font color="orange">TAns</font></tt>.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="TAns" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This is a CAS expression which we consider nominally to be the response of the teacher. Of course, it could be the answer or a common mistake. The default value of this is the field <tt>questionAns</tt>. The AnswerTest will be applied with this against the value in <tt><font color="orange">SAns</font></tt>.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnsTest" minOccurs="0" maxOccurs="1" type="anstest"> <xs:annotation> <xs:documentation>The AnswerTest to be applied to this response.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnsTestOpt" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>The AnswerTest Options, for this AnswerTest.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="true" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" minOccurs="0" maxOccurs="1" type="rawmarkmod"> <xs:annotation> <xs:documentation>The way in which the <tt><font color="orange">RawMark</font></tt> for this branch of the potential response is used to affect the RawMark for the attempt as a whole. It must be one of the values, =, +, - or =AT. The latter assigns the mark to be that returned by the AnswerTest, in the case where partial credit is returned.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="RawMark" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>The mark applied for this attempt, should be between 0 and 1, although does not need to be.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>The penalty applied for this attempt, if this branch is activated. The last such modified penalty is used. If nothing is set, then the normal penalty scheme for the question as a whole is used. This value should be either (i) between 0 and 1, (although does not need to be), or (ii) the string '' or 'default'. Basically this is a way to make sure a specific penalty is set, regardless of the mark. Useful for removing a penalty in the case of a common and silly slip.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="FeedBack" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This castext is only generated if this branch of the distracter is activated. The context in which this is evaluated is as follows: <ol> <li> <tt>questionVarsInst</tt> </li> <li> <tt>questionAnsInst</tt>, using the name given by <tt>questionAnsKey</tt> </li> <li> <tt>questionAnsVarsInst</tt> </li> </ol> This castext is then concatenated to form the FeedBack for this attempt.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnswerNote" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This string is added to the AnswerNote for the attempt at this question.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ApLat" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This literally asks "Apply which later test?". It must be the number of an existing potential response. This will allow branching and the construction of tree like flow charts for the execution of feedback or partial credit. There are two provisos: <ul><li> No potential response is executed more than once. If this happens, the marking scheme bails out and takes no further action. This is to prevent loops.</li> <li> If the value of this field does not correspond to a legitimate Potential response, then the marking scheme bails out and takes no further action.</li></ul> This latter can be used to advantage by assigning the field a value of -1 to indicate the end of the process. <p> The default blank potential responses do not jump, but finish the process.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="false" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" minOccurs="0" maxOccurs="1" type="rawmarkmod"> <xs:annotation> <xs:documentation>The way in which the <tt><font color="orange">RawMark</font></tt> for this branch of the potential response is used to affect the RawMark for the attempt as a whole. It must be one of the values, =, +, - or =AT. The latter assigns the mark to be that returned by the AnswerTest, in the case where partial credit is returned.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="RawMark" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>The mark applied for this attempt, should be between 0 and 1, although does not need to be.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>The penalty applied for this attempt, if this branch is activated. The last such modified penalty is used. If nothing is set, then the normal penalty scheme for the question as a whole is used. This value should be either (i) between 0 and 1, (although does not need to be), or (ii) the string '' or 'default'. Basically this is a way to make sure a specific penalty is set, regardless of the mark. Useful for removing a penalty in the case of a common and silly slip.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="FeedBack" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This castext is only generated if this branch of the distracter is activated. The context in which this is evaluated is as follows: <ol> <li> <tt>questionVarsInst</tt> </li> <li> <tt>questionAnsInst</tt>, using the name given by <tt>questionAnsKey</tt> </li> <li> <tt>questionAnsVarsInst</tt> </li> </ol> This castext is then concatenated to form the FeedBack for this attempt.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="AnswerNote" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This string is added to the AnswerNote for the attempt at this question.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ApLat" minOccurs="0" maxOccurs="1" type="xs:string"> <xs:annotation> <xs:documentation>This literally asks "Apply which later test?". It must be the number of an existing potential response. This will allow branching and the construction of tree like flow charts for the execution of feedback or partial credit. There are two provisos: <ul><li> No potential response is executed more than once. If this happens, the marking scheme bails out and takes no further action. This is to prevent loops.</li> <li> If the value of this field does not correspond to a legitimate Potential response, then the marking scheme bails out and takes no further action.</li></ul> This latter can be used to advantage by assigning the field a value of -1 to indicate the end of the process. <p> The default blank potential responses do not jump, but finish the process.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="keyval"> <xs:sequence> <xs:element name="key" type="xs:string" /> <xs:element name="val" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:element name="assessmentItem"> <xs:complexType> <xs:all> <xs:element ref="dublincore" /> <xs:element ref="lom" /> <xs:element ref="stack" /> <xs:element ref="question" /> <xs:element ref="questionOptions" /> <xs:element ref="questionPotResp" /> </xs:all> </xs:complexType> </xs:element> <xs:element name="mathQuiz"> <xs:complexType> <xs:all> <xs:element ref="dublincore" /> <xs:element ref="lom" /> <xs:element ref="stack" /> <xs:element ref="assessmentItem" /> </xs:all> <xs:attribute name="version" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[1-9]+[0-9]*\.[0-9]+" /> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:schema> --- NEW FILE: assessmentItem.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mathQuiz.jpg --- (This appears to be a binary file; contents omitted.) --- test.xsd DELETED --- --- NEW FILE: test_instance_mathquiz.xml --- <?xml version="1.0"?> <mathQuiz version="1.0" xmlns:p1="http://purl.org/dc/elements/1.1/" xmlns:p2="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/Program%20Files/EasyPHP1-8/www/stack-1-0/schemas/test_quiz.xsd"> <!--Element dublincore is optional--> <dublincore> <p1:identifier>string by default</p1:identifier> <p1:title>string by default</p1:title> <p1:description>string by default</p1:description> <p1:creator>string by default</p1:creator> <p1:publisher>string by default</p1:publisher> <p1:type>string by default</p1:type> <p1:format>string by default</p1:format> <p1:language>string by default</p1:language> <p1:rights>string by default</p1:rights> <p1:date>string by default</p1:date> </dublincore> <!--Element lom is optional--> <lom> <p2:keyword> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:keyword> <p2:context> <p2:source> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:source> <p2:value> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:value> </p2:context> <p2:difficulty> <p2:source> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:source> <p2:value> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:value> </p2:difficulty> <p2:typicallearningtime> <p2:datetime>string</p2:datetime> <p2:description> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:description> </p2:typicallearningtime> </lom> <!--Element stack is optional--> <stack> <!--Element competency is optional--> <competency>string</competency> <!--Element competencylevel is optional--> <competencylevel>string</competencylevel> <!--Element excercisetype is optional--> <excercisetype>string</excercisetype> </stack> <assessmentItem> <!--Element dublincore is optional--> <dublincore> <p1:identifier>string by default</p1:identifier> <p1:title>string by default</p1:title> <p1:description>string by default</p1:description> <p1:creator>string by default</p1:creator> <p1:publisher>string by default</p1:publisher> <p1:type>string by default</p1:type> <p1:format>string by default</p1:format> <p1:language>string by default</p1:language> <p1:rights>string by default</p1:rights> <p1:date>string by default</p1:date> </dublincore> <!--Element lom is optional--> <lom> <p2:keyword> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:keyword> <p2:context> <p2:source> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:source> <p2:value> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:value> </p2:context> <p2:difficulty> <p2:source> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:source> <p2:value> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:value> </p2:difficulty> <p2:typicallearningtime> <p2:datetime>string</p2:datetime> <p2:description> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> <p2:langstring xml:lang="en-US"> <!--Attribute xml:lang is optional--> </p2:langstring> </p2:description> </p2:typicallearningtime> </lom> <!--Element stack is optional--> <stack> <!--Element competency is optional--> <competency>string</competency> <!--Element competencylevel is optional--> <competencylevel>string</competencylevel> <!--Element excercisetype is optional--> <excercisetype>string</excercisetype> </stack> <!--Element question is optional--> <question> <!--Element questionVarsRaw is optional--> <questionVarsRaw>string</questionVarsRaw> <!--Element questionVars is optional--> <questionVars> <key>string</key> <val>string</val> </questionVars> <!--Element questionStem is optional--> <questionStem>string</questionStem> <!--Element questionAns is optional--> <questionAns>string</questionAns> <!--Element questionAnsKey is optional--> <questionAnsKey>string</questionAnsKey> <!--Element questionAnsVarsRaw is optional--> <questionAnsVarsRaw>string</questionAnsVarsRaw> <!--Element questionAnsVars is optional--> <questionAnsVars> <key>string</key> <val>string</val> </questionAnsVars> <!--Element questionSol is optional--> <questionSol>string</questionSol> <!--Element questionNote is optional--> <questionNote>string</questionNote> </question> <!--Element questionOptions is optional--> <questionOptions> <!--Element InsertStars is optional--> <InsertStars>FALSE</InsertStars> <!--Element InformalSyntax is optional--> <InformalSyntax>FALSE</InformalSyntax> <!--Element AllowInputTool is optional--> <AllowInputTool>Form box + JOME</AllowInputTool> <!--Element SyntaxHint is optional--> <SyntaxHint>string</SyntaxHint> <!--Element Display is optional--> <Display>LaTeX Source</Display> <!--Element Language is optional--> <Language>nl</Language> <!--Element QuVal is optional--> <QuVal>-1E4</QuVal> <!--Element MarkModMethod is optional--> <MarkModMethod>Last Answer</MarkModMethod> <!--Element Penalty is optional--> <Penalty>-1E4</Penalty> <!--Element Forbid is optional--> <Forbid>string</Forbid> <!--Element Allow is optional--> <Allow>string</Allow> <!--Element AnsTest is optional--> <AnsTest>True</AnsTest> <!--Element AnsTestOpt is optional--> <AnsTestOpt>string</AnsTestOpt> <!--Element TeacherEmail is optional--> <TeacherEmail>string</TeacherEmail> <!--Element FeedBackGenericCorrect is optional--> <FeedBackGenericCorrect>string</FeedBackGenericCorrect> <!--Element FeedBackGenericIncorrect is optional--> <FeedBackGenericIncorrect>string</FeedBackGenericIncorrect> <!--Element FeedBackGenericPCorrect is optional--> <FeedBackGenericPCorrect>string</FeedBackGenericPCorrect> <!--Element ShowSol is optional--> <ShowSol>After correct answer</ShowSol> </questionOptions> <!--Element questionPotResp is optional, maxOccurs=unbounded--> <questionPotResp> <!--Element SAns is optional--> <SAns>string</SAns> <!--Element TAns is optional--> <TAns>string</TAns> <!--Element AnsTest is optional--> <AnsTest>True</AnsTest> <!--Element AnsTestOpt is optional--> <AnsTestOpt>string</AnsTestOpt> <true> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </true> <false> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </false> </questionPotResp> <questionPotResp> <!--Element SAns is optional--> <SAns>string</SAns> <!--Element TAns is optional--> <TAns>string</TAns> <!--Element AnsTest is optional--> <AnsTest>True</AnsTest> <!--Element AnsTestOpt is optional--> <AnsTestOpt>string</AnsTestOpt> <true> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </true> <false> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </false> </questionPotResp> <questionPotResp> <!--Element SAns is optional--> <SAns>string</SAns> <!--Element TAns is optional--> <TAns>string</TAns> <!--Element AnsTest is optional--> <AnsTest>True</AnsTest> <!--Element AnsTestOpt is optional--> <AnsTestOpt>string</AnsTestOpt> <true> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </true> <false> <!--Element RawMarkMod is optional--> <RawMarkMod>=AT</RawMarkMod> <!--Element RawMark is optional--> <RawMark>string</RawMark> <!--Element Penalty is optional--> <Penalty>string</Penalty> <!--Element FeedBack is optional--> <FeedBack>string</FeedBack> <!--Element AnswerNote is optional--> <AnswerNote>string</AnswerNote> <!--Element ApLat is optional--> <ApLat>string</ApLat> </false> </questionPotResp> </assessmentItem> </mathQuiz> --- NEW FILE: stack_question_metadata-1.0.xsd --- <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" version="1.0"> <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd" /> <xs:import namespace="http://www.imsglobal.org/xsd/imsmd_v1p2" schemaLocation="imsmd_v1p2.xsd" /> <xs:element name="dublincore" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element ref="dc:identifier" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>This is a globally unique identifer for the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:title" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The name of the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:description" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The description the question.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:creator" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Shows who edited the question last.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:publisher" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>The server URL responsible for making the question available. Internal variable</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:type" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Nature of genre of content of resource. Internal variable: most likely text for question</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:format" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Digital manifestation of resource. Internal variable: most likely stackQuestion/(version number)</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:language" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>language of content of resource. User defined, maybe default to users current Windows/Linux language setting</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:rights" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Rights management statement for the resource, or reference to a service providing such information</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="dc:date" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>An automatic time stamp showing when the question was last edited.</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lom" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element ref="lom:keyword" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Keywords, for searching over banks of questions. Note that any question with the keyword 'demo' will appear as a demo question for guest users and students to try and edit.</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="lom:context" minOccurs="0" maxOccurs="1"> <xs:annotation> <xs:documentation>Describes the educational context of the intended target audience of the resource. User defined list type</xs:documentation> </xs:annotation> </xs:element> <xs:element ref="lom:difficulty" minOccurs="0" maxOccurs="1"> ... [truncated message content] |
From: pkiddie <pk...@us...> - 2005-08-04 12:10:21
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22588/scripts Modified Files: Tag: development_xmlrqp stackXML.php Log Message: STACK now writes out its question and quiz schemas. All functions are commented. Example schemas and diagrams included. One time creation of schemas is now located in 'stackTest.php' Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.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 *** stackXML.php 3 Aug 2005 13:55:24 -0000 1.13.2.5 --- stackXML.php 4 Aug 2005 12:09:43 -0000 1.13.2.6 *************** *** 9,152 **** */ - //<PDK> Simple XML document class for phpV4 - writes out UTF-8 conforming XML - /** - * XmlDocument - * - * Simple Xml writer class for phpV4. Writes out UTF-8 conforming XML - * - * @access public - */ [...2286 lines suppressed...] ! } ! ! //Terminate a sequence of metadata tags ! $xml.='</xs:sequence>'; ! ! //We must now tag the 'metadata' tag with a version attribute ! $xml.= stack_schema_write_attribute('version', true); ! ! return $xml; ! } ! ! stack_xml_create_question_schema(); ! echo("Saved schema"); ?> --- 1436,1440 ---- } ! //stack_xml_create_question_schema(); ! //stack_xml_create_quiz_schema(); ?> |
From: pkiddie <pk...@us...> - 2005-08-03 17:03:07
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17100 Modified Files: Tag: development_xmlrqp changelog.txt index.php Log Message: On first run of STACK, index.php calls about_install.php script informing the user what they have to do to get stack installed. Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/changelog.txt,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** changelog.txt 3 Aug 2005 13:57:21 -0000 1.1.2.3 --- changelog.txt 3 Aug 2005 17:02:19 -0000 1.1.2.4 *************** *** 34,39 **** stackQuestion as expected. - AnsTest values to be written out in schema. ! ! Interface issues: --- 34,45 ---- stackQuestion as expected. - AnsTest values to be written out in schema. ! ! Issues when running STACK with IIS instead of Apache: ! - Must give read+execute access to the cmd.exe file from the IUSR_Guest account in order to open processes. Not the best solution - is a ! potentially serious security hole ! - Must give full permissions to the stack-1-0 directory by using the IIS snap-in in Computer Management - also must add 'index.php' to list ! of default web pages ! - various mYSQL issues: cannot use the latest version of mySQL with PHP4 over iis due to the use of more secure authentication: ! - tmp directory within stack-1-0 - to make writable, the IUSR_Guest account must have full control of it. Interface issues: Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** index.php 14 Jul 2005 18:44:54 -0000 1.23 --- index.php 3 Aug 2005 17:02:21 -0000 1.23.2.1 *************** *** 1,118 **** ! <?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. ! * @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."; ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! ! /////////////////////////////////////////////////////////////// ! // (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; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! --- 1,239 ---- ! <?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. ! ! * @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'); ! ! ! ! ! ! /////////////////////////////////////////////////////////////// ! ! // (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; ! ! } ! ! ! ! include('html/pagefoot.php'); ! ! ! ! ?> ! ! ! |
From: pkiddie <pk...@us...> - 2005-08-03 17:02:45
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17100/lang/en/doc Modified Files: Tag: development_xmlrqp about_install.php Log Message: On first run of STACK, index.php calls about_install.php script informing the user what they have to do to get stack installed. Index: about_install.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/about_install.php,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** about_install.php 1 Aug 2005 21:56:33 -0000 1.2.2.2 --- about_install.php 3 Aug 2005 17:02:22 -0000 1.2.2.3 *************** *** 36,40 **** user, a CAS, and a database over the internet. Hence the system ! itself requires of a number of extra components. --- 36,40 ---- user, a CAS, and a database over the internet. Hence the system ! itself requires a number of extra components. |
From: pkiddie <pk...@us...> - 2005-08-03 13:57:30
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28425 Modified Files: Tag: development_xmlrqp changelog.txt Log Message: Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/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 1 Aug 2005 21:56:24 -0000 1.1.2.2 --- changelog.txt 3 Aug 2005 13:57:21 -0000 1.1.2.3 *************** *** 26,33 **** Known issues: ! Process running times do not seem to correlate in Windows 98 ! stackUpdateDatabase is run before the database is set up on a fresh installation of STACK ! Order of question fields in stackQuestion is important - must relate to the database entries. ! confusing under windows how to make sure CAS is working added a couple of comments. --- 26,38 ---- Known issues: ! - Process running times do not seem to correlate in Windows 98 ! - stackUpdateDatabase is run before the database is set up on a fresh installation of STACK ! - Order of question fields in stackQuestion is important - must relate to the database entries. ! - confusing under windows how to make sure CAS is working added a couple of comments. ! - In the potential response schema structure, the possible enumerations for RawMarkMod and AnsTest are not output. This ! is a known issue and is due to the $markmods array which holds the possible values being present in stackAuthor - not ! stackQuestion as expected. ! - AnsTest values to be written out in schema. ! |
From: pkiddie <pk...@us...> - 2005-08-03 13:55:34
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28028/scripts Modified Files: Tag: development_xmlrqp stackQuestion.php stackXML.php Log Message: Refinements to schema creation: addition of methods to simplify schema creation. Updates to stackQuestion. Some example schemas Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.4 retrieving revision 1.13.2.5 diff -C2 -d -r1.13.2.4 -r1.13.2.5 *** stackXML.php 2 Aug 2005 16:00:27 -0000 1.13.2.4 --- stackXML.php 3 Aug 2005 13:55:24 -0000 1.13.2.5 *************** *** 1399,1407 **** include($filename); ! $dublinCoreUri = 'http://purl.org/dc/elements/1.1/'; ! $learningObjectUri = 'http://www.imsglobal.org/xsd/imsmd_v1p2'; //Namespace does not seem to resolve to anything ! $dublinCoreLocation = 'dc.xsd'; ! $learningObjectLocation = 'imsmd_v1p2.xsd'; $types = array(); //Array of metadata types - dublincore, stack, lom etc. --- 1399,1418 ---- [...1050 lines suppressed...] + + $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + //Assume a default minimum occurrence of 0 for the field - doesnt have to crop up + $schemaMinOccursAttr->nodeValue=$minOccurs; + + $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); + //Assume a default maximum occurrence of 1 - must only occur exactly once + $schemaMaxOccursAttr->nodeValue=$maxOccurs; + + //Add attributes to element + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaMinOccursAttr); + $schemaField->setAttributeNode($schemaMaxOccursAttr); + + return $schemaField; + } + + function stack_xml_create_schema_keyval_type() { Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.30.2.3 retrieving revision 1.30.2.4 diff -C2 -d -r1.30.2.3 -r1.30.2.4 *** stackQuestion.php 2 Aug 2005 16:00:26 -0000 1.30.2.3 --- stackQuestion.php 3 Aug 2005 13:55:24 -0000 1.30.2.4 *************** *** 263,266 **** --- 263,268 ---- $sqlToSchemaMapping['TIMESTAMP']='time'; + $sqlToSchemaMapping['FLOAT']='float'; + *************** *** 861,867 **** // 'Mark modifier operation'; ! $stackQuestionPotResp['RawMarkMod']['type']='option'; $stackQuestionPotResp['RawMarkMod']['branch']=TRUE; // 'Mark modifier'; --- 863,870 ---- // 'Mark modifier operation'; ! //<PDK> edited for schema output $stackQuestionPotResp['RawMarkMod']['type']='option'; $stackQuestionPotResp['RawMarkMod']['branch']=TRUE; + $stackQuestionPotResp['RawMarkMod']['values']= array ('=','+','-','=AT'); // 'Mark modifier'; *************** *** 1080,1084 **** $stackOptions['AnsTest']['values'] = $ats; ! /** --- 1083,1088 ---- $stackOptions['AnsTest']['values'] = $ats; ! //<PDK> added here ! $stackQuestionPotResp['AnsTest']['values'] = $ats; /** |
From: pkiddie <pk...@us...> - 2005-08-03 13:55:33
|
Update of /cvsroot/stack/stack-1-0/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28028/schemas Added Files: Tag: development_xmlrqp dc.xsd imsmd_v1p2.xsd sample_questions.xml sample_questions.xsd test.xsd test_instance test_instance.xml test_instance2.xml Log Message: Refinements to schema creation: addition of methods to simplify schema creation. Updates to stackQuestion. Some example schemas --- NEW FILE: test_instance.xml --- <?xml version="1.0"?> <assessmentItem xmlns="http://www.stack.bham.ac.uk/schemas/stackQuestion.xsd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/temp/Java%20Schema%20Validator/msv-20030225/test.xsd"> <dc:title>Patrologia Latina Database</dc:title> <dc:creator>Jacques Paul Migne</dc:creator> <dc:date>1993</dc:date> <dc:language>la</dc:language> <dc:format>CD-ROM</dc:format> <dc:description> The Patrologia Latina Database is an electronic version of the 221 volumes of the first edition of Jacques-Paul Migne's Patrologia Latina which was published between 1844 and 1865. The Patrologia Latina comprises the works of the Church Fathers from Tertullian in 200 AD to the death of Pope Innocent III in 1216. The database is fully searchable. </dc:description> <dc:publisher>Chadwyck-Healey</dc:publisher> </assessmentItem> --- NEW FILE: test_instance2.xml --- <?xml version="1.0"?> <assessmentItem version="1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///c:/temp/Java%20Schema%20Validator/msv-20030225/test.xsd"> <dc:identifier>string by default</dc:identifier> <dc:title>string by default</dc:title> <dc:description>string by default</dc:description> <dc:creator>string by default</dc:creator> <dc:publisher>string by default</dc:publisher> <dc:type>string by default</dc:type> <dc:format>string by default</dc:format> <dc:language>string by default</dc:language> <dc:rights>string by default</dc:rights> <dc:date>string by default</dc:date> <lom:keyword>test</lom:keyword> <lom:context>Higher Education</lom:context> <lom:difficulty>easy</lom:difficulty> <lom:typicallearningtime> <lom:datetime>string</lom:datetime> </lom:typicallearningtime> <competency>string</competency> <competencylevel>string</competencylevel> <excercisetype>string</excercisetype> <question> <questionVarsRaw>string</questionVarsRaw> <questionVars> <key>string</key> <val>string</val> </questionVars> <questionStem>string</questionStem> <questionAns>string</questionAns> <questionAnsKey>string</questionAnsKey> <questionAnsVarsRaw>string</questionAnsVarsRaw> <questionAnsVars> <key>string</key> <val>string</val> </questionAnsVars> <questionSol>string</questionSol> <questionNote>string</questionNote> </question> <questionOptions> <InsertStars>string</InsertStars> <InformalSyntax>string</InformalSyntax> <AllowInputTool>string</AllowInputTool> <SyntaxHint>string</SyntaxHint> <Display>string</Display> <Language>string</Language> <QuVal>string</QuVal> <MarkModMethod>string</MarkModMethod> <Penalty>string</Penalty> <Forbid>string</Forbid> <Allow>string</Allow> <AnsTest>string</AnsTest> <AnsTestOpt>string</AnsTestOpt> <TeacherEmail>string</TeacherEmail> <FeedBackGenericCorrect>string</FeedBackGenericCorrect> <FeedBackGenericIncorrect>string</FeedBackGenericIncorrect> <FeedBackGenericPCorrect>string</FeedBackGenericPCorrect> <ShowSol>string</ShowSol> </questionOptions> <questionPotResp> <SAns>string</SAns> <TAns>string</TAns> <AnsTest>string</AnsTest> <AnsTestOpt>string</AnsTestOpt> <true> <RawMarkMod>string</RawMarkMod> <RawMark>string</RawMark> <Penalty>string</Penalty> <FeedBack>string</FeedBack> <AnswerNote>string</AnswerNote> <ApLat>string</ApLat> </true> <false> <RawMarkMod>string</RawMarkMod> <RawMark>string</RawMark> <Penalty>string</Penalty> <FeedBack>string</FeedBack> <AnswerNote>string</AnswerNote> <ApLat>string</ApLat> </false> </questionPotResp> </assessmentItem> --- NEW FILE: test_instance --- <?xml version="1.0"?> <assessmentItem xmlns="http://www.stack.bham.ac.uk/schemas/stackQuestion.xsd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" version="1.0"> <dc:title>Patrologia Latina Database</dc:title> <dc:creator>Jacques Paul Migne</dc:creator> <dc:date>1993</dc:date> <dc:language>la</dc:language> <dc:format>CD-ROM</dc:format> <bc:extent>2 computer laser optical disks; 4 3/4 in</bc:extent> <dc:description> The Patrologia Latina Database is an electronic version of the 221 volumes of the first edition of Jacques-Paul Migne's Patrologia Latina which was published between 1844 and 1865. The Patrologia Latina comprises the works of the Church Fathers from Tertullian in 200 AD to the death of Pope Innocent III in 1216. The database is fully searchable. </dc:description> <bc:systemRequirements> Multimedia PC 486x or higher, 8mb memory, CD-ROM drive, sound card, SVGA 256-colour monitor, Windows 95 or Windows 3.1 </bc:systemRequirements> <subject subjectScheme="LCSH"> Christian literature, Early </subject> <identifier identifierScheme="URN"> isbn:0-89887-113-1 </identifier> <bc:placePublication>Cambridge</bc:placePublication> <dc:publisher>Chadwyck-Healey</dc:publisher> </assessmentItem> --- NEW FILE: sample_questions.xml --- <?xml version="1.0"?> <mathQuiz> <assessmentItem> <assessmentItem_ord order="0"> <questionVarsRaw>n = 3;m = 5;p = 2*(x-n)^2*(x-m);q = expand(p)</questionVarsRaw> <questionStem>Factorise \[ @q@, \] given that $(x-@n@)$ is a factor. </questionStem> <questionAns>p</questionAns> <questionAnsKey>ans1</questionAnsKey> <questionAnsVarsRaw>n = 3;m = 5;p = 2*(x-n)^2*(x-m);q = expand(p)</questionAnsVarsRaw> <questionPotResp> <questionPotResp_ord order="0"> <SAns>ans1</SAns> <TAns>p</TAns> <AnsTest>FacForm</AnsTest> <AnsTestOpt>x</AnsTestOpt> <true> <RawMarkMod>=</RawMarkMod> [...1053 lines suppressed...] <SyntaxHint>[matrix([?,?],[?,?]),matrix([?,?],[?,?])]</SyntaxHint> </questionOptions> <questionAnsVars> <questionAnsVars_ord order="0"> <key>SA</key> <value>ans1[1]</value> </questionAnsVars_ord> <questionAnsVars_ord order="1"> <key>SB</key> <value>ans1[2]</value> </questionAnsVars_ord> </questionAnsVars> <questionGUID>MTExMjE3NjE0NTM5Mzg0Mj</questionGUID> <questionName>matrix_noncom_2</questionName> <questionDescription>Show matrix multiplication is not commutative</questionDescription> <questionKeywords>demo, matrix, multiply</questionKeywords> <questionDateLastEdited>2005-04-25 17:23:13</questionDateLastEdited> </assessmentItem_ord> </assessmentItem> </mathQuiz> --- NEW FILE: test.xsd --- <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2" version="1.0"> <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd" /> <xs:import namespace="http://www.imsglobal.org/xsd/imsmd_v1p2" schemaLocation="imsmd_v1p2.xsd" /> <xs:element name="dublincore"> <xs:complexType> <xs:sequence> <xs:element ref="dc:identifier" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:title" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:description" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:creator" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:publisher" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:type" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:format" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:language" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:rights" minOccurs="0" maxOccurs="1" /> <xs:element ref="dc:date" minOccurs="0" maxOccurs="1" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lom"> <xs:complexType> <xs:sequence> <xs:element ref="lom:keyword" minOccurs="0" maxOccurs="1" /> <xs:element ref="lom:context" minOccurs="0" maxOccurs="1" /> <xs:element ref="lom:difficulty" minOccurs="0" maxOccurs="1" /> <xs:element ref="lom:typicallearningtime" minOccurs="0" maxOccurs="1" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="stack"> <xs:complexType> <xs:sequence> <xs:element name="competency" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="competencylevel" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="excercisetype" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="question"> <xs:complexType> <xs:sequence> <xs:element name="questionVarsRaw" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionVars" minOccurs="0" maxOccurs="1" type="keyval" /> <xs:element name="questionStem" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionAns" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionAnsKey" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionAnsVarsRaw" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionAnsVars" minOccurs="0" maxOccurs="1" type="keyval" /> <xs:element name="questionSol" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="questionNote" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="insertstars"> <xs:restriction base="xs:string"> <xs:enumeration value="TRUE" /> <xs:enumeration value="FALSE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="informalsyntax"> <xs:restriction base="xs:string"> <xs:enumeration value="TRUE" /> <xs:enumeration value="FALSE" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="allowinputtool"> <xs:restriction base="xs:string"> <xs:enumeration value="Form box" /> <xs:enumeration value="Form box + JOME" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="display"> <xs:restriction base="xs:string"> <xs:enumeration value="String" /> <xs:enumeration value="LaTeX" /> <xs:enumeration value="MathML" /> <xs:enumeration value="LaTeX Source" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="language"> <xs:restriction base="xs:string"> <xs:enumeration value="en" /> <xs:enumeration value="es" /> <xs:enumeration value="nl" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="markmodmethod"> <xs:restriction base="xs:string"> <xs:enumeration value="Penalty" /> <xs:enumeration value="Last Answer" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="anstest"> <xs:restriction base="xs:string"> <xs:enumeration value="AlgEquiv" /> <xs:enumeration value="CASEqual" /> <xs:enumeration value="Num_tol_relative" /> <xs:enumeration value="Num_tol_absolute" /> <xs:enumeration value="String" /> <xs:enumeration value="StringSloppy" /> <xs:enumeration value="RegExp" /> <xs:enumeration value="FacForm" /> <xs:enumeration value="SA_factored" /> <xs:enumeration value="SA_expanded" /> <xs:enumeration value="PartFrac" /> <xs:enumeration value="Diff" /> <xs:enumeration value="Int" /> <xs:enumeration value="SA_True" /> <xs:enumeration value="True" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="showsol"> <xs:restriction base="xs:string"> <xs:enumeration value="Always" /> <xs:enumeration value="Never" /> <xs:enumeration value="On request" /> <xs:enumeration value="After correct answer" /> </xs:restriction> </xs:simpleType> <xs:element name="questionOptions"> <xs:complexType> <xs:sequence> <xs:element name="InsertStars" minOccurs="0" maxOccurs="1" type="insertstars" /> <xs:element name="InformalSyntax" minOccurs="0" maxOccurs="1" type="informalsyntax" /> <xs:element name="AllowInputTool" minOccurs="0" maxOccurs="1" type="allowinputtool" /> <xs:element name="SyntaxHint" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="Display" minOccurs="0" maxOccurs="1" type="display" /> <xs:element name="Language" minOccurs="0" maxOccurs="1" type="language" /> <xs:element name="QuVal" minOccurs="0" maxOccurs="1" type="xs:float" /> <xs:element name="MarkModMethod" minOccurs="0" maxOccurs="1" type="markmodmethod" /> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:float" /> <xs:element name="Forbid" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="Allow" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="AnsTest" minOccurs="0" maxOccurs="1" type="anstest" /> <xs:element name="AnsTestOpt" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="TeacherEmail" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="FeedBackGenericCorrect" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="FeedBackGenericIncorrect" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="FeedBackGenericPCorrect" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="ShowSol" minOccurs="0" maxOccurs="1" type="showsol" /> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="anstest"> <xs:restriction base="xs:string"> <xs:enumeration value="AlgEquiv" /> <xs:enumeration value="CASEqual" /> <xs:enumeration value="Num_tol_relative" /> <xs:enumeration value="Num_tol_absolute" /> <xs:enumeration value="String" /> <xs:enumeration value="StringSloppy" /> <xs:enumeration value="RegExp" /> <xs:enumeration value="FacForm" /> <xs:enumeration value="SA_factored" /> <xs:enumeration value="SA_expanded" /> <xs:enumeration value="PartFrac" /> <xs:enumeration value="Diff" /> <xs:enumeration value="Int" /> <xs:enumeration value="SA_True" /> <xs:enumeration value="True" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="rawmarkmod"> <xs:restriction base="xs:string"> <xs:enumeration value="=" /> <xs:enumeration value="+" /> <xs:enumeration value="-" /> <xs:enumeration value="=AT" /> </xs:restriction> </xs:simpleType> <xs:element name="questionPotResp"> <xs:complexType> <xs:sequence> <xs:element name="SAns" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="TAns" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="AnsTest" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="AnsTestOpt" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="true"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="RawMark" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="FeedBack" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="AnswerNote" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="ApLat" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="false"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="RawMark" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="Penalty" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="FeedBack" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="AnswerNote" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="ApLat" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="keyval"> <xs:sequence> <xs:element name="key" type="xs:string" /> <xs:element name="val" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:element name="assessmentItem"> <xs:complexType> <xs:all> <xs:element ref="dublincore" /> <xs:element ref="lom" /> <xs:element ref="stack" /> <xs:element ref="question" /> <xs:element ref="questionOptions" /> <xs:element ref="questionPotResp" /> </xs:all> <xs:attribute name="version" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[1-9]+[0-9]*\.[0-9]+" /> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:schema> --- NEW FILE: imsmd_v1p2.xsd --- <?xml version="1.0" encoding="UTF-8"?> <!-- edited by Thomas Wason --> <xsd:schema xmlns="http://www.imsglobal.org/xsd/imsmd_v1p2" targetNamespace="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" version="IMS MD 1.2.1"> <xsd:import namespace = "http://www.w3.org/XML/1998/namespace" schemaLocation = "http://www.w3.org/2001/03/xml.xsd"/> <!-- ******************** --> <!-- ** Change History ** --> <!-- ******************** --> <xsd:annotation> <xsd:documentation>2001-04-26 T.D.Wason. IMS meta-data 1.2 XML-Schema. </xsd:documentation> <xsd:documentation>2001-06-07 S.E.Thropp. Changed the multiplicity on all elements to match the </xsd:documentation> <xsd:documentation>Final 1.2 Binding Specification. </xsd:documentation> <xsd:documentation>Changed all elements that use the langstringType to a multiplicy of 1 or more </xsd:documentation> <xsd:documentation>Changed centity in the contribute element to have a multiplicity of 0 or more. </xsd:documentation> <xsd:documentation>Changed the requirement element to have a multiplicity of 0 or more. </xsd:documentation> <xsd:documentation> 2001-07-25 Schawn Thropp. Updates to bring the XSD up to speed with the W3C </xsd:documentation> <xsd:documentation> XML Schema Recommendation. The following changes were made: Change the </xsd:documentation> <xsd:documentation> namespace to reference the 5/2/2001 W3C XML Schema Recommendation,the base </xsd:documentation> <xsd:documentation> type for the durtimeType, simpleType, was changed from timeDuration to duration. </xsd:documentation> <xsd:documentation> Any attribute declarations that have use="default" had to change to use="optional" </xsd:documentation> <xsd:documentation> - attr.type. Any attribute declarations that have value ="somevalue" had to change </xsd:documentation> <xsd:documentation> to default = "somevalue" - attr.type (URI) </xsd:documentation> <xsd:documentation> 2001-09-04 Schawn Thropp </xsd:documentation> <xsd:documentation> Changed the targetNamespace and namespace of schema to reflect version change </xsd:documentation> </xsd:annotation> <!-- *************************** --> <!-- ** Attribute Declaration ** --> <!-- *************************** --> <xsd:attributeGroup name="attr.type"> <xsd:attribute name="type" use="optional" default="URI"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="URI"/> <xsd:enumeration value="TEXT"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:attributeGroup> <xsd:group name="grp.any"> <xsd:annotation> <xsd:documentation>Any namespaced element from any namespace may be used for an "any" element. The namespace for the imported element must be defined in the instance, and the schema must be imported. </xsd:documentation> </xsd:annotation> <xsd:sequence> <xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group> <!-- ************************* --> <!-- ** Element Declaration ** --> <!-- ************************* --> <xsd:element name="aggregationlevel" type="aggregationlevelType"/> <xsd:element name="annotation" type="annotationType"/> <xsd:element name="catalogentry" type="catalogentryType"/> <xsd:element name="catalog" type="catalogType"/> <xsd:element name="centity" type="centityType"/> <xsd:element name="classification" type="classificationType"/> <xsd:element name="context" type="contextType"/> <xsd:element name="contribute" type="contributeType"/> <xsd:element name="copyrightandotherrestrictions" type="copyrightandotherrestrictionsType"/> <xsd:element name="cost" type="costType"/> <xsd:element name="coverage" type="coverageType"/> <xsd:element name="date" type="dateType"/> <xsd:element name="datetime" type="datetimeType"/> <xsd:element name="description" type="descriptionType"/> <xsd:element name="difficulty" type="difficultyType"/> <xsd:element name="educational" type="educationalType"/> <xsd:element name="entry" type="entryType"/> <xsd:element name="format" type="formatType"/> <xsd:element name="general" type="generalType"/> <xsd:element name="identifier" type="xsd:string"/> <xsd:element name="intendedenduserrole" type="intendedenduserroleType"/> <xsd:element name="interactivitylevel" type="interactivitylevelType"/> <xsd:element name="interactivitytype" type="interactivitytypeType"/> <xsd:element name="keyword" type="keywordType"/> <xsd:element name="kind" type="kindType"/> <xsd:element name="langstring" type="langstringType"/> <xsd:element name="language" type="xsd:string"/> <xsd:element name="learningresourcetype" type="learningresourcetypeType"/> <xsd:element name="lifecycle" type="lifecycleType"/> <xsd:element name="location" type="locationType"/> <xsd:element name="lom" type="lomType"/> <xsd:element name="maximumversion" type="minimumversionType"/> <xsd:element name="metadatascheme" type="metadataschemeType"/> <xsd:element name="metametadata" type="metametadataType"/> <xsd:element name="minimumversion" type="maximumversionType"/> <xsd:element name="name" type="nameType"/> <xsd:element name="purpose" type="purposeType"/> <xsd:element name="relation" type="relationType"/> <xsd:element name="requirement" type="requirementType"/> <xsd:element name="resource" type="resourceType"/> <xsd:element name="rights" type="rightsType"/> <xsd:element name="role" type="roleType"/> <xsd:element name="semanticdensity" type="semanticdensityType"/> <xsd:element name="size" type="sizeType"/> <xsd:element name="source" type="sourceType"/> <xsd:element name="status" type="statusType"/> <xsd:element name="structure" type="structureType"/> <xsd:element name="taxon" type="taxonType"/> <xsd:element name="taxonpath" type="taxonpathType"/> <xsd:element name="technical" type="technicalType"/> <xsd:element name="title" type="titleType"/> <xsd:element name="type" type="typeType"/> <xsd:element name="typicalagerange" type="typicalagerangeType"/> <xsd:element name="typicallearningtime" type="typicallearningtimeType"/> <xsd:element name="value" type="valueType"/> <xsd:element name="person" type="personType"/> <xsd:element name="vcard" type="xsd:string"/> <xsd:element name="version" type="versionType"/> <xsd:element name="installationremarks" type="installationremarksType"/> <xsd:element name="otherplatformrequirements" type="otherplatformrequirementsType"/> <xsd:element name="duration" type="durationType"/> <xsd:element name="id" type="idType"/> <!-- ******************* --> <!-- ** Complex Types ** --> <!-- ******************* --> <xsd:complexType name="aggregationlevelType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="annotationType" mixed="true"> <xsd:sequence> <xsd:element ref="person" minOccurs="0"/> <xsd:element ref="date" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="catalogentryType" mixed="true"> <xsd:sequence> <xsd:element ref="catalog"/> <xsd:element ref="entry"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="centityType"> <xsd:sequence> <xsd:element ref="vcard"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="classificationType" mixed="true"> <xsd:sequence> <xsd:element ref="purpose" minOccurs="0"/> <xsd:element ref="taxonpath" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="description" minOccurs="0"/> <xsd:element ref="keyword" minOccurs="0" maxOccurs="unbounded"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="contextType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="contributeType" mixed="true"> <xsd:sequence> <xsd:element ref="role"/> <xsd:element ref="centity" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="date" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="copyrightandotherrestrictionsType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="costType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="coverageType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="dateType"> <xsd:sequence> <xsd:element ref="datetime" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="descriptionType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="difficultyType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="durationType"> <xsd:sequence> <xsd:element ref="datetime" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="educationalType" mixed="true"> <xsd:sequence> <xsd:element ref="interactivitytype" minOccurs="0"/> <xsd:element ref="learningresourcetype" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="interactivitylevel" minOccurs="0"/> <xsd:element ref="semanticdensity" minOccurs="0"/> <xsd:element ref="intendedenduserrole" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="context" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="typicalagerange" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="difficulty" minOccurs="0"/> <xsd:element ref="typicallearningtime" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> <xsd:element ref="language" minOccurs="0" maxOccurs="unbounded"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="entryType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="generalType" mixed="true"> <xsd:sequence> <xsd:element ref="identifier" minOccurs="0"/> <xsd:element ref="title" minOccurs="0"/> <xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="language" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="description" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="keyword" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="coverage" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="structure" minOccurs="0"/> <xsd:element ref="aggregationlevel" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="installationremarksType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="intendedenduserroleType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="interactivitylevelType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="interactivitytypeType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="keywordType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="kindType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="langstringType"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute ref="xml:lang"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="learningresourcetypeType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="lifecycleType" mixed="true"> <xsd:sequence> <xsd:element ref="version" minOccurs="0"/> <xsd:element ref="status" minOccurs="0"/> <xsd:element ref="contribute" minOccurs="0" maxOccurs="unbounded"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="locationType"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attributeGroup ref="attr.type"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="lomType"> <xsd:sequence> <xsd:element ref="general" minOccurs="0"/> <xsd:element ref="lifecycle" minOccurs="0"/> <xsd:element ref="metametadata" minOccurs="0"/> <xsd:element ref="technical" minOccurs="0"/> <xsd:element ref="educational" minOccurs="0"/> <xsd:element ref="rights" minOccurs="0"/> <xsd:element ref="relation" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="annotation" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="classification" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="metametadataType" mixed="true"> <xsd:sequence> <xsd:element ref="identifier" minOccurs="0"/> <xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="contribute" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="metadatascheme" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="language" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="nameType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="otherplatformrequirementsType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="personType"> <xsd:sequence> <xsd:element ref="vcard"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="purposeType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="relationType" mixed="true"> <xsd:sequence> <xsd:element ref="kind" minOccurs="0"/> <xsd:element ref="resource" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="requirementType" mixed="true"> <xsd:sequence> <xsd:element ref="type" minOccurs="0"/> <xsd:element ref="name" minOccurs="0"/> <xsd:element ref="minimumversion" minOccurs="0"/> <xsd:element ref="maximumversion" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="resourceType" mixed="true"> <xsd:sequence> <xsd:element ref="identifier" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> <xsd:element ref="catalogentry" minOccurs="0" maxOccurs="unbounded"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="rightsType" mixed="true"> <xsd:sequence> <xsd:element ref="cost" minOccurs="0"/> <xsd:element ref="copyrightandotherrestrictions" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="roleType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="semanticdensityType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="sourceType"> <xsd:sequence> <xsd:element ref="langstring"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="statusType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="stringType"> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute ref="xml:lang"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="structureType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="taxonpathType"> <xsd:sequence> <xsd:element ref="source" minOccurs="0"/> <xsd:element ref="taxon" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="taxonType"> <xsd:sequence> <xsd:element ref="id" minOccurs="0"/> <xsd:element ref="entry" minOccurs="0"/> <xsd:element ref="taxon" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="technicalType" mixed="true"> <xsd:sequence> <xsd:element ref="format" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="size" minOccurs="0"/> <xsd:element ref="location" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="requirement" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="installationremarks" minOccurs="0"/> <xsd:element ref="otherplatformrequirements" minOccurs="0"/> <xsd:element ref="duration" minOccurs="0"/> <xsd:group ref="grp.any"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="titleType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="typeType"> <xsd:sequence> <xsd:element ref="source"/> <xsd:element ref="value"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="typicalagerangeType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="typicallearningtimeType"> <xsd:sequence> <xsd:element ref="datetime" minOccurs="0"/> <xsd:element ref="description" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="valueType"> <xsd:sequence> <xsd:element ref="langstring"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="versionType"> <xsd:sequence> <xsd:element ref="langstring" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <!-- ****************** --> <!-- ** Simple Types ** --> <!-- ****************** --> <xsd:simpleType name="formatType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="sizeType"> <xsd:restriction base="xsd:int"/> </xsd:simpleType> <xsd:simpleType name="datetimeType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="idType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="metadataschemeType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="catalogType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="minimumversionType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="maximumversionType"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> </xsd:schema> --- NEW FILE: dc.xsd --- <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://purl.org/dc/elements/1.1/" targetNamespace="http://purl.org/dc/elements/1.1/" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:annotation> <xs:documentation xml:lang="en"> DCMES 1.1 XML Schema XML Schema for http://purl.org/dc/elements/1.1/ namespace Created 2003-04-02 Created by Tim Cole (t-...@ui...) Tom Habing (th...@ui...) Jane Hunter (ja...@ds...) Pete Johnston (p.j...@uk...), Carl Lagoze (la...@cs...) This schema declares XML elements for the 15 DC elements from the http://purl.org/dc/elements/1.1/ namespace. It defines a complexType SimpleLiteral which permits mixed content and makes the xml:lang attribute available. It disallows child elements by use of minOcccurs/maxOccurs. However, this complexType does permit the derivation of other complexTypes which would permit child elements. All elements are declared as substitutable for the abstract element any, which means that the default type for all elements is dc:SimpleLiteral. </xs:documentation> </xs:annotation> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"> </xs:import> <xs:complexType name="SimpleLiteral"> <xs:annotation> <xs:documentation xml:lang="en"> This is the default type for all of the DC elements. It permits text content only with optional xml:lang attribute. Text is allowed because mixed="true", but sub-elements are disallowed because minOccurs="0" and maxOccurs="0" are on the xs:any tag. This complexType allows for restriction or extension permitting child elements. </xs:documentation> </xs:annotation> <xs:complexContent mixed="true"> <xs:restriction base="xs:anyType"> <xs:sequence> <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/> </xs:sequence> <xs:attribute ref="xml:lang" use="optional"/> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:element name="any" type="SimpleLiteral" abstract="true"/> <xs:element name="title" substitutionGroup="any"/> <xs:element name="creator" substitutionGroup="any"/> <xs:element name="subject" substitutionGroup="any"/> <xs:element name="description" substitutionGroup="any"/> <xs:element name="publisher" substitutionGroup="any"/> <xs:element name="contributor" substitutionGroup="any"/> <xs:element name="date" substitutionGroup="any"/> <xs:element name="type" substitutionGroup="any"/> <xs:element name="format" substitutionGroup="any"/> <xs:element name="identifier" substitutionGroup="any"/> <xs:element name="source" substitutionGroup="any"/> <xs:element name="language" substitutionGroup="any"/> <xs:element name="relation" substitutionGroup="any"/> <xs:element name="coverage" substitutionGroup="any"/> <xs:element name="rights" substitutionGroup="any"/> <xs:group name="elementsGroup"> <xs:annotation> <xs:documentation xml:lang="en"> This group is included as a convenience for schema authors who need to refer to all the elements in the http://purl.org/dc/elements/1.1/ namespace. </xs:documentation> </xs:annotation> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="any"/> </xs:choice> </xs:sequence> </xs:group> <xs:complexType name="elementContainer"> <xs:annotation> <xs:documentation xml:lang="en"> This complexType is included as a convenience for schema authors who need to define a root or container element for all of the DC elements. </xs:documentation> </xs:annotation> <xs:choice> <xs:group ref="elementsGroup"/> </xs:choice> </xs:complexType> </xs:schema> --- NEW FILE: sample_questions.xsd --- <?xml version="1.0"?> <xs:schema id="mathQuiz" targetNamespace="http://tempuri.org/sample_questions.xsd" xmlns:mstns="http://tempuri.org/sample_questions.xsd" xmlns="http://tempuri.org/sample_questions.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified"> <xs:element name="mathQuiz" msdata:IsDataSet="true" msdata:Locale="en-GB" msdata:EnforceConstraints="False"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="assessmentItem"> <xs:complexType> <xs:sequence> <xs:element name="assessmentItem_ord" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="questionVarsRaw" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="questionStem" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> <xs:element name="questionAns" type="xs:string" minOccurs="0" msdata:Ordinal="2" /> <xs:element name="questionAnsKey" type="xs:string" minOccurs="0" msdata:Ordinal="3" /> <xs:element name="questionAnsVarsRaw" type="xs:string" minOccurs="0" msdata:Ordinal="4" /> <xs:element name="questionNote" type="xs:string" minOccurs="0" msdata:Ordinal="6" /> <xs:element name="questionGUID" type="xs:string" minOccurs="0" msdata:Ordinal="7" /> <xs:element name="questionName" type="xs:string" minOccurs="0" msdata:Ordinal="8" /> <xs:element name="questionDescription" type="xs:string" minOccurs="0" msdata:Ordinal="9" /> <xs:element name="questionKeywords" type="xs:string" minOccurs="0" msdata:Ordinal="10" /> <xs:element name="questionDateLastEdited" type="xs:string" minOccurs="0" msdata:Ordinal="11" /> <xs:element name="questionSol" type="xs:string" minOccurs="0" msdata:Ordinal="12" /> <xs:element name="questionPotResp" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="questionPotResp_ord" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="SAns" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="TAns" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> <xs:element name="AnsTest" type="xs:string" minOccurs="0" msdata:Ordinal="2" /> <xs:element name="AnsTestOpt" type="xs:string" minOccurs="0" msdata:Ordinal="3" /> <xs:element name="true" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" type="xs:string" minOccurs="0" /> <xs:element name="RawMark" type="xs:string" minOccurs="0" /> <xs:element name="ApLat" type="xs:string" minOccurs="0" /> <xs:element name="AnswerNote" type="xs:string" minOccurs="0" /> <xs:element name="FeedBack" type="xs:string" minOccurs="0" /> <xs:element name="Penalty" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="false" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="RawMarkMod" type="xs:string" minOccurs="0" /> <xs:element name="RawMark" type="xs:string" minOccurs="0" /> <xs:element name="ApLat" type="xs:string" minOccurs="0" /> <xs:element name="FeedBack" type="xs:string" minOccurs="0" /> <xs:element name="AnswerNote" type="xs:string" minOccurs="0" /> <xs:element name="Penalty" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="order" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="questionOptions" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Forbid" type="xs:string" minOccurs="0" /> <xs:element name="AnsTest" type="xs:string" minOccurs="0" /> <xs:element name="AnsTestOpt" type="xs:string" minOccurs="0" /> <xs:element name="InsertStars" type="xs:string" minOccurs="0" /> <xs:element name="AllowInputTool" type="xs:string" minOccurs="0" /> <xs:element name="SyntaxHint" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="questionVars" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="questionVars_ord" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="key" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="value" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> </xs:sequence> <xs:attribute name="order" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="questionAnsVars" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="questionAnsVars_ord" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="key" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="value" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> </xs:sequence> <xs:attribute name="order" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="order" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> |
From: pkiddie <pk...@us...> - 2005-08-02 16:00:49
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1984/scripts Modified Files: Tag: development_xmlrqp stackQuestion.php stackXML.php Log Message: Updated potential responses structure to indicate to XML schema parser whether type is global or part of a true/false branch. Schema creation for an 'assessmentItem' completed - just needs more elegence! Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.3 retrieving revision 1.13.2.4 diff -C2 -d -r1.13.2.3 -r1.13.2.4 *** stackXML.php 1 Aug 2005 21:56:34 -0000 1.13.2.3 --- stackXML.php 2 Aug 2005 16:00:27 -0000 1.13.2.4 *************** *** 1344,1347 **** --- 1344,1360 ---- } + /*function stack_xml_create_question($question) + { + //This time we want namespace awareness when producing our XML files + $dom = new DOMIT_DOCUMENT(); + $dom->SetNamespaceAwareness(true); + + + } + + function stack_xml_create_quiz($quiz) + { + }*/ + /** * Creates a question schema for the specified question *************** *** 1359,1367 **** */ //Creates a question schema using the stackQuestion data structure //Writes out each of the possible entities that can exist in the XML file, and in the case of the metadata //The particular standard it belongs to ! ! function stack_xml_create_question_schema($questionSchemaLocation,$questionSchemaVersion) { include('stackstd.php'); //For writing out schema version: use stack version --- 1372,1392 ---- */ + //Only difference between quiz and question is quiz has multiple questions, or 'AssessmentItems' - each quiz also + //has global options, and a global metadata structure + function stack_xml_create_quiz_schema($quizSchemaLocation,$quizSchemaVersion) + { + + + } + + /*function stack_xml_create_question_schema($questionSchemaLocation,$questionSchemaVersion) + { + + }*/ + //Creates a question schema using the stackQuestion data structure //Writes out each of the possible entities that can exist in the XML file, and in the case of the metadata //The particular standard it belongs to ! function stack_xml_create_question_schema() { include('stackstd.php'); //For writing out schema version: use stack version *************** *** 1374,1381 **** include($filename); ! $dublinCoreUri = 'http://purl.org/dc/elements/1.1'; ! $learningObjectUri = 'http://www.imsglobal.org/xsd/imsmd_v1p2'; $types = array(); //Array of metadata types - dublincore, stack, lom etc. // Don't export questionID within metadata --- 1399,1411 ---- include($filename); ! $dublinCoreUri = 'http://purl.org/dc/elements/1.1/'; ! $learningObjectUri = 'http://www.imsglobal.org/xsd/imsmd_v1p2'; //Namespace does not seem to resolve to anything ! ! $dublinCoreLocation = 'dc.xsd'; ! $learningObjectLocation = 'imsmd_v1p2.xsd'; $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 *************** *** 1392,1395 **** --- 1422,1427 ---- //$dom->SetNamespaceAwareness(true); //We dont want to use namespace awareness for schema generation + $dom->appendChild($dom->createProcessingInstruction('xml', "version=\"1.0\" encoding=\"utf-8\"")); + //Contruct the header for the schema $schemaElem = new DOMIT_Element('xs:schema'); //Root element <xs:schema *************** *** 1420,1431 **** --- 1452,1475 ---- //Import namespaces to provide access to particular fields from LOM/DC $dcImportNode = new DOMIT_Element('xs:import'); + $dcImportAttr = new DOMIT_Attr('namespace'); $dcImportAttr->nodeValue=$dublinCoreUri; + + $dcImportLoc = new DOMIT_Attr('schemaLocation'); + $dcImportLoc->nodeValue=$dublinCoreLocation; + $dcImportNode->setAttributeNode($dcImportAttr); + $dcImportNode->setAttributeNode($dcImportLoc); $lomImportNode = new DOMIT_Element('xs:import'); + $lomImportAttr = new DOMIT_Attr('namespace'); $lomImportAttr->nodeValue=$learningObjectUri; + + $lomImportLoc = new DOMIT_Attr('schemaLocation'); + $lomImportLoc->nodeValue=$learningObjectLocation; + $lomImportNode->setAttributeNode($lomImportAttr); + $lomImportNode->setAttributeNode($lomImportLoc); $schemaElem->appendChild($dcImportNode); *************** *** 1481,1488 **** $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); ! //Assume a default minimum occurrence for the field if (empty($questionField['minoccurs'])) { ! $schemaMinOccursAttr->nodeValue=1; } --- 1525,1532 ---- $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); ! //Assume a default minimum occurrence of 0 for the field - doesnt have to crop up if (empty($questionField['minoccurs'])) { ! $schemaMinOccursAttr->nodeValue=0; } *************** *** 1493,1497 **** $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); ! //Assume a default minimum occurrence for the field if (empty($questionField['maxoccurs'])) { --- 1537,1541 ---- $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); ! //Assume a default maxmimum occurrence for the field if (empty($questionField['maxoccurs'])) { *************** *** 1627,1630 **** --- 1671,1675 ---- } + $xmlElements[] = $type; //Add 'type' to collection of xml elements $schemaComplexType->appendChild($schemaSequence); $schemaElement->appendChild($schemaComplexType); *************** *** 1637,1641 **** $schemaElementAttr = &new DOMIT_Attr('name'); $schemaElementAttr->nodeValue='question'; ! $schemaElement->setAttributeNode($schemaElementAttr); --- 1682,1687 ---- $schemaElementAttr = &new DOMIT_Attr('name'); $schemaElementAttr->nodeValue='question'; ! $xmlElements[] = 'question'; ! $schemaElement->setAttributeNode($schemaElementAttr); *************** *** 1744,1747 **** --- 1790,1794 ---- $schemaElementAttr = &new DOMIT_Attr('name'); $schemaElementAttr->nodeValue='questionOptions'; + $xmlElements[] = 'questionOptions'; $schemaElement->setAttributeNode($schemaElementAttr); *************** *** 1787,1790 **** --- 1834,1838 ---- $schemaElementAttr = &new DOMIT_Attr('name'); $schemaElementAttr->nodeValue='questionPotResp'; + $xmlElements[] = 'questionPotResp'; $schemaElement->setAttributeNode($schemaElementAttr); *************** *** 1793,1812 **** $schemaSequence = &new DOMIT_Element('xs:sequence'); foreach($stackQuestionPotResp as $arrayKey=>$responsesField) { ! $schemaField = &new DOMIT_Element('xs:element'); ! $schemaFieldAttr = &new DOMIT_Attr('name'); ! $schemaFieldAttr->nodeValue=$arrayKey; ! $schemaTypeAttr = &new DOMIT_Attr('type'); ! $schemaTypeAttr->nodeValue='xs:string'; ! $schemaField->setAttributeNode($schemaFieldAttr); ! $schemaField->setAttributeNode($schemaTypeAttr); ! $schemaSequence->appendChild($schemaField); ! ! /*$schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); //Assume a default minimum occurrence for the field --- 1841,1879 ---- $schemaSequence = &new DOMIT_Element('xs:sequence'); + $responseBranch = &new DOMIT_Element('xs:element'); + $responseBranchName = &new DOMIT_Attr('name'); + $responseBranchName->nodeValue='true'; + + $responseBranch->setAttributeNode($responseBranchName); + + $responseBranchCopy = &new DOMIT_Element('xs:element'); + $responseBranchCopyName = &new DOMIT_Attr('name'); + $responseBranchCopyName->nodeValue='false'; + + $responseBranchCopy->setAttributeNode($responseBranchCopyName); + + $responseBranchCType = &new DOMIT_Element('xs:complexType'); + $responseBranchSeq = &new DOMIT_Element('xs:sequence'); + + //Global response parameters foreach($stackQuestionPotResp as $arrayKey=>$responsesField) { ! //If the field is not a branched response parameter ! if (!$responsesField['branch']) ! { ! $schemaField = &new DOMIT_Element('xs:element'); ! $schemaFieldAttr = &new DOMIT_Attr('name'); ! $schemaFieldAttr->nodeValue=$arrayKey; ! $schemaTypeAttr = &new DOMIT_Attr('type'); ! $schemaTypeAttr->nodeValue='xs:string'; ! $schemaField->setAttributeNode($schemaFieldAttr); ! $schemaField->setAttributeNode($schemaTypeAttr); ! $schemaSequence->appendChild($schemaField); ! ! /*$schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); //Assume a default minimum occurrence for the field *************** *** 1820,1830 **** $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; }*/ } $schemaComplexType->appendChild($schemaSequence); $schemaElement->appendChild($schemaComplexType); $schemaElem->appendChild($schemaElement); ! //4. The 'keyval' type /* <xs:complexType name="keyval"> --- 1887,1987 ---- $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; }*/ + } + + + //If the field does belong to a response branch. Add to colllection within the true/false elements + else if ($responsesField['branch']) + { + $responseField = &new DOMIT_Element('xs:element'); + + $responseFieldAttr = &new DOMIT_Attr('name'); + $responseFieldAttr->nodeValue=$arrayKey; + + $responseTypeAttr = &new DOMIT_Attr('type'); + $responseTypeAttr->nodeValue='xs:string'; + + $responseField->setAttributeNode($responseFieldAttr); + $responseField->setAttributeNode($responseTypeAttr); + + $responseBranchSeq->appendChild($responseField); + } } + $responseBranchCType->appendChild($responseBranchSeq); + $responseBranch->appendChild($responseBranchCType); + $responseBranchCopy->appendChild($responseBranchCType); + + //Make copy of response branch, then change name attribute to 'false' - saves processing + //$responseBranchCopy = new DOMIT_Element(''); + //$responseBranchCopy = $responseBranch; + //$responseBranchCopy->setAttribute('name','false'); + + $schemaSequence->appendChild($responseBranch); + $schemaSequence->appendChild($responseBranchCopy); + $schemaComplexType->appendChild($schemaSequence); $schemaElement->appendChild($schemaComplexType); + //$schemaElement->appendChild($responseBranch); + //$schemaElement->appendChild($responseBranchCopy); $schemaElem->appendChild($schemaElement); ! //4. The keyval type - call function ! $schemaKeyValElement = stack_xml_create_schema_keyval_type(); ! ! $schemaElem->appendChild($schemaKeyValElement); ! ! //5. Now we must link these types to the head element - the 'AssessmentItem' ! //Iterate through each of the types written into the schema - xmlElement ! /*<xs:element name="AssessmentItem"> ! <xs:complexType> ! <xs:all> ! <xs:element ref="dublincore" /> ! <xs:element ref="lom" /> ! <xs:element ref="stack" /> ! <xs:element ref="question" /> ! <xs:element ref="questionOptions" /> ! <xs:element ref="questionPotResp" /> ! </xs:all> ! </xs:complexType> ! </xs:element> ! */ ! $schemaElement = &new DOMIT_Element('xs:element'); ! ! $schemaElementAttr = &new DOMIT_Attr('name'); ! $schemaElementAttr->nodeValue='assessmentItem'; ! ! $schemaElement->setAttributeNode($schemaElementAttr); ! ! $schemaComplexType = &new DOMIT_Element('xs:complexType'); ! ! $schemaAllElem = &new DOMIT_Element('xs:all'); ! ! foreach($xmlElements as $xmlElement) ! { ! $schemaField = &new DOMIT_Element('xs:element'); ! ! $schemaFieldAttr = &new DOMIT_Attr('ref'); ! $schemaFieldAttr->nodeValue=$xmlElement; ! ! $schemaField->setAttributeNode($schemaFieldAttr); ! ! $schemaAllElem->appendChild($schemaField); ! } ! ! //5.1. We must append a version element onto the schema, within the AssessmentItem element ! $schemaVersionElement = stack_xml_create_schema_version(); ! ! $schemaComplexType->appendChild($schemaAllElem); ! $schemaComplexType->appendChild($schemaVersionElement); ! $schemaElement->appendChild($schemaComplexType); ! $schemaElem->appendChild($schemaElement); ! ! //Append root schema node onto DOM object and save ! $dom->appendChild($schemaElem); ! print_r("gone in here"); ! $dom->saveXML('schemas/test.xsd',true); ! } ! ! //4. The 'keyval' type /* <xs:complexType name="keyval"> *************** *** 1835,1842 **** </xs:complexType> */ $schemaComplexType = &new DOMIT_Element('xs:complexType'); $schemaCTypeAttr = &new DOMIT_Attr('name'); ! $schemaCTypeAttr->nodeValue $schemaSequence = &new DOMIT_Element('xs:sequence'); --- 1992,2010 ---- </xs:complexType> */ + + //Creates an XML field, taking in the number of occurences: default to 0 + function stack_xml_create_field($name, $minOccurs,$maxOccurs) + { + //Return an xml element which can simply be appended + } + + function stack_xml_create_schema_keyval_type() + { $schemaComplexType = &new DOMIT_Element('xs:complexType'); $schemaCTypeAttr = &new DOMIT_Attr('name'); ! $schemaCTypeAttr->nodeValue='keyval'; ! $schemaComplexType->setAttributeNode($schemaCTypeAttr); ! $schemaSequence = &new DOMIT_Element('xs:sequence'); *************** *** 1871,1964 **** //Append onto main schema element $schemaComplexType->appendChild($schemaSequence); - $schemaElem->appendChild($schemaComplexType); - - //5. Now we must link these types to the head element - the 'Question' ! ! /* //Export element to XML ! $schemaField = new DOMIT_Element('xs:element'); ! $schemaFieldAttr ! ! ! //Parse only metadata fields ! if (!empty($questionField['type']) && ($questionField['type']=='meta')) { ! ! //Check metatag contains something - otherwise we default to STACK namespace ! if (!empty($questionField['metatype']) && $array_value_exists($types, $questionField['metatype')) ! { ! $types[] = $questionField['metatype']; ! } ! } ! } ! } ! ! ! //If of any other type except meta and other ! else ! { ! if(!empty($questionField['doc'])) { ! $xml.=stack_schema_write_element_document($arrayKey,$questionField['mysql'],$questionField['doc']); ! } ! ! else { ! $xml.=stack_schema_write_element($arrayKey,$questionField['mysql']); ! } ! ! } ! } ! }*/ ! ! $dom->appendChild($schemaElem); ! $dom->saveXML('test.xsd'); ! ! //$xml = ""; ! ! /*//Create a sequence of metadata tags ! $xml.='<xs:sequence>'; ! ! //An assessment item consists of a single question, a number of reponses, and a set of options ! foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object ! { ! //We dont want to parse metadata, but we do with other fields ! if (!empty($questionField['type']) && array_value_exists(&) { ! ! //Other fields are arrays of other structures, such as $stackOptions and $stackQuestionPotResp ! if($questionField['type']=='other') ! { ! //Check questionfieldkey is either options or potentioal responses, if not echo a warning to the developer ! //foreach($arrayKey as ! } ! ! //If of any other type except meta and other ! else ! { ! if(!empty($questionField['doc'])) { ! $xml.=stack_schema_write_element_document($arrayKey,$questionField['mysql'],$questionField['doc']); ! } ! ! else { ! $xml.=stack_schema_write_element($arrayKey,$questionField['mysql']); ! } ! ! } ! } ! } ! ! //Terminate a sequence of metadata tags ! $xml.='</xs:sequence>'; ! ! //We must now tag the 'metadata' tag with a version attribute ! $xml.= stack_schema_write_attribute('version', true); ! ! return $xml; ! ! ! */ ! } //Takes in a 1D array and searches to see if a particular item occurs in the array function array_value_exists(&$array, $value) --- 2039,2081 ---- //Append onto main schema element $schemaComplexType->appendChild($schemaSequence); ! return $schemaComplexType; ! } ! //Creates a version element for putting onto the schema ! function stack_xml_create_schema_version() ! { ! $schemaVersionElement = &new DOMIT_Element('xs:attribute'); ! $schemaVersionElementNameAttr = &new DOMIT_Attr('name'); ! $schemaVersionElementNameAttr->nodeValue='version'; + $schemaVersionUseAttr = &new DOMIT_Attr('use'); + $schemaVersionUseAttr->nodeValue='required'; + + $schemaVersionElement->setAttributeNode($schemaVersionElementNameAttr); + $schemaVersionElement->setAttributeNode($schemaVersionUseAttr); + $schemaSimpleType = &new DOMIT_Element('xs:simpleType'); + $schemaRestrictionType = &new DOMIT_Element('xs:restriction'); ! $schemaRestrictionTypeBaseAttr = &new DOMIT_Attr('base'); ! $schemaRestrictionTypeBaseAttr->nodeValue='xs:string'; ! ! $schemaRestrictionType->setAttributeNode($schemaRestrictionTypeBaseAttr); ! ! $schemaPatternType = &new DOMIT_Element('xs:pattern'); ! ! $schemaPatternTypeAttr = &new DOMIT_Attr('value'); ! $schemaPatternTypeAttr->nodeValue='[1-9]+[0-9]*\.[0-9]+'; ! ! $schemaPatternType->setAttributeNode($schemaPatternTypeAttr); ! ! //Construct version entity ! $schemaRestrictionType->appendChild($schemaPatternType); ! $schemaSimpleType->appendChild($schemaRestrictionType); ! $schemaVersionElement->appendChild($schemaSimpleType); + return $schemaVersionElement; + } //Takes in a 1D array and searches to see if a particular item occurs in the array function array_value_exists(&$array, $value) *************** *** 2164,2168 **** } ! stack_xml_create_question_schema('',''); echo("Saved schema"); ?> --- 2281,2285 ---- } ! stack_xml_create_question_schema(); echo("Saved schema"); ?> Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.30.2.2 retrieving revision 1.30.2.3 diff -C2 -d -r1.30.2.2 -r1.30.2.3 *** stackQuestion.php 1 Aug 2005 21:56:34 -0000 1.30.2.2 --- stackQuestion.php 2 Aug 2005 16:00:26 -0000 1.30.2.3 *************** *** 480,484 **** $stackQuestion['questionKeywords']['metatag']='keyword'; ! $stackQuestion['questionKeywords']['metatype']='dublincore'; // 'Body'; --- 480,484 ---- $stackQuestion['questionKeywords']['metatag']='keyword'; ! $stackQuestion['questionKeywords']['metatype']='lom'; // 'Body'; *************** *** 596,600 **** $stackQuestion['questionLearningContext']['mysql']='TINYTEXT'; ! $stackQuestion['questionLearningContext']['metatag']='learningcontext'; $stackQuestion['questionLearningContext']['metatype']='lom'; --- 596,600 ---- $stackQuestion['questionLearningContext']['mysql']='TINYTEXT'; ! $stackQuestion['questionLearningContext']['metatag']='context'; $stackQuestion['questionLearningContext']['metatype']='lom'; *************** *** 836,856 **** //////////////////////////////////// ! ! // 'Expression 1: SAns'; $stackQuestionPotResp['SAns']['type']='casstring'; // 'Expression 2: TAns'; $stackQuestionPotResp['TAns']['type']='casstring'; // 'Answer test'; $stackQuestionPotResp['AnsTest']['type']='option'; // 'Answer test options'; $stackQuestionPotResp['AnsTestOpt']['type']='option'; // The following fields are indented within 'true' or 'false' branches --- 836,860 ---- //////////////////////////////////// ! // <PDK>Branch field put in for autodectection of branch/global reponse parameters within schema writing // 'Expression 1: SAns'; $stackQuestionPotResp['SAns']['type']='casstring'; + $stackQuestionPotResp['SAns']['branch']=FALSE; + // 'Expression 2: TAns'; $stackQuestionPotResp['TAns']['type']='casstring'; + $stackQuestionPotResp['TAns']['branch']=FALSE; // 'Answer test'; $stackQuestionPotResp['AnsTest']['type']='option'; + $stackQuestionPotResp['AnsTest']['branch']=FALSE; // 'Answer test options'; $stackQuestionPotResp['AnsTestOpt']['type']='option'; + $stackQuestionPotResp['AnsTestOpt']['branch']=FALSE; // The following fields are indented within 'true' or 'false' branches *************** *** 859,882 **** --- 863,892 ---- $stackQuestionPotResp['RawMarkMod']['type']='option'; + $stackQuestionPotResp['RawMarkMod']['branch']=TRUE; // 'Mark modifier'; $stackQuestionPotResp['RawMark']['type']='option'; + $stackQuestionPotResp['RawMark']['branch']=TRUE; // 'Penalty'; $stackQuestionPotResp['Penalty']['type']='option'; + $stackQuestionPotResp['Penalty']['branch']=TRUE; // 'Feedback'; $stackQuestionPotResp['FeedBack']['type']='castext'; + $stackQuestionPotResp['FeedBack']['branch']=TRUE; // Answer note'; $stackQuestionPotResp['AnswerNote']['type']='string'; + $stackQuestionPotResp['AnswerNote']['branch']=TRUE; // 'Apply later tests'; $stackQuestionPotResp['ApLat']['type']='string'; + $stackQuestionPotResp['ApLat']['branch']=TRUE; |
From: pkiddie <pk...@us...> - 2005-08-01 21:56:47
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8872/scripts Modified Files: Tag: development_xmlrqp stackDatabase.php stackQuestion.php stackXML.php Log Message: stackQuestion 'metatype' tag added for dublin core and ieee lom metadata. Installation documentation updated. Readme updated StackStd now checks for the presence of particular files before attempting to load them in - less errors during installation stack_question_schema method in progress Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.34 retrieving revision 1.34.2.1 diff -C2 -d -r1.34 -r1.34.2.1 *** stackDatabase.php 25 Jul 2005 14:11:25 -0000 1.34 --- stackDatabase.php 1 Aug 2005 21:56:33 -0000 1.34.2.1 *************** *** 1,1688 **** ! <?php ! ! /** ! * Functions to access the MySQL Database. This should allow other ! * databases to be used without too much pain. ! * ! * @package data ! * @subpackage Stack ! */ ! [...5035 lines suppressed...] ! die(); ! ! } ! ! } ! ! ! ! /***** ! ! * Check if updates are necessary ! ! **/ ! ! stack_db_database_update(); ! ! ! ! ?> ! Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.13.2.2 retrieving revision 1.13.2.3 diff -C2 -d -r1.13.2.2 -r1.13.2.3 *** stackXML.php 28 Jul 2005 15:03:49 -0000 1.13.2.2 --- stackXML.php 1 Aug 2005 21:56:34 -0000 1.13.2.3 *************** *** 1,4 **** <?php ! require_once('other/domit/xml_domit_include.php'); /** --- 1,4 ---- <?php ! require_once("{$stack_root}/other/domit/xml_domit_include.php"); /** *************** *** 1345,1349 **** /** ! * Creates question metadata for the specified question when using PHP5. Use of DOM XML. * * References the question metadata schema within the XML file along with the schema/stackQuestion version in use. Then iterates through --- 1345,1349 ---- /** ! * Creates a question schema for the specified question * * References the question metadata schema within the XML file along with the schema/stackQuestion version in use. Then iterates through *************** *** 1358,1374 **** * @return void */ - function stack_xml_create_question_metadata_v5($questionSchemaLocation,$questionSchemaVersion,$question,$directory,$filename) - { - global $stackQuestion; // Don't export questionID within metadata ! if (array_key_exists('questionID',$question)) { ! unset($question['questionID']); } //Dont export questionBody within metadata ! if (array_key_exists('questionBody',$question)) { ! unset($question['questionID']); } // Make sure the question is validated. --- 1358,1982 ---- * @return void */ + //Creates a question schema using the stackQuestion data structure + //Writes out each of the possible entities that can exist in the XML file, and in the case of the metadata + //The particular standard it belongs to + + function stack_xml_create_question_schema($questionSchemaLocation,$questionSchemaVersion) + { + 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; + + $options = stack_options_set(array()); + $filename = stack_lang_filename($options,'doc/en_doc.php'); //Include documentation to document fields if it is available + include($filename); + + $dublinCoreUri = 'http://purl.org/dc/elements/1.1'; + $learningObjectUri = 'http://www.imsglobal.org/xsd/imsmd_v1p2'; + + $types = array(); //Array of metadata types - dublincore, stack, lom etc. + // Don't export questionID within metadata ! if (array_key_exists('questionID',$stackQuestion)) { ! unset($stackQuestion['questionID']); } //Dont export questionBody within metadata ! if (array_key_exists('questionBody',$stackQuestion)) { ! unset($stackQuestion['questionID']); ! } ! ! $dom = new DOMIT_Document(); ! //$dom->SetNamespaceAwareness(true); //We dont want to use namespace awareness for schema generation ! ! //Contruct the header for the schema ! $schemaElem = new DOMIT_Element('xs:schema'); //Root element <xs:schema ! ! $schemaNamespaceAttr = new DOMIT_Attr('xmlns'); ! $schemaNamespaceAttr->nodeValue='http://www.stack.bham.ac.uk/schemas/stackQuestion.xsd'; ! ! $schemaDefaultNamespaceAttr = new DOMIT_Attr('xmlns:xs'); ! $schemaDefaultNamespaceAttr->nodeValue='http://www.w3.org/2001/XMLSchema'; ! ! $dcNamespaceAttr = new DOMIT_Attr('xmlns:dc'); ! $dcNamespaceAttr->nodeValue=$dublinCoreUri; ! ! //Doesnt resolve to a valid namespace?? ! $lomNamespaceAttr = new DOMIT_Attr('xmlns:lom'); ! $lomNamespaceAttr->nodeValue=$learningObjectUri; ! ! //Used to ensure latest schema version is used ! $schemaVersionAttr = new DOMIT_Attr('version'); ! $schemaVersionAttr->nodeValue=$stack_ver['release']; ! ! $schemaElem->setAttributeNode($schemaNamespaceAttr); ! $schemaElem->setAttributeNode($schemaDefaultNamespaceAttr); ! $schemaElem->setAttributeNode($dcNamespaceAttr); ! $schemaElem->setAttributeNode($lomNamespaceAttr); ! $schemaElem->setAttributeNode($schemaVersionAttr); ! ! //Import namespaces to provide access to particular fields from LOM/DC ! $dcImportNode = new DOMIT_Element('xs:import'); ! $dcImportAttr = new DOMIT_Attr('namespace'); ! $dcImportAttr->nodeValue=$dublinCoreUri; ! $dcImportNode->setAttributeNode($dcImportAttr); ! ! $lomImportNode = new DOMIT_Element('xs:import'); ! $lomImportAttr = new DOMIT_Attr('namespace'); ! $lomImportAttr->nodeValue=$learningObjectUri; ! $lomImportNode->setAttributeNode($lomImportAttr); ! ! $schemaElem->appendChild($dcImportNode); ! $schemaElem->appendChild($lomImportNode); ! ! //Iterate through the stackQuestion data structure - retrieving list of metatypes ! //There are three types - dublincore, lom and stack ! //Dublincore and lom will be prepended with namespace identification ! //Stack metadata will not be ! //Once we know which values belong where - we then add to definition of elements. ! foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object ! { ! //Parse only metadata fields ! if (!empty($questionField['type']) && ($questionField['type']=='meta')) { ! ! //Check metatag contains something, and that something doesnt already exist in types of metadata ! if (!empty($questionField['metatype']) && !array_value_exists($types, $questionField['metatype'])) ! { ! $types[] = $questionField['metatype']; ! } ! } } + + //$types = array('dublincore','lom'); + + //We then iterate through each metadata type + //'Object' style definitions + //1. Metadata objects + foreach($types as $arrayKey=>$type) + { + $schemaElement = &new DOMIT_Element('xs:element'); + $schemaElementAttr = &new DOMIT_Attr('name'); + $schemaElementAttr->nodeValue=$type; + + $schemaElement->setAttributeNode($schemaElementAttr); + + $schemaComplexType = &new DOMIT_Element('xs:complexType'); + $schemaSequence = &new DOMIT_Element('xs:sequence'); + + foreach($stackQuestion as $questionKey=>$questionField) //Iterate through sub array of each array object + { + //Only select those metadata fields which correspond to a particular type + if (!empty($questionField['metatype']) && $questionField['metatype']==$type) + { + switch($type) + { + //Dublin core metadata elements + case('dublincore'): + { + $schemaField = &new DOMIT_Element('xs:element'); + $schemaFieldAttr = &new DOMIT_Attr('ref'); + $schemaFieldAttr->nodeValue='dc:'.$questionField['metatag']; + + $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + } + + $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['maxoccurs'])) + { + $schemaMaxOccursAttr->nodeValue=1; + } + + else + { + $schemaMaxOccursAttr->nodeValue=$questionField['maxoccurs']; + } + + //Add attributes to element + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaMinOccursAttr); + $schemaField->setAttributeNode($schemaMaxOccursAttr); + + $schemaSequence->appendChild($schemaField); + + break; + } + + //IEEE LOM metadata elements + case('lom'): + { + $schemaField = &new DOMIT_Element('xs:element'); + $schemaFieldAttr = &new DOMIT_Attr('ref'); + $schemaFieldAttr->nodeValue='lom:'.$questionField['metatag']; + + $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + } + + $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['maxoccurs'])) + { + $schemaMaxOccursAttr->nodeValue=1; + } + + else + { + $schemaMaxOccursAttr->nodeValue=$questionField['maxoccurs']; + } + + //Add attributes to element + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaMinOccursAttr); + $schemaField->setAttributeNode($schemaMaxOccursAttr); + + $schemaSequence->appendChild($schemaField); + + break; + } + + //Any other metadata elements - 'stack' type included + default: + { + $schemaField = &new DOMIT_Element('xs:element'); + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue=$questionField['metatag']; + + $schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + } + + $schemaMaxOccursAttr = &new DOMIT_Attr('maxOccurs'); + //Assume a default minimum occurrence for the field + if (empty($questionField['maxoccurs'])) + { + $schemaMaxOccursAttr->nodeValue=1; + } + + else + { + $schemaMaxOccursAttr->nodeValue=$questionField['maxoccurs']; + } + + //Add attributes to element + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaMinOccursAttr); + $schemaField->setAttributeNode($schemaMaxOccursAttr); + + //Since we are not referencing known metadata from namespace we need to define the type of data + //we are representing + $schemaTypeAttr = &new DOMIT_Attr('type'); + + //Default to xs:string + if (empty($questionField['mysql'])) + { + $schemaTypeAttr->nodeValue='xs:string'; + } + + //Else map from SQL datatype to a schema implementation + else + { + //2. Ensure element type is upper case to ensure comparison array (SQL->XML variable) will work. + $elementType = strtoupper($questionField['mysql']); + + //3. Now we are only interested in the first word of the SQL datatype in order to convert to XML datatype, hence explode + //Make sensitive to white space + $elementDataType = explode(" ", $elementType); + + //4. But we also can have SQL datatypes which give array length - CHAR(22) for example - we are not interested in this + //Make sensitive to open bracket + $elementDataType = explode("(", $elementDataType[0]); + + $schemaTypeAttr->nodeValue='xs:'.$sqlToSchemaMapping[$elementDataType[0]]; + } + + $schemaField->setAttributeNode($schemaTypeAttr); + $schemaSequence->appendChild($schemaField); + + break; + } + } + } + } + + $schemaComplexType->appendChild($schemaSequence); + $schemaElement->appendChild($schemaComplexType); + $schemaElem->appendChild($schemaElement); + } + + //2. Question terms + //Now we must iterate through stackQuestion again, this time picking out the non-metadata terms - question, options, and potential responses. + $schemaElement = &new DOMIT_Element('xs:element'); + $schemaElementAttr = &new DOMIT_Attr('name'); + $schemaElementAttr->nodeValue='question'; + + $schemaElement->setAttributeNode($schemaElementAttr); + + $schemaComplexType = &new DOMIT_Element('xs:complexType'); + $schemaSequence = &new DOMIT_Element('xs:sequence'); + + foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object + { + //Do not parse metadata fields, have already done so. Also do not parse 'other' types, this will be the next step + if ((!empty($questionField['type']) && ($questionField['type']!='other') && $questionField['type']!='meta')) { + + //This time we are using the tag given in each field that resides in stackQuestion + $schemaField = &new DOMIT_Element('xs:element'); + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue=$arrayKey; + + $schemaTypeAttr = &new DOMIT_Attr('type'); + + //Detect type: rawkeyval, castext, casstring are all of type xs:string + //keyval is of type keyval which has a key and value + switch($questionField['type']) + { + case('castext'): + { + $schemaTypeAttr->nodeValue='xs:string'; + break; + } + + case('casstring'): + { + $schemaTypeAttr->nodeValue='xs:string'; + break; + } + + case('rawkeyval'): + { + $schemaTypeAttr->nodeValue='xs:string'; + break; + } + + case('string'): + { + $schemaTypeAttr->nodeValue='xs:string'; + break; + } + + case('keyval'): + { + $schemaTypeAttr->nodeValue='keyval'; + break; + } + + //If another type is declared, then default to a string type + default: + { + $schemaTypeAttr->nodeValue='xs:string'; + break; + } + } + + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaTypeAttr); + + $schemaSequence->appendChild($schemaField); + + /*$schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + }*/ + + + } + } + + $schemaComplexType->appendChild($schemaSequence); + $schemaElement->appendChild($schemaComplexType); + $schemaElem->appendChild($schemaElement); + + //3. 'Other' terms - potential responses and options + //Any other 'others' will be picked out, but not put into the schema - warn the programmer! + $validOtherTerms = array('questionOptions','questionPotResp'); + + foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object + { + + //Simple check to see if there are any unknown types in stackQuestion + if (!empty($questionField['type']) && ($questionField['type']=='other')) { + if (!array_value_exists($validOtherTerms,$arrayKey)) + { + echo"There is an item of type 'other' which will not be written out to the schema: $arrayKey"; + } + } + } + + //3.1 Now output 'other' types + //3.1.1 Option type + $schemaElement = &new DOMIT_Element('xs:element'); + $schemaElementAttr = &new DOMIT_Attr('name'); + $schemaElementAttr->nodeValue='questionOptions'; + + $schemaElement->setAttributeNode($schemaElementAttr); + + $schemaComplexType = &new DOMIT_Element('xs:complexType'); + $schemaSequence = &new DOMIT_Element('xs:sequence'); + + foreach($stackOptions as $arrayKey=>$optionField) + { + $schemaField = &new DOMIT_Element('xs:element'); + + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue=$arrayKey; + + $schemaTypeAttr = &new DOMIT_Attr('type'); + $schemaTypeAttr->nodeValue='xs:string'; + + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaTypeAttr); + + $schemaSequence->appendChild($schemaField); + + /*$schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + }*/ + } + + $schemaComplexType->appendChild($schemaSequence); + $schemaElement->appendChild($schemaComplexType); + $schemaElem->appendChild($schemaElement); + + //3.1.2 Potential reponses type + $schemaElement = &new DOMIT_Element('xs:element'); + $schemaElementAttr = &new DOMIT_Attr('name'); + $schemaElementAttr->nodeValue='questionPotResp'; + + $schemaElement->setAttributeNode($schemaElementAttr); + + $schemaComplexType = &new DOMIT_Element('xs:complexType'); + $schemaSequence = &new DOMIT_Element('xs:sequence'); + + foreach($stackQuestionPotResp as $arrayKey=>$responsesField) + { + $schemaField = &new DOMIT_Element('xs:element'); + + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue=$arrayKey; + + $schemaTypeAttr = &new DOMIT_Attr('type'); + $schemaTypeAttr->nodeValue='xs:string'; + + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaTypeAttr); + + $schemaSequence->appendChild($schemaField); + + /*$schemaMinOccursAttr = &new DOMIT_Attr('minOccurs'); + + //Assume a default minimum occurrence for the field + if (empty($questionField['minoccurs'])) + { + $schemaMinOccursAttr->nodeValue=1; + } + + else + { + $schemaMinOccursAttr->nodeValue=$questionField['minoccurs']; + }*/ + } + + $schemaComplexType->appendChild($schemaSequence); + $schemaElement->appendChild($schemaComplexType); + $schemaElem->appendChild($schemaElement); + + //4. The 'keyval' type + /* + <xs:complexType name="keyval"> + - <xs:sequence> + <xs:element name="key" type="xs:string" /> + <xs:element name="val" type="xs:string" /> + </xs:sequence> + </xs:complexType> + */ + $schemaComplexType = &new DOMIT_Element('xs:complexType'); + + $schemaCTypeAttr = &new DOMIT_Attr('name'); + $schemaCTypeAttr->nodeValue + $schemaSequence = &new DOMIT_Element('xs:sequence'); + + //Making the 'key' element + $schemaField = &new DOMIT_Element('xs:element'); + + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue='key'; + + $schemaTypeAttr = &new DOMIT_Attr('type'); + $schemaTypeAttr->nodeValue='xs:string'; + + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaTypeAttr); + + $schemaSequence->appendChild($schemaField); + + //Making the 'val' element + $schemaField = &new DOMIT_Element('xs:element'); + + $schemaFieldAttr = &new DOMIT_Attr('name'); + $schemaFieldAttr->nodeValue='val'; + + $schemaTypeAttr = &new DOMIT_Attr('type'); + $schemaTypeAttr->nodeValue='xs:string'; + + $schemaField->setAttributeNode($schemaFieldAttr); + $schemaField->setAttributeNode($schemaTypeAttr); + + $schemaSequence->appendChild($schemaField); + + //Append onto main schema element + $schemaComplexType->appendChild($schemaSequence); + $schemaElem->appendChild($schemaComplexType); + + //5. Now we must link these types to the head element - the 'Question' + + + /* //Export element to XML + $schemaField = new DOMIT_Element('xs:element'); + $schemaFieldAttr + + + + //Parse only metadata fields + if (!empty($questionField['type']) && ($questionField['type']=='meta')) { + + //Check metatag contains something - otherwise we default to STACK namespace + if (!empty($questionField['metatype']) && $array_value_exists($types, $questionField['metatype')) + { + $types[] = $questionField['metatype']; + } + } + } + } + + + //If of any other type except meta and other + else + { + if(!empty($questionField['doc'])) { + $xml.=stack_schema_write_element_document($arrayKey,$questionField['mysql'],$questionField['doc']); + } + + else { + $xml.=stack_schema_write_element($arrayKey,$questionField['mysql']); + } + + } + } + }*/ + + $dom->appendChild($schemaElem); + $dom->saveXML('test.xsd'); + + //$xml = ""; + + /*//Create a sequence of metadata tags + $xml.='<xs:sequence>'; + + //An assessment item consists of a single question, a number of reponses, and a set of options + foreach($stackQuestion as $arrayKey=>$questionField) //Iterate through sub array of each array object + { + //We dont want to parse metadata, but we do with other fields + if (!empty($questionField['type']) && array_value_exists(&) { + + //Other fields are arrays of other structures, such as $stackOptions and $stackQuestionPotResp + if($questionField['type']=='other') + { + //Check questionfieldkey is either options or potentioal responses, if not echo a warning to the developer + //foreach($arrayKey as + } + + //If of any other type except meta and other + else + { + if(!empty($questionField['doc'])) { + $xml.=stack_schema_write_element_document($arrayKey,$questionField['mysql'],$questionField['doc']); + } + + else { + $xml.=stack_schema_write_element($arrayKey,$questionField['mysql']); + } + + } + } + } + + //Terminate a sequence of metadata tags + $xml.='</xs:sequence>'; + + //We must now tag the 'metadata' tag with a version attribute + $xml.= stack_schema_write_attribute('version', true); + + return $xml; + + + + + + */ + } + + //Takes in a 1D array and searches to see if a particular item occurs in the array + function array_value_exists(&$array, $value) + { + foreach ($array as $arrayValue) + { + if ($value==$arrayValue) + { + return true; + } + } + + return false; + } + + + function stack_xml_create_question_metadata_v5($questionSchemaLocation,$questionSchemaVersion,$question,$directory,$filename) + { + global $stackQuestion; // Make sure the question is validated. *************** *** 1555,1557 **** --- 2163,2168 ---- return $xml; } + + stack_xml_create_question_schema('',''); + echo("Saved schema"); ?> Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.30.2.1 retrieving revision 1.30.2.2 diff -C2 -d -r1.30.2.1 -r1.30.2.2 *** stackQuestion.php 28 Jul 2005 13:49:33 -0000 1.30.2.1 --- stackQuestion.php 1 Aug 2005 21:56:34 -0000 1.30.2.2 *************** *** 1,2137 **** ! <?php ! ! /** ! * This file contains most functions which deal with questions. These are the ! * everyday functions used by students, and it is rare indeed that this file is not ! * required. Functions for authoring questions (not used by students) are ! * kept in stackAuthor.php ! * ! * @package scripts ! * @subpackage Stack [...6397 lines suppressed...] ! $seeds = stack_db_getseeds($qID,$user); ! ! if (is_array($seeds)) { ! ! $seed = end($seeds); ! ! } ! ! ! ! return($seed); ! ! ! ! } ! ! ! ! ?> ! |
From: pkiddie <pk...@us...> - 2005-08-01 21:56:47
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8872/scripts/install Modified Files: Tag: development_xmlrqp stackInstall.php Log Message: stackQuestion 'metatype' tag added for dublin core and ieee lom metadata. Installation documentation updated. Readme updated StackStd now checks for the presence of particular files before attempting to load them in - less errors during installation stack_question_schema method in progress Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** stackInstall.php 18 Jul 2005 10:53:37 -0000 1.13 --- stackInstall.php 1 Aug 2005 21:56:33 -0000 1.13.2.1 *************** *** 1,321 **** ! <?php ! /** ! * Installs the various functions needed by STACK. ! * @package install ! * @subpackage Stack ! */ ! ! // To install, add comments to this line. ! die(); ! ! /** ! * Include the stack settings. ! */ ! require_once('../../stackstd.php'); ! ! /* Add the MySQL username and password here. Use NULL for the password to ! * be prompted to enter it (works only when run in CLI mode) ! */ ! ! $stack_mysqlroot['user'] = 'root'; ! $stack_mysqlroot['host'] = $stack_mysql['host']; ! ! if (array_key_exists('pswd',$_POST)) { ! ! $stack_mysqlroot['pswd'] = $_POST['pswd']; ! ! /* If you wish to add the sample questions to stack's database change this line. */ ! // Not yet implemented. ! // $add_sample_questions = FALSE; ! ! // The SQL privileges which stack requires on its database ! define('STACK_SQL_PRIVILEGES', 'ALTER,CREATE,CREATE TEMPORARY TABLES,DELETE,DROP,INDEX,INSERT,LOCK TABLES,SELECT,UPDATE'); ! ! /** ! * Used to connect to the MySQL stack database and execute a query. ! * ! * ! * @param string $qu The query to execute ! * @param string $who The MySQL user name ! * @param array &$err Array of errors passed by reference ! * @return void ! */ ! function stack_mysqlcmd($qu,$who,&$err) ! { ! global $stack_mysql; ! global $stack_mysqlroot; ! ! if ('root' == $who) { ! $host = $stack_mysqlroot['host']; ! $user = $stack_mysqlroot['user']; ! $password = $stack_mysqlroot['pswd']; ! $db = ''; ! } else { ! $host = $stack_mysql['host']; ! $user = $stack_mysql['user']; ! $password = $stack_mysql['pswd']; ! $db = $stack_mysql['stackdb']; ! } ! ! mysql_connect($host,$user,$password); ! ! // Root only connects to drop and create users! ! if ('root'!=$who) { ! mysql_select_db($db); ! } ! ! $result = mysql_query($qu); ! ! echo "User :<b>$who</b><br> ! Database Selected: <b>{$db}</b><br> ! Query: <b>$qu</b>\n<p><b>Results</b></p>\n\n"; ! ! if($result == 0) ! { ! echo "<b>Error ".mysql_errno().": ".mysql_error()."</b>"; ! $err=TRUE; ! } ! elseif (@mysql_num_rows($result) == 0) ! { ! echo("<b>Query completed. No results returned. </b><br />"); ! } ! else ! { ! echo "<p><table border=1><thead><tr>\n"; ! for($i = 0;$i < mysql_num_fields($result);$i++) ! { ! echo "<th>".mysql_field_name($result,$i). "</th>"; ! } ! echo " </tr></thead><tbody>\n"; ! for ($i = 0; $i < mysql_num_rows($result); $i++) ! { ! echo "<tr>"; ! $row = mysql_fetch_row($result); ! for($j = 0;$j<mysql_num_fields($result);$j++) ! { ! echo("<td>" . $row[$j] . "</td>"); ! } ! echo "</tr>\n"; ! } ! echo "</tbody></table></p>\n"; ! } //end else ! echo "<hr />\n\n\n"; ! } ! // ** MYSQL install! ! ! echo "<h1>STACK setup - stage 1 of 2</h1>"; ! echo "<p>This script sets up the database. When this is done, proceed to stage two of the set-up process.</p>"; ! echo "<h2>Set up the databases</h2>"; ! ! // (1) Create a database 'stack' ! //stack_mysqlcmd("DROP DATABASE {$stack_mysql['stackdb']}",'root',$err); ! stack_mysqlcmd("CREATE DATABASE IF NOT EXISTS {$stack_mysql['stackdb']}",'root',$err); ! ! // (2) Grant privileges to the user. ! ! $qu = "GRANT " . STACK_SQL_PRIVILEGES . " ON {$stack_mysql['stackdb']}.* ! TO '{$stack_mysql['user']}'@'localhost' ! IDENTIFIED BY '{$stack_mysql['pswd']}'"; ! stack_mysqlcmd($qu,'root',$err); ! ! $qu = "GRANT " . STACK_SQL_PRIVILEGES . " ON {$stack_mysql['stackdb']}.* ! TO '{$stack_mysql['user']}'@'{$stack_mysql['host']}' ! IDENTIFIED BY '{$stack_mysql['pswd']}'"; ! stack_mysqlcmd($qu,'root',$err); ! ! $qu = "FLUSH PRIVILEGES"; ! stack_mysqlcmd($qu,'root',$err); ! ! // (3) Create a question table ! // ! // Create a MySQL query from $stackQuestion. ! $qu = "CREATE TABLE IF NOT EXISTS stackQuestion ("; ! ! foreach ($stackQuestion as $key => $val) { ! if ('meta' == $val['type']) { ! $qu.="$key {$val['mysql']},"; ! } ! } ! ! $qu = substr($qu,0,strlen($qu)-1); ! $qu .= " );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! // (4) Create the attempts table ! // ! ! // Create table ! $qu = "CREATE TABLE IF NOT EXISTS questionAttempts ("; ! // Add primary key ! $qu .= "attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! // Add questionID number ! $qu .= "questionID INT, "; ! // Add which seed is used ! $qu .= "questionSeedInst INT, "; ! // Who the attempt belongs to ! $qu .= "userID INT, "; ! // Add questionNote (to indicate the instance) ! $qu .= "questionNote TEXT, "; ! ! ! // Add other fields ! foreach ($stackQuestionAttempt as $key => $val) { ! if ('Ans' != $key) { ! $qu.="$key {$val['mysql']}, "; ! } ! } ! ! // The Ans variable is treated slightly differently. ! ! $qu .= "AnsValue VARCHAR(255)," ; ! $qu .= "AnsDisplay TEXT, "; ! $qu .= "AnsError TEXT, "; ! ! $qu .= " INDEX(attemptID) );"; ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! // (5) Create the users table ! // ! ! // Create table ! $qu = " CREATE TABLE IF NOT EXISTS `stackUser` ( ! `id` int(10) unsigned NOT NULL auto_increment, ! `username` varchar(100) NOT NULL default '', ! `password` varchar(32) NOT NULL default '', ! `idnumber` varchar(64) default NULL, ! `firstname` varchar(20) NOT NULL default '', ! `lastname` varchar(20) NOT NULL default '', ! `email` varchar(100) NOT NULL default '', ! `phone1` varchar(20) default NULL, ! `institution` varchar(40) default NULL, ! `department` varchar(30) default NULL, ! `address` varchar(70) default NULL, ! `options` text default NULL, ! `firstaccess` int(10) unsigned NOT NULL default '0', ! `lastaccess` int(10) unsigned NOT NULL default '0', ! PRIMARY KEY (`id`), ! UNIQUE KEY `id` (`id`), ! UNIQUE KEY `username` (`username`), ! KEY `user_firstname` (`firstname`), ! KEY `user_lastname` (`lastname`), ! KEY `user_lastaccess` (`lastaccess`), ! KEY `user_email` (`email`), ! KEY `idnumber` (`idnumber`) ! );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! // (6) Create the table to link questions to quizzes ! ! $qu = "CREATE TABLE IF NOT EXISTS quiz_question ( ! ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizID INT, ! questionID INT, ! qord INT ); "; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! // (7) Create the quiz table ! ! // Create field list ! $qu = ''; ! foreach ($stackQuiz as $key => $val) { ! $qu .= ", $key {$val['mysql']}"; ! } ! $qu = substr($qu,1,strlen($qu)-1); ! $qu = "CREATE TABLE IF NOT EXISTS stackQuiz ( {$qu} );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! // (8) Create the quiz attmpet table ! ! $qu = "CREATE TABLE IF NOT EXISTS quizAttempts ( ! attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizID int(11) default NULL, ! userID int(11) default NULL, ! Seed int(11) default NULL, ! MaxMark float default NULL, ! Mark float default NULL, ! SolRequest bool );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! /************************************************/ ! /* (500) RQP tables have been created. */ ! /************************************************/ ! ! // (501) RQPcacheItem ! // ! // Caches item sources. ! $qu = "CREATE TABLE IF NOT EXISTS RQPcacheItem ("; ! // Add primary key ! $qu .= "cacheID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! $qu .= "lastEdited TIMESTAMP, "; ! ! $tabfields = array('questionGUID','questionBody'); ! foreach ($tabfields as $field) { ! $val = $stackQuestion[$field]; ! $qu .= "$field {$val['mysql']},"; ! } ! ! $qu = substr($qu,0,strlen($qu)-1); ! $qu .= " );"; ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! // (502) RQPcacheItemInst ! // ! // Caches item sources. ! $qu = "CREATE TABLE IF NOT EXISTS RQPcacheItemInst ("; ! // Add primary key ! $qu .= "cacheID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! // Add the seed info ! $qu .= "lastEdited TIMESTAMP, questionSeedInst INT, "; ! $qu .= "questionGUID CHAR(22), "; ! $tabfields = array('questionBody'); ! foreach ($tabfields as $field) { ! $val = $stackQuestion[$field]; ! $qu.="$field {$val['mysql']},"; ! } ! ! $qu = substr($qu,0,strlen($qu)-1); ! $qu .= " );"; ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! /************************************************/ ! /* (\infty) Check the tables have been created. */ ! /************************************************/ ! stack_mysqlcmd('SHOW TABLES',$stack_mysql['user'],$err); ! ! if ('' != $err) { ! echo "\n\n\n<br/ ><font color='red'>***** WARNING! ******</font><br />\n\n ERRORS OCCURRED DURING EXECUTION.<br />\n Please read the above carefully."; ! echo "<p>Please type in the MYSQL root password:</p>"; ! echo "<form name=\"install\" action=\"{$stack_web_url}scripts/install/stackInstall.php\" method=\"POST\"> ! <input type=\"password\" name=\"pswd\" value=\"\" /> ! <br /><input type=\"submit\" name=\"Submit\" value=\"Submit\" /> ! </form>"; ! // die(); ! } ! else { ! echo "\n\n Success with database setup!</br />\n\n"; ! echo "Please proceed to the <a href='stacktest.php'>next stage</a></br />\n\n"; ! } ! ! } else { ! ! $user = $stack_mysqlroot['user']; ! $host = $stack_mysqlroot['host']; ! ! echo "<h1>STACK setup - stage 1 of 2</h1>"; ! echo "<p>Please type in the MYSQL root password for <tt>$user@$host</tt>. </p>"; ! echo "<form name=\"install\" action=\"{$stack_web_url}scripts/install/stackInstall.php\" method=\"POST\"> ! <input type=\"password\" name=\"pswd\" value=\"\" /> ! <br /><input type=\"submit\" name=\"Submit\" value=\"Submit\" /> ! </form>"; ! ! } ! ! ?> --- 1,642 ---- ! <?php ! ! /** ! ! * Installs the various functions needed by STACK. ! ! * @package install ! ! * @subpackage Stack ! ! */ ! ! ! ! // To install, add comments to this line. ! ! //die(); ! ! ! ! /** ! ! * Include the stack settings. ! ! */ ! ! require('../../stackstd.php'); ! ! ! ! /* Add the MySQL username and password here. Use NULL for the password to ! ! * be prompted to enter it (works only when run in CLI mode) ! ! */ ! ! ! ! $stack_mysqlroot['user'] = 'root'; ! ! $stack_mysqlroot['host'] = $stack_mysql['host']; ! ! ! ! if (array_key_exists('pswd',$_POST)) { ! ! ! ! $stack_mysqlroot['pswd'] = $_POST['pswd']; ! ! ! ! /* If you wish to add the sample questions to stack's database change this line. */ ! ! // Not yet implemented. ! ! // $add_sample_questions = FALSE; ! ! ! ! // The SQL privileges which stack requires on its database ! ! define('STACK_SQL_PRIVILEGES', 'ALTER,CREATE,CREATE TEMPORARY TABLES,DELETE,DROP,INDEX,INSERT,LOCK TABLES,SELECT,UPDATE'); ! ! ! ! /** ! ! * Used to connect to the MySQL stack database and execute a query. ! ! * ! ! * ! ! * @param string $qu The query to execute ! ! * @param string $who The MySQL user name ! ! * @param array &$err Array of errors passed by reference ! ! * @return void ! ! */ ! ! function stack_mysqlcmd($qu,$who,&$err) ! ! { ! ! global $stack_mysql; ! ! global $stack_mysqlroot; ! ! ! ! if ('root' == $who) { ! ! $host = $stack_mysqlroot['host']; ! ! $user = $stack_mysqlroot['user']; ! ! $password = $stack_mysqlroot['pswd']; ! ! $db = ''; ! ! } else { ! ! $host = $stack_mysql['host']; ! ! $user = $stack_mysql['user']; ! ! $password = $stack_mysql['pswd']; ! ! $db = $stack_mysql['stackdb']; ! ! } ! ! ! ! mysql_connect($host,$user,$password); ! ! ! ! // Root only connects to drop and create users! ! ! if ('root'!=$who) { ! ! mysql_select_db($db); ! ! } ! ! ! ! $result = mysql_query($qu); ! ! ! ! echo "User :<b>$who</b><br> ! ! Database Selected: <b>{$db}</b><br> ! ! Query: <b>$qu</b>\n<p><b>Results</b></p>\n\n"; ! ! ! ! if($result == 0) ! ! { ! ! echo "<b>Error ".mysql_errno().": ".mysql_error()."</b>"; ! ! $err=TRUE; ! ! } ! ! elseif (@mysql_num_rows($result) == 0) ! ! { ! ! echo("<b>Query completed. No results returned. </b><br />"); ! ! } ! ! else ! ! { ! ! echo "<p><table border=1><thead><tr>\n"; ! ! for($i = 0;$i < mysql_num_fields($result);$i++) ! ! { ! ! echo "<th>".mysql_field_name($result,$i). "</th>"; ! ! } ! ! echo " </tr></thead><tbody>\n"; ! ! for ($i = 0; $i < mysql_num_rows($result); $i++) ! ! { ! ! echo "<tr>"; ! ! $row = mysql_fetch_row($result); ! ! for($j = 0;$j<mysql_num_fields($result);$j++) ! ! { ! ! echo("<td>" . $row[$j] . "</td>"); ! ! } ! ! echo "</tr>\n"; ! ! } ! ! echo "</tbody></table></p>\n"; ! ! } //end else ! ! echo "<hr />\n\n\n"; ! ! } ! ! // ** MYSQL install! ! ! ! ! echo "<h1>STACK setup - stage 1 of 2</h1>"; ! ! echo "<p>This script sets up the database. When this is done, proceed to stage two of the set-up process.</p>"; ! ! echo "<h2>Set up the databases</h2>"; ! ! ! ! // (1) Create a database 'stack' ! ! //stack_mysqlcmd("DROP DATABASE {$stack_mysql['stackdb']}",'root',$err); ! ! stack_mysqlcmd("CREATE DATABASE IF NOT EXISTS {$stack_mysql['stackdb']}",'root',$err); ! ! ! ! // (2) Grant privileges to the user. ! ! ! ! $qu = "GRANT " . STACK_SQL_PRIVILEGES . " ON {$stack_mysql['stackdb']}.* ! ! TO '{$stack_mysql['user']}'@'localhost' ! ! IDENTIFIED BY '{$stack_mysql['pswd']}'"; ! ! stack_mysqlcmd($qu,'root',$err); ! ! ! ! $qu = "GRANT " . STACK_SQL_PRIVILEGES . " ON {$stack_mysql['stackdb']}.* ! ! TO '{$stack_mysql['user']}'@'{$stack_mysql['host']}' ! ! IDENTIFIED BY '{$stack_mysql['pswd']}'"; ! ! stack_mysqlcmd($qu,'root',$err); ! ! ! ! $qu = "FLUSH PRIVILEGES"; ! ! stack_mysqlcmd($qu,'root',$err); ! ! ! ! // (3) Create a question table ! ! // ! ! // Create a MySQL query from $stackQuestion. ! ! $qu = "CREATE TABLE IF NOT EXISTS stackQuestion ("; ! ! ! ! foreach ($stackQuestion as $key => $val) { ! ! if ('meta' == $val['type']) { ! ! $qu.="$key {$val['mysql']},"; ! ! } ! ! } ! ! ! ! $qu = substr($qu,0,strlen($qu)-1); ! ! $qu .= " );"; ! ! ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! ! ! // (4) Create the attempts table ! ! // ! ! ! ! // Create table ! ! $qu = "CREATE TABLE IF NOT EXISTS questionAttempts ("; ! ! // Add primary key ! ! $qu .= "attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! ! // Add questionID number ! ! $qu .= "questionID INT, "; ! ! // Add which seed is used ! ! $qu .= "questionSeedInst INT, "; ! ! // Who the attempt belongs to ! ! $qu .= "userID INT, "; ! ! // Add questionNote (to indicate the instance) ! ! $qu .= "questionNote TEXT, "; ! ! ! ! ! ! // Add other fields ! ! foreach ($stackQuestionAttempt as $key => $val) { ! ! if ('Ans' != $key) { ! ! $qu.="$key {$val['mysql']}, "; ! ! } ! ! } ! ! ! ! // The Ans variable is treated slightly differently. ! ! ! ! $qu .= "AnsValue VARCHAR(255)," ; ! ! $qu .= "AnsDisplay TEXT, "; ! ! $qu .= "AnsError TEXT, "; ! ! ! ! $qu .= " INDEX(attemptID) );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! ! ! // (5) Create the users table ! ! // ! ! ! ! // Create table ! ! $qu = " CREATE TABLE IF NOT EXISTS `stackUser` ( ! ! `id` int(10) unsigned NOT NULL auto_increment, ! ! `username` varchar(100) NOT NULL default '', ! ! `password` varchar(32) NOT NULL default '', ! ! `idnumber` varchar(64) default NULL, ! ! `firstname` varchar(20) NOT NULL default '', ! ! `lastname` varchar(20) NOT NULL default '', ! ! `email` varchar(100) NOT NULL default '', ! ! `phone1` varchar(20) default NULL, ! ! `institution` varchar(40) default NULL, ! ! `department` varchar(30) default NULL, ! ! `address` varchar(70) default NULL, ! ! `options` text default NULL, ! ! `firstaccess` int(10) unsigned NOT NULL default '0', ! ! `lastaccess` int(10) unsigned NOT NULL default '0', ! ! PRIMARY KEY (`id`), ! ! UNIQUE KEY `id` (`id`), ! ! UNIQUE KEY `username` (`username`), ! ! KEY `user_firstname` (`firstname`), ! ! KEY `user_lastname` (`lastname`), ! ! KEY `user_lastaccess` (`lastaccess`), ! ! KEY `user_email` (`email`), ! ! KEY `idnumber` (`idnumber`) ! ! );"; ! ! ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! // (6) Create the table to link questions to quizzes ! ! ! ! $qu = "CREATE TABLE IF NOT EXISTS quiz_question ( ! ! ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! ! quizID INT, ! ! questionID INT, ! ! qord INT ); "; ! ! ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! // (7) Create the quiz table ! ! ! ! // Create field list ! ! $qu = ''; ! ! foreach ($stackQuiz as $key => $val) { ! ! $qu .= ", $key {$val['mysql']}"; ! ! } ! ! $qu = substr($qu,1,strlen($qu)-1); ! ! $qu = "CREATE TABLE IF NOT EXISTS stackQuiz ( {$qu} );"; ! ! ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! // (8) Create the quiz attmpet table ! ! ! ! $qu = "CREATE TABLE IF NOT EXISTS quizAttempts ( ! ! attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! ! quizID int(11) default NULL, ! ! userID int(11) default NULL, ! ! Seed int(11) default NULL, ! ! MaxMark float default NULL, ! ! Mark float default NULL, ! ! SolRequest bool );"; ! ! ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! /************************************************/ ! ! /* (500) RQP tables have been created. */ ! ! /************************************************/ ! ! ! ! // (501) RQPcacheItem ! ! // ! ! // Caches item sources. ! ! $qu = "CREATE TABLE IF NOT EXISTS RQPcacheItem ("; ! ! // Add primary key ! ! $qu .= "cacheID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! ! $qu .= "lastEdited TIMESTAMP, "; ! ! ! ! $tabfields = array('questionGUID','questionBody'); ! ! foreach ($tabfields as $field) { ! ! $val = $stackQuestion[$field]; ! ! $qu .= "$field {$val['mysql']},"; ! ! } ! ! ! ! $qu = substr($qu,0,strlen($qu)-1); ! ! $qu .= " );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! ! ! // (502) RQPcacheItemInst ! ! // ! ! // Caches item sources. ! ! $qu = "CREATE TABLE IF NOT EXISTS RQPcacheItemInst ("; ! ! // Add primary key ! ! $qu .= "cacheID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "; ! ! // Add the seed info ! ! $qu .= "lastEdited TIMESTAMP, questionSeedInst INT, "; ! ! $qu .= "questionGUID CHAR(22), "; ! ! $tabfields = array('questionBody'); ! ! foreach ($tabfields as $field) { ! ! $val = $stackQuestion[$field]; ! ! $qu.="$field {$val['mysql']},"; ! ! } ! ! ! ! $qu = substr($qu,0,strlen($qu)-1); ! ! $qu .= " );"; ! ! stack_mysqlcmd($qu,$stack_mysql['user'],$err); ! ! ! ! /************************************************/ ! ! /* (\infty) Check the tables have been created. */ ! ! /************************************************/ ! ! stack_mysqlcmd('SHOW TABLES',$stack_mysql['user'],$err); ! ! ! ! if ('' != $err) { ! ! echo "\n\n\n<br/ ><font color='red'>***** WARNING! ******</font><br />\n\n ERRORS OCCURRED DURING EXECUTION.<br />\n Please read the above carefully."; ! ! echo "<p>Please type in the MYSQL root password:</p>"; ! ! echo "<form name=\"install\" action=\"{$stack_web_url}scripts/install/stackInstall.php\" method=\"POST\"> ! ! <input type=\"password\" name=\"pswd\" value=\"\" /> ! ! <br /><input type=\"submit\" name=\"Submit\" value=\"Submit\" /> ! ! </form>"; ! ! // die(); ! ! } ! ! else { ! ! echo "\n\n Success with database setup!</br />\n\n"; ! ! echo "Please proceed to the <a href='stacktest.php'>next stage</a></br />\n\n"; ! ! } ! ! ! ! } else { ! ! ! ! $user = $stack_mysqlroot['user']; ! ! $host = $stack_mysqlroot['host']; ! ! ! ! echo "<h1>STACK setup - stage 1 of 2</h1>"; ! ! echo "<p>Please type in the MYSQL root password for <tt>$user@$host</tt>. </p>"; ! ! echo "<form name=\"install\" action=\"{$stack_web_url}scripts/install/stackInstall.php\" method=\"POST\"> ! ! <input type=\"password\" name=\"pswd\" value=\"\" /> ! ! <br /><input type=\"submit\" name=\"Submit\" value=\"Submit\" /> ! ! </form>"; ! ! ! ! } ! ! ! ! ?> ! |
From: pkiddie <pk...@us...> - 2005-08-01 21:56:42
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8872 Modified Files: Tag: development_xmlrqp changelog.txt readme.txt stackstd.php.dist Log Message: stackQuestion 'metatype' tag added for dublin core and ieee lom metadata. Installation documentation updated. Readme updated StackStd now checks for the presence of particular files before attempting to load them in - less errors during installation stack_question_schema method in progress Index: stackstd.php.dist =================================================================== RCS file: /cvsroot/stack/stack-1-0/stackstd.php.dist,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** stackstd.php.dist 14 Jul 2005 07:27:03 -0000 1.19 --- stackstd.php.dist 1 Aug 2005 21:56:33 -0000 1.19.2.1 *************** *** 104,108 **** // The forbidden commands are generated dynamically, and stored here ! include($stack_logfiles.'CASkeywords.php'); // Anything in the associative array $maximalocal will become --- 104,110 ---- // The forbidden commands are generated dynamically, and stored here ! if (file_exists($stack_logfiles.'CASkeywords.php')) { ! include($stack_logfiles.'CASkeywords.php'); ! } // Anything in the associative array $maximalocal will become *************** *** 159,188 **** /***************************************************/ ! require_once("{$stack_root}/scripts/stackUtility.php"); ! $stack_page_start_time = stack_microtime_float(); ! require_once("{$stack_root}/scripts/stackQuestion.php"); ! require_once("{$stack_root}/scripts/stackQuiz.php"); ! require_once("{$stack_root}/scripts/stackDatabase.php"); ! require_once("{$stack_root}/scripts/stackSocketSend.php"); ! require_once("{$stack_root}/scripts/CASpool/stackProcess.php"); ! if ('unix' == $stack_os) { ! require_once("{$stack_root}/scripts/stackUnix.php"); ! } ! if ('win' == $stack_os) { ! require_once("{$stack_root}/scripts/stackWin.php"); ! } ! // Set the default language. ! $stackOptions['Language']['default'] = $stack_defaultlang; ! if ($stack_stand_alone) { ! require_once("{$stack_root}/scripts/moodlelib.php"); } --- 161,193 ---- /***************************************************/ ! //Check a valid path has been supplied to library files ! if (file_exists("{$stack_root}/scripts/")) { ! require_once("{$stack_root}/scripts/stackUtility.php"); ! $stack_page_start_time = stack_microtime_float(); ! require_once("{$stack_root}/scripts/stackQuestion.php"); ! require_once("{$stack_root}/scripts/stackQuiz.php"); ! require_once("{$stack_root}/scripts/stackDatabase.php"); ! require_once("{$stack_root}/scripts/stackSocketSend.php"); ! require_once("{$stack_root}/scripts/CASpool/stackProcess.php"); ! if ('unix' == $stack_os) { ! require_once("{$stack_root}/scripts/stackUnix.php"); ! } ! if ('win' == $stack_os) { ! require_once("{$stack_root}/scripts/stackWin.php"); ! } ! // Set the default language. ! $stackOptions['Language']['default'] = $stack_defaultlang; ! if ($stack_stand_alone) { ! require_once("{$stack_root}/scripts/moodlelib.php"); ! } } Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/changelog.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 *** changelog.txt 28 Jul 2005 15:03:49 -0000 1.1.2.1 --- changelog.txt 1 Aug 2005 21:56:24 -0000 1.1.2.2 *************** *** 18,22 **** - STACK Readme updated with new installation documentation directory ! - Stakc installation script: checks for presence of stack_std before allowing user to access their stack web site etc. - Some documentation additions. --- 18,26 ---- - STACK Readme updated with new installation documentation directory ! - Stakc installation script: checks for presence of stack_std before allowing user to access their stack web site etc. ! - Points to right stackInstall.php script ! - Stackstd file: checks for the presence of library scripts before loading them, thus allows us to load stackstd.php with ! fewer errors during installation script ! - Some documentation additions. Index: readme.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/readme.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 *** readme.txt 28 Jul 2005 13:36:22 -0000 1.1.2.1 --- readme.txt 1 Aug 2005 21:56:33 -0000 1.1.2.2 *************** *** 71,75 **** ! /stackroot/lang/en/doc/install.php --- 71,75 ---- ! /stackroot/lang/en/doc/about_install.php |
From: pkiddie <pk...@us...> - 2005-08-01 21:56:42
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8872/lang/en/doc Modified Files: Tag: development_xmlrqp about_install.php Log Message: stackQuestion 'metatype' tag added for dublin core and ieee lom metadata. Installation documentation updated. Readme updated StackStd now checks for the presence of particular files before attempting to load them in - less errors during installation stack_question_schema method in progress Index: about_install.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/about_install.php,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** about_install.php 28 Jul 2005 13:36:21 -0000 1.2.2.1 --- about_install.php 1 Aug 2005 21:56:33 -0000 1.2.2.2 *************** *** 19,25 **** if (file_exists('../../../stackstd.php')) { ! require_once('../../../stackstd.php'); } ?> --- 19,28 ---- if (file_exists('../../../stackstd.php')) { ! include_once('../../../stackstd.php'); } + $stack_ver['cvsmodule'] = 'stack-1-0'; + + ?> *************** *** 531,536 **** In particular you will need to add a password for the mysql user. - Please note this user must be created within a mySQL database editing tool, for example phpMyAdmin. - </li> --- 534,537 ---- |
From: pkiddie <pk...@us...> - 2005-08-01 21:53:15
|
Update of /cvsroot/stack/stack-1-0/schemas In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8251/schemas Log Message: Directory /cvsroot/stack/stack-1-0/schemas added to the repository --> Using per-directory sticky tag `development_xmlrqp' |
From: Chris S. <san...@us...> - 2005-07-31 07:42:37
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11118/lang/en Modified Files: stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/stack.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** stack.php 25 Jul 2005 11:24:08 -0000 1.16 --- stack.php 31 Jul 2005 07:42:28 -0000 1.17 *************** *** 82,86 **** $string['TeacherAnsIs'] = 'The teacher\'s answer is'; ! $string['ThisCanDisplay'] = 'This can be displayed as'; $string['WorkedSolution'] = 'Worked solution'; $string['NoSolution'] = '[No solution available]'; --- 82,86 ---- $string['TeacherAnsIs'] = 'The teacher\'s answer is'; ! $string['ThisCanDisplay'] = 'This can be entered as'; $string['WorkedSolution'] = 'Worked solution'; $string['NoSolution'] = '[No solution available]'; |
From: Chris S. <san...@us...> - 2005-07-31 07:42:36
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11118/scripts Modified Files: stackDatabase.php stackWin.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** stackDatabase.php 25 Jul 2005 14:11:25 -0000 1.34 --- stackDatabase.php 31 Jul 2005 07:42:28 -0000 1.35 *************** *** 1207,1218 **** if(0 != mysql_num_rows($result)) { $row = mysql_fetch_row($result); foreach ($row as $key => $val) { $user[$stackUserKeys[$key]] = stripslashes($val); } - } ! if (array_key_exists('options',$user)) { ! $user['options'] = base64_unserialize($user['options']); ! } return $user; --- 1207,1219 ---- if(0 != mysql_num_rows($result)) { $row = mysql_fetch_row($result); + foreach ($row as $key => $val) { $user[$stackUserKeys[$key]] = stripslashes($val); } ! if (array_key_exists('options',$user)) { ! $user['options'] = base64_unserialize($user['options']); ! } ! } return $user; Index: stackWin.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackWin.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stackWin.php 18 Jul 2005 11:58:22 -0000 1.7 --- stackWin.php 31 Jul 2005 07:42:28 -0000 1.8 *************** *** 91,95 **** if(is_resource($TeXProcess)) { - if (!fwrite($pipes[0], $stack_cas['initCommand'])) { echo "<br />Could not write to the CAS process!<br/ >\n"; --- 91,94 ---- *************** *** 100,103 **** --- 99,104 ---- fflush($pipes[0]); + //echo "<pre>".$strin."</pre>"; + $ret = ''; // read output from stdout |
From: Chris S. <san...@us...> - 2005-07-31 07:42:36
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11118 Modified Files: analysis.php Log Message: Index: analysis.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/analysis.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** analysis.php 14 Jul 2005 07:27:03 -0000 1.15 --- analysis.php 31 Jul 2005 07:42:27 -0000 1.16 *************** *** 164,168 **** } - if (array_key_exists('RawMark',$_POST)) { if ('any' != $_POST['RawMark'] ) { --- 164,167 ---- *************** *** 283,287 **** //////////////////////////////////////////////// - // action = echo "<hr /><p>Enter the information for the student answers that you would like to see:</p>\n --- 282,285 ---- |
From: Chris S. <san...@us...> - 2005-07-31 07:42:36
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11118/scripts/install Modified Files: stackInstall.php stacktest.php Log Message: Index: stacktest.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stacktest.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stacktest.php 14 Jul 2005 18:44:55 -0000 1.5 --- stacktest.php 31 Jul 2005 07:42:28 -0000 1.6 *************** *** 1,3 **** ! ?<php /** * Installs the various functions needed by STACK. --- 1,3 ---- ! <?php /** * Installs the various functions needed by STACK. Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** stackInstall.php 18 Jul 2005 10:53:37 -0000 1.13 --- stackInstall.php 31 Jul 2005 07:42:28 -0000 1.14 *************** *** 7,11 **** // To install, add comments to this line. ! die(); /** --- 7,11 ---- // To install, add comments to this line. ! //die(); /** |