From: Juliette W. <jv...@us...> - 2005-06-17 13:16:51
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23417/frontend_general Modified Files: Tag: frontend_dev editquiz_display.php front_end_display.php qb_display.php question_bank_util.php Log Message: Couple of fixes and made function names more consistent Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.php,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** qb_display.php 16 Jun 2005 14:30:16 -0000 1.1.2.4 --- qb_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.5 *************** *** 1,5 **** <?php ! function stack_print_question_bank_screen($admin, $question_bank_filter) { global $stack_root; $options = ''; --- 1,5 ---- <?php ! function stack_display_qb_main($admin, $question_bank_filter) { global $stack_root; $options = ''; *************** *** 18,22 **** } ! function stack_print_edit_screen($question, $errors) { global $stack_root; include_once("{$stack_root}/scripts/stackAuthor.php"); --- 18,22 ---- } ! function stack_display_qb_edit($question, $errors) { global $stack_root; include_once("{$stack_root}/scripts/stackAuthor.php"); *************** *** 30,43 **** } ! 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 = ''; --- 30,43 ---- } ! function stack_display_qb_export($name) { global $stack_web_url; echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } ! function stack_display_error_no_questions_selected() { echo "<p>Could not get any ticked questions! Please try again.</p>"; } ! function stack_display_qb_edit_metadata($question_bank_filter) { global $stack_root; $options = ''; *************** *** 49,53 **** } ! 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>"; --- 49,53 ---- } ! function stack_display_qb_error_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>"; *************** *** 55,59 **** ! function stack_import_questions_screen($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: --- 55,59 ---- ! function stack_display_qb_import($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: *************** *** 67,71 **** ! function stack_show_uploaded_questions_screen($quiz) { echo "<h2>Details of questions uploaded</h2>"; --- 67,71 ---- ! function stack_display_qb_show_imported($quiz) { echo "<h2>Details of questions uploaded</h2>"; *************** *** 102,107 **** } ! function stack_upload_error_screen() { echo '<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ?> --- 102,121 ---- } ! function stack_display_qb_error_upload_failure() { echo '<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ! ! function stack_display_qb_error_validation_failure() { ! echo '<p>Could not instantiate the question, because of errors. ! <br />Try to edit the question instead.</p>'; ! } ! ! function stack_display_qb_preview($questionInst) { ! echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> ! <td align='left'> ! ! <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); ! echo ")</td><td align='right'>"; ! echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; ! } ?> Index: front_end_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/front_end_display.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 *** front_end_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.6 --- front_end_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.7 *************** *** 1,5 **** <?php ! function stack_login_screen($username, $errun, $errps) { echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; --- 1,5 ---- <?php ! function stack_display_main_login($username, $errun, $errps) { echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; *************** *** 31,35 **** } ! function stack_update_info_screen($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"index.php?\" method=\"post\" name=\"register\" id=\"register\">"; --- 31,35 ---- } ! function stack_display_main_update_userinfo($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"index.php?\" method=\"post\" name=\"register\" id=\"register\">"; *************** *** 40,49 **** } ! function stack_update_info_error_screen() { echo '<h1>Update user information</h1>'; echo '<p>Please logout and login as a personal user first to update your information.</p>'; } ! function stack_registration_screen($username, $user, $errors, $err) { echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; --- 40,49 ---- } ! function stack_display_main_error_update_userinfo() { echo '<h1>Update user information</h1>'; echo '<p>Please logout and login as a personal user first to update your information.</p>'; } ! function stack_display_main_register($username, $user, $errors, $err) { echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; *************** *** 54,62 **** } ! function stack_logout_screen() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ! function stack_select_quiz_screen($quiz_store, $user) { global $stack_root; require_once("{$stack_root}/html/quizjava.html"); --- 54,62 ---- } ! function stack_display_main_logout() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ! function stack_display_main_select_quiz($quiz_store, $user) { global $stack_root; require_once("{$stack_root}/html/quizjava.html"); *************** *** 95,104 **** } ! function stack_login_error_screen($error) { echo "There was an error with the login or registration"; echo $error; } ! function stack_welcome_screen($user) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; } --- 95,104 ---- } ! function stack_display_main_error_login($error) { echo "There was an error with the login or registration"; echo $error; } ! function stack_display_main_welcome($user) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; } Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/question_bank_util.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 *** question_bank_util.php 16 Jun 2005 13:09:24 -0000 1.1.2.1 --- question_bank_util.php 17 Jun 2005 13:16:41 -0000 1.1.2.2 *************** *** 136,139 **** --- 136,150 ---- } + function stack_get_seed() { + if (array_key_exists('seed',$_POST)) { + $seed=$_POST['seed']; + } else { + // HACK: this should involve the concept of a user! + $seed = time(); + } + + return $seed; + } + Index: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_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 *** editquiz_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.2 --- editquiz_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.3 *************** *** 6,10 **** // @param $quiz_store // @param $PostTo ! function stack_select_quiz_screen($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { --- 6,10 ---- // @param $quiz_store // @param $PostTo ! function stack_display_editquiz_select($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { *************** *** 30,38 **** } else { ! stack_no_quiz_screen($PostTo); } } ! function stack_no_quiz_screen($PostTo) { echo "<p>You have no quizzes available to try.</p>"; --- 30,38 ---- } else { ! stack_display_editquiz_no_quizzes($PostTo); } } ! function stack_display_editquiz_no_quizzes($PostTo) { echo "<p>You have no quizzes available to try.</p>"; *************** *** 42,46 **** } ! function stack_add_questions_screen($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='$quizid'>"; --- 42,46 ---- } ! function stack_display_editquiz_add_questions($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='$quizid'>"; *************** *** 58,62 **** ! function stack_quiz_edit_screen($quiz,$errors,$PostTo) { stack_quiz_edit_form($quiz,$errors,$PostTo = ''); --- 58,62 ---- ! function stack_display_editquiz_edit($quiz,$errors,$PostTo) { stack_quiz_edit_form($quiz,$errors,$PostTo = ''); *************** *** 66,75 **** } ! function stack_quiz_edit_errors($errors) { echo "<font color=\"red\">"; show_array($errors); echo "</font>"; } ! function stack_quiz_edit_not_admin($user) { echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; --- 66,75 ---- } ! function stack_display_editquiz_error($errors) { echo "<font color=\"red\">"; show_array($errors); echo "</font>"; } ! function stack_display_editquiz_error_not_admin($user) { echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; |