From: pkiddie <pk...@us...> - 2005-08-23 11:48:30
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6251 Modified Files: Tag: development_xmlrqp editquiz.php import.php index.php Log Message: Put default_action back in import.php Took out redeclares of listmenu in import.php and editquiz.php Index: import.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/import.php,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** import.php 22 Aug 2005 17:20:18 -0000 1.1.2.7 --- import.php 23 Aug 2005 11:48:09 -0000 1.1.2.8 *************** *** 32,36 **** session_start(); - require_once("other/ListMenu.php"); include('stackstd.php'); --- 32,35 ---- *************** *** 41,49 **** require_once("{$stack_root}/scripts/stackAuthor.php"); ! //$default_action = 'import'; include('frontend_general/process_input.php'); - //include_once('frontend_general/edit_quiz_util.php'); - $PostTo = 'import.php'; $filter = ''; --- 40,46 ---- require_once("{$stack_root}/scripts/stackAuthor.php"); ! $default_action = 'import'; include('frontend_general/process_input.php'); $PostTo = 'import.php'; $filter = ''; Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.13.2.6 retrieving revision 1.13.2.7 diff -C2 -d -r1.13.2.6 -r1.13.2.7 *** editquiz.php 22 Aug 2005 17:20:18 -0000 1.13.2.6 --- editquiz.php 23 Aug 2005 11:48:09 -0000 1.13.2.7 *************** *** 33,38 **** */ session_start(); - - require_once("other/ListMenu.php"); require_once("stackstd.php"); --- 33,36 ---- Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.23.2.4 retrieving revision 1.23.2.5 diff -C2 -d -r1.23.2.4 -r1.23.2.5 *** index.php 23 Aug 2005 10:18:08 -0000 1.23.2.4 --- index.php 23 Aug 2005 11:48:09 -0000 1.23.2.5 *************** *** 1,141 **** ! <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. ! * - Added logic to view installation instructions if stackstd.php not dectected ! * @package Stack ! */ ! ! ! /** ! * ! */ ! session_start(); ! ! /////////////////////////////////////////////////////////////// ! // (1) Process Input - this sets $action, $user and $username ! /////////////////////////////////////////////////////////////// ! ! if (file_exists('stackstd.php')) { ! include('stackstd.php'); ! } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions ! include('lang/en/doc/about_install.php'); ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); ! //1. Check that XML schemas are up to date ! if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) ! { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; ! } ! ! /////////////////////////////////////////////////////////////// ! // (2) Take any actions required ! /////////////////////////////////////////////////////////////// ! ! // Note that we need to unset the user before printing the header. ! if ('logout' == $action) { ! $user = NULL; ! session_unregister('user'); ! unset($_SESSION['user']); ! $_GET['expand'] = 0; ! } ! ! include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! ! ////////////////////////////////////////////////////////////// ! // (2) Print the page. ! ////////////////////////////////////////////////////////////// ! ! include('html/pagehead.php'); ! ! if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; ! } ! ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } ! } ! ! if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! echo $errors['user']; ! $action = 'loginscreen'; ! } ! ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! stack_user_update_info($user, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! case 'update_schema': ! stack_xml_update_schema("{$stack_root}/schemas/"); ! break; ! case 'update_db': ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! break; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! --- 1,141 ---- ! <?php ! /** ! * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. ! * - Added logic to view installation instructions if stackstd.php not dectected ! * @package Stack ! */ ! ! ! /** ! * ! */ ! session_start(); ! ! /////////////////////////////////////////////////////////////// ! // (1) Process Input - this sets $action, $user and $username ! /////////////////////////////////////////////////////////////// ! ! if (file_exists('stackstd.php')) { ! include('stackstd.php'); ! } else { ! //echo "STACK is not correctly installed."; ! //View the installation instructions ! include('lang/en/doc/about_install.php'); ! die(); ! } ! ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); ! ! //Initialisation ! include_once("{$stack_root}/scripts/stackXML.php"); ! //1. Check that XML schemas are up to date ! if (!stack_xml_check_schema_version("{$stack_root}/schemas/")) ! { ! $action = 'update_schema'; ! } ! ! //2. Check whether database needs updating - need to be logged in to get credentials ! include_once("{$stack_root}/scripts/stackDatabase.php"); ! if (!stack_db_database_update() && stack_is_logged_in($user) and !stack_user_is_guest($user)) ! { ! $action = 'update_db'; ! } ! ! /////////////////////////////////////////////////////////////// ! // (2) Take any actions required ! /////////////////////////////////////////////////////////////// ! ! // Note that we need to unset the user before printing the header. ! if ('logout' == $action) { ! $user = NULL; ! session_unregister('user'); ! unset($_SESSION['user']); ! $_GET['expand'] = 0; ! } ! ! include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! ! ////////////////////////////////////////////////////////////// ! // (2) Print the page. ! ////////////////////////////////////////////////////////////// ! ! include('html/pagehead.php'); ! ! if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; ! } ! ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } ! } ! ! if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; ! echo $errors['user']; ! $action = 'loginscreen'; ! } ! ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! stack_user_update_info($user, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! case 'update_schema': ! stack_xml_update_schema("{$stack_root}/schemas/"); ! break; ! case 'update_db': ! include("{$stack_root}/scripts/install/stackUpdateDatabase.php"); ! break; ! } ! ! include('html/pagefoot.php'); ! ! ?> ! |