From: pkiddie <pk...@us...> - 2005-08-10 08:48:53
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15907 Modified Files: Tag: development_xmlrqp editquiz.php question_bank.php Log Message: Editquiz.php added to, to allow the exporting of quiz XML files Lists of questions now exportable with new code in stackXML StackQuiz data structure updated Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** editquiz.php 14 Jul 2005 17:59:12 -0000 1.13 --- editquiz.php 10 Aug 2005 08:48:45 -0000 1.13.2.1 *************** *** 65,69 **** $question_bank_filter = stack_get_questionbank_filter(); - //////////////////////////////////////////////// // (2) Take any actions required on entry to the page --- 65,68 ---- *************** *** 77,80 **** --- 76,81 ---- // quiz_edit_addqs Add questions to the quiz. // filter Re-display the list of questions, filtered. + // quiz_xml Export the current quiz as an XML file + // quiz_xml_db Export single quiz as XML from database *************** *** 89,92 **** --- 90,100 ---- $quizid_source = 'database'; } + + else if ('quiz_xml' == $action) { + $quizid_source = 'post'; + } + else if ('quiz_xml_db' == $action) { + $quizid_source = 'database'; + } if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { *************** *** 97,103 **** } } ! $quizid = stack_get_quizid($quizid_source, $quiz); ! if (('quiz_edit' == $action or 'quiz_edit_addqs' == $action) and '' == $quiz) { $quiz = stack_get_quiz('database', $quizid); --- 105,111 ---- } } ! $quizid = stack_get_quizid($quizid_source, $quiz); ! if (('quiz_edit' == $action or 'quiz_edit_addqs' == $action) and '' == $quiz) { $quiz = stack_get_quiz('database', $quizid); *************** *** 136,139 **** --- 144,155 ---- $action = 'quiz_edit'; } + + if ('quiz_xml' == $action) { + + include_once("{$stack_root}/scripts/stackXML.php"); + + $quiz = stack_get_quiz('database', $quizid); + $name = stack_xml_write_quiz_new($quiz,"{$stack_root}/tmp/"); + } //////////////////////////////////////////////// *************** *** 154,159 **** stack_db_listquestions_quiz($question_bank_filter,$quizid); break; ! case 'quiz_xml'; ! echo "This feature is not yet implemented."; } --- 170,183 ---- stack_db_listquestions_quiz($question_bank_filter,$quizid); break; ! case 'quiz_xml': ! { ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; ! $action = 'quizbank_screen'; ! } ! } ! ! switch ($action) { ! case 'quizbank_screen': ! echo"<br>The main quiz screen should be shown here<br>"; } Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** question_bank.php 5 Aug 2005 10:44:25 -0000 1.8.2.2 --- question_bank.php 10 Aug 2005 08:48:45 -0000 1.8.2.3 *************** *** 161,165 **** $name = ''; if (NULL !== $questions_to_export) { ! $name = stack_xml_write_quiz_file($questions_to_export, "{$stack_root}/tmp/"); } $action = 'export_xml'; --- 161,165 ---- $name = ''; if (NULL !== $questions_to_export) { ! $name = stack_xml_write_question_list($questions_to_export, "{$stack_root}/tmp/"); } $action = 'export_xml'; |