From: Juliette W. <jv...@us...> - 2005-06-16 10:59:44
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17014 Modified Files: Tag: frontend_dev qb_display.php qb_export.php qb_metadata.php question_bank.php question_bank_util.php Log Message: Put more of the html into qb_display.php Index: qb_export.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_export.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** qb_export.php 15 Jun 2005 17:19:28 -0000 1.1.2.1 --- qb_export.php 16 Jun 2005 10:59:34 -0000 1.1.2.2 *************** *** 13,17 **** if (NULL == $quiz) { ! echo "<p>Could not get any ticked questions! Please try again.</p>"; $action = 'questionbank_screen'; } --- 13,17 ---- if (NULL == $quiz) { ! stack_print_questionbank_no_questions_screen(); $action = 'questionbank_screen'; } *************** *** 21,25 **** $name = stack_xml_write_quiz_file($quiz, "{$stack_root}/tmp/"); ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } --- 21,25 ---- $name = stack_xml_write_quiz_file($quiz, "{$stack_root}/tmp/"); ! stack_print_download_export_screen($name); } *************** *** 31,35 **** $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } --- 31,35 ---- $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); ! stack_print_download_export_screen($name); } Index: qb_metadata.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_metadata.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** qb_metadata.php 15 Jun 2005 17:30:44 -0000 1.1.2.1 --- qb_metadata.php 16 Jun 2005 10:59:34 -0000 1.1.2.2 *************** *** 4,8 **** if ('edit_metadata' == $action ) { if (!$admin) { ! echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; } else { // If needed update the database --- 4,8 ---- if ('edit_metadata' == $action ) { if (!$admin) { ! stack_print_not_admin(); } else { // If needed update the database *************** *** 17,29 **** session_unregister('question'); session_unregister('questionInst'); ! $options = ''; ! include("{$stack_root}/html/qselectform.php"); ! ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! // This line appears to be broken - it doesn't save the metadata! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! ! } ?> --- 17,24 ---- session_unregister('question'); session_unregister('questionInst'); + + stack_print_edit_metadata_screen($question_bank_filter); ! } ?> Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/question_bank_util.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** question_bank_util.php 15 Jun 2005 20:17:08 -0000 1.1.2.6 --- question_bank_util.php 16 Jun 2005 10:59:34 -0000 1.1.2.7 *************** *** 108,111 **** --- 108,124 ---- } + // This function also sets $SESSION['bank_filter'] if required + function stack_get_questionbank_filter() { + $question_bank_filter = ''; + if (array_key_exists('bank_filter',$_SESSION)) { + $question_bank_filter = $_SESSION['bank_filter']; + } + if (array_key_exists('bank_filter',$_POST)) { + $question_bank_filter = $_POST['bank_filter']; + $_SESSION['bank_filter'] = $question_bank_filter; + } + return $question_bank_filter; + } + Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_display.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** qb_display.php 15 Jun 2005 20:07:09 -0000 1.1.2.2 --- qb_display.php 16 Jun 2005 10:59:34 -0000 1.1.2.3 *************** *** 30,32 **** --- 30,55 ---- } + function stack_print_download_export_screen($name) { + global $stack_web_url; + echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; + } + + function stack_print_questionbank_no_questions_screen() { + echo "<p>Could not get any ticked questions! Please try again.</p>"; + } + + function stack_print_edit_metadata_screen($question_bank_filter) { + global $stack_root; + $options = ''; + include("{$stack_root}/html/qselectform.php"); + + stack_db_listquestions('edit_metadata',$question_bank_filter); + // This line appears to be broken - it doesn't save the metadata! + echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; + } + + function stack_print_not_admin() { + echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; + + } ?> Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.13 retrieving revision 1.3.2.14 diff -C2 -d -r1.3.2.13 -r1.3.2.14 *** question_bank.php 16 Jun 2005 04:11:38 -0000 1.3.2.13 --- question_bank.php 16 Jun 2005 10:59:34 -0000 1.3.2.14 *************** *** 126,144 **** // (2.2) Work out the correct value for any filter to be applied to the // question bank. ! $question_bank_filter = ''; ! if (array_key_exists('bank_filter',$_SESSION)) { ! $question_bank_filter = $_SESSION['bank_filter']; ! } ! if (array_key_exists('bank_filter',$_POST)) { ! $question_bank_filter = $_POST['bank_filter']; ! $_SESSION['bank_filter'] = $question_bank_filter; ! } ! - // (2.3) Uploaded file. - if ('upload_xml_file' == $action) { - include('upload_questions.php'); - $action = 'questionbank_screen'; - } // End (2.3) --- 126,131 ---- // (2.2) Work out the correct value for any filter to be applied to the // question bank. ! $question_bank_filter = stack_get_questionbank_filter(); // End (2.3) |