You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(486) |
Jul
(201) |
Aug
(194) |
Sep
(87) |
Oct
(72) |
Nov
(72) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(41) |
Mar
(22) |
Apr
(4) |
May
(12) |
Jun
|
Jul
|
Aug
(42) |
Sep
(21) |
Oct
(14) |
Nov
(10) |
Dec
|
2007 |
Jan
(14) |
Feb
(34) |
Mar
(61) |
Apr
(54) |
May
(140) |
Jun
(184) |
Jul
(164) |
Aug
(130) |
Sep
(241) |
Oct
(175) |
Nov
(148) |
Dec
(96) |
2008 |
Jan
(5) |
Feb
(38) |
Mar
(30) |
Apr
(46) |
May
(25) |
Jun
(22) |
Jul
(5) |
Aug
(17) |
Sep
(2) |
Oct
(100) |
Nov
(83) |
Dec
(33) |
2009 |
Jan
(127) |
Feb
(43) |
Mar
(86) |
Apr
(34) |
May
(50) |
Jun
(168) |
Jul
(48) |
Aug
(66) |
Sep
(38) |
Oct
(75) |
Nov
(113) |
Dec
(72) |
2010 |
Jan
(123) |
Feb
(68) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(131) |
Jul
(56) |
Aug
(79) |
Sep
(69) |
Oct
(17) |
Nov
(166) |
Dec
(32) |
2011 |
Jan
(21) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Chris S. <san...@us...> - 2005-06-17 06:29:06
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14331 Modified Files: Tag: frontend_dev quiz.php Log Message: Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.22.2.3 retrieving revision 1.22.2.4 diff -C2 -d -r1.22.2.3 -r1.22.2.4 *** quiz.php 16 Jun 2005 12:13:37 -0000 1.22.2.3 --- quiz.php 17 Jun 2005 06:28:55 -0000 1.22.2.4 *************** *** 645,649 **** if ($focus) { ! echo " <tr><td nowrap='nowrap'><a href=\"javascript:takeaction('focus',0);\">".get_string('UnFocus','stack','')."</a></td> <td> ".get_string('UnFocusExplain','stack','')."</td></tr>\n"; } else { --- 645,649 ---- if ($focus) { ! echo " <tr><td nowrap='nowrap'><a href=\"javascript:takeaction('unfocus',0);\">".get_string('UnFocus','stack','')."</a></td> <td> ".get_string('UnFocusExplain','stack','')."</td></tr>\n"; } else { |
From: Chris S. <san...@us...> - 2005-06-17 06:29:06
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14331/scripts Modified Files: Tag: frontend_dev stackQuestion.php Log Message: Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** stackQuestion.php 10 Jun 2005 20:53:16 -0000 1.19 --- stackQuestion.php 17 Jun 2005 06:28:55 -0000 1.19.2.1 *************** *** 683,687 **** // 'Language'; $stackOptions['Language']['type'] = 'list'; ! $stackOptions['Language']['values'] = array('en','nl'); $stackOptions['Language']['default'] = 'en'; --- 683,687 ---- // 'Language'; $stackOptions['Language']['type'] = 'list'; ! $stackOptions['Language']['values'] = array('en','es','nl'); $stackOptions['Language']['default'] = 'en'; |
From: Juliette W. <jv...@us...> - 2005-06-16 16:51:02
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23419 Modified Files: Tag: frontend_dev editquiz.php index.php question_bank.php Log Message: I've broken some of the edit quiz code but want to save this before I leave work this evening! Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.6 retrieving revision 1.10.2.7 diff -C2 -d -r1.10.2.6 -r1.10.2.7 *** editquiz.php 16 Jun 2005 11:44:44 -0000 1.10.2.6 --- editquiz.php 16 Jun 2005 16:50:49 -0000 1.10.2.7 *************** *** 15,18 **** --- 15,19 ---- require_once("{$stack_root}/html/trypopupform.html"); + require_once("{$stack_root}/frontend_general/editquiz_display.php"); require_once("{$stack_root}/html/helpform.php"); require_once("{$stack_root}/html/quizjava.html"); *************** *** 25,47 **** $default_action = 'quiz_choose'; include('frontend_general/process_input.php'); ! //$menu = new ListMenu('/'.$stack_basepath.'/',"html/stack-menu.txt"); ! $PostTo = 'editquiz.php'; ! $filter = ''; ! ! // $title = "Manage STACK quizzes"; ! // HACK: this should be $options['Display'], below but it is unset ! // stack_page_header($title,'LaTeX'); ! ! include('html/pagehead.php'); ! ! if ('admin' != $user['username'] or !$user['loggedin']) { ! 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']}."; ! echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; ! stack_page_footer(); die(); ! } //////////////////////////////////////////////// --- 26,42 ---- $default_action = 'quiz_choose'; include('frontend_general/process_input.php'); + include('frontend_general/frontend_util.php'); + include('frontend_general/edit_quiz_util.php'); + $PostTo = 'editquiz.php'; + $filter = ''; + $quizID = NULL; + include('html/pagehead.php'); ! if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { ! stack_quiz_edit_not_admin($user); ! include('html/pagefoot.php'); die(); ! } //////////////////////////////////////////////// *************** *** 58,92 **** // show_array($_POST); ! //////////////////////////////////////////////// ! // (3) Process incoming data ! //////////////////////////////////////////////// ! ! //show_array($_POST); ! ! if ('quiz_delete' == $action) { ! ! if (array_key_exists('quizID',$_POST)){ ! $quizID = $_POST['quizID']; ! stack_db_quiz_delete($quizID); ! $action = 'quiz_choose'; ! } ! } ! ! $question_bank_filter = ''; ! if (array_key_exists('bank_filter',$_SESSION)) { ! $question_bank_filter = $_SESSION['bank_filter']; } ! ! if ('filter' == $action) { ! ! if (array_key_exists('quizID',$_POST)){ ! $quizID = $_POST['quizID']; ! $question_bank_filter = $_POST['bank_filter']; ! $action = 'quiz_edit_addqs'; ! $_SESSION['bank_filter'] = $question_bank_filter; ! } ! } ! ! if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { if (array_key_exists('quiz',$_POST)) { --- 53,69 ---- // show_array($_POST); ! echo "Action is $action"; ! $quizid_source = ''; ! if ('quiz_delete' == $action or 'filter' == $action) { ! $quizid_source = 'post'; ! } else if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { ! $quizid_source = 'quiz'; ! } else if ('quiz_new' == $action) { ! $quizid_source = 'database'; } ! ! $quizID = stack_get_quizID($quizid_source); ! ! if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { if (array_key_exists('quiz',$_POST)) { *************** *** 100,122 **** } if ('quiz_edit' == $action) { ! // Do we need to add questions to the quiz? if (array_key_exists('questionsToAdd',$_POST)) { - $quiz['questionsToAdd'] = array_keys($_POST['questionsToAdd']); - } } if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { - stack_quiz_edit($quiz,$errors); - } if ('quiz_new' == $action) { - - $quizID = stack_db_quiz_update(array()); $quiz['quizID'] = $quizID; $action = 'quiz_edit'; --- 77,117 ---- } + + echo $quizID; + + if ('filter' == $action) { + $filter_source = 'post'; + } else { + $filter_source = 'session'; + } + + $question_bank_filter = stack_get_question_bank_filter($filter_source); + + if ('quiz_delete' == $action and $quizID != NULL) { + stack_db_quiz_delete($quizID); + $action = 'quiz_choose'; + } + + if ('filter' == $action and $quizID != NULL) { + $action = 'quiz_edit_addqs'; + stack_set_session_question_bank_filter($question_bank_filter); + } + + if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { + $quiz = stack_get_quiz(); + } if ('quiz_edit' == $action) { ! // Do we need to add questions to the quiz? if (array_key_exists('questionsToAdd',$_POST)) { $quiz['questionsToAdd'] = array_keys($_POST['questionsToAdd']); } } if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { stack_quiz_edit($quiz,$errors); } if ('quiz_new' == $action) { $quiz['quizID'] = $quizID; $action = 'quiz_edit'; *************** *** 127,200 **** //////////////////////////////////////////////// ! echo "<font color=\"red\">"; show_array($errors); ! echo "</font>"; ! ! ! if ('quiz_choose' == $action) { ! ! $quiz_store = stack_db_quiz_get(); ! ! if (is_array($quiz_store)) { ! echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='-1' /> ! <input type='hidden' name='action' value='quiz_choose' />"; ! ! echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th></th><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th></th></tr>"; ! foreach ($quiz_store as $qs => $quiz) ! { ! $qname = $quiz['quizName']; ! if ('' == trim($qname)) { ! $qname = '[empty]'; ! } ! $qID = $quiz['quizID']; ! echo "<tr><td>{$qID}</td><td><a href=\"javascript:takeaction('quiz_edit','$qID');\">{$qname}</a></td>\n"; ! echo "<td>".$quiz['quizDescription']."</td>\n"; ! echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>Del</font></a></td></tr>\n"; ! } ! echo "\n</table>\n\n</p>"; ! ! } else { ! echo "<p>You have no quizzes available to try.</p>"; ! ! echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='-1' /> ! <input type='hidden' name='action' value='quiz_choose' />"; ! ! } ! ! ! ! } ! ! if ('quiz_edit' == $action) { ! ! stack_quiz_edit_form($quiz,$errors,$PostTo = ''); ! ! echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='-1'> ! <input type='hidden' name='action' value='quiz_choose'>"; ! ! } ! ! ! if ('quiz_edit_addqs' == $action) { ! ! echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='$quizID'>"; ! ! echo "<a href=\"javascript:takeaction('filter',{$quizID});\">Filter</a> "; ! echo "Name = <input type='text' name='bank_filter[name]' value='{$question_bank_filter['name']}' />"; ! echo " Keyword = <input type='text' name='bank_filter[kw]' value='{$question_bank_filter['kw']}' />"; ! ! stack_db_listquestions_quiz($question_bank_filter); ! ! echo '<input type="hidden" name="action" value="quiz_edit" />'; ! echo "<input type=\"submit\" value=\"Add\" />\n</form>\n"; ! ! ! } ! // echo "<a href=\"javascript:takeaction('quiz_new','0');\">New quiz</a>"; include('html/pagefoot.php'); --- 122,140 ---- //////////////////////////////////////////////// ! stack_quiz_edit_errors($errors); ! switch ($action) { ! case 'quiz_choose': ! $quiz_store = stack_db_quiz_get(); ! stack_select_quiz_screen($quiz_store, $PostTo); ! break; ! case 'quiz_edit': ! stack_quiz_edit_screen($quiz,$errors,$PostTo); ! break; ! case 'quiz_edit_addqs': ! stack_add_questions_screen($PostTo, $quizID, $question_bank_filter); ! break; ! } ! include('html/pagefoot.php'); Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.18 retrieving revision 1.3.2.19 diff -C2 -d -r1.3.2.18 -r1.3.2.19 *** question_bank.php 16 Jun 2005 14:30:17 -0000 1.3.2.18 --- question_bank.php 16 Jun 2005 16:50:49 -0000 1.3.2.19 *************** *** 45,76 **** $RawAns = ''; - //////////////////////////////////////////////// - // (1) Decide what we are trying to do. - //////////////////////////////////////////////// - - // 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. - - // action = questionbank_screen Begin again. - - ////////////////////////////////////////////////////////////// // (2) Perform any actions on entering the page ////////////////////////////////////////////////////////////// $admin = FALSE; if ('admin' == $user['username']) { --- 45,72 ---- $RawAns = ''; ////////////////////////////////////////////////////////////// // (2) Perform any actions on entering the page ////////////////////////////////////////////////////////////// + // Possible values for $action at this point are + // edit_new Edit a blank question + // edit Edit a question, in $SESSION or $POST + // edit_from_db Get a question from db and edit. + // preview Try a question in $SESSION or $POST. + // preview_from_db Get a question from db. Instantiate and try. + // new_version Try a new version of this question. + // validate Validate the response to the current question. + // mark Mark the response to the current question. + // save Store a question in the db. + // save_as Store as a new question in the db. + // delete Delete a question from the db. + // export_xml Export current question as xml. + // export_xml_db Export single question as xml from the database. + // export_xml_list Export the list of selected questions as a single XML file + // import Deal with an uploaded file. + // edit_metadata Edit all the meta data fields in the question bank. + // questionbank_screen Begin again. + + $admin = FALSE; if ('admin' == $user['username']) { *************** *** 165,169 **** } else { stack_question_validate($question,$errors); - include_once("{$stack_root}/scripts/stackXML.php"); } --- 161,164 ---- *************** *** 191,215 **** } ! if ('delete' == $action) { ! $questionID = $_POST['questionID']; ! if ($admin) { ! stack_db_dropquestion($questionID); ! } ! $action = 'questionbank_screen'; ! } ! ! if ('save' == $action) { ! stack_db_addquestion($question); ! $action = 'questionbank_screen'; } - if ('save_as' == $action) { - stack_db_addquestion($question,TRUE); - $action = 'questionbank_screen'; - } - - if ('edit' == $action) { - stack_question_validate($question,$errors); - } ////////////////////////////////////////////////////////////// --- 186,210 ---- } ! switch ($action) { ! case 'delete': ! $questionID = $_POST['questionID']; ! if ($admin) { ! stack_db_dropquestion($questionID); ! } ! $action = 'questionbank_screen'; ! break; ! case 'save': ! stack_db_addquestion($question); ! $action = 'questionbank_screen'; ! break; ! case 'save_as': ! stack_db_addquestion($question,TRUE); ! $action = 'questionbank_screen'; ! break; ! case 'edit': ! stack_question_validate($question,$errors); ! break; } ////////////////////////////////////////////////////////////// Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.7 retrieving revision 1.17.2.8 diff -C2 -d -r1.17.2.7 -r1.17.2.8 *** index.php 16 Jun 2005 14:30:16 -0000 1.17.2.7 --- index.php 16 Jun 2005 16:50:49 -0000 1.17.2.8 *************** *** 20,29 **** */ - - /* - * This page displays the login screen. It is the first page accessed by a - * STACK user. - */ - /////////////////////////////////////////////////////////////// // (1) Process Input - this sets $action, $user and $username --- 20,23 ---- *************** *** 34,38 **** $default_action = 'loginscreen'; include($stack_root.'/frontend_general/process_input.php'); ! include($stack_root.'/frontend_general/front_end_display.php'); /////////////////////////////////////////////////////////////// --- 28,33 ---- $default_action = 'loginscreen'; include($stack_root.'/frontend_general/process_input.php'); ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include_once($stack_root.'/frontend_general/frontend_util.php'); /////////////////////////////////////////////////////////////// *************** *** 90,97 **** } - - - - if ('error' == $action) { stack_login_error_screen($error); --- 85,88 ---- |
From: Juliette W. <jv...@us...> - 2005-06-16 16:51:02
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23419/frontend_general Modified Files: Tag: frontend_dev front_end_display.php Added Files: Tag: frontend_dev editquiz_display.php frontend_util.php Log Message: I've broken some of the edit quiz code but want to save this before I leave work this evening! --- NEW FILE: frontend_util.php --- <?php function stack_get_username($user) { return nsf('username',$user); } function stack_get_err($errors) { return nsf($errors,'user'); } function stack_get_errun($err) { return nsf($err,'username'); } function stack_get_errps($err){ return nsf($err,'password'); } function stack_get_err2($errors) { $err = ''; if (is_array($errors)) { if (array_key_exists('user',$errors)) { $err = $errors['user']; } } return $err; } function stack_is_logged_in($user) { if ($user['loggedin']) { return TRUE; } else { return FALSE; } } function stack_user_is_guest($user) { if ('guest' == $user['username']) { return TRUE; } else { return FALSE; } } function stack_user_is_admin($user) { if ('admin' == $user['username']) { return TRUE; } else { return FALSE; } } ?> --- NEW FILE: editquiz_display.php --- <?php function stack_select_quiz_screen($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizID' value='-1' /> <input type='hidden' name='action' value='quiz_choose' />"; echo "\n<table cellpadding='2'>\n"; echo "\n<tr><th></th><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th></th></tr>"; foreach ($quiz_store as $qs => $quiz) { $qname = $quiz['quizName']; if ('' == trim($qname)) { $qname = '[empty]'; } $qID = $quiz['quizID']; echo "<tr><td>{$qID}</td><td><a href=\"javascript:takeaction('quiz_edit','$qID');\">{$qname}</a></td>\n"; echo "<td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>Del</font></a></td></tr>\n"; } echo "\n</table>\n\n</p>"; } else { echo "<p>You have no quizzes available to try.</p>"; echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizID' value='-1' /> <input type='hidden' name='action' value='quiz_choose' />"; } } 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'>"; echo "<a href=\"javascript:takeaction('filter',{$quizID});\">Filter</a> "; echo "Name = <input type='text' name='bank_filter[name]' value='{$question_bank_filter['name']}' />"; echo " Keyword = <input type='text' name='bank_filter[kw]' value='{$question_bank_filter['kw']}' />"; stack_db_listquestions_quiz($question_bank_filter); echo '<input type="hidden" name="action" value="quiz_edit" />'; echo "<input type=\"submit\" value=\"Add\" />\n</form>\n"; } function stack_quiz_edit_screen($quiz,$errors,$PostTo) { stack_quiz_edit_form($quiz,$errors,$PostTo = ''); echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizID' value='-1'> <input type='hidden' name='action' value='quiz_choose'>"; } 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']}."; echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; } ?> 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.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** front_end_display.php 16 Jun 2005 14:30:16 -0000 1.1.2.4 --- front_end_display.php 16 Jun 2005 16:50:50 -0000 1.1.2.5 *************** *** 1,48 **** <?php - // Putting these functions here temporarily - function stack_get_username($user) { - return nsf('username',$user); - } - - function stack_get_err($errors) { - return nsf($errors,'user'); - } - - function stack_get_errun($err) { - return nsf($err,'username'); - } - - function stack_get_errps($err){ - return nsf($err,'password'); - } - - function stack_get_err2($errors) { - $err = ''; - if (is_array($errors)) { - if (array_key_exists('user',$errors)) { - $err = $errors['user']; - } - } - return $err; - } - - function stack_is_logged_in($user) { - if ($user['loggedin']) { - return TRUE; - } else { - return FALSE; - } - } - - function stack_user_is_guest($user) { - if ('guest' == $user['username']) { - return TRUE; - } else { - return FALSE; - } - } - - 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>'; --- 1,4 ---- |
From: Juliette W. <jv...@us...> - 2005-06-16 14:30:30
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12534/scripts Modified Files: Tag: frontend_dev stackAuthor.php stackDatabase.php Log Message: More minor changes Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.16.2.4 retrieving revision 1.16.2.5 diff -C2 -d -r1.16.2.4 -r1.16.2.5 *** stackDatabase.php 16 Jun 2005 04:11:38 -0000 1.16.2.4 --- stackDatabase.php 16 Jun 2005 14:30:17 -0000 1.16.2.5 *************** *** 176,183 **** echo('<td>' . $qkeywords . '</td>'); echo "\n<td nowrap='nowrap'><a href=\"javascript:SelectQ('$row[0]','edit_from_db');\">edit</a> ! <a href=\"javascript:SelectQ('$row[0]','try_from_db');\">try</a> <a href=\"javascript:SelectQ('$row[0]','export_xml_db');\">xml</a>"; if ('edit'==$action) { ! echo "\n<a href=\"javascript:SelectQ('$row[0]','delete_from_db');\"><font color=\"red\">del</font></a>"; } echo "\n</td>"; --- 176,183 ---- echo('<td>' . $qkeywords . '</td>'); echo "\n<td nowrap='nowrap'><a href=\"javascript:SelectQ('$row[0]','edit_from_db');\">edit</a> ! <a href=\"javascript:SelectQ('$row[0]','preview_from_db');\">try</a> <a href=\"javascript:SelectQ('$row[0]','export_xml_db');\">xml</a>"; if ('edit'==$action) { ! echo "\n<a href=\"javascript:SelectQ('$row[0]','delete');\"><font color=\"red\">del</font></a>"; } echo "\n</td>"; Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.22.2.2 retrieving revision 1.22.2.3 diff -C2 -d -r1.22.2.2 -r1.22.2.3 *** stackAuthor.php 15 Jun 2005 13:34:37 -0000 1.22.2.2 --- stackAuthor.php 16 Jun 2005 14:30:17 -0000 1.22.2.3 *************** *** 193,201 **** if ($stack_stand_alone) { if (''==$errors) { ! echo "<a href=\"javascript:EditQ('try')\">Preview Question</a> \n"; echo "<a href=\"javascript:EditQ('export_xml')\">Export Question</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('store_in_db')\">Save Question</a>\n ! <a href=\"javascript:EditQ('store_new_db')\">Save Question As...</a>\n"; } } --- 193,201 ---- if ($stack_stand_alone) { if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preview')\">Preview Question</a> \n"; echo "<a href=\"javascript:EditQ('export_xml')\">Export Question</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('save')\">Save Question</a>\n ! <a href=\"javascript:EditQ('save_as')\">Save Question As...</a>\n"; } } *************** *** 319,327 **** echo "<p><a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; if (''==$errors) { ! echo "<a href=\"javascript:EditQ('try')\">Try this question</a> \n"; echo "<a href=\"javascript:EditQ('export_xml')\">Export XML</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('store_in_db')\">Store question</a>\n ! <a href=\"javascript:EditQ('store_new_db')\">Store as a new question</a>\n"; } } --- 319,327 ---- echo "<p><a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preveiw')\">Try this question</a> \n"; echo "<a href=\"javascript:EditQ('export_xml')\">Export XML</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('save')\">Store question</a>\n ! <a href=\"javascript:EditQ('save_as')\">Store as a new question</a>\n"; } } |
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) { |
From: Juliette W. <jv...@us...> - 2005-06-16 14:30:29
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12534/html Modified Files: Tag: frontend_dev admin-menu.txt trypopupform.html Log Message: More minor changes Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.8.2.7 retrieving revision 1.8.2.8 diff -C2 -d -r1.8.2.7 -r1.8.2.8 *** admin-menu.txt 16 Jun 2005 13:09:24 -0000 1.8.2.7 --- admin-menu.txt 16 Jun 2005 14:30:16 -0000 1.8.2.8 *************** *** 3,8 **** .Questions|question_bank.php?action=questionbank_screen ! ..New|question_bank.php?action=start_new ! ..Import|question_bank.php?action=upload_xml_file .Quizzes|editquiz.php?action=quiz_choose ..New|editquiz.php?action=quiz_new --- 3,8 ---- .Questions|question_bank.php?action=questionbank_screen ! ..New|question_bank.php?action=edit_new ! ..Import|question_bank.php?action=import .Quizzes|editquiz.php?action=quiz_choose ..New|editquiz.php?action=quiz_new Index: trypopupform.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/trypopupform.html,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** trypopupform.html 10 Jun 2005 20:23:57 -0000 1.4 --- trypopupform.html 16 Jun 2005 14:30:16 -0000 1.4.2.1 *************** *** 2,6 **** function TryPopup(questionID,seed,RawAns) { f = document.stackquestiontryform; ! f.action.value = "try_from_db"; f.questionID.value = questionID; f.seed.value = seed; --- 2,6 ---- function TryPopup(questionID,seed,RawAns) { f = document.stackquestiontryform; ! f.action.value = "preview_from_db"; f.questionID.value = questionID; f.seed.value = seed; *************** *** 22,26 **** function NewPopup() { f = document.stackquestiontryform; ! f.action.value = "start_new"; w = window.open('this','questionTry','width=800,height=500,scrollbars=yes,resizable=yes,toolbar=no'); f.target = 'questionTry'; --- 22,26 ---- function NewPopup() { f = document.stackquestiontryform; ! f.action.value = "edit_new"; w = window.open('this','questionTry','width=800,height=500,scrollbars=yes,resizable=yes,toolbar=no'); f.target = 'questionTry'; |
From: Juliette W. <jv...@us...> - 2005-06-16 14:30:25
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12534/frontend_general Modified Files: Tag: frontend_dev front_end_display.php qb_display.php Log Message: More minor changes Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** qb_display.php 16 Jun 2005 13:49:22 -0000 1.1.2.3 --- qb_display.php 16 Jun 2005 14:30:16 -0000 1.1.2.4 *************** *** 56,60 **** function stack_import_questions_screen($errors) { ! echo nsf($errors,'upload_xml_file'); echo "Select a file to upload and edit: <br /> --- 56,60 ---- function stack_import_questions_screen($errors) { ! echo nsf($errors,'import'); echo "Select a file to upload and edit: <br /> 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.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** front_end_display.php 16 Jun 2005 12:13:36 -0000 1.1.2.3 --- front_end_display.php 16 Jun 2005 14:30:16 -0000 1.1.2.4 *************** *** 18,21 **** --- 18,48 ---- } + function stack_get_err2($errors) { + $err = ''; + if (is_array($errors)) { + if (array_key_exists('user',$errors)) { + $err = $errors['user']; + } + } + return $err; + } + + function stack_is_logged_in($user) { + if ($user['loggedin']) { + return TRUE; + } else { + return FALSE; + } + } + + function stack_user_is_guest($user) { + if ('guest' == $user['username']) { + return TRUE; + } else { + return FALSE; + } + } + + 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>'; |
From: Juliette W. <jv...@us...> - 2005-06-16 13:49:34
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21154 Modified Files: Tag: frontend_dev question_bank.php Log Message: More question bank tidying up changes Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.16 retrieving revision 1.3.2.17 diff -C2 -d -r1.3.2.16 -r1.3.2.17 *** question_bank.php 16 Jun 2005 13:09:24 -0000 1.3.2.16 --- question_bank.php 16 Jun 2005 13:49:22 -0000 1.3.2.17 *************** *** 68,73 **** // action = questionbank_screen Begin again. ! include('html/pagehead.php'); ! $admin = FALSE; if ('admin' == $user['username']) { --- 68,76 ---- // action = questionbank_screen Begin again. ! ! ////////////////////////////////////////////////////////////// ! // (2) Perform any actions on entering the page ! ////////////////////////////////////////////////////////////// ! $admin = FALSE; if ('admin' == $user['username']) { *************** *** 117,163 **** } ! // (2.1) edit, try or store. ! // There should be a question in the $POST or $SESSION if ($get_question) { $question = stack_get_question($source); $questionInst = stack_get_questionInst(); } ! ! // (2.2) Work out the correct value for any filter to be applied to the ! // question bank. $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'; } --- 120,153 ---- } ! // Get the question, question options and question instance if required if ($get_question) { $question = stack_get_question($source); + $options = stack_options_set($question); $questionInst = stack_get_questionInst(); } ! // Work out the correct value for any filter to be applied to the question ! // bank $question_bank_filter = stack_get_questionbank_filter(); ! $upload_successful = FALSE; 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); ! // If a single question has been uploaded, edit it, if multiple ! // questions store them in the database ! if (array_key_exists('assessmentItem',$qu)) { ! $question = $qu['assessmentItem']; ! $action = 'edit'; ! } else if (array_key_exists('mathQuiz',$qu)) { ! $quiz = $qu['mathQuiz']['assessmentItem']; ! $upload_successful = TRUE; ! } ! } } } *************** *** 173,180 **** 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); --- 163,166 ---- *************** *** 189,197 **** $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(); --- 175,181 ---- $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); } } ! ! if ('edit_metadata' == $action ) { if (!$admin) { stack_print_not_admin(); *************** *** 205,271 **** } } ! ! session_unregister('question'); ! session_unregister('questionInst'); ! ! stack_print_edit_metadata_screen($question_bank_filter); ! ! } ! ! ////////////////////////////////////////////////// ! // (3) Now we have a $question, set up the context ! ////////////////////////////////////////////////// ! ! // Change 'edit_from_db' to 'edit'. We are done here. ! ! ! // Delete a $question if ('delete_from_db' == $action) { $questionID = $_POST['questionID']; ! if (!$admin) { stack_db_dropquestion($questionID); } $action = 'questionbank_screen'; } ! ! // These branches need the question to be validated if ('edit' == $action) { stack_question_validate($question,$errors); } ! // We ignored any quiz and subject options! ! $options = stack_options_set($question); ! ! // Store any $question ! 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'; } // Deal with actions connected with previewing questions include('qb_preview.php'); ! ! if ('questionbank_screen'==$action) ! { session_unregister('question'); session_unregister('questionInst'); - - stack_print_question_bank_screen($admin, $question_bank_filter); - } - - //(4.2) Edit questions - if ('edit' == $action) { - stack_print_edit_screen($question, $errors); } - - - include('html/pagefoot.php'); ?> --- 189,269 ---- } } ! } ! if ('delete_from_db' == $action) { $questionID = $_POST['questionID']; ! if ($admin) { stack_db_dropquestion($questionID); } $action = 'questionbank_screen'; } + + 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'; ! } ! if ('edit' == $action) { stack_question_validate($question,$errors); } + + ////////////////////////////////////////////////////////////// + // (3) Print the page. + ////////////////////////////////////////////////////////////// ! include('html/pagehead.php'); ! ! switch ($action) { ! case 'uploaded_xml': ! if ($upload_successful) { ! stack_show_uploaded_questions_screen($quiz); ! } else { ! stack_upload_error_screen(); ! } ! break; ! case 'upload_xml_file': ! stack_import_questions_screen($errors); ! break; ! case 'export_xml': ! if (NULL == $questions_to_export) { ! stack_print_questionbank_no_questions_screen(); ! $action = 'questionbank_screen'; ! } ! stack_print_download_export_screen($name); ! break; ! case 'edit_metadata': ! stack_print_edit_metadata_screen($question_bank_filter); ! break; } // Deal with actions connected with previewing questions include('qb_preview.php'); ! ! switch ($action) { ! case 'questionbank_screen': ! stack_print_question_bank_screen($admin, $question_bank_filter); ! break; ! case 'edit': ! stack_print_edit_screen($question, $errors); ! break; ! } ! ! include('html/pagefoot.php'); ! ////////////////////////////////////////////////////////////// ! // (3) Deal with any actions on leaving the page ! ////////////////////////////////////////////////////////////// ! ! ! if ('questionbank_screen'==$action or 'edit_metadata' == $action) ! { session_unregister('question'); session_unregister('questionInst'); } ?> |
From: Juliette W. <jv...@us...> - 2005-06-16 13:49:34
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21154/frontend_general Modified Files: Tag: frontend_dev qb_display.php Log Message: More question bank tidying up changes Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/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 16 Jun 2005 13:09:23 -0000 1.1.2.2 --- qb_display.php 16 Jun 2005 13:49:22 -0000 1.1.2.3 *************** *** 101,103 **** --- 101,107 ---- echo "<h2>Current database of questions</h2>"; } + + 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>'; + } ?> |
From: Juliette W. <jv...@us...> - 2005-06-16 13:09:33
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28349/frontend_general Modified Files: Tag: frontend_dev qb_display.php Added Files: Tag: frontend_dev question_bank_util.php Log Message: Put code back into question_bank.php Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.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_display.php 16 Jun 2005 11:44:45 -0000 1.1.2.1 --- qb_display.php 16 Jun 2005 13:09:23 -0000 1.1.2.2 *************** *** 53,55 **** --- 53,103 ---- } + + + function stack_import_questions_screen($errors) { + echo nsf($errors,'upload_xml_file'); + echo "Select a file to upload and edit: + <br /> + <form enctype='multipart/form-data' action=\"question_bank.php\"' method='POST'><br />\n + <input type ='file' name='xmlfile' />\n + <input type ='hidden' name='action' value='uploaded_xml' /> + <input type ='submit' name='go' value='Upload'> + </form>\n\n"; + } + + + function stack_show_uploaded_questions_screen($quiz) { + + echo "<h2>Details of questions uploaded</h2>"; + echo '<table><thead><tr>'; + echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; + echo '</tr></thead><tbody>'; + + $errs = NULL; + + foreach ($quiz as $key => $qu) { + + stack_question_validate($quiz[$key],$errs[$key]); + $qu['questionID'] = stack_db_addquestion($qu); + echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; + $errc = FALSE; + if (nsf($errs,$key)) { + if (is_array($errs[$key])) { + $errc = TRUE; + } + } + if ($errc) { + echo "<td><font color=\"red\">Invalid question</font></td>"; + } else { + echo "<td><font color=\"greed\">Valid question</font></td>"; + } + echo "</tr>\n"; + } + + // HACK: we need error trapping here. + // HACK: we should return to the user details of what has been uploaded! + + echo "</tbody></table>\n"; + echo "<h2>Current database of questions</h2>"; + } ?> --- NEW FILE: question_bank_util.php --- <?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... * * * This file contains the logic of interactions with the site as * an editor of questions and the question bank. * * @package frontend * @subpackage Stack */ function stack_get_question_from_session() { global $stackQuestion; $question = NULL; // Get any $question from the current $_SESSION if (array_key_exists('question',$_SESSION)) { foreach ($stackQuestion as $qfield => $val) { if (array_key_exists($qfield,$_SESSION['question'])) { if ('' != $_SESSION['question'][$qfield]) { $question[$qfield] = $_SESSION['question'][$qfield]; } } } unset($_SESSION['question']); } return $question; } function stack_get_questionInst() { $questionInst = NULL; // Get any $questionInst from the current $_SESSION if (array_key_exists('questionInst',$_SESSION)) { $questionInst=$_SESSION['questionInst']; unset($_SESSION['questionInst']); } return $questionInst; } function stack_get_question_from_post() { global $stackQuestion; $question = NULL; // Get any $_POSTED data // This should over write any $_SESSION data, as it may have been entered in a form. foreach($stackQuestion as $qfield => $attribs) { if (array_key_exists($qfield,$_POST) ) { if ('questionOptions' == $qfield) { $question[$qfield] = $_POST[$qfield]; } else if ('questionPotResp' == $qfield ) { $question[$qfield] = $_POST[$qfield]; } else if ( '' !=trim($_POST[$qfield]) ) { // We need this: all fields on form will be present in $_POST. $question[$qfield] = $_POST[$qfield]; } } } return $question; } // $source should be 'from database', 'new' or 'default' function stack_get_question($source) { $question = NULL; // $_POSTED data should over write any $_SESSION data, as it may have been // entered in a form. if ('default' == $source) { $question = stack_get_question_from_session(); $question = stack_get_question_from_post(); } else if ('database' == $source) { $questionID = $_POST['questionID']; $question=stack_db_getquestion($questionID); } if ('new' == $source or NULL == $question) { $question['questionID']='0'; $question['questionAnsKey']='ans1'; } return $question; } // 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; } function stack_get_selected_questions() { $quiz = NULL; if (array_key_exists('checked',$_POST)) { if (is_array($_POST['checked'])) { foreach ($_POST['checked'] as $quID => $val) { if ('ticked' == $val) { $quiz[] = $quID; } } } } return $quiz; } ?> |
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 --- |
From: Juliette W. <jv...@us...> - 2005-06-16 13:09:32
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28349/html Modified Files: Tag: frontend_dev admin-menu.txt Log Message: Put code back into question_bank.php Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.8.2.6 retrieving revision 1.8.2.7 diff -C2 -d -r1.8.2.6 -r1.8.2.7 *** admin-menu.txt 15 Jun 2005 16:39:52 -0000 1.8.2.6 --- admin-menu.txt 16 Jun 2005 13:09:24 -0000 1.8.2.7 *************** *** 4,8 **** .Questions|question_bank.php?action=questionbank_screen ..New|question_bank.php?action=start_new ! ..Import|import_question_screen.php?action=upload_xml_file .Quizzes|editquiz.php?action=quiz_choose ..New|editquiz.php?action=quiz_new --- 4,8 ---- .Questions|question_bank.php?action=questionbank_screen ..New|question_bank.php?action=start_new ! ..Import|question_bank.php?action=upload_xml_file .Quizzes|editquiz.php?action=quiz_choose ..New|editquiz.php?action=quiz_new |
From: Juliette W. <jv...@us...> - 2005-06-16 12:35:43
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8925 Modified Files: Tag: frontend_dev import_question_screen.php qb_display.php qb_export.php question_bank_util.php upload_questions.php Log Message: Tidying up export and import code Index: qb_export.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_export.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_export.php 16 Jun 2005 10:59:34 -0000 1.1.2.2 --- qb_export.php 16 Jun 2005 12:35:34 -0000 1.1.2.3 *************** *** 1,36 **** <?php if ('export_xml_list'==$action) { ! $quiz = NULL; ! if (array_key_exists('checked',$_POST)) { ! if (is_array($_POST['checked'])) { ! foreach ($_POST['checked'] as $quID => $val) { ! if ('ticked' == $val) { ! $quiz[] = $quID; ! } ! } ! } ! } ! ! if (NULL == $quiz) { ! stack_print_questionbank_no_questions_screen(); ! $action = 'questionbank_screen'; ! } ! ! include_once("{$stack_root}/scripts/stackXML.php"); ! ! $name = stack_xml_write_quiz_file($quiz, "{$stack_root}/tmp/"); ! ! stack_print_download_export_screen($name); } if ('export_xml'==$action) { ! echo "export_xml"; ! stack_question_validate($question,$errors); ! include_once("{$stack_root}/scripts/stackXML.php"); ! $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); stack_print_download_export_screen($name); } ?> --- 1,34 ---- <?php + $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); } + + + ?> Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_display.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** qb_display.php 16 Jun 2005 10:59:34 -0000 1.1.2.3 --- qb_display.php 16 Jun 2005 12:35:34 -0000 1.1.2.4 *************** *** 53,55 **** --- 53,102 ---- } + + function stack_import_questions_screen($errors) { + echo nsf($errors,'upload_xml_file'); + echo "Select a file to upload and edit: + <br /> + <form enctype='multipart/form-data' action=\"question_bank.php\"' method='POST'><br />\n + <input type ='file' name='xmlfile' />\n + <input type ='hidden' name='action' value='upload_xml_file' /> + <input type ='submit' name='go' value='Upload'> + </form>\n\n"; + } + + + function stack_show_uploaded_questions_screen($quiz, $qu) { + + echo "<h2>Details of questions uploaded</h2>"; + echo '<table><thead><tr>'; + echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; + echo '</tr></thead><tbody>'; + + $errs = NULL; + + foreach ($quiz as $key => $qu) { + + stack_question_validate($quiz[$key],$errs[$key]); + $qu['questionID'] = stack_db_addquestion($qu); + echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; + $errc = FALSE; + if (nsf($errs,$key)) { + if (is_array($errs[$key])) { + $errc = TRUE; + } + } + if ($errc) { + echo "<td><font color=\"red\">Invalid question</font></td>"; + } else { + echo "<td><font color=\"greed\">Valid question</font></td>"; + } + echo "</tr>\n"; + } + + // HACK: we need error trapping here. + // HACK: we should return to the user details of what has been uploaded! + + echo "</tbody></table>\n"; + echo "<h2>Current database of questions</h2>"; + } ?> Index: upload_questions.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/upload_questions.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 *** upload_questions.php 15 Jun 2005 16:01:30 -0000 1.1.2.1 --- upload_questions.php 16 Jun 2005 12:35:34 -0000 1.1.2.2 *************** *** 1,4 **** --- 1,7 ---- <?php + + include_once('qb_display.php'); + if (array_key_exists('xmlfile',$_FILES)) { if (is_uploaded_file($_FILES['xmlfile']['tmp_name'])) { *************** *** 16,55 **** // (1) a quiz of questions. Store each in the database. } else if (array_key_exists('mathQuiz',$qu)) { - $quiz = $qu['mathQuiz']['assessmentItem']; ! ! echo "<h2>Details of questions uploaded</h2>"; ! echo '<table><thead><tr>'; ! echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; ! echo '</tr></thead><tbody>'; ! ! $errs = NULL; ! ! foreach ($quiz as $key => $qu) { ! ! stack_question_validate($quiz[$key],$errs[$key]); ! $qu['questionID'] = stack_db_addquestion($qu); ! echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>"; ! $errc = FALSE; ! if (nsf($errs,$key)) { ! if (is_array($errs[$key])) { ! $errc = TRUE; ! } ! } ! if ($errc) { ! echo "<td><font color=\"red\">Invalid question</font></td>"; ! } else { ! echo "<td><font color=\"greed\">Valid question</font></td>"; ! } ! echo "</tr>\n"; ! } ! ! // HACK: we need error trapping here. ! // HACK: we should return to the user details of what has been uploaded! ! ! echo "</tbody></table>\n"; ! echo "<h2>Current database of questions</h2>"; ! ! } else { $error['upload_xml_file']='<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; --- 19,24 ---- // (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. $qu); } else { $error['upload_xml_file']='<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/question_bank_util.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 *** question_bank_util.php 16 Jun 2005 10:59:34 -0000 1.1.2.7 --- question_bank_util.php 16 Jun 2005 12:35:34 -0000 1.1.2.8 *************** *** 121,124 **** --- 121,138 ---- } + function stack_get_selected_questions() { + $quiz = NULL; + if (array_key_exists('checked',$_POST)) { + if (is_array($_POST['checked'])) { + foreach ($_POST['checked'] as $quID => $val) { + if ('ticked' == $val) { + $quiz[] = $quID; + } + } + } + } + + return $quiz; + } Index: import_question_screen.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/import_question_screen.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 *** import_question_screen.php 16 Jun 2005 11:44:44 -0000 1.1.2.2 --- import_question_screen.php 16 Jun 2005 12:35:34 -0000 1.1.2.3 *************** *** 26,29 **** --- 26,30 ---- $default_action = ''; include($stack_root.'/frontend_general/process_input.php'); + include_once('qb_display.php'); ////////////////////////////////////////////////////////////// *************** *** 33,49 **** include('html/pagehead.php'); ! ! if ('upload_xml_file' == $action) { ! echo nsf($errors,'upload_xml_file'); ! ! ! echo "Select a file to upload and edit: ! <br /> ! <form enctype='multipart/form-data' action=\"question_bank.php\"' method='POST'><br />\n ! <input type ='file' name='xmlfile' />\n ! <input type ='hidden' name='action' value='upload_xml_file' /> ! <input type ='submit' name='go' value='Upload'> ! </form>\n\n"; ! } include('html/pagefoot.php'); --- 34,40 ---- include('html/pagehead.php'); ! if ('upload_xml_file' == $action) { ! stack_import_questions_screen($errors); ! } include('html/pagefoot.php'); |
From: Juliette W. <jv...@us...> - 2005-06-16 12:13:48
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26394 Modified Files: Tag: frontend_dev index.php quiz.php Removed Files: Tag: frontend_dev select_quiz.php Log Message: Put select quiz stuff back into the index file. --- select_quiz.php DELETED --- Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.22.2.2 retrieving revision 1.22.2.3 diff -C2 -d -r1.22.2.2 -r1.22.2.3 *** quiz.php 14 Jun 2005 17:54:52 -0000 1.22.2.2 --- quiz.php 16 Jun 2005 12:13:37 -0000 1.22.2.3 *************** *** 666,670 **** echo "<tr><td nowrap='nowrap'><a href=\"index.php?action=choose_quiz\">".get_string('ChooseQuiz','stack','')."</a></td> <td>".get_string('ClickHereTryQuiz','stack','')."</td></tr>\n ! <tr><td><a href='select_quiz.php'>".get_string('Home','stack','')."</a></td> <td>".get_string('STACKHomePage','stack','')."</td></tr>\n"; echo "</table>"; --- 666,670 ---- echo "<tr><td nowrap='nowrap'><a href=\"index.php?action=choose_quiz\">".get_string('ChooseQuiz','stack','')."</a></td> <td>".get_string('ClickHereTryQuiz','stack','')."</td></tr>\n ! <tr><td><a href='index.php?action=choose_quiz'>".get_string('Home','stack','')."</a></td> <td>".get_string('STACKHomePage','stack','')."</td></tr>\n"; echo "</table>"; Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.5 retrieving revision 1.17.2.6 diff -C2 -d -r1.17.2.5 -r1.17.2.6 *** index.php 16 Jun 2005 11:44:44 -0000 1.17.2.5 --- index.php 16 Jun 2005 12:13:37 -0000 1.17.2.6 *************** *** 37,41 **** /////////////////////////////////////////////////////////////// ! // (2) Log out the user if required. /////////////////////////////////////////////////////////////// --- 37,41 ---- /////////////////////////////////////////////////////////////// ! // (2) Take any actions required /////////////////////////////////////////////////////////////// *************** *** 47,50 **** --- 47,52 ---- } + include('frontend_general/loginregister.php'); + ////////////////////////////////////////////////////////////// // (2) Print the page. *************** *** 88,91 **** --- 90,107 ---- } + if ('welcome' == $action) { + stack_welcome_screen($user); + $action = 'choose_quiz'; + } + + if ('error' == $action) { + stack_login_error_screen($error); + } + + if ('choose_quiz' == $action) { + $quiz_store = stack_db_quiz_get(); + stack_select_quiz_screen($quiz_store, $user); + } + include('html/pagefoot.php'); |
From: Juliette W. <jv...@us...> - 2005-06-16 12:13:47
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26394/html Modified Files: Tag: frontend_dev student-menu.txt Log Message: Put select quiz stuff back into the index file. Index: student-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/student-menu.txt,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** student-menu.txt 16 Jun 2005 11:44:45 -0000 1.2.2.2 --- student-menu.txt 16 Jun 2005 12:13:37 -0000 1.2.2.3 *************** *** 2,6 **** // level // text // link // target // ! .Select Quiz|select_quiz.php?action=choose_quiz .Update user info|index.php?action=update_info .Logout|index.php?action=logout --- 2,6 ---- // level // text // link // target // ! .Select Quiz|index.php?action=choose_quiz .Update user info|index.php?action=update_info .Logout|index.php?action=logout |
From: Juliette W. <jv...@us...> - 2005-06-16 12:13:47
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26394/frontend_general Modified Files: Tag: frontend_dev front_end_display.php Log Message: Put select quiz stuff back into the index file. 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.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** front_end_display.php 16 Jun 2005 11:58:30 -0000 1.1.2.2 --- front_end_display.php 16 Jun 2005 12:13:36 -0000 1.1.2.3 *************** *** 19,23 **** function stack_login_screen($username, $errun, $errps) { ! echo '<h1>Login</h1><form action="select_quiz.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>'; echo '</tr><tr><td>Password:</td>'; --- 19,23 ---- 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>'; echo '</tr><tr><td>Password:</td>'; *************** *** 30,34 **** </form> ! <form action="select_quiz.php" method="post" name="guestlogin"> Some courses may allow guest access: <input type="hidden" name="username" value="guest" /> --- 30,34 ---- </form> ! <form action="index.php" method="post" name="guestlogin"> Some courses may allow guest access: <input type="hidden" name="username" value="guest" /> *************** *** 50,54 **** function stack_update_info_screen($user, $err, $errors) { echo '<h1>Update user information</h1>'; ! echo "<form action=\"select_quiz.php?\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To update your information, please complete the following form.<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td>'.nsf($err,'username').'</td></tr>'; --- 50,54 ---- 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\">"; echo '<p>To update your information, please complete the following form.<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td>'.nsf($err,'username').'</td></tr>'; *************** *** 63,67 **** function stack_registration_screen($username, $user, $errors, $err) { ! echo "<h1>Register as a new user</h1><form action=\"select_quiz.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; --- 63,67 ---- 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>'; echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; |
From: Juliette W. <jv...@us...> - 2005-06-16 11:58:46
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820/frontend_general Modified Files: Tag: frontend_dev front_end_display.php Log Message: Moved select quiz html into separate file 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.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** front_end_display.php 16 Jun 2005 11:44:45 -0000 1.1.2.1 --- front_end_display.php 16 Jun 2005 11:58:30 -0000 1.1.2.2 *************** *** 74,77 **** --- 74,123 ---- 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"); + echo "<h1>Please choose a quiz to try</h1>"; + global $stackQuiz; + if (is_array($quiz_store)) { + + + echo "<p>\n<form name='quizform' action='quiz.php' method='POST'> + <input type='hidden' name='quizID' value='-1'> + <input type='hidden' name='action' value='continue_quiz'>"; + + echo "\n<table cellpadding='2'>\n"; + echo "\n<tr><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th>Last mark (%)</th></tr>"; + foreach ($quiz_store as $qs => $quiz) { + $qname = $quiz['quizName']; + $qID = $quiz['quizID']; + $mark = '-'; + if (is_array($user)) { + if (array_key_exists('id',$user)) { + $userinfo = stack_db_quiz_quizattempt_getlast($qID,$user['id']); + if (is_array($userinfo)) { + if (NULL != $userinfo['mark']) { + $mark = round(100*$userinfo['mark']/$userinfo['maxmark'],2); + } + } + } + } + echo "<tr><td><a href=\"javascript:takeaction('continue_quiz','$qID');\">{$qname}</a></td>\n"; + echo "<td>".$quiz['quizDescription']."</td><td align='center'>$mark</td></tr>\n"; + } + echo "\n</table>\n</form>\n</p>"; + } else { + echo "<p>You have no quizzes available to try.</p>"; + } + } + + 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>"; + } ?> |
From: Juliette W. <jv...@us...> - 2005-06-16 11:58:46
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820 Modified Files: Tag: frontend_dev select_quiz.php Log Message: Moved select quiz html into separate file Index: select_quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/select_quiz.php,v retrieving revision 1.1.4.3 retrieving revision 1.1.4.4 diff -C2 -d -r1.1.4.3 -r1.1.4.4 *** select_quiz.php 16 Jun 2005 11:44:44 -0000 1.1.4.3 --- select_quiz.php 16 Jun 2005 11:58:30 -0000 1.1.4.4 *************** *** 36,39 **** --- 36,40 ---- $default_action = ''; include($stack_root.'/frontend_general/process_input.php'); + include($stack_root.'/frontend_general/front_end_display.php'); ////////////////////////////////////////////////////////////// *************** *** 53,102 **** if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; $action = 'choose_quiz'; } if ('error' == $action) { ! echo "There was an error with the login or registration"; ! echo $error; } if ('choose_quiz' == $action) { - require_once("{$stack_root}/html/quizjava.html"); - echo "<h1>Please choose a quiz to try</h1>"; - $quiz_store = stack_db_quiz_get(); ! ! if (is_array($quiz_store)) { ! echo "<p>\n<form name='quizform' action='quiz.php' method='POST'> ! <input type='hidden' name='quizID' value='-1'> ! <input type='hidden' name='action' value='continue_quiz'>"; ! ! echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th>Last mark (%)</th></tr>"; ! foreach ($quiz_store as $qs => $quiz) ! { ! $qname = $quiz['quizName']; ! $qID = $quiz['quizID']; ! $mark = '-'; ! if (is_array($user)) { ! if (array_key_exists('id',$user)) { ! $userinfo = stack_db_quiz_quizattempt_getlast($qID,$user['id']); ! if (is_array($userinfo)) { ! if (NULL != $userinfo['mark']) { ! $mark = round(100*$userinfo['mark']/$userinfo['maxmark'],2); ! } ! } ! } ! } ! echo "<tr><td><a href=\"javascript:takeaction('continue_quiz','$qID');\">{$qname}</a></td>\n"; ! echo "<td>".$quiz['quizDescription']."</td><td align='center'>$mark</td></tr>\n"; ! } ! echo "\n</table>\n</form>\n</p>"; ! ! } else { ! echo "<p>You have no quizzes available to try.</p>"; ! } ! } include('html/pagefoot.php'); --- 54,69 ---- if ('welcome' == $action) { ! stack_welcome_screen($user); $action = 'choose_quiz'; } if ('error' == $action) { ! stack_login_error_screen($error); } if ('choose_quiz' == $action) { $quiz_store = stack_db_quiz_get(); ! stack_select_quiz_screen($quiz_store, $user); ! } include('html/pagefoot.php'); |
From: Juliette W. <jv...@us...> - 2005-06-16 11:45:08
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8615/html Modified Files: Tag: frontend_dev index-menu.txt student-menu.txt Log Message: Put code back into index.php, put session_starts back in the files. Index: index-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/index-menu.txt,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** index-menu.txt 13 Jun 2005 13:04:06 -0000 1.2.2.1 --- index-menu.txt 16 Jun 2005 11:44:45 -0000 1.2.2.2 *************** *** 3,7 **** .Login|index.php?action=loginscreen ! .Register|registration_screen.php .About STACK|documentation.php?action=about_general ..Install|documentation.php?action=about_install --- 3,7 ---- .Login|index.php?action=loginscreen ! .Register|index.php?action=registration_screen .About STACK|documentation.php?action=about_general ..Install|documentation.php?action=about_install Index: student-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/student-menu.txt,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** student-menu.txt 13 Jun 2005 13:04:06 -0000 1.2.2.1 --- student-menu.txt 16 Jun 2005 11:44:45 -0000 1.2.2.2 *************** *** 3,7 **** .Select Quiz|select_quiz.php?action=choose_quiz ! .Update user info|update_info.php?action=userupdate .Logout|index.php?action=logout .Help |documentation.php?action=student_overview --- 3,7 ---- .Select Quiz|select_quiz.php?action=choose_quiz ! .Update user info|index.php?action=update_info .Logout|index.php?action=logout .Help |documentation.php?action=student_overview |
From: Juliette W. <jv...@us...> - 2005-06-16 11:45:07
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8615/frontend_general Modified Files: Tag: frontend_dev process_input.php Added Files: Tag: frontend_dev front_end_display.php qb_display.php Log Message: Put code back into index.php, put session_starts back in the files. --- NEW FILE: qb_display.php --- <?php function stack_print_question_bank_screen($admin, $question_bank_filter) { global $stack_root; $options = ''; include("{$stack_root}/html/qselectform.php"); if ($admin) { stack_db_listquestions('edit',$question_bank_filter); } else { stack_db_listquestions('try',$question_bank_filter); } echo "<p><a href=\"javascript:SelectQs('export_xml_list');\">Export selected as XML</a> "; echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } function stack_print_edit_screen($question, $errors) { global $stack_root; include_once("{$stack_root}/scripts/stackAuthor.php"); include("{$stack_root}/html/qselectform.php"); stack_question_edit_form($question,$errors); echo "<p><a href=\"javascript:HelpPopup('all','stackQuestion');\">Help with question fields.</a>\n <a href=\"javascript:HelpPopup('all','stackOptions');\">Help with options.</a>\n <a href=\"javascript:HelpPopup('all','stackAnswerTest');\">Help with answer tests.</a>\n <a href=\"javascript:HelpPopup('all','stackQuestionPotResp');\">Help with potential responses.</a></p>"; } 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>"; } ?> --- NEW FILE: front_end_display.php --- <?php // Putting these functions here temporarily function stack_get_username($user) { return nsf('username',$user); } function stack_get_err($errors) { return nsf($errors,'user'); } function stack_get_errun($err) { return nsf($err,'username'); } function stack_get_errps($err){ return nsf($err,'password'); } function stack_login_screen($username, $errun, $errps) { echo '<h1>Login</h1><form action="select_quiz.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>'; echo '</tr><tr><td>Password:</td>'; echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td>'; echo '</tr><tr><td> <input type="hidden" name="action" value="login" /> <input type="submit" value="Login" /> </td></tr> </table> </form> <form action="select_quiz.php" method="post" name="guestlogin"> Some courses may allow guest access: <input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="login" /> <input type="submit" value="Login as a guest" /> <br />(Note, the question versions and attempts of the guest user remain only during your session.) </form> <form action="index.php" method="post" name="guestlogin"> Register with this STACK sever: <input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="registration_screen" /> <input type="submit" value="Register" /> </form>'; } function stack_update_info_screen($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"select_quiz.php?\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To update your information, please complete the following form.<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td>'.nsf($err,'username').'</td></tr>'; stack_user_edit_form($user,$errors); echo '</table><input type="hidden" name="action" value="userupdate" /><input type="submit" value="Update" /></form>'; } 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=\"select_quiz.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; // TO DO: Need to fix typo in this form - institution stack_user_edit_form($user,$errors); echo '</table><input type="hidden" name="action" value="register" /><input type="submit" value="Register" /></form>'; } function stack_logout_screen() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ?> Index: process_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/process_input.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 *** process_input.php 14 Jun 2005 15:50:06 -0000 1.1.2.4 --- process_input.php 16 Jun 2005 11:44:44 -0000 1.1.2.5 *************** *** 20,24 **** */ - session_start(); $errors = ''; --- 20,23 ---- |
From: Juliette W. <jv...@us...> - 2005-06-16 11:45:07
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8615 Modified Files: Tag: frontend_dev chat.php documentation.php editquiz.php import_question_screen.php index.php question_bank.php select_quiz.php Removed Files: Tag: frontend_dev ToDo.txt front_end_display.php registration_screen.php update_info.php Log Message: Put code back into index.php, put session_starts back in the files. Index: import_question_screen.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/import_question_screen.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 *** import_question_screen.php 14 Jun 2005 16:01:04 -0000 1.1.2.1 --- import_question_screen.php 16 Jun 2005 11:44:44 -0000 1.1.2.2 *************** *** 22,25 **** --- 22,26 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// + session_start(); include('stackstd.php'); $default_action = ''; --- ToDo.txt DELETED --- --- front_end_display.php DELETED --- Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.5 retrieving revision 1.10.2.6 diff -C2 -d -r1.10.2.5 -r1.10.2.6 *** editquiz.php 16 Jun 2005 04:11:38 -0000 1.10.2.5 --- editquiz.php 16 Jun 2005 11:44:44 -0000 1.10.2.6 *************** *** 9,12 **** --- 9,14 ---- */ + session_start(); + require_once("other/ListMenu.php"); require_once("stackstd.php"); --- registration_screen.php DELETED --- Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.4 retrieving revision 1.17.2.5 diff -C2 -d -r1.17.2.4 -r1.17.2.5 *** index.php 16 Jun 2005 11:28:50 -0000 1.17.2.4 --- index.php 16 Jun 2005 11:44:44 -0000 1.17.2.5 *************** *** 30,37 **** /////////////////////////////////////////////////////////////// include('stackstd.php'); $default_action = 'loginscreen'; include($stack_root.'/frontend_general/process_input.php'); ! include('front_end_display.php'); /////////////////////////////////////////////////////////////// --- 30,38 ---- /////////////////////////////////////////////////////////////// + session_start(); include('stackstd.php'); $default_action = 'loginscreen'; include($stack_root.'/frontend_general/process_input.php'); ! include($stack_root.'/frontend_general/front_end_display.php'); /////////////////////////////////////////////////////////////// *************** *** 50,53 **** --- 51,55 ---- ////////////////////////////////////////////////////////////// + include('html/pagehead.php'); Index: documentation.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/documentation.php,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** documentation.php 14 Jun 2005 15:50:05 -0000 1.2.2.3 --- documentation.php 16 Jun 2005 11:44:44 -0000 1.2.2.4 *************** *** 27,30 **** --- 27,31 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// + session_start(); include('stackstd.php'); $default_action = ''; --- update_info.php DELETED --- Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.14 retrieving revision 1.3.2.15 diff -C2 -d -r1.3.2.14 -r1.3.2.15 *** question_bank.php 16 Jun 2005 10:59:34 -0000 1.3.2.14 --- question_bank.php 16 Jun 2005 11:44:44 -0000 1.3.2.15 *************** *** 28,31 **** --- 28,32 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// + session_start(); include('stackstd.php'); $default_action = 'questionbank_screen'; Index: chat.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/chat.php,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** chat.php 14 Jun 2005 15:50:05 -0000 1.8.2.2 --- chat.php 16 Jun 2005 11:44:44 -0000 1.8.2.3 *************** *** 12,15 **** --- 12,16 ---- * */ + session_start(); require_once("stackstd.php"); include('stackstd.php'); Index: select_quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/select_quiz.php,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -C2 -d -r1.1.4.2 -r1.1.4.3 *** select_quiz.php 14 Jun 2005 15:50:06 -0000 1.1.4.2 --- select_quiz.php 16 Jun 2005 11:44:44 -0000 1.1.4.3 *************** *** 31,34 **** --- 31,35 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// + session_start(); $action = 'choose_quiz'; include('stackstd.php'); |
From: Juliette W. <jv...@us...> - 2005-06-16 11:28:58
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32188 Modified Files: Tag: frontend_dev index.php registration_screen.php update_info.php Added Files: Tag: frontend_dev front_end_display.php Log Message: Moving html for frontend out into separate file. Index: update_info.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/update_info.php,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -C2 -d -r1.1.4.2 -r1.1.4.3 *** update_info.php 14 Jun 2005 15:50:06 -0000 1.1.4.2 --- update_info.php 16 Jun 2005 11:28:50 -0000 1.1.4.3 *************** *** 34,37 **** --- 34,38 ---- include_once($stack_root."/scripts/stackUser.php"); + include('front_end_display.php'); ////////////////////////////////////////////////////////////// *************** *** 41,46 **** include('html/pagehead.php'); - echo '<h1>Update user information</h1>'; - if ($user['loggedin'] and 'guest' != $user['username']) { $err = ''; --- 42,45 ---- *************** *** 50,61 **** } } ! ! echo "<form action=\"select_quiz.php?expand=$expand\" method=\"post\" name=\"register\" id=\"register\">"; ! echo '<p>To update your information, please complete the following form.<p>'; ! echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td>'.nsf($err,'username').'</td></tr>'; ! stack_user_edit_form($user,$errors); ! echo '</table><input type="hidden" name="action" value="userupdate" /><input type="submit" value="Update" /></form>'; } else { ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; } --- 49,55 ---- } } ! stack_update_info_screen($user, $err, $errors); } else { ! stack_update_info_error_screen(); } --- NEW FILE: front_end_display.php --- <?php // Putting these functions here temporarily function stack_get_username($user) { return nsf('username',$user); } function stack_get_err($errors) { return nsf($errors,'user'); } function stack_get_errun($err) { return nsf($err,'username'); } function stack_get_errps($err){ return nsf($err,'password'); } function stack_login_screen($username, $errun, $errps) { echo '<h1>Login</h1><form action="select_quiz.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>'; echo '</tr><tr><td>Password:</td>'; echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td>'; echo '</tr><tr><td> <input type="hidden" name="action" value="login" /> <input type="submit" value="Login" /> </td></tr> </table> </form> <form action="select_quiz.php" method="post" name="guestlogin"> Some courses may allow guest access: <input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="login" /> <input type="submit" value="Login as a guest" /> <br />(Note, the question versions and attempts of the guest user remain only during your session.) </form> <form action="select_quiz.php" method="post" name="guestlogin"> Register with this STACK sever: <input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="register" /> <input type="submit" value="Register" /> </form>'; } function stack_update_info_screen($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"select_quiz.php?\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To update your information, please complete the following form.<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td>'.nsf($err,'username').'</td></tr>'; stack_user_edit_form($user,$errors); echo '</table><input type="hidden" name="action" value="userupdate" /><input type="submit" value="Update" /></form>'; } 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=\"select_quiz.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; // TO DO: Need to fix typo in this form - institution stack_user_edit_form($user,$errors); echo '</table><input type="hidden" name="action" value="register" /><input type="submit" value="Register" /></form>'; } function stack_logout_screen() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ?> Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -C2 -d -r1.17.2.3 -r1.17.2.4 *** index.php 14 Jun 2005 15:50:05 -0000 1.17.2.3 --- index.php 16 Jun 2005 11:28:50 -0000 1.17.2.4 *************** *** 31,36 **** include('stackstd.php'); ! $default_action = ''; include($stack_root.'/frontend_general/process_input.php'); /////////////////////////////////////////////////////////////// --- 31,37 ---- include('stackstd.php'); ! $default_action = 'loginscreen'; include($stack_root.'/frontend_general/process_input.php'); + include('front_end_display.php'); /////////////////////////////////////////////////////////////// *************** *** 52,90 **** if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ! $err = nsf($errors,'user'); ! $errun = nsf($err,'username'); ! $errps = nsf($err,'password'); ! $username = nsf($user,'username'); ! ! echo '<h1>Login</h1><form action="select_quiz.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>'; ! echo '</tr><tr><td>Password:</td>'; ! echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td>'; ! echo '</tr><tr><td> ! <input type="hidden" name="action" value="login" /> ! <input type="submit" value="Login" /> ! </td></tr> ! </table> ! </form> ! <form action="select_quiz.php" method="post" name="guestlogin"> ! Some courses may allow guest access: ! <input type="hidden" name="username" value="guest" /> ! <input type="hidden" name="password" value="guest" /> ! <input type="hidden" name="action" value="login" /> ! <input type="submit" value="Login as a guest" /> ! <br />(Note, the question versions and attempts of the guest user remain only during your session.) ! </form> ! <form action="select_quiz.php" method="post" name="guestlogin"> ! Register with this STACK sever: ! <input type="hidden" name="username" value="guest" /> ! <input type="hidden" name="password" value="guest" /> ! <input type="hidden" name="action" value="register" /> ! <input type="submit" value="Register" /> ! </form>'; include('html/pagefoot.php'); --- 53,88 ---- if ('logout' == $action) { ! stack_logout_screen(); ! $action = 'loginscreen'; } ! 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); ! } ! if ('registration_screen' == $action) { ! include_once($stack_root."/scripts/stackUser.php"); ! $err = stack_get_err($errors); ! $username = stack_get_username($user); ! stack_registration_screen($username, $user, $errors, $err); ! } ! 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 { ! stack_update_info_error_screen(); ! } ! } include('html/pagefoot.php'); Index: registration_screen.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/registration_screen.php,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -C2 -d -r1.1.4.2 -r1.1.4.3 *** registration_screen.php 14 Jun 2005 15:50:06 -0000 1.1.4.2 --- registration_screen.php 16 Jun 2005 11:28:50 -0000 1.1.4.3 *************** *** 27,30 **** --- 27,31 ---- $default_action = ''; include($stack_root.'/frontend_general/process_input.php'); + include('front_end_display.php'); ////////////////////////////////////////////////////////////// *************** *** 34,50 **** include('html/pagehead.php'); - include_once($stack_root."/scripts/stackUser.php"); - $err = nsf($errors,'user'); - $err = nsf($err,'username'); - $username = nsf('username',$user); - echo "<h1>Register as a new user</h1><form action=\"select_quiz.php\" method=\"post\" name=\"register\" id=\"register\">"; - echo '<p>To register as a STACK user, please provide the following information.<p>'; - echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; ! stack_user_edit_form($user,$errors); ! ! echo '</table><input type="hidden" name="action" value="register" /><input type="submit" value="Register" /></form>'; include('html/pagefoot.php'); --- 35,45 ---- include('html/pagehead.php'); ! include_once($stack_root."/scripts/stackUser.php"); ! $err = stack_get_err($errors); ! $username = stack_get_username($user); + stack_registration_screen($username, $user, $errors, $err); include('html/pagefoot.php'); |
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) |
From: Chris S. <san...@us...> - 2005-06-16 04:11:47
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13332/scripts Modified Files: Tag: frontend_dev stackDatabase.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.16.2.3 retrieving revision 1.16.2.4 diff -C2 -d -r1.16.2.3 -r1.16.2.4 *** stackDatabase.php 15 Jun 2005 20:33:14 -0000 1.16.2.3 --- stackDatabase.php 16 Jun 2005 04:11:38 -0000 1.16.2.4 *************** *** 109,130 **** global $_PHP_SELF; - // Sort out how we are going to filter questions. - $filter_kw = ''; - $filter_name = ''; if ('try' == $action) { ! $filter_kw = 'demo'; ! $filter_name = ''; ! } else { ! if (is_array($filter)) { ! if (array_key_exists('kw',$filter)) { ! $filter_kw = trim($filter['kw']); ! } ! if (array_key_exists('name',$filter)) { ! $filter_name = trim($filter['name']); ! } ! } } ! // Build the query to the database. $query = 'SELECT --- 109,126 ---- global $_PHP_SELF; + // Sort out how we are going to filter questions. + if ('' === $filter) { + $filter['kw'] = ''; + $filter['name'] = ''; + } if ('try' == $action) { ! $filter['kw'] = 'demo'; ! $filter['name'] = ''; } ! ! $filter_name = $filter['name']; ! $filter_kw = $filter['kw']; ! // Build the query to the database. $query = 'SELECT *************** *** 167,181 **** // Decide how to filter questions ! $dispQ = TRUE; ! if ('' != $filter_kw) { ! if ('' != $filter_name) { ! $dispQ = max(strpos($qkeywords,$filter_kw),strpos($qname,$filter_name)); ! } else { ! $dispQ = strpos($qkeywords,$filter_kw); ! } ! } else if ('' != $filter_name) { ! $dispQ = strpos($qname,$filter_name); ! } ! if (FALSE !== $dispQ) { --- 163,167 ---- // Decide how to filter questions ! $dispQ = stack_db_question_filter($qname,$qkeywords,$filter_name,$filter_kw); if (FALSE !== $dispQ) { *************** *** 242,245 **** --- 228,239 ---- { // List all the questions in the database + // Sort out how we are going to filter questions. + if ('' === $filter) { + $filter['kw'] = ''; + $filter['name'] = ''; + } + $filter_name = $filter['name']; + $filter_kw = $filter['kw']; + $query = 'SELECT questionID, questionName, questionKeywords *************** *** 251,255 **** echo '<table><thead><tr>'; ! echo "<tr><th>Add</th><th>Question no.</th><th>Name</th> <th>Key words</th></tr>\n"; echo "\n</thead><tbody>\n"; --- 245,249 ---- echo '<table><thead><tr>'; ! echo "<tr><th>Add</th><th>Question no.</th><th>Name</th> <th>Keyword</th></tr>\n"; echo "\n</thead><tbody>\n"; *************** *** 257,265 **** $row = mysql_fetch_row($result); $qkw = stripslashes($row[2]); ! $dispQ = TRUE; ! if ('' != $filter) { ! $dispQ = strpos($qkw,$filter); ! } if (FALSE !== $dispQ) { --- 251,257 ---- $row = mysql_fetch_row($result); + $name = stripslashes($row[1]); $qkw = stripslashes($row[2]); ! $dispQ = stack_db_question_filter($name,$qkw,$filter_name,$filter_kw); if (FALSE !== $dispQ) { *************** *** 267,278 **** $qname = ''; ! if ('' != $row[1]) { ! $qname = stripslashes($row[1]); ! $qname = "<a href=\"javascript:EditPopup('$qID');\">{$qname}</a>"; } echo "<tr><td><input type=\"checkbox\" name=\"questionsToAdd[$qID][add]\" value=\"ticked\" /></td>\n"; ! echo "<td>$qID</td><td>$qname</td><td>$qkw</td> </tr>\n"; } // End preg_match to display each line. --- 259,269 ---- $qname = ''; ! if ('' != $name) { ! $name = "<a href=\"javascript:EditPopup('$qID');\">{$name}</a>"; } echo "<tr><td><input type=\"checkbox\" name=\"questionsToAdd[$qID][add]\" value=\"ticked\" /></td>\n"; ! echo "<td>$qID</td><td>$name</td><td>$qkw</td> </tr>\n"; } // End preg_match to display each line. *************** *** 288,291 **** --- 279,310 ---- } + + /** + * Decides whether to display a question based upon the name, keywords and filter. + * + * @param $name string Question name. + * @param $kw string Question keywords. + * @param $filter_name string Filter to be applied to the name. + * @param $filter_kw string Filter to be applied to the name. + * @return $dispQ boolean + */ + function stack_db_question_filter($name,$kw,$filter_name,$filter_kw) { + + $dispQ = TRUE; + + if ('' != $filter_kw) { + if ('' != $filter_name) { + $dispQ = max(strpos($kw,$filter_kw),strpos($name,$filter_name)); + } else { + $dispQ = strpos($kw,$filter_kw); + } + } else if ('' != $filter_name) { + $dispQ = strpos($name,$filter_name); + } + + return($dispQ); + } + + /** * Add or edit a question in the database. |