From: Juliette W. <jv...@us...> - 2005-06-16 14:30:29
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12534 Modified Files: Tag: frontend_dev index.php qb_preview.php question_bank.php Log Message: More minor changes Index: qb_preview.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_preview.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_preview.php 15 Jun 2005 17:19:22 -0000 1.1.2.2 --- qb_preview.php 16 Jun 2005 14:30:17 -0000 1.1.2.3 *************** *** 11,20 **** unset($questionInst); ! $action = 'try'; } // These branches need the question to be validated ! if ('edit' == $action or 'try'==$action or 'export_xml'==$action) { stack_question_validate($question,$errors); } --- 11,20 ---- unset($questionInst); ! $action = 'preview'; } // These branches need the question to be validated ! if ('edit' == $action or 'preview'==$action or 'export_xml'==$action) { stack_question_validate($question,$errors); } *************** *** 32,36 **** ! if ('try'==$action && $database) { if (''==$errors) { $action='validate'; --- 32,36 ---- ! if ('preview'==$action && $database) { if (''==$errors) { $action='validate'; *************** *** 65,69 **** // If we have just taken a question from the edit from, we need to instantiate it. ! if ('try'==$action) { if (''==$errors) { $action='mark'; --- 65,69 ---- // If we have just taken a question from the edit from, we need to instantiate it. ! if ('preview'==$action) { if (''==$errors) { $action='mark'; Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.17 retrieving revision 1.3.2.18 diff -C2 -d -r1.3.2.17 -r1.3.2.18 *** question_bank.php 16 Jun 2005 13:49:22 -0000 1.3.2.17 --- question_bank.php 16 Jun 2005 14:30:17 -0000 1.3.2.18 *************** *** 49,67 **** //////////////////////////////////////////////// ! // action = start_new Edit a blank question // action = edit Edit a question, in $SESSION or $POST // action = edit_from_db Get a question from db and edit. ! // action = try Try a question in $SESSION or $POST. ! // action = try_from_db Get a question from db. Instantiate and try. // action = new_version Try a new version of this question. // action = validate Validate the response to the current question. // action = mark Mark the response to the current question. ! // action = store_in_db Store a question in the db. ! // action = store_new_db Store as a new question in the db. ! // action = delete_from_db Delete a question from the db. // action = export_xml Export current question as xml. // action = export_xml_db Export single question as xml from the database. // action = export_xml_list Export the list of selected questions as a single XML file ! // action = upload_xml_file Deal with an uploaded file. // action = edit_metadata Edit all the meta data fields in the question bank. --- 49,67 ---- //////////////////////////////////////////////// ! // action = edit_new Edit a blank question // action = edit Edit a question, in $SESSION or $POST // action = edit_from_db Get a question from db and edit. ! // action = preview Try a question in $SESSION or $POST. ! // action = preview_from_db Get a question from db. Instantiate and try. // action = new_version Try a new version of this question. // action = validate Validate the response to the current question. // action = mark Mark the response to the current question. ! // action = save Store a question in the db. ! // action = save_as Store as a new question in the db. ! // action = delete Delete a question from the db. // action = export_xml Export current question as xml. // action = export_xml_db Export single question as xml from the database. // action = export_xml_list Export the list of selected questions as a single XML file ! // action = import Deal with an uploaded file. // action = edit_metadata Edit all the meta data fields in the question bank. *************** *** 79,83 **** $new_question = FALSE; ! if ('start_new' == $action) { $new_question = TRUE; $action = 'edit'; --- 79,83 ---- $new_question = FALSE; ! if ('edit_new' == $action) { $new_question = TRUE; $action = 'edit'; *************** *** 85,89 **** $database = FALSE; ! if ('edit_from_db'==$action or 'try_from_db'==$action or 'export_xml_db'==$action) { $database = TRUE; } --- 85,89 ---- $database = FALSE; ! if ('edit_from_db'==$action or 'preview_from_db'==$action or 'export_xml_db'==$action) { $database = TRUE; } *************** *** 93,98 **** } ! if ('try_from_db' == $action) { ! $action = 'try'; } --- 93,98 ---- } ! if ('preview_from_db' == $action) { ! $action = 'preview'; } *************** *** 106,112 **** or 'mark' == $action or 'validate' == $action ! or 'store_in_db' == $action ! or 'store_new_db' == $action ! or 'try' == $action or 'new_version' == $action or 'export_xml' == $action) { --- 106,112 ---- or 'mark' == $action or 'validate' == $action ! or 'save' == $action ! or 'save_as' == $action ! or 'preview' == $action or 'new_version' == $action or 'export_xml' == $action) { *************** *** 191,195 **** } ! if ('delete_from_db' == $action) { $questionID = $_POST['questionID']; if ($admin) { --- 191,195 ---- } ! if ('delete' == $action) { $questionID = $_POST['questionID']; if ($admin) { *************** *** 199,208 **** } ! if ('store_in_db' == $action) { stack_db_addquestion($question); $action = 'questionbank_screen'; } ! if ('store_new_db' == $action) { stack_db_addquestion($question,TRUE); $action = 'questionbank_screen'; --- 199,208 ---- } ! if ('save' == $action) { stack_db_addquestion($question); $action = 'questionbank_screen'; } ! if ('save_as' == $action) { stack_db_addquestion($question,TRUE); $action = 'questionbank_screen'; *************** *** 227,231 **** } break; ! case 'upload_xml_file': stack_import_questions_screen($errors); break; --- 227,231 ---- } break; ! case 'import': stack_import_questions_screen($errors); break; Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.6 retrieving revision 1.17.2.7 diff -C2 -d -r1.17.2.6 -r1.17.2.7 *** index.php 16 Jun 2005 12:13:37 -0000 1.17.2.6 --- index.php 16 Jun 2005 14:30:16 -0000 1.17.2.7 *************** *** 61,69 **** } if ('loginscreen' == $action) { ! $err = nsf($errors,'user'); ! $errun = nsf($err,'username'); ! $errps = nsf($err,'password'); ! $username = nsf($user,'username'); stack_login_screen($username, $errun, $errps); } --- 61,74 ---- } + if ('welcome' == $action) { + stack_welcome_screen($user); + $action = 'choose_quiz'; + } + if ('loginscreen' == $action) { ! $err = stack_get_err($errors); ! $errun = stack_get_errun($err); ! $errps = stack_get_errps($err); ! $username = stack_get_username($user); stack_login_screen($username, $errun, $errps); } *************** *** 77,87 **** if ('update_info' == $action) { ! if ($user['loggedin'] and 'guest' != $user['username']) { ! $err = ''; ! if (is_array($errors)) { ! if (array_key_exists('user',$errors)) { ! $err = $errors['user']; ! } ! } stack_update_info_screen($user, $err, $errors); } else { --- 82,87 ---- if ('update_info' == $action) { ! if (stack_is_logged_in($user) and !stack_user__is_guest($user)) { ! $err = stack_get_err2($errors); stack_update_info_screen($user, $err, $errors); } else { *************** *** 90,97 **** } ! if ('welcome' == $action) { ! stack_welcome_screen($user); ! $action = 'choose_quiz'; ! } if ('error' == $action) { --- 90,96 ---- } ! ! ! if ('error' == $action) { |