From: pkiddie <pk...@us...> - 2005-07-18 10:44:48
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv656/scripts Modified Files: stackAuthor.php stackQuestion.php stackXML.php Log Message: Addition of XML metadata to questions, and prelim authoring fields Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** stackAuthor.php 18 Jul 2005 10:07:18 -0000 1.27 --- stackAuthor.php 18 Jul 2005 10:44:17 -0000 1.28 *************** *** 371,398 **** } ! //<PDK> Insert user definable metadata here ! /* echo "\n<hr />\n ! <table cellboarder='0' cellpadding='2'> ! <tr> <td>".get_string('stackQuestion_questionLanguage','stack','').":</td> ! <td><input type='input' name='questionLanguage' value='".sf($question,'questionLanguage')."' size='10' /></tr> ! <tr> <td>".get_string('stackQuestion_questionLearningContext','stack','').":</td> ! <td><input type='input' name='questionLearningContext' value='".sf($question,'questionLearningContext')."' size='20' /></tr> ! <tr> <td>".get_string('stackQuestion_questionDifficulty','stack','').":</td> ! <td><input type='input' name='questionDifficulty' value='".sf($question,'questionDifficulty')."' size='20' /></tr> ! <tr> <td>".get_string('stackQuestion_questionCompetency','stack','').":</td> ! <td><input type='input' name='questionCompetency' value='".sf($question,'questionCompetency')."' size='20' /></tr> ! <tr> <td>".get_string('stackQuestion_questionCompetencyLevel','stack','').":</td> ! <td><input type='input' name='questionCompetencyLevel' value='".sf($question,'questionCompetency')."' size='20' /></tr> ! <tr> <td>".get_string('stackQuestion_questionTimeAllocated','stack','').":</td> ! <td><input type='input' name='questionTimeAllocated' value='".sf($question,'questionTimeAllocated')."' size='20' /></tr> ! <tr> <td>".get_string('stackQuestion_questionExcerciseType','stack','').":</td> ! <td><input type='input' name='questionExcerciseType' value='".sf($question,'questionExcerciseType')."' size='20' /></tr> ! </table> "; */ ! ! include('stackXML.php'); ! stack_schema_write_metadata(""); ! ! echo "\n<hr />\n"; $qfield='questionLanguage'; $qfield_name = "question[{$qfield}]"; --- 371,382 ---- } ! $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','',get_string('stackOptions_edit_resppro','stack'),'','','','','',get_string('stackOptions_edit_out','stack'),''); ! $options_list = array('InsertStars','InformalSyntax','AllowInputTool','SyntaxHint','Forbid','Allow','MarkModMethod','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','ShowSol'); ! ! stack_options_edit_form($options_headings,$options_list,$optval,'questionOptions'); ! ! echo "\n<hr />\n"; + //<PDK> Insert user definable metadata here $qfield='questionLanguage'; $qfield_name = "question[{$qfield}]"; *************** *** 456,463 **** echo "\n<hr />\n"; - $options_headings = array(get_string('stackOptions_edit_inmeth','stack'),'','','',get_string('stackOptions_edit_resppro','stack'),'','','','','',get_string('stackOptions_edit_out','stack'),''); - $options_list = array('InsertStars','InformalSyntax','AllowInputTool','SyntaxHint','Forbid','Allow','MarkModMethod','FeedBackGenericCorrect','FeedBackGenericPCorrect','FeedBackGenericIncorrect','Display','ShowSol'); - - stack_options_edit_form($options_headings,$options_list,$optval,'questionOptions'); --- 440,443 ---- Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stackXML.php 18 Jul 2005 10:16:57 -0000 1.7 --- stackXML.php 18 Jul 2005 10:44:18 -0000 1.8 *************** *** 9,13 **** //<PDK> sqlToSchemaMapping array maps basic SQL data types used in STAKCK to their respective XML schema data types ! $sqlToSchemaMapping['CHAR']='string'; $sqlToSchemaMapping['VARCHAR']='string'; $sqlToSchemaMapping['TEXT']='string'; --- 9,13 ---- //<PDK> sqlToSchemaMapping array maps basic SQL data types used in STAKCK to their respective XML schema data types ! /*$sqlToSchemaMapping['CHAR']='string'; $sqlToSchemaMapping['VARCHAR']='string'; $sqlToSchemaMapping['TEXT']='string'; *************** *** 19,23 **** $sqlToSchemaMapping['TIME']='time'; $sqlToSchemaMapping['DATETIME']='dateTime'; ! $sqlToSchemaMapping['TIMESTAMP']='time'; /** --- 19,23 ---- $sqlToSchemaMapping['TIME']='time'; $sqlToSchemaMapping['DATETIME']='dateTime'; ! $sqlToSchemaMapping['TIMESTAMP']='time';*/ /** *************** *** 315,322 **** function stack_schema_create_metadata() { ! global $stackQuestion; //use definitive stackQuestion data structure ! global $sqlToSchemaMapping; $xml = ""; //Do not export questionID - internal SQL variable --- 315,325 ---- function stack_schema_create_metadata() { ! global $stackQuestion, $sqlToSchemaMapping; //use definitive stackQuestion data structure $xml = ""; + + //print_r($sqlToSchemaMapping); + + //print_r($stackQuestion); //Do not export questionID - internal SQL variable *************** *** 427,431 **** $elementDataType = explode("(", $elementDataType[0]); ! echo $sqlToSchemaMapping[$elementDataType[0]]; return "<xs:element name=".'"'.$elementName.'"'.' type="xs:'.$sqlToSchemaMapping[$elementDataType[0]].'"/>'; --- 430,434 ---- $elementDataType = explode("(", $elementDataType[0]); ! //echo $sqlToSchemaMapping[$elementDataType[0]]; return "<xs:element name=".'"'.$elementName.'"'.' type="xs:'.$sqlToSchemaMapping[$elementDataType[0]].'"/>'; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** stackQuestion.php 18 Jul 2005 10:07:18 -0000 1.25 --- stackQuestion.php 18 Jul 2005 10:44:18 -0000 1.26 *************** *** 118,122 **** $stackOptions['ShowSol']['default']='On request'; ! //////////////////////////////////////////////////////////////////////// --- 118,134 ---- $stackOptions['ShowSol']['default']='On request'; ! //<PDK> sqlToSchemaMapping array maps basic SQL data types used in STAKCK to their respective XML schema data types ! //Only place temporarily here pending a resolution! ! $sqlToSchemaMapping['CHAR']='string'; ! $sqlToSchemaMapping['VARCHAR']='string'; ! $sqlToSchemaMapping['TEXT']='string'; ! $sqlToSchemaMapping['TINYTEXT']='string'; ! $sqlToSchemaMapping['INT']='int'; ! $sqlToSchemaMapping['INT UNSIGNED']='int'; ! $sqlToSchemaMapping['DECIMAL']='decimal'; ! $sqlToSchemaMapping['DATE']='date'; ! $sqlToSchemaMapping['TIME']='time'; ! $sqlToSchemaMapping['DATETIME']='dateTime'; ! $sqlToSchemaMapping['TIMESTAMP']='time'; //////////////////////////////////////////////////////////////////////// |