From: Juliette W. <jv...@us...> - 2005-06-16 13:09:33
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28349 Modified Files: Tag: frontend_dev question_bank.php Removed Files: Tag: frontend_dev import_question_screen.php qb_display.php qb_export.php qb_metadata.php question_bank_util.php upload_questions.php Log Message: Put code back into question_bank.php --- qb_export.php DELETED --- --- qb_metadata.php DELETED --- --- upload_questions.php DELETED --- Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.15 retrieving revision 1.3.2.16 diff -C2 -d -r1.3.2.15 -r1.3.2.16 *** question_bank.php 16 Jun 2005 11:44:44 -0000 1.3.2.15 --- question_bank.php 16 Jun 2005 13:09:24 -0000 1.3.2.16 *************** *** 36,41 **** include('html/javascripthead.html'); include('html/inputtool.html'); ! include('question_bank_util.php'); ! include('qb_display.php'); $question = ''; --- 36,41 ---- include('html/javascripthead.html'); include('html/inputtool.html'); ! include_once($stack_root.'/frontend_general/question_bank_util.php'); ! include_once($stack_root.'/frontend_general/qb_display.php'); $question = ''; *************** *** 129,139 **** $question_bank_filter = stack_get_questionbank_filter(); ! // End (2.3) // (2.4) Export a whole list of questions. ! include('qb_export.php'); // (2.5) action = edit_metadata ! include('qb_metadata.php'); ////////////////////////////////////////////////// --- 129,215 ---- $question_bank_filter = stack_get_questionbank_filter(); ! ! if ('upload_xml_file' == $action) { ! stack_import_questions_screen($errors); ! } ! ! if ('uploaded_xml' == $action) { ! if (array_key_exists('xmlfile',$_FILES)) { ! if (is_uploaded_file($_FILES['xmlfile']['tmp_name'])) { ! $pq = file_get_contents($_FILES['xmlfile']['tmp_name']); ! include_once("{$stack_root}/scripts/stackXML.php"); ! ! $qu = stack_xml_parse_question_string($pq); ! ! // Sort out what has been uploaded. ! // (0) a single question. Edit this. ! if (array_key_exists('assessmentItem',$qu)) { ! $question = $qu['assessmentItem']; ! ! $action = 'edit'; ! // (1) a quiz of questions. Store each in the database. ! } else if (array_key_exists('mathQuiz',$qu)) { ! $quiz = $qu['mathQuiz']['assessmentItem']; ! stack_show_uploaded_questions_screen($quiz); ! } else { ! $error['upload_xml_file']='<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ! ! } ! } ! ! $action = 'questionbank_screen'; ! } // (2.4) Export a whole list of questions. ! $multiple_questions = FALSE; ! ! if ('export_xml_list'==$action) { ! $multiple_questions = TRUE; ! $action = 'export_xml'; ! } ! ! if ('export_xml'==$action) { ! if ($multiple_questions) { ! $questions_to_export = stack_get_selected_questions(); ! if (NULL == $questions_to_export) { ! stack_print_questionbank_no_questions_screen(); ! $action = 'questionbank_screen'; ! } ! } else { ! stack_question_validate($question,$errors); ! include_once("{$stack_root}/scripts/stackXML.php"); ! } ! ! include_once("{$stack_root}/scripts/stackXML.php"); ! ! if ($multiple_questions) { ! $name = stack_xml_write_quiz_file($questions_to_export, "{$stack_root}/tmp/"); ! } else { ! $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); ! } ! stack_print_download_export_screen($name); ! } // (2.5) action = edit_metadata ! if ('edit_metadata' == $action ) { ! if (!$admin) { ! stack_print_not_admin(); ! } else { ! // If needed update the database ! if (array_key_exists('edit_metadata',$_POST)) { ! $edit_metadata = $_POST['edit_metadata']; ! if (is_array($edit_metadata)) { ! stack_db_edit_metadata($edit_metadata); ! } ! } ! } ! ! session_unregister('question'); ! session_unregister('questionInst'); ! ! stack_print_edit_metadata_screen($question_bank_filter); ! ! } ////////////////////////////////////////////////// --- import_question_screen.php DELETED --- --- qb_display.php DELETED --- --- question_bank_util.php DELETED --- |