From: pkiddie <pk...@us...> - 2005-08-15 16:38:23
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996 Modified Files: Tag: development_xmlrqp changelog.txt editquiz.php Added Files: Tag: development_xmlrqp import.php Log Message: New revision of DOMIT with better support for namespacing 'Import question' works Preliminary front-end script for importing questions/quizzes and question lists Index: changelog.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/changelog.txt,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** changelog.txt 12 Aug 2005 17:16:46 -0000 1.1.2.6 --- changelog.txt 15 Aug 2005 16:09:23 -0000 1.1.2.7 *************** *** 25,36 **** - 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 ! ! - Schema creation - this is created upon first installation, and where the STACK version changes in any way, this metadata is recreated ! - Exporting of questions, quizzes, and question lists ! questionUserLastUpdated field, what should it contain ! ! Each potential response now has a order element, as order is crucial. ! Question variable keyval types are encompassed within a <questionVar> XML declaration Known issues: --- 25,36 ---- - 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 ! ! - Schema creation - this is created upon first installation, and where the STACK version changes in any way, this metadata is recreated ! - Exporting of questions, quizzes, and question lists ! questionUserLastUpdated field, what should it contain ! ! Each potential response now has a order element, as order is crucial. ! Question variable keyval types are encompassed within a <questionVar> XML declaration Known issues: *************** *** 41,50 **** - 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. 12/08/2005 AnsTest values to be written out in schema. ! - Currently all metadata fields are written out - but are written default instead of what their default values are. This needs to be rectified ! - Ability to export a quiz with no questions attached ! - Adding a 'type' to quizID breaks the quiz export functionality ! - Really after exporting, the download file should be appended with the quiz listing ! - Quiz needs 'import' button - Head elements in schema do not have a minOcurrs and maxOccurs attributes - fails validation 12/08/2005 --- 41,53 ---- - 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. 12/08/2005 AnsTest values to be written out in schema. ! - Currently all metadata fields are written out - but are written default instead of what their default values are. This needs to be rectified ! ! - Where to put version checking routine - ask Chris - initialisation? - on importing questions check against version - old XML questions will not have a version attached ! - Ability to export a quiz with no questions attached - should I block this? NO ! - Adding a 'type' to quizID breaks the quiz export functionality - Chris fine ! - Really after exporting, the download file should be appended with the quiz listing - how? - DONE ! - Quiz needs 'import' button - Chris - DONE ! - Where does a new question get assigned a GUID? - in stackDatabase.php - Head elements in schema do not have a minOcurrs and maxOccurs attributes - fails validation 12/08/2005 *************** *** 63,68 **** Todo: - Exporting an individual question, a list of questions and a quiz - DONE (10/08/2005) ! - Importing an individual question, a list of questions and a quiz ! - Version checking - RQP faults encapsulated within SOAP specific faults. - Remove minOcurrs and maxOcurrs on root 'type' nodes --- 66,72 ---- Todo: - Exporting an individual question, a list of questions and a quiz - DONE (10/08/2005) ! - Importing an individual question, a list of questions and a quiz ! - Version checking - DONE 15/08/2005 ! - Declarenamespace using DOMIT v1 - RQP faults encapsulated within SOAP specific faults. - Remove minOcurrs and maxOcurrs on root 'type' nodes --- NEW FILE: import.php --- <?php /** Provides the front end interactions for the import functionality, and then returns the user to the correct page, i.e. if they are uploading a question,quiz or list of questions */ session_start(); require_once("other/ListMenu.php"); require_once("stackstd.php"); require_once("{$stack_root}/html/trypopupform.html"); require_once("{$stack_root}/frontend_general/editquiz_display.php"); require_once("{$stack_root}/html/helpform.php"); require_once("{$stack_root}/html/quizjava.html"); require_once("{$stack_root}/scripts/stackAuthor.php"); /////////////////////////////////////////////////////////////// // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// $default_action = 'import'; include('frontend_general/process_input.php'); //include_once('frontend_general/edit_quiz_util.php'); $PostTo = 'import.php'; $filter = ''; $quizid = NULL; include('html/pagehead.php'); if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { stack_display_editquiz_error_not_admin($user); include('html/pagefoot.php'); die(); } if ($action=='import') { stack_display_qb_import($errors); } /** * Displays the form for importing a file * @return void */ function stack_display_qb_import($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: <br /> <form enctype='multipart/form-data' action=\"question_bank.php\"' method='POST'><br />\n <input type ='file' name='xmlfile' />\n <input type ='hidden' name='action' value='uploaded_xml' /> <input type ='submit' name='go' value='Upload'> </form>\n\n"; } /** * Displays the imported questions * @param array $quiz The imported quiz * @return void */ function stack_display_qb_show_imported($quiz) { echo "<h2>Details of questions uploaded</h2>"; echo '<table><thead><tr>'; echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; echo '</tr></thead><tbody>'; $errs = NULL; foreach ($quiz as $key => $qu) { stack_question_validate($quiz[$key],$errs[$key]); $qu['questionID'] = stack_db_addquestion($qu); echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; $errc = FALSE; if (nsf($errs,$key)) { if (is_array($errs[$key])) { $errc = TRUE; } } if ($errc) { echo "<td><font color=\"red\">Invalid question</font></td>"; echo "</tr></tbody></table>\n\n"; echo stack_question_errstr($errs[$key]); echo "\n\n<table><thead><tr>"; echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; echo '</tr></thead><tbody>'; } else { echo "<td><font color=\"greed\">Valid question</font></td>"; } echo "</tr>\n"; } echo "</tbody></table>\n"; echo "<h2>Current database of questions</h2>"; } ?> Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** editquiz.php 10 Aug 2005 08:48:45 -0000 1.13.2.1 --- editquiz.php 15 Aug 2005 16:09:23 -0000 1.13.2.2 *************** *** 142,145 **** --- 142,150 ---- if ('quiz_new' == $action) { $quiz['quizid'] = $quizid; + //<TODO> Automatically generated quiz metadata + $quiz['questionFormat'] = 'text/xml; charset="utf-8"'; + $quiz['questionPublisher'] = $stack_web_url; + $quiz['type'] = 'quiz'; + $quiz['questionUserLastEdited'] = $user['firstname']." ".$user['lastname']; $action = 'quiz_edit'; } *************** *** 160,168 **** switch ($action) { case 'quiz_choose': $quiz_store = stack_db_quiz_get(); stack_display_editquiz_select($quiz_store, $PostTo); break; ! case 'quiz_edit': stack_display_editquiz_edit($quiz,$errors,$PostTo); break; --- 165,180 ---- switch ($action) { + case 'quiz_xml': + { + echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; + } case 'quiz_choose': $quiz_store = stack_db_quiz_get(); stack_display_editquiz_select($quiz_store, $PostTo); break; ! case 'import': ! { ! } ! case 'quiz_edit': stack_display_editquiz_edit($quiz,$errors,$PostTo); break; *************** *** 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>"; } --- 182,185 ---- |