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-20 15:43:36
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/html Modified Files: admin-menu.txt helpform.php index-menu.txt quizjava.html student-menu.txt trypopupform.html Log Message: Major changes to the font end. Attempt 1. Index: helpform.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/helpform.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** helpform.php 5 Apr 2005 02:44:44 -0000 1.4 --- helpform.php 20 Jun 2005 15:42:53 -0000 1.5 *************** *** 18,22 **** */ ! echo "<form name=\"stackquestionhelpform\" action=\"{$stack_web_url}doc/stackHelp.php\" method=\"POST\">"; ?> <input type="hidden" name="field" value="" /> <input type="hidden" name="variable" value="" /> --- 18,22 ---- */ ! echo "<form name=\"stackquestionhelpform\" action=\"{$stack_web_url}doc/help_popup.php\" method=\"POST\">"; ?> <input type="hidden" name="field" value="" /> <input type="hidden" name="variable" value="" /> Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** admin-menu.txt 12 Jun 2005 07:47:06 -0000 1.8 --- admin-menu.txt 20 Jun 2005 15:42:53 -0000 1.9 *************** *** 2,27 **** // level // text // link // target // ! .Questions|question_bank.php ! ..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 - .Preview|select_quiz.php .Reporting|analysis.php .Logout|index.php?action=logout ! .Import|question_bank.php?action=upload_xml_file ! .Help|documentation.php?action=help&field=general ! ..Authoring guide|documentation.php?action=author ! ..Maxima's docs|maximadocs/maxdoc/maxima_toc.html|Maxima_docs ! ..Enabled functions|documentation.php?action=functions ! ..Question fields|documentation.php?action=stackQuestion ! ..Options|documentation.php?action=stackOptions ! ..Answer Tests|documentation.php?action=stackAnswerTest ! ..Potential responses|documentation.php?action=stackQuestionPotResp ! ..Maxima|http://maxima.sourceforge.net/_blank ! .About STACK |documentation.php?action=about ! ..Install|documentation.php?action=install ! ..Develop|documentation.php?action=develop ! ..CAS online Demo|chat.php ..MathML Demo|chat_mathml.php ..Sourceforge|http://sourceforge.net/projects/stack|_blank --- 2,26 ---- // level // text // link // target // ! .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 .Reporting|analysis.php .Logout|index.php?action=logout ! .Help|documentation.php ! ..Author doc|documentation.php?action=author_gettingstarted ! ..Syntax|documentation.php?action=author_commonsyntax ! ..Question fields|documentation.php?action=author_questionfields ! ..Options|documentation.php?action=author_options ! ..Answer tests|documentation.php?action=author_answertest ! ..Potential responses|documentation.php?action=author_potresp ! ..FAQ|documentation.php?action=author_faq ! ..Maxima|documentation.php?action=author_maxima ! ..CAS functions|documentation.php?action=functions ! .About STACK |documentation.php?action=about_general ! ..Install|documentation.php?action=about_install ! ..Develop|documentation.php?action=about_develop ! ..CAS online|chat.php ..MathML Demo|chat_mathml.php ..Sourceforge|http://sourceforge.net/projects/stack|_blank Index: index-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/index-menu.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index-menu.txt 10 Jun 2005 20:23:57 -0000 1.2 --- index-menu.txt 20 Jun 2005 15:42:53 -0000 1.3 *************** *** 3,15 **** .Login|index.php?action=loginscreen ! .Register|registration_screen.php ! .Help|documentation.php?action=studenthelp ! .About STACK|documentation.php?action=about ! ..Install|documentation.php?action=install ! ..Develop|documentation.php?action=develop ! ..Question Bank Demo|question_bank.php ! ..CAS online Demo|chat.php ..Sourceforge|http://sourceforge.net/projects/stack|_blank - ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo --- 3,22 ---- .Login|index.php?action=loginscreen ! .Register|index.php?action=registration_screen ! .About STACK|documentation.php?action=about_general ! ..Question bank|question_bank.php ! ...New question|question_bank.php?action=edit_new ! ...Author doc|documentation.php?action=author_gettingstarted ! ...Syntax|documentation.php?action=author_commonsyntax ! ...Options|documentation.php?action=author_options ! ...Answer tests|documentation.php?action=author_answertest ! ...FAQ|documentation.php?action=author_faq ! ...Maxima|documentation.php?action=author_maxima ! ...CAS functions|documentation.php?action=functions ! ..CAS online|chat.php ! ..Install|documentation.php?action=about_install ! ..Develop|documentation.php?action=about_develop ! ..Forum|http://mantis.york.ac.uk/moodle/course/view.php?id=21|_blank ..Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo Index: student-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/student-menu.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** student-menu.txt 10 Jun 2005 20:23:57 -0000 1.2 --- student-menu.txt 20 Jun 2005 15:42:53 -0000 1.3 *************** *** 2,17 **** // level // text // link // target // ! .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=studenthelp ! .About STACK |documentation.php?action=about ! ..Install|documentation.php?action=install ! ..Develop|documentation.php?action=develop ..Question Bank Demo|question_bank.php ..CAS online Demo|chat.php ! ..Sourceforge|http://sourceforge.net/projects/stack|_blank ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ! ..Maxima|http://maxima.sourceforge.net/_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo --- 2,21 ---- // level // text // link // target // ! .Select Quiz|index.php?action=choose_quiz ! .Update user info|index.php?action=update_info .Logout|index.php?action=logout ! .Help |documentation.php?action=student_overview ! ..Practice Mode|documentation.php?action=student_practicemode ! ..Assessment Mode|documentation.php?action=student_assessmentmode ! ..Answer Input|documentation.php?action=student_input ! ..Stack's output|documentation.php?action=student_understandingoutput ! ..Forbidden Answers|documentation.php?action=student_forbidden ! .About STACK |documentation.php?action=about_general ..Question Bank Demo|question_bank.php ..CAS online Demo|chat.php ! ..Install|documentation.php?action=about_install ! ..Develop|documentation.php?action=about_develop ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ! ..STACK at Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo Index: quizjava.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/quizjava.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** quizjava.html 21 Apr 2005 16:01:21 -0000 1.7 --- quizjava.html 20 Jun 2005 15:42:53 -0000 1.8 *************** *** 1,8 **** <script language="javascript"> function takeaction(c,n) { - document.forms.quizform.quizID.value = n; document.forms.quizform.action.value = c; document.forms.quizform.submit(); } function addquestions() { document.forms.stackquizeditform.action.value = "quiz_edit_addqs"; --- 1,13 ---- <script language="javascript"> function takeaction(c,n) { document.forms.quizform.action.value = c; + document.forms.quizform.quizid.value = n; document.forms.quizform.submit(); } + function quiztry(c,n) { + document.forms.quiztryform.action.value = c; + document.forms.quiztryform.quizid.value = n; + document.forms.quiztryform.submit(); + } function addquestions() { document.forms.stackquizeditform.action.value = "quiz_edit_addqs"; Index: trypopupform.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/trypopupform.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trypopupform.html 10 Jun 2005 20:23:57 -0000 1.4 --- trypopupform.html 20 Jun 2005 15:42:53 -0000 1.5 *************** *** 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: Chris S. <san...@us...> - 2005-06-20 15:43:35
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/scripts/maxima Modified Files: stackmaxima.mac Log Message: Major changes to the font end. Attempt 1. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** stackmaxima.mac 12 Jun 2005 16:10:01 -0000 1.13 --- stackmaxima.mac 20 Jun 2005 15:42:54 -0000 1.14 *************** *** 455,459 **** /* (1) p is degree 0 in v */ /* (2.1) p is linear in v, and the coefficients have no common factors */ ! /* (2.2) p is linear in v, and the coefficients of v is 1 */ /* (3) p is quadratic, the coefficients have no common factors */ /* and p does not factor over the **rationals** */ --- 455,459 ---- /* (1) p is degree 0 in v */ /* (2.1) p is linear in v, and the coefficients have no common factors */ ! /* (2.2) p is linear in v, and the coefficients of v is -1 */ /* (3) p is quadratic, the coefficients have no common factors */ /* and p does not factor over the **rationals** */ *************** *** 557,577 **** )$ - /* A function for one particular type of question! */ - - /* fntrans_unpack(ex) */ - /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ - /* That is to say, the result of applying some kind of grpahical transformation to f. */ - /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ - /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ - fntrans_unpack(ex):=BLOCK([f,l,a,b,c,d], - l:ex, - if atom(l) then RETURN([FALSE,a,b,c,d]), - if op(l)="+" then (d:part(l,2),l:part(l,1)) else d:0, - if atom(l) then RETURN([FALSE,a,b,c,d]), - if op(l)="*" then (a:part(l,1),l:part(l,2)) else a:1, - if op(l)=f then (l:part(l,1),b:coeff(l,x,1),c:coeff(l,x,0)) else RETURN([FALSE,a,b,c,d]), - /* if atom(l) then RETURN([FALSE,a,b,c,d]), */ - RETURN([TRUE,a,b,c,d]) - )$ /* An answer test based expandp(sa). */ --- 557,560 ---- *************** *** 645,648 **** --- 628,655 ---- )$ + /*******************************************************************************/ + /* Very specific maxima functions */ + /*******************************************************************************/ + + + /* A function for one particular type of question! */ + + /* fntrans_unpack(ex) */ + /* ex is assumed to be an expression of the form, a*f(b*x+c)+d */ + /* That is to say, the result of applying some kind of grpahical transformation to f. */ + /* If the function sucesfully unpacks this, it returns the list [TRUE,a,b,c,d] */ + /* If the function fails, it returns [FALSE,a,b,c,d], where it goes as far as it can. */ + fntrans_unpack(ex):=BLOCK([f,l,aa,bb,cc,dd], + l:ex, + if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), + if op(l)="+" then (dd:part(l,2),l:part(l,1)) else dd:0, + if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), + if op(l)="*" then (aa:part(l,1),l:part(l,2)) else aa:1, + if op(l)=f then (l:part(l,1),bb:coeff(l,x,1),cc:coeff(l,x,0)) else RETURN([FALSE,aa,bb,cc,dd]), + /* if atom(l) then RETURN([FALSE,aa,bb,cc,dd]), */ + RETURN([TRUE,aa,bb,cc,dd]) + )$ + + /* Stack expects some output */ print("[ Stack-Maxima started ]"); |
From: Chris S. <san...@us...> - 2005-06-20 15:43:33
|
Update of /cvsroot/stack/stack-1-0/maximadocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/maximadocs Modified Files: functions.php Log Message: Major changes to the font end. Attempt 1. Index: functions.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/maximadocs/functions.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** functions.php 6 Jun 2005 09:38:34 -0000 1.6 --- functions.php 20 Jun 2005 15:42:53 -0000 1.7 *************** *** 13,18 **** together with the extent to which they are supported by STACK.</p> - <p><a href="maximadocs/maxdoc/maxima_toc.html">Complete maxima documentation</a> <a href="../doc/">STACK documentation</a></p> - <p>Some whole libraries have been excluded from STACK. Hence, there may be no good reason why a function you would like has been excluded from this list. If you think this is the case, please --- 13,16 ---- |
From: Chris S. <san...@us...> - 2005-06-20 15:43:33
|
Update of /cvsroot/stack/stack-1-0/scripts/CASpool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/scripts/CASpool Modified Files: stackCAS.php Log Message: Major changes to the font end. Attempt 1. Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/CASpool/stackCAS.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackCAS.php 12 Jun 2005 16:10:00 -0000 1.4 --- stackCAS.php 20 Jun 2005 15:42:54 -0000 1.5 *************** *** 186,190 **** if ($eqpos = strpos($strin,'=',$offset)) { // Check there are ='s do { ! $gb = GrabBetween($strin,'[',']',$eqpos); $val = substr($gb[0], 1, strlen($gb[0])-2); $val = str_replace('"', '', $val); --- 186,190 ---- if ($eqpos = strpos($strin,'=',$offset)) { // Check there are ='s do { ! $gb = stack_util_grabbetween($strin,'[',']',$eqpos); $val = substr($gb[0], 1, strlen($gb[0])-2); $val = str_replace('"', '', $val); *************** *** 230,234 **** do { ! $gb = GrabBetween($uploc,'[',']',$offset); $locals[] = $this->CASParsePreparse($gb[0]); $offset=$gb[2]+1; --- 230,234 ---- do { ! $gb = stack_util_grabbetween($uploc,'[',']',$offset); $locals[] = $this->CASParsePreparse($gb[0]); $offset=$gb[2]+1; *************** *** 355,359 **** if ($eqpos = strpos($strin,'=',$offset)) { // Check there are ='s do { ! $gb = GrabBetween($strin,'[',']',$eqpos); $val = substr($gb[0], 1, strlen($gb[0])-2); $val = str_replace('"', '', $val); --- 355,359 ---- if ($eqpos = strpos($strin,'=',$offset)) { // Check there are ='s do { ! $gb = stack_util_grabbetween($strin,'[',']',$eqpos); $val = substr($gb[0], 1, strlen($gb[0])-2); $val = str_replace('"', '', $val); |
From: Chris S. <san...@us...> - 2005-06-20 15:43:32
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897 Modified Files: chat.php documentation.php editquiz.php index.php question_bank.php quiz.php Removed Files: ToDo.txt loginregister.php process_input.php registration_screen.php select_quiz.php update_info.php Log Message: Major changes to the font end. Attempt 1. --- ToDo.txt DELETED --- --- loginregister.php DELETED --- --- process_input.php DELETED --- Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.php 10 Jun 2005 20:23:56 -0000 1.17 --- index.php 20 Jun 2005 15:42:52 -0000 1.18 *************** *** 16,37 **** * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... ! * * @package Stack */ - - /* - * 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 /////////////////////////////////////////////////////////////// ! $action = 'loginscreen'; ! include('process_input.php'); /////////////////////////////////////////////////////////////// ! // (2) Log out the user if required. /////////////////////////////////////////////////////////////// --- 16,40 ---- * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... ! * ! * This file contains the front end logic for the main frontend pages ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. * @package Stack */ /////////////////////////////////////////////////////////////// // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! ! session_start(); ! include('stackstd.php'); ! $default_action = 'loginscreen'; ! include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); /////////////////////////////////////////////////////////////// ! // (2) Take any actions required /////////////////////////////////////////////////////////////// *************** *** 41,46 **** --- 44,56 ---- session_unregister('user'); unset($_SESSION['user']); + $_GET['expand'] = 0; } + include('frontend_general/loginregister.php'); + $err = nsf($errors,'user'); + $errun = stack_get_errun($err); + $errps = stack_get_errps($err); + + ////////////////////////////////////////////////////////////// // (2) Print the page. *************** *** 50,88 **** 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'); --- 60,97 ---- if ('logout' == $action) { ! echo '<h1>Thank you</h1><p>Thank you for using STACK.'; ! $action = 'loginscreen'; } ! if ('welcome' == $action) { ! echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! $action = 'choose_quiz'; ! } ! switch ($action) { ! case 'loginscreen': ! stack_display_main_login($username, $errun, $errps); ! break; ! case 'registration_screen': ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! break; ! case 'update_info': ! if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { ! $err = stack_get_err2($errors); ! stack_display_main_update_userinfo($user, $err, $errors); ! } else { ! echo '<h1>Update user information</h1>'; ! echo '<p>Please logout and login as a personal user first to update your information.</p>'; ! } ! break; ! case 'error': ! echo "There was an error with the login or registration"; ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_quiz_student_select($quiz_store, $user); ! break; ! } include('html/pagefoot.php'); --- registration_screen.php DELETED --- Index: documentation.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/documentation.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** documentation.php 12 Jun 2005 16:10:00 -0000 1.2 --- documentation.php 20 Jun 2005 15:42:52 -0000 1.3 *************** *** 16,21 **** * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... * ! * @package Stack */ --- 16,24 ---- * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... + * @author Juliette White jv...@jv... * ! * This file contains the front end logic for the documentation ! * @package frontend ! * @subpackage Stack */ *************** *** 27,31 **** // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! include('process_input.php'); ////////////////////////////////////////////////////////////// --- 30,37 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! session_start(); ! include('stackstd.php'); ! $default_action = ''; ! include($stack_root.'/frontend_general/process_input.php'); ////////////////////////////////////////////////////////////// *************** *** 33,52 **** ////////////////////////////////////////////////////////////// ! include('html/helpform.php'); ! include('html/pagehead.php'); ! if ('studenthelp' == $action) { // Student help information ! include('doc/help.html'); ! } else if ('logo' == $action) { // Information about the logo ! include('pics/index.php'); ! } else if ('about' == $action) { // Information about STACK ! include('doc/aboutSTACK.php'); } else if ('functions' == $action) { // Documentation on Maxima Functions ! include("maximadocs/functions.php"); ! } else { // Other documentation ! include("doc/{$action}.php"); } ! include('html/pagefoot.php'); ?> --- 39,54 ---- ////////////////////////////////////////////////////////////// ! include($stack_root.'/html/helpform.php'); ! include($stack_root.'/html/pagehead.php'); ! if ('logo' == $action) { // Information about the logo ! include($stack_root.'/pics/index.php'); } else if ('functions' == $action) { // Documentation on Maxima Functions ! include($stack_root.'/maximadocs/functions.php'); ! } else if ('' != $action) { // Other documentation ! include($stack_root."/doc/{$action}.php"); } ! include($stack_root.'/html/pagefoot.php'); ?> Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** quiz.php 10 Jun 2005 20:23:56 -0000 1.22 --- quiz.php 20 Jun 2005 15:42:52 -0000 1.23 *************** *** 11,14 **** --- 11,35 ---- include('stackstd.php'); + $default_action = 'choose_quiz'; + include($stack_root.'/frontend_general/process_input.php'); + + + ///////////////////////////////////////////////////////////// + // (1) For a quiz, the admin user should behave like a guest. + // We don't want lots of admin user quizzes to be stored. + // The user is not stored in the session, so it lasts only + // for this script. + ///////////////////////////////////////////////////////////// + + if ($user['id'] <= 0 or !$user['loggedin']) { + include_once($stack_root."/scripts/stackUser.php"); + $user = stack_user_guest(); + } + + + ////////////////////////////////////////////////////////// + // (2) Assign default values to quiz specific variables. + ////////////////////////////////////////////////////////// + $errors = ''; $options = ''; *************** *** 20,83 **** $focus = FALSE; $focus_on = NULL; - - //////////////////////////////////////////////////// - // Process incoming data, and check for any errors. - /////////////////////////////////////////////////// ! ! if (get_magic_quotes_gpc()) { ! /** ! * Automatically removes slashes deeply from arrays. ! * ! * @param $value incoming array. ! * @return $value the array with slashed removed. ! */ ! function stripslashes_deep($value) ! { ! $value = is_array($value) ? ! array_map('stripslashes_deep', $value) : ! stripslashes($value); ! ! return $value; ! } ! ! $_POST = array_map('stripslashes_deep', $_POST); ! $_GET = array_map('stripslashes_deep', $_GET); ! $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } ! ! //////////////////////////////////////////////// ! // (1) Establish the user. ! //////////////////////////////////////////////// ! ! if (array_key_exists('user',$_SESSION)) { ! $user = $_SESSION['user']; ! } else { ! // Make sure the user is logged in as a Guest. ! include_once($stack_root."/scripts/stackUser.php"); ! $user = stack_user_guest(); ! } ! ! ! $implied_guest = FALSE; ! if (is_array($user)) { ! if (array_key_exists('id',$user)) { ! if ($user['id'] <= 0 or !$user['loggedin']) { ! $implied_guest = TRUE; ! } ! } else { ! $implied_guest = TRUE; ! } ! } else { ! $implied_guest = TRUE; } - if ( $implied_guest) { - include_once($stack_root."/scripts/stackUser.php"); - $user = stack_user_guest(); - } - //////////////////////////////////////////////// ! // (2) Decide what we are trying to do. //////////////////////////////////////////////// --- 41,54 ---- $focus = FALSE; $focus_on = NULL; ! if (array_key_exists('focus',$_SESSION)) { ! $focus = $_SESSION['focus']; } ! if (array_key_exists('focus_on',$_SESSION)) { ! $focus_on = $_SESSION['focus_on']; } //////////////////////////////////////////////// ! // (3) Decide what we are trying to do. //////////////////////////////////////////////// *************** *** 85,101 **** // action = unfocus See all questions at once. // action = continue_quiz Continue a quiz, from $user information // action = new_quiz_version Start a new quiz version ! // actopn = validate Validate the response to *every question* // action = mark Mark the response to *every question* // action = mark_question Mark the response only to question in the field questiono // action = solutions Mark the response to *every question* then show the solutions // This prevents further attempts ! ! if (array_key_exists('action',$_POST)) { ! $action = $_POST['action']; ! } else { ! $action = 'choose_quiz'; ! } ! if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; --- 56,69 ---- // action = unfocus See all questions at once. // action = continue_quiz Continue a quiz, from $user information + // (default_action) // action = new_quiz_version Start a new quiz version ! // actoin = validate Validate the response to *every question* // action = mark Mark the response to *every question* // action = mark_question Mark the response only to question in the field questiono // action = solutions Mark the response to *every question* then show the solutions // This prevents further attempts ! ! // If there is a quiz stored in the $_SESSION, we should use this. ! // Otherwise we need to generate one. if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; *************** *** 104,142 **** } - - if (array_key_exists('focus',$_SESSION)) { - $focus = $_SESSION['focus']; - } - if (array_key_exists('focus_on',$_SESSION)) { - $focus_on = $_SESSION['focus_on']; - } - //////////////////////////////////////////////// ! // (2) Take some action //////////////////////////////////////////////// ! // (2.1) Guest users cannot store information in the DB if ('continue_quiz' == $action and 0 == $user['id']) { $action = 'new_quiz_version'; } ! // (2.2) Sort out focus/unfocus behaviour. if ('focus' == $action) { $focus = TRUE; ! // This is a bit of a HACK! We need to get the number into $_POST, ! // And the javascript function takeaction('mark_question',no) inserts into quizID, so ..... ! ! if (array_key_exists('quizID',$_POST) ){ ! $focus_on = $_POST['quizID']; } else { $focus_on = 1; } } if ('unfocus' == $action) { $focus = FALSE; } ! // (2.3) construct the $quiz if ('continue_quiz' == $action or 'new_quiz_version' == $action) { // Clear any existing quiz and quizInst from the $_SESSION --- 72,102 ---- } //////////////////////////////////////////////// ! // (4) Take some action //////////////////////////////////////////////// ! // (4.1) Guest users cannot store information in the DB if ('continue_quiz' == $action and 0 == $user['id']) { $action = 'new_quiz_version'; } ! // (4.2) Sort out focus/unfocus behaviour. if ('focus' == $action) { $focus = TRUE; ! // This is a bit of a HACK, since we need to get the number into $_POST, ! // And the javascript function takeaction('mark_question',no) inserts into quizid, so ..... ! if (array_key_exists('quizid',$_POST) ){ ! $focus_on = $_POST['quizid']; } else { $focus_on = 1; } } + if ('unfocus' == $action) { $focus = FALSE; } ! // (4.3) construct the $quiz if ('continue_quiz' == $action or 'new_quiz_version' == $action) { // Clear any existing quiz and quizInst from the $_SESSION *************** *** 144,151 **** session_unregister('quiz'); ! if (array_key_exists('quizID',$_POST)) { ! $quizID = $_POST['quizID']; // Get the particular quiz, without hidden questions. ! $quiz = stack_db_quiz_get($quizID,FALSE); // Get a list of questionIDs in this quiz $quiz_questions = NULL; --- 104,111 ---- session_unregister('quiz'); ! if (array_key_exists('quizid',$_POST)) { ! $quizid = $_POST['quizid']; // Get the particular quiz, without hidden questions. ! $quiz = stack_db_quiz_get($quizid,FALSE); // Get a list of questionIDs in this quiz $quiz_questions = NULL; *************** *** 164,168 **** } ! // (2.4) At this point we should have a $quiz and $quizInst to work on. // Find out if we have quiz options. $quiz_options = array(); --- 124,128 ---- } ! // (4.4) At this point we should have a $quiz and $quizInst to work on. // Find out if we have quiz options. $quiz_options = array(); *************** *** 171,179 **** } ! // (2.5) Reconstruct $quizInst from previous data if ('continue_quiz' == $action) { // Check for the necessary informtaion incoming. ! $userinfo = stack_db_quiz_quizattempt_getlast($quizID,$user['id']); if (is_array($userinfo)) { --- 131,139 ---- } ! // (4.5) Reconstruct $quizInst from previous data if ('continue_quiz' == $action) { // Check for the necessary informtaion incoming. ! $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); if (is_array($userinfo)) { *************** *** 182,185 **** --- 142,149 ---- $quiz['seed'] = $seed; + // Check if students have previously asked for solutions. + // If so, they can't do anything else with this version + // of the quiz, but look at the solutions again. + // ie, they can't try again after solutions. if ($userinfo['SolRequest']) { $action = 'solutions'; *************** *** 192,195 **** --- 156,161 ---- $quizInst[]=$qInst; + // Make the $RawAns array equal to the student's last answer, if + // they have tried the quiz before. if (array_key_exists('questionAttempts', $qInst)) { if (is_array($qInst['questionAttempts'])) { *************** *** 204,215 **** } ! // (2.6) Start a new quiz if ('new_quiz_version' == $action) { $focus = FALSE; ! $seed = time()+rand(0,30000); $quiz['seed'] = $seed; // Record the information in the DB if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_store($quiz['quizID'],$user['id'],$seed); } --- 170,181 ---- } ! // (4.6) Start a new quiz if ('new_quiz_version' == $action) { $focus = FALSE; ! $seed = time()+rand(0,30000); $quiz['seed'] = $seed; // Record the information in the DB if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_store($quiz['quizid'],$user['id'],$seed); } *************** *** 218,233 **** stack_question_validate($question,$errors["qu$key"]); ! $options = stack_options_set($question); if ( '' == $errors["qu$key"] ) { - // HACK: Need a better mechanism $quizInst[] = stack_question_inst($question,$seed,$options,$errors["qu$key"]); } else { $question = NULL; ! $question['questionStemInst'] = "<font color=\"red\">There were errors in the question.</font> ! <br />Please contact your system administrator about questionID $qID.<br />"; ! $question['questionAnsInst'] = 0; ! $question['errors'] = $errors["qu$key"]; ! $quizInst[] = $question; } } --- 184,198 ---- stack_question_validate($question,$errors["qu$key"]); ! $options = stack_options_set($question,$quiz_options); if ( '' == $errors["qu$key"] ) { $quizInst[] = stack_question_inst($question,$seed,$options,$errors["qu$key"]); } else { $question = NULL; ! $a = array($qID); ! $question['questionStemInst'] = get_string('Quiz_error_q','stack',$a); ! $question['questionAnsInst'] = 0; ! $question['errors'] = $errors["qu$key"]; ! $quizInst[] = $question; } } *************** *** 236,246 **** ! // (2.7) Get the information from the $_SESSION if ('new_quiz_version' != $action and 'continue_quiz' != $action and 'choose_quiz' != $action) { ! // (2.6.1) Get the quiz from the $_SESSION if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; ! $quizID = $quiz['quizID']; $quiz_options = array(); if (array_key_exists('quizOptions',$quiz)){ --- 201,211 ---- ! // (4.7) Get the information about the quiz from the $_SESSION if ('new_quiz_version' != $action and 'continue_quiz' != $action and 'choose_quiz' != $action) { ! // (4.7.1) Get the quiz from the $_SESSION if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; ! $quizid = $quiz['quizid']; $quiz_options = array(); if (array_key_exists('quizOptions',$quiz)){ *************** *** 251,255 **** } ! // (2.6.2) Get the quizInst from the $_SESSION if (array_key_exists('quizInst',$_SESSION)) { $quizInst=$_SESSION['quizInst']; --- 216,220 ---- } ! // (4.7.2) Get the quizInst from the $_SESSION if (array_key_exists('quizInst',$_SESSION)) { $quizInst=$_SESSION['quizInst']; *************** *** 258,281 **** } ! // (2.6.3) Ensure that for each question in the quiz, $RawAns exists. foreach ($quizInst as $key => $q) { $RawAns[] = ''; } ! // (2.6.4) Get the list of answers from $_POST if (array_key_exists('RawAns',$_POST) ){ foreach ($_POST['RawAns'] as $key => $q) { $RawAns[$key] = $q; ! } } } ! // (2.8) Mark just one question in the quiz. if ('mark_question' == $action) { // This is a bit of a HACK! We need to get the number into $_POST, ! // And the javascript function takeaction('mark_question',no) inserts into quizID, so ..... ! if (array_key_exists('quizID',$_POST) ){ ! $q_no=$_POST['quizID']; } else { $errors['questionno'] = 'Could not get question number from $_POST'; --- 223,246 ---- } ! // (4.7.3) Ensure that for each question in the quiz, $RawAns exists. foreach ($quizInst as $key => $q) { $RawAns[] = ''; } ! // (4.7.4) Get the list of answers from $_POST if (array_key_exists('RawAns',$_POST) ){ foreach ($_POST['RawAns'] as $key => $q) { $RawAns[$key] = $q; ! } } } ! // (4.8) Mark just one question in the quiz. if ('mark_question' == $action) { // This is a bit of a HACK! We need to get the number into $_POST, ! // And the javascript function takeaction('mark_question',no) inserts into quizid, so ..... ! if (array_key_exists('quizid',$_POST) ){ ! $q_no=$_POST['quizid']; } else { $errors['questionno'] = 'Could not get question number from $_POST'; *************** *** 283,287 **** } ! // (2.8) Process responses. This requires a focus/unfocus top-level split if ( 'new_quiz_version' != $action and 'continue_quiz' != $action --- 248,252 ---- } ! // (4.9) Process responses. This requires a focus/unfocus top-level split if ( 'new_quiz_version' != $action and 'continue_quiz' != $action *************** *** 291,295 **** if ($focus) { ! // (2.8.focus) Process one question in the quiz, and don't loose new answers. $key = $focus_on; --- 256,260 ---- if ($focus) { ! // (4.10.focus) Process one question in the quiz, and don't loose new answers. $key = $focus_on; *************** *** 433,439 **** // (2.9.1) record the fact we have asked for solutions if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_seensol($quiz['quizID'],$user['id'],$quiz['seed']); } ! $quizID = $quiz['quizID']; // (2.9.2) make sure we mark the last non-empty different attempt. --- 398,404 ---- // (2.9.1) record the fact we have asked for solutions if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_seensol($quiz['quizid'],$user['id'],$quiz['seed']); } ! $quizid = $quiz['quizid']; // (2.9.2) make sure we mark the last non-empty different attempt. *************** *** 599,603 **** // (1) Pose the question ! echo '<p>'.$qInst['questionStemInst'].'</p>'; if (array_key_exists('errors',$qInst)) { --- 564,568 ---- // (1) Pose the question ! stack_question_inst_displayq($qInst); if (array_key_exists('errors',$qInst)) { *************** *** 648,652 **** echo "\n<a name ='quizend'><hr /></a>\n\n"; echo "<input type='hidden' name='action' value='' />\n ! <input type='hidden' name='quizID' value='-1' /> <input type='hidden' name='questionno' value='' />\n </form>\n\n\n"; // form in which questions are entered. --- 613,617 ---- echo "\n<a name ='quizend'><hr /></a>\n\n"; echo "<input type='hidden' name='action' value='' />\n ! <input type='hidden' name='quizid' value='-1' /> <input type='hidden' name='questionno' value='' />\n </form>\n\n\n"; // form in which questions are entered. *************** *** 673,677 **** if (('mark' == $action or 'mark_question' == $action) and '0' != $user['id']) { ! stack_db_quiz_quizattempt_updatemark($quiz['quizID'],$user['id'],$quiz['seed'],$totm,$tot); } --- 638,642 ---- if (('mark' == $action or 'mark_question' == $action) and '0' != $user['id']) { ! stack_db_quiz_quizattempt_updatemark($quiz['quizid'],$user['id'],$quiz['seed'],$totm,$tot); } *************** *** 680,684 **** 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 { *************** *** 697,705 **** <td>".get_string('SolutionsExplain','stack','')."</td></tr>\n <tr><td></td><td>".get_string('SolutionsExplain2','stack','')."</td></tr> ! <tr><td nowrap='nowrap'><a href=\"javascript:takeaction('new_quiz_version',$quizID);\">".get_string('NewVersion','stack','')."</a></td> <td>".get_string('NewVersionExplain','stack','')."</td></tr>"; 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>"; --- 662,670 ---- <td>".get_string('SolutionsExplain','stack','')."</td></tr>\n <tr><td></td><td>".get_string('SolutionsExplain2','stack','')."</td></tr> ! <tr><td nowrap='nowrap'><a href=\"javascript:takeaction('new_quiz_version',$quizid);\">".get_string('NewVersion','stack','')."</a></td> <td>".get_string('NewVersionExplain','stack','')."</td></tr>"; 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>"; --- update_info.php DELETED --- Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** question_bank.php 10 Jun 2005 20:23:56 -0000 1.3 --- question_bank.php 20 Jun 2005 15:42:52 -0000 1.4 *************** *** 16,24 **** * @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 --- 16,25 ---- * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... + * @author Juliette White jv...@jv... * ! * This file contains the front end logic for the question bank ! * TO DO: Some of the code in this file needs to be factored out into separate ! * algorithms- ideally we should have a function for each action on entry and ! * for display. * @package frontend * @subpackage Stack *************** *** 28,36 **** // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! include('process_input.php'); include('html/trypopupform.html'); include('html/helpform.php'); include('html/javascripthead.html'); include('html/inputtool.html'); $question = ''; --- 29,42 ---- // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! session_start(); ! include('stackstd.php'); ! $default_action = 'questionbank_screen'; ! include($stack_root.'/frontend_general/process_input.php'); include('html/trypopupform.html'); include('html/helpform.php'); 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 = ''; *************** *** 40,484 **** $RawAns = ''; ! //////////////////////////////////////////////// ! // (1) Decide what we are trying to do. ! //////////////////////////////////////////////// ! ! // 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. ! // action = startover Begin again. - if (isset($_POST['action'])) - {$action=$_POST['action'];} - else if (isset($_GET['action'])) - {$action=$_GET['action'];} - else - {$action='startover';} ! include('html/pagehead.php'); ! // (2.1) edit, try or store. ! // There should be a question in the $POST or $SESSION ! if ('edit' == $action 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) { ! // 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']); ! } ! // Get any $questionInst from the current $_SESSION ! if (array_key_exists('questionInst',$_SESSION)) { ! $questionInst=$_SESSION['questionInst']; ! unset($_SESSION['questionInst']); } - - // 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]; - } - } - } - - } - // End (2.1) - - // (2.2) Get a question from the database. - if ('edit_from_db'==$action or 'try_from_db'==$action or 'export_xml_db'==$action) { - $questionID = $_POST['questionID']; - $question=stack_db_getquestion($questionID); } - // End (2.2) ! // (2.3) Provide a minimal blank question ! if ('start_new' == $action) { ! $question['questionID']='0'; ! $question['questionAnsKey']='ans1'; } ! // End (2.3) ! ! // (2.4) Uploaded file. ! if ('upload_xml_file' == $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']; ! ! 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>"; ! $action = 'startover'; ! } else { ! $error['upload_xml_file']='<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; } - - } - } } ! // End (2.4) ! ! // (2.5) Export a whole list of questions. ! 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) { ! echo "<p>Could not get any ticked questions! Please try again.</p>"; ! $action = 'startover'; ! } ! } ! // (2.6) Filter questions in the question bank, based upon a regular expression. ! if (array_key_exists('bank_filter',$_POST)) { ! $question_bank_filter = trim($_POST['bank_filter']); ! } else { ! $question_bank_filter = ''; } ! ! // (2.7) action = edit_metadata ! if ('edit_metadata' == $action ) { ! if ( 'admin' != $user['username'] ) { ! 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 ! if (array_key_exists('edit_metadata',$_POST)) { ! $edit_metadata = $_POST['edit_metadata']; ! if (is_array($edit_metadata)) { ! stack_db_edit_metadata($edit_metadata); } - } - } - } // END (2.7) - - ////////////////////////////////////////////////// - // (3) Now we have a $question, set up the context - ////////////////////////////////////////////////// - - // Change 'edit_from_db' to 'edit'. We are done here. - if ('edit_from_db'==$action) { - $action='edit'; - } - - // Delete a $question - if ('delete_from_db' == $action) { - $questionID = $_POST['questionID']; - if ('admin'==$user['username']) { - stack_db_dropquestion($questionID); } ! $action = 'startover'; ! } ! ! // Change the $questionInst, to a $question ! if ('new_version' == $action) { ! ! foreach ($stackQuestion as $qfield => $val) ! { ! if (array_key_exists($qfield,$questionInst)) ! { ! $question[$qfield] = $questionInst[$qfield]; ! } ! } ! unset($questionInst); ! ! $action = 'try'; ! } ! ! ! // These branches need the question to be validated ! if ('edit' == $action or 'try_from_db' == $action or 'try'==$action or 'export_xml_db'==$action or 'export_xml'==$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 = 'startover'; ! } ! if ('store_new_db' == $action) { ! stack_db_addquestion($question,TRUE); ! $action = 'startover'; } - // Have the questions been marked? - if ('mark' == $action or 'validate' == $action) { ! if (array_key_exists('RawAns',$_POST) ){ ! $RawAns=$_POST['RawAns']; ! } ! else { ! $error['RawAns'] = '<font color="red">You have not entered an answer!</font>'; } ! } ! // If we have just taken a question from the db, we need to instantiate it. ! if ('try_from_db'==$action) { ! if (''==$errors) { ! $action='validate'; ! if (array_key_exists('seed',$_POST)) { ! $seed=$_POST['seed']; ! } else { ! // HACK: this should involve the concept of a user! ! $seed = time(); ! } $questionInst = stack_question_inst($question,$seed,$options,$errors); - // For the purposes of this test, fill in the correct answer - // Which must exist! - // $RawAns = $questionInst['questionAnsInst']['value']; ! if (array_key_exists('RawAns',$_POST)) { ! $RawAns=$_POST['RawAns']; ! } ! if (''!=$errors) { ! $action='edit'; } - - } - else { - echo "Could not instantiate the question, because of errors. - <br />Try to edit the question instead."; - $action='edit'; - } - } - - // If we have just taken a question from the edit from, we need to instantiate it. - if ('try'==$action) { - if (''==$errors) { - $action='mark'; - $seed = time(); // HACK: this should involve the concept of a user! - $questionInst = stack_question_inst($question,$seed,$options,$errors); - // For the purposes of this test, fill in the correct answer - // Which must exist! - $RawAns = $questionInst['questionAnsInst']['value']; } if (''!=$errors) { $action='edit'; - echo '<p>Could not instantiate the question, because of errors. - <br />Try to edit the question instead.</p>'; - //show_array($errors); } - } ! ! // Now deal with a student's answer if ('mark'==$action or 'validate'==$action) { ! $this_attempt = stack_question_inst_mark($questionInst,$options,$RawAns,$errors); ! $this_attempt['Action']=$action; ! stack_question_add_attempt($questionInst,$this_attempt,$errors); ! ! } ! ! //////////////////////////////////////////////// ! // (4) Go somewhere next. ! //////////////////////////////////////////////// ! ! // include javascript and form (all pages) ! include("{$stack_root}/html/qselectform.php"); ! ! ! // (4.1) Starting ! ! if ('edit_metadata'==$action) ! { ! session_unregister('question'); ! session_unregister('questionInst'); ! ! $options = ''; ! ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! } ! if ('startover'==$action) ! { session_unregister('question'); session_unregister('questionInst'); - - $options = ''; - - if ('admin'==$user['username']) { - stack_db_listquestions('edit',$question_bank_filter); - echo "<p><a href=\"javascript:SelectQ('','upload_xml_file');\">Import questions in XML format</a></p>"; - - } else { - stack_db_listquestions('try',$question_bank_filter); - } - - echo "<p><a href=\"javascript:SelectQ('','start_new');\">Author a new question</a> "; - 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> "; - } - //(4.2) Edit questions - if ('edit' == $action or 'start_new'==$action) - {// Edit the $question - include_once("{$stack_root}/scripts/stackAuthor.php"); - - //show_array($errors); - //show_array($question); - //echo stack_question_errstr($errors); - - 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>"; - - } - - //(4.3) Try the questions - if ('mark' == $action or 'validate' == $action) { - - $_SESSION['questionInst'] = $questionInst; - $_SESSION['question'] = $questionInst; - - echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> - <td align='left'> - - <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); - echo ")</td><td align='right'>"; - echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; - - - //show_array($questionInst); - stack_question_inst_try_test($questionInst,$this_attempt,$options,$errors); - - //stack_question_inst_try($questionInst,$this_attempt,$options,$errors); - //stack_question_inst_show_sol($questionInst,$errors); - - } - - if ('export_xml_db' == $action or 'export_xml' == $action) { - include_once("{$stack_root}/scripts/stackXML.php"); - - $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>"; - } - - if ('export_xml_list'==$action) { - include_once("{$stack_root}/scripts/stackXML.php"); - - $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>"; - } - - if ('upload_xml_file' == $action) { - echo nsf($errors,'upload_xml_file'); - - $PostTo=$_PHP_SELF; - echo "Select a file to upload and edit: - <br /> - <form enctype='multipart/form-data' action='$_PHP_SELF' 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'); - ?> --- 46,333 ---- $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 Present a form to add file name to upload. ! // uploaded_xml 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']) { ! $admin = TRUE; ! } ! ! $new_question = FALSE; ! if ('edit_new' == $action) { ! $new_question = TRUE; ! $action = 'edit'; ! } ! $database = FALSE; ! if ('edit_from_db'==$action or 'preview_from_db'==$action or 'export_xml_db'==$action) { ! $database = TRUE; ! } ! ! if ('edit_from_db' == $action or 'edit_new' == $action) { ! $action = 'edit'; ! } ! ! if ('preview_from_db' == $action) { ! $action = 'preview'; ! } ! ! if ('export_xml_db' == $action) { ! $action = 'export_xml'; ! } ! ! $get_question = FALSE; ! if ('edit' == $action ! or 'mark' == $action ! or 'validate' == $action ! or 'save' == $action ! or 'save_as' == $action ! or 'preview' == $action ! or 'new_version' == $action ! or 'export_xml' == $action) { ! $get_question = TRUE; ! $source = 'default'; ! if ($database) { ! $source = 'database'; ! } else if ($new_question) { ! $source = 'new'; } } ! // 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. This is not needed by all actions, but it is harmless to set it. ! $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; ! } ! } } } ! ! if ('export_xml' == $action) { ! include_once("{$stack_root}/scripts/stackXML.php"); ! stack_question_validate($question,$errors); ! $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); ! $questions_to_export = TRUE; } ! if ('export_xml_list' == $action) { ! include_once("{$stack_root}/scripts/stackXML.php"); ! $questions_to_export = stack_get_selected_questions(); ! $name = ''; ! if (NULL !== $questions_to_export) { ! $name = stack_xml_write_quiz_file($questions_to_export, "{$stack_root}/tmp/"); ! } ! $action = 'export_xml'; } ! ! ! if ('edit_metadata' == $action ) { ! if ($admin) { ! // 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); ! } } } ! } ! ! 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': ! if (!$new_question) { ! stack_question_validate($question,$errors); ! } ! break; } ! ! ////////////////////////////////////////////////////////////// ! // (3) Print the page. ! ////////////////////////////////////////////////////////////// ! include('html/pagehead.php'); ! ! switch ($action) { ! case 'uploaded_xml': ! if ($upload_successful) { ! stack_display_qb_show_imported($quiz); ! } else { ! echo '<p>Could not extract a question or quiz from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ! $action = 'questionbank_screen'; ! break; ! case 'import': ! stack_display_qb_import($errors); ! break; ! case 'export_xml': ! if (NULL == $questions_to_export) { ! echo "<p>Could not get any ticked questions! Please try again.</p>"; ! } else { ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; ! } ! $action = 'questionbank_screen'; ! break; ! case 'edit_metadata': ! if (!$admin) { ! print_string('qp_notadmin','stack'); ! } ! stack_display_qb_edit_metadata($question_bank_filter); ! break; } ! // Preview a new version of the quiz. ! if ('new_version' == $action) { ! foreach ($stackQuestion as $qfield => $val) { ! if (array_key_exists($qfield,$questionInst)) { ! $question[$qfield] = $questionInst[$qfield]; ! } ! } ! unset($questionInst); ! $action = 'preview'; ! } ! if ('mark' == $action or 'validate' == $action) { ! if (array_key_exists('RawAns',$_POST) ){ ! $RawAns=$_POST['RawAns']; ! } else { ! $error['RawAns'] = '<font color="red">You have not entered an answer!</font>'; } ! } ! ! if ('preview'==$action) { + stack_question_validate($question,$errors); + + if ('' == $errors) { + if ($database) { + $action = 'validate'; + } else { + $action = 'mark'; + } + + $seed = stack_get_seed(); + $options = stack_options_set($question); $questionInst = stack_question_inst($question,$seed,$options,$errors); ! // For the purposes of this test, fill in the correct answer ! if ($database) { ! if (array_key_exists('RawAns',$_POST)) { ! $RawAns=$_POST['RawAns']; ! } ! } else { ! $RawAns = $questionInst['questionAnsInst']['value']; } } if (''!=$errors) { + echo '<p>Could not instantiate the question, because of errors.<br />Try to edit the question instead.</p>'; $action='edit'; } } ! ! ! // Now deal with the answer if ('mark'==$action or 'validate'==$action) { ! $this_attempt = stack_question_inst_mark($questionInst,$options,$RawAns,$errors); ! $this_attempt['Action'] = $action; ! stack_question_add_attempt($questionInst,$this_attempt,$errors); ! $_SESSION['questionInst'] = $questionInst; ! $_SESSION['question'] = $questionInst; ! // CJS We should display the question as the student should see it. Hence not ! //stack_display_qb_preview($questionInst); ! // But instead ! ! stack_question_inst_try_test($questionInst,$this_attempt,$options,$errors); ! } + + switch ($action) { + case 'questionbank_screen': + stack_display_qb_main($admin, $question_bank_filter); + break; + case 'edit': + if (!$admin) { + print_string('qp_notadmin','stack'); + } + stack_display_qb_edit($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'); } ?> Index: chat.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/chat.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** chat.php 10 Jun 2005 18:40:24 -0000 1.8 --- chat.php 20 Jun 2005 15:42:52 -0000 1.9 *************** *** 13,51 **** */ session_start(); require_once("other/ListMenu.php"); - require_once("stackstd.php"); - - - //////////////////////////////////////////////// - // (1) Establish user - //////////////////////////////////////////////// - // (2.0) Try to establish the user. - if (array_key_exists('user',$_SESSION)) { - $user = $_SESSION['user']; - } - - - // Deal with slahes in input - if (get_magic_quotes_gpc()) { - /** - * Automatically removes slashes deeply from arrays. - * - * @param $value incoming array. - * @return $value the array with slashed removed. - */ - function stripslashes_deep($value) - { - $value = is_array($value) ? - array_map('stripslashes_deep', $value) : - stripslashes($value); - - return $value; - } - - $_POST = array_map('stripslashes_deep', $_POST); - $_GET = array_map('stripslashes_deep', $_GET); - $_COOKIE = array_map('stripslashes_deep', $_COOKIE); - } $options['Display']='LaTeX'; --- 13,22 ---- */ session_start(); + require_once("stackstd.php"); + include('stackstd.php'); + $default_action = ''; + include($stack_root.'/frontend_general/process_input.php'); require_once("other/ListMenu.php"); $options['Display']='LaTeX'; --- select_quiz.php DELETED --- Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** editquiz.php 12 Jun 2005 07:47:06 -0000 1.10 --- editquiz.php 20 Jun 2005 15:42:52 -0000 1.11 *************** *** 2,16 **** /** * ! * This file contains the logic of interactions with the site as ! * an editor of quizzes. * * @package frontend * @subpackage Stack */ session_start(); require_once("other/ListMenu.php"); require_once("stackstd.php"); require_once("{$stack_root}/html/trypopupform.html"); require_once("{$stack_root}/html/helpform.php"); require_once("{$stack_root}/html/quizjava.html"); --- 2,37 ---- /** * ! * Welcome to STACK. A system for teaching and assessment using a ! * computer algebra kernel. ! * <br> ! * This file is licensed under the GPL License. ! * <br> ! * A copy of the license is in your STACK distribution called ! * license.txt. If you are missing this file you can obtain ! * it from: ! * http://www.stack.bham.ac.uk/license.txt ! * <br> ! * Copyright (c) 2005, Christopher James Sangwin ! * ! * @author Chris Sangwin C.J...@bh... ! * @author Laura Naismith L.N...@bh... ! * @author Juliette White jv...@jv... * + * + * This file contains the front end logic for the quiz editting + * TO DO: Some of the code in this file needs to be factored out into separate + * algorithms- ideally we should have a function for each action on entry and + * for display. * @package frontend * @subpackage Stack */ + session_start(); + require_once("other/ListMenu.php"); require_once("stackstd.php"); 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"); *************** *** 21,196 **** // (1) Process Input - this sets $action, $user and $username /////////////////////////////////////////////////////////////// ! include('process_in... [truncated message content] |
From: Chris S. <san...@us...> - 2005-06-20 15:43:08
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/frontend_general Added Files: edit_quiz_util.php editquiz_display.php front_end_display.php frontend_util.php loginregister.php process_input.php qb_display.php question_bank_util.php Log Message: Major changes to the font end. Attempt 1. --- NEW FILE: editquiz_display.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... * @author Juliette White jv...@jv... * @package Stack * * This file contains display functions used by edit_quiz.php */ /* * Displays the list of quizzes for the admin to edit * @param array $quizstore The store of quizzes * @param string $PostTo The page that the info from the form should be posted to * @return void */ function stack_display_editquiz_select($quiz_store, $PostTo) { global $stackQuiz,$stack_web_url; if (is_array($quiz_store)) { echo "<p>\n<form name='quiztryform' action='{$stack_web_url}quiz.php' method='POST'> <input type='hidden' name='quizid' value='-1' /> <input type='hidden' name='action' value='quiz_choose' /></form>"; 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>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; echo "<td><a href=\"javascript:quiztry('continue_quiz','$qID');\">try</a></td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_xml','$qID');\">xml</a></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></form>"; } else { stack_display_editquiz_no_quizzes($PostTo); } } /* * Displays a message saying that are no quizzes to edit * @param string $PostTo The page that the info from the form should be posted to * @return void */ function stack_display_editquiz_no_quizzes($PostTo) { 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' />"; } /* * Displays the page for adding questions to a quiz * @param string $PostTo The page that the info from the form should be posted to * @param int $quizid The id of the quiz to add the questions to * @param array $question_bank_filter The question bank filter to apply * @return void */ function stack_display_editquiz_add_questions($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='$quizid'>"; 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"; } /* * Displays the page for editting a quiz * @param array $quiz The quiz to edit * @param array $errors The errors string * @param string $PostTo The page that the info from the form should be posted to * @return void */ function stack_display_editquiz_edit($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'>"; } /* * Displays any quiz editting erros * @param array $errors The errors string * @return void */ function stack_display_editquiz_error($errors) { echo "<font color=\"red\">"; show_array($errors); echo "</font>"; } /* * Displays a message saying that the user is not the admin so cannot edit quizzes * @param array $user The user * @return void */ function stack_display_editquiz_error_not_admin($user) { echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; } ?> --- NEW FILE: front_end_display.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... * @author Juliette White jv...@jv... * @package Stack * * This file contains dispaly functions used by index.php */ /* * Displays the login screen * @param string $username * @param string $errun * @param string $errps * @return void */ function stack_display_main_login($username, $errun, $errps) { echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; 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="index.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>'; } /* * Displays the update user info form * @param array $username * @param string $err * @param array $errors * @return void */ function stack_display_main_update_userinfo($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"index.php?\" method=\"post\" name=\"register\" id=\"register\">"; 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>'; } /* * Displays the registration screen * @param string $username * @param array $user * @param array $errors * @param string $err * @return void */ function stack_display_main_register($username, $user, $errors, $err) { echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; 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>'; } ?> --- NEW FILE: process_input.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... * @author Juliette White jv...@jv... * * * This file contains the common code used to process the input for pages in the * frontend code. * * @package frontend * @subpackage Stack */ $errors = ''; $user = ''; if (get_magic_quotes_gpc()) { /** * Automatically removes slashes deeply from arrays. * * @param $value incoming array. * @return $value the array with slashed removed. */ function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } // The expand variable is needed so that when you move to a next page, the // menu is created with the right part of the menu expanded. /* if (array_key_exists('expand',$_GET)) { $expand = $_GET['expand']; } else { // This is our first visit to the page. $expand = 0; } */ $action = $default_action; if (array_key_exists('action',$_GET)) { $action = $_GET['action']; } if (array_key_exists('action',$_POST)) { $action = $_POST['action']; } // Establish the user - we always need this to print the header as well as // for other purposes depending on the file. // (2.0) Try to establish the user. if (array_key_exists('user',$_SESSION)) { $user = $_SESSION['user']; $username = $user['username']; } else { // Make sure the user is logged in as a Guest. // Is a blank user a guest user??? // CJS: no. A blank user is not a guest user. See stackUser.php, where these are defined. include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } $username = stack_user_get_name($user); ?> --- NEW FILE: edit_quiz_util.php --- <?php /* * Gets the question bank filter * @param string $source - Must be 'post' or 'session' * @return array $question_bank_filter */ function stack_get_qb_filter($source) { if ('post' == $source) { $question_bank_filter = nsf($_POST, 'bank_filter'); } else if ('session' == $source) { $question_bank_filter = nsf($_SESSION, 'bank_filter'); } return $question_bank_filter; } /* * Sets the session question bank field * @param array $question_bank_filter * @return void */ function stack_set_qb_filter_in_session($question_bank_filter) { $_SESSION['bank_filter'] = $question_bank_filter; } // $quizid only set if $sourc eis 'database' /* * Gets the quiz * @param string $source - Must be 'post' or 'database' * @param int $quizid This is only set if the $source is 'database', is set * to the quiz id * @return array $quiz */ function stack_get_quiz($source, $quizid) { if ('post' == $source) { $quiz = nsf($_POST, 'quiz'); } else if ('database' == $source) { $quiz = stack_db_quiz_get($quizid); } return $quiz; } /* * Gets the quiz id * @param string $source - Must be 'post', 'database' or 'quiz' * @param int $quiz This is only set if the $source is 'quiz', is set * to the quiz to get the quiz id from * @return array $quiz */ function stack_get_quizid($source, $quiz) { $quizid = ''; if ('quiz' == $source) { $quizid = nsf($quiz,'quizid'); } else if ('database' == $source) { $quizid = stack_db_quiz_update(array()); } else if ('post' == $source) { $quizid = nsf($_POST, 'quizid'); } return $quizid; } ?> --- NEW FILE: frontend_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... * @author Juliette White jv...@jv... * * * This file contains utility functions used by the front end code * TO DO: Some of these functions needs to be consolidated with the functions * in the other utility files. * @package frontend * @subpackage Stack */ // ********************************************************** // General user related functions // ********************************************************** /* * Returns the username associated with a user * @param array $user, The user * @return string $username The username */ function stack_user_get_name($user) { return nsf('username',$user); } /* * @param array $err * @return string */ function stack_get_errun($err) { return nsf($err,'username'); } /* * @param array $err, The user * @return string */ function stack_get_errps($err){ return nsf($err,'password'); } /* * Returns TRUE if the user is the admin user, FALSE otherwise * @param array $errors, The errors array * @return string $err */ function stack_get_err2($errors) { $err = ''; if (is_array($errors)) { if (array_key_exists('user',$errors)) { $err = $errors['user']; } } return $err; } /* * Returns TRUE if the user is logged in, FALSE otherwise * @param $user, The user * @return bool */ function stack_is_logged_in($user) { if ($user['loggedin']) { return TRUE; } else { return FALSE; } } /* * Returns TRUE if the user is the guest user, FALSE otherwise * @param $user, The user * @return bool */ function stack_user_is_guest($user) { if ('guest' == $user['username']) { return TRUE; } else { return FALSE; } } /* * Returns TRUE if the user is the admin user, FALSE otherwise * @param $user, The user * @return bool */ function stack_user_is_admin($user) { if ('admin' == $user['username']) { return TRUE; } else { return FALSE; } } /* * Gets the questionbank filter if this has been set. * TO DO: This also sets $SESSION['bank_filter']. This should really * be in a separate function. Also should have a $source parameter * @return array question_bank_filter The Question Bank Filter */ 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; } ?> --- NEW FILE: qb_display.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... * @author Juliette White jv...@jv... * * @package Stack * * This file contains display functions used by question_bank.php */ /* * Displays the main question bank page * @param bool $admin TRUE if the user is the admin user, FALSE otherwise * @param array $question_bank_filter The question bank filter * @return void */ function stack_display_qb_main($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> "; } /* * Displays the form for editting a question * @param array $question The question to edit * @param array $errors The question bank filter * @return void */ function stack_display_qb_edit($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','author_questionfields');\">Help with question fields.</a>\n <a href=\"javascript:HelpPopup('all','author_options');\">Help with options.</a>\n <a href=\"javascript:HelpPopup('all','author_answertest');\">Help with answer tests.</a>\n <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; } /* * Displays the edit metadate form * @param array $question_bank_filter The question bank filter to apply * @return void */ function stack_display_qb_edit_metadata($question_bank_filter) { global $stack_root; include("{$stack_root}/html/qselectform.php"); stack_db_listquestions('edit_metadata',$question_bank_filter); echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } /* * Displays the form for importing a file * @return void */ function stack_display_qb_import($errors) { echo nsf($errors,'import'); 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"; } /* * Displays the imported questions * @param array $quiz The imported quiz * @return void */ function stack_display_qb_show_imported($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>"; echo "</tr></tbody></table>\n\n"; echo stack_question_errstr($errs[$key]); echo "\n\n<table><thead><tr>"; echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; echo '</tr></thead><tbody>'; } else { echo "<td><font color=\"greed\">Valid question</font></td>"; } echo "</tr>\n"; } echo "</tbody></table>\n"; echo "<h2>Current database of questions</h2>"; } /* * Displays the preview of a question * @return void */ function stack_display_qb_preview($questionInst) { echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> <td align='left'> <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); echo ")</td><td align='right'>"; echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; } ?> --- NEW FILE: loginregister.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... * @author Juliette White jv...@jv... * * This file contains a script called by index.php * TO DO: This code should really be factored out into functions and the logic * returned to question_bank.php * * @package frontend * @subpackage Stack */ // Log user into STACK if ('login' == $action) { if (array_key_exists('username',$_POST)) { $username = $_POST['username']; $password = $_POST['password']; $user = stack_user_login($username,$password,$errors); if ($user['loggedin']) { $action = 'welcome'; } } else { $action = 'error'; $error = "No username was specified"; } } // Register as a new user if ('register' == $action) { if (array_key_exists('user',$_POST)) { // We have an incoming form with new user information $user = $_POST['user']; if (stack_db_user_get($user['username'])) { $action = 'error'; $errors['user']['username'] = '<font color="red">Username "'.$user['username'].'" already exists.</font>'; $error = $errors['user']['username']; } else { stack_user_information_validate($user,$errors); if (!nsf($errors,'user')) { if ('' != trim($user['password'])) { $user['id'] = stack_db_user_store($user); $user['loggedin'] = TRUE; $action = 'welcome'; } else { $errors['user']['password'] = '<font color="red">Password must be non-empty.</font>'; $action = 'error'; $error = $errors['user']['password']; } } } } } // Update user info if ('userupdate' == $action and $user['loggedin']) { if (array_key_exists('user',$_POST)) { // We have an incoming form with new user information // Merge posted info with new infor foreach ($_POST['user'] as $key => $val) { $user[$key] = $val; } stack_user_information_validate($user,$errors); if (!nsf($errors,'user')) { if ('' != trim($user['password'])) { $user = stack_db_user_update($user); } else { $errors['user']['password'] = '<font color="red">Password must be non-empty.</font>'; $error = $errors['user']['password']; $action = 'error'; } } } } $_SESSION['user'] = $user; ?> --- 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... * @author Juliette White jv...@jv... * * This file contains utility functions used by question_bank.php * TO DO: Some of these functions needs to be consolidated with the functions * in the other utility files. * @package frontend * @subpackage Stack */ /* * Gets the question that has been stored in the session * @return array $question Quiz question */ 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; } /* * Gets the question instance that has been stored in the session * @return array $questionInst Quiz question instance */ 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; } /* * Gets the question instance that has been stored in $_POST * @return array $questionInst Quiz question */ function stack_get_question_from_post() { global $stackQuestion; $question = NULL; 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; } /* * Gets the question instance that has been stored in $_POST * @param string $source. Must be 'database', 'new' or 'default' * @return array $questionInst Quiz question */ 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(); if (array_key_exists('questionID',$_POST)) { $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; } /* * Gets the selected questions * @return array $quiz The questions selected */ 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; } /* * Gets the seed variable that should be used * @return array $seed The seed variable */ function stack_get_seed() { if (array_key_exists('seed',$_POST)) { $seed=$_POST['seed']; } else { // HACK: this should involve the concept of a user! $seed = time(); } return $seed; } ?> |
From: Chris S. <san...@us...> - 2005-06-20 15:43:08
|
Update of /cvsroot/stack/stack-1-0/lang/es In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/lang/es Added Files: stack.php Log Message: Major changes to the font end. Attempt 1. --- NEW FILE: stack.php --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/stack/stack-1-0/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/doc Added Files: about_develop.php about_general.php about_install.php author_answertest.php author_commonsyntax.php author_faq.php author_gettingstarted.php author_maxima.php author_options.php author_potresp.php author_questionfields.php help_popup.php student_assessmentmode.php student_forbidden.php student_input.php student_overview.php student_practicemode.php student_understandingoutput.php Removed Files: Rosetta.pdf aboutSTACK.php author.php develop.php en_doc.php help.html help.php helpform.html index.php install.php stackAnswerTest.php stackCommonSyntax.php stackHelp.php stackOptions.php stackQuestion.php stackQuestionPotResp.php stackcvs.png testsuite.php todo.php Log Message: Major changes to the font end. Attempt 1. --- stackHelp.php DELETED --- --- NEW FILE: student_forbidden.php --- <a name="forbid"><h2>Forbidden words</h2></a> Suppose that Stack asked you to calculate sin(<font face="SYMBOL">p</font>/4) (for which the answer is of course 2<sup>-1/2</sup>). One cunning plan that might occur to you would be to just enter <tt><font color="GREEN">sin(pi/4)</font></tt> as your answer, leaving the CAS to do all the real work. If this worked, it would remove the whole point, so Stack prevents it. For each question, there are certain "forbidden words" that you are not allowed to use as part of your answer; in the example above, the word "sin" would be forbidden. If you give an answer involving a forbidden word, Stack will tell you, and you will be able to go back and change it without any penalty. --- NEW FILE: author_faq.php --- <?php /** * An authoring guide for STACK questions. * * @package documentation * @subpackage Stack */ ?> <h1><a name="FAQ">Frequently Asked Questions</a></h1> <?php $faqs = array(); $faq['title'] = 'What is LaTeX? Were can I get help learning LaTeX?'; $faq['answer']= '<p>LaTeX is a document preparation system. For STACK questions we only need some simple LaTeX, so please do not be put off. Details about LaTeX are available from <a href="http://www.latex-project.org/guides/">http://www.latex-project.org/guides/</a>. </p> <p>Perhaps a better introduction for those totally new to LaTeX is found <a href="http://www.comp.leeds.ac.uk/andyr/misc/latex/">here</a> with more specific information about <a href="http://www.comp.leeds.ac.uk/andyr/misc/latex/latextutorial9.html">mathematics</a> with examples for you to follow. Note that some of the more complex examples will not work on STACK. Just keep things simple.</p> <p>Another option is <a href="http://www.dessci.com/en/products/texaide/">TeXaide</a>.'; $latexex = array( "x^2", "x_n", "x^{2x}", "\alpha\beta", "\sin(3\pi x)", "\frac{1}{1-n^2}", "\int_a^b x^2\ dx"); $latexstr = '\begin{tabular}{c|c|c} \LaTeX Fragment, ex & \verb#$ex$# & \verb#\\[ ex \\]# \\\\ '."\n"; foreach ($latexex as $key) { $latexstr .= ' \verb# '.$key.' # & $ '.$key.' $ & \\[ '.$key.' \\] \\\\ \hline'."\n"; } $latexstr .= '\end{tabular}'; $latexstr = stack_latex_to_html($latexstr); $faq['answer'] .= "<p>Here are some simple examples</p>$latexstr"; $faqs[] = $faq; $faq['title'] = 'Can I add HTML to CAS-enabled text?'; $faq['answer']= 'Yes: in your CAS-enabled text, anything contained between two tags <tt>< html> stuff < html></tt> structures is kept as HTML and not passed through the LaTeX to HTML converter. You can use these tags to insert references to images etc.'; $faqs[] = $faq; $faq['title'] = 'Why does a Maxima function not work in STACK?'; $faq['answer']= '<p>Not all Maxima functions are enabled by STACK, for obvious security reasons. You can find a list of which functions STACK will allow on <a href="index.php?action=CAS&field=functions">this page</a>. This varies between different installations of STACK. See the next FAQ entry for more information on how to change the setting which generate this page.</p> <p>It may be that your function belongs to a library which STACK does not load by default. Do you need to use Maxima\'s <tt>load</tt> command to use it? If so, you will need to ask your system administrator or the developers to add a <tt>load</tt> command to the file <tt>stackmaxima.mac</tt> so that this library becomes available.</p> <p>You should also be aware that there are also a number of functions defined by STACK which are not standard Maxima functions. The command you need may well not be enabled since you should use one STACK provides instead. Details of these are available <a href="#syntax">here</a>.</p>'; $faqs[] = $faq; $faq['title'] = 'How can I change which Maxima functions STACK allows?'; $faq['answer']= '<p>This is a job for your system administrator, who can alter your installation by changing <pre> public_html/scripts/maxima/maximafun.php </pre> <em>It is not enough to just change this file!</em> You will also need to copy and re-run the script <pre> $stack_root/scripts/install/install.php </pre> as in the install process. This should not re-install the databases or wipe data, but at the end of the file will generate a number of temporary files to reflect your new settings. The most important of these for this purpose is <pre> $stack_logfiles/CASkeywords.php </pre></p>'; $faqs[] = $faq; echo "<ol>"; foreach ($faqs as $key => $faq) { echo " <li><a href=\"#fqa{$key}\">{$faq['title']}</a></li>\n"; } echo "</ol>\n\n"; foreach ($faqs as $key => $faq) { $keyno = $key+1; echo " <h3><a name=\"fqa{$key}\">{$keyno}. {$faq['title']}</a></h3>\n"; echo $faq['answer']; } ?> --- NEW FILE: help_popup.php --- <?php /** * Generates help files. * This file is used in the help popup windows, for individual fields. * * This is used by both the student and teacher. * * @package documentation * @subpackage Stack */ ?> <head> <title>Stack help!</title> <style type="text/css"> @import url(../html/stack.css); </style> <script type="text/javascript"> window.focus(); </script> <?php include('../stackstd.php'); // HACK for now. include('en_doc.php'); include("{$stack_root}/html/htmlstyle.html"); ?> </head> <body> <div id=main> <div id=SectionText> <?php $field = $_POST['field']; $variable = $_POST['variable']; if (array_key_exists('field',$_GET)) { $field = $_GET['field']; } if (array_key_exists('variable',$_GET)) { $variable = $_GET['variable']; } //show_array($_POST); //echo $variable; if ('student'==$field) { include('student_input.php'); } else if('all'==$field) { // Then we would like a lot of documentation. $filename=$variable.'.php'; include($filename); } else { if ('stackQuestion' == $variable) { $q_field = $stackQuestion[$field]; $fn = 'stackQuestion_'.$field;} else if ('stackOptions' == $variable) { $q_field = $stackOptions[$field]; $fn = 'stackOptions_'.$field; } else if ('stackQuestionPotResp' == $variable) { $q_field = $stackQuestionPotResp[$field]; $fn = 'stackQuestion_PR_'.$field; } $fd = get_string($fn,'stack',''); echo "<h3>$fd</h3>"; echo $q_field['doc']; echo "<p>"; echo "Name of field: <font color=orange><tt>$field</tt></font>. Type of field: <font color=orange><tt>{$q_field['type']}</tt></font>."; if (array_key_exists('required',$q_field)) { echo " Required: <font color=orange><tt>{$q_field['required']}</tt></font>."; } } ?> </div><br /></div></div></body></html> --- testsuite.php DELETED --- --- stackQuestionPotResp.php DELETED --- --- NEW FILE: author_commonsyntax.php --- <?php /** * Every CAS system is unique, and they all have different input * syntaxs. This file describes some aliases that STACK uses to * sort out some of these problems. * * @package documentation * @subpackage Stack */ ?> <h1>Common syntax, and STACK commands</h1> <p>Every CAS system is unique, and they all have different a syntax for doing the amazing complex tasks they are asked to perform. Each CAS system uses a slightly different syntax, details of which are given in the invaluable <a href="doc/dev/Rosetta.pdf">Rosetta.pdf</a>. This makes moving from one to the other a difficult task! Since many CAS systems allow a synonym (or alias) to be set up, adapting the function name is not an overwhelming task. Furthermore, the vast majority of tasks we need in single variable calculus and algebra CAA can be reduced to these tasks. So by adopting this common syntax more than expected can be achieved. </p> <p>This section contains details of basic functions, STACK specific functions and various ALIAS commands used by STACK to provide users of other CAS systems a more familiar command name. </p> <?php include($stack_root.'/scripts/maxima/stackfun.php'); function disp_cas($type){ global $stack_cmd; echo "<table>\n"; foreach ($stack_cmd as $fun => $vals) { if ($type == $vals['type']) { echo "<tr><td nowrap='nowrap' align='top'><b><a NAME=\"STACK_command_$fun\">$fun</a></b></td> <td nowrap='nowrap' align='top'>{$vals['syntax']}</tt></td> <td>{$vals['doc']}</td></tr>\n"; } } echo "</table>\n"; } ?> <h2>Numbers</h2> <?php disp_cas('num') ?> <h2>Sets, lists and matrices</h2> <p> Lists are entered using brackets, eg <tt>[1,2,3]</tt>. These are native to Maxima.</p> <p> Sets are implemented using the Maxima package <tt>nset</tt> which is automatically loaded by STACK. See the <a href="maximadocs/maxdoc/nset.html">specific documentation</a>. Note that, in addtion to Maxima's use of <tt>set(a1,a2,...,an)</tt> to construct a set with members <em>a1,a2,...,an</em>, STACK allows the use of curly braces: <tt>{a1,a2,...,an}.</tt> </p> <p> Matrices are a standard part of Maxima, and are entered using a syntax like <tt>matrix([1,2,3],[x^2,y^2,z^2]);</tt> </p> <p><em>Warning!</em> Maxima uses "." to signify matrix multiplication, eg <tt>A.B</tt> However, <tt>A*B</tt> is also defined as pointwise multiplication. <!--the <tt>vect</tt> packagefor vector and tensor functions re-defines this to be a <em>commutative</em>operator with strange consequences. Do not use "." for multiplication, use <tt>*</tt>instead.</p> --> With all these things, if the student needs to enter something as an answer, consider setting the optional <?php stack_doc_dispstackqfield('SyntaxHint','stackOptions'); ?> <h2>Trig and "calculator" functions</h2> <p>Basic "calculator" functions would use their "natural" names. The angular measure is always assumed to be <em>radians</em>. This is in keeping with the CAS, but probably not best suited for more elementary school assessment. Similarly <tt>log</tt> is a natural logarithm. </p> <table> <tr> <td> <b>Trig </br> </td> <td><tt>sin(x), cos(x), tan(x)</tt></td> <td> The angular measure is always assumed to be <em>radians</em>.</td> </tr> <tr> <td> <b>Hyperbolic </br> </td> <td><tt>sinh(x), cosh(x), tanh(x)</tt></td></tr> <tr> <td> <b>Logarithms </br> </td> <td><tt>log(x), exp(x)</tt></td> <td> Natural logarithms, and exponential function.</td></tr> </table> <h2>Algebra</h2> <?php disp_cas('algebra') ?> <h2>Calculus</h2> <?php disp_cas('calculus') ?> <h2>Random numbers</h2> <?php disp_cas('rand') ?> The syntax is as follows. <ol> <li>If <tt>x</tt> is an <em>integer</em> return an integer between 0 and <tt>x-1</tt>.</li> <li>If <tt>x</tt> is a <em>float</em> return a float in the range 0 to <tt>x</tt>. </li> <li>If <tt>x</tt> is a <em>list</em> return a randomly selected element.</li> <li>If <tt>x</tt> is a <em>matrix</em> then rand is applied to every element of this matrix, as above.</li> </ol> <p>For the purposes of learning and teaching, we do not need an algorithm which is statistically perfect. We are much more interested in simplicity, efficiency and reproducibility across platforms. Hence, we adopt a linear method.</p> <h2>Plots</h2> In STACK, the <tt>plot</tt> command has been defined to be a wrapper for Maxima's <tt>plot2d</tt> command. Try, for example the following. <pre>@plot(x^2,[x,-1,1])@</pre> To get many plots in one window, we need to define a list of functions, perhaps with Maxima's <a href='maximadocs/maxdoc/maxima_38.html#IDX948'>MAKELIST</a> command. <pre>@(p(k):=x^k,pl:makelist(p(k),k,1,5),plot(pl,[x,-1,1]))@</pre> --- install.php DELETED --- --- aboutSTACK.php DELETED --- --- NEW FILE: about_general.php --- <?php /** * A short blurb about what STACK is. * * @package documentation * @subpackage Stack */ ?> <p>The STACK system is a computer aided assessment package for mathematics.</p> <p>In computer aided assessment (CAA), there are two classes of <em>question types</em>. <ul> <li><em>Teacher-provided answer questions</em><br /> In these questions, a student makes a selection from, or interacts with, potential answers which the teacher has selected. Examples include multiple choice, multiple response and so on. </li> <li><em>Student-provided answer questions</em><br /> In these questions the student's answer contains the content. It is not a selection. Examples of these are numeric questions. </li> </ul> STACK concentrates on student-provided answers which are mathematical expressions. For example, a student might respond to a question with a polynomial or matrix. Essantially STACK asks for mathematical expressions and evaluates these using computer algebra. The prototype test is the following pseudo-code. <pre>If simplify(student_answer-teacher_answer) = 0 then mark = 1, else mark = 0. </pre> A CAS provides a library of functions with which to manipulate students' answers and generate outcomes such as providing feedback. Establishing algebraic equivalence with a correct answer is only one kind of manipluation which is possible. Using CAS can also help generate random yet structured problems, and corresponding worked solutions. <p>In STACK a lot of attention has been paid to allowing teachers to author and manage their own questions. You can try this for yourself by looking at the question bank demo, authoring guide and other options available here.</p> <!-- Please do not remove this public credit. CJS, June 2005 --> <p>This system is the brain child of <a href='email:ch...@sa...'>Chris Sangwin</a>.</p> --- stackcvs.png DELETED --- --- Rosetta.pdf DELETED --- --- NEW FILE: about_develop.php --- <?php /** * Details of how to Develop. * * @package documentation * @subpackage Stack */ ?> <h1>Developing STACK</h1> <p>This document is intended for people who wish to develop the code for STACK. Contributions are welcome, please contact the developers at <a href="http://sourceforge.net/projects/stack">sourceforge</a> for more information. <h3>History</h3> STACK has its roots in the AiM CAA system. The original motivation for the project, and core development is by <a href="mailto:ch...@sa...">Chris Sangwin</a>. If you are using STACK please do contact Chris, as it is always a pleasure to hear from users. <table cellpadding='2' border='1'> <tr><td>Nov 2004-April 2005</td><td>Stack 1.0</td><td>STACK project started as part of the Serving Mathematics in a Distributed e-Learning Environment project funded by JISC.</td></tr> <tr><td>Summer 2004</td><td>Previous work</td><td>Core original code written by <a href="mailto:ch...@sa...">Chris Sangwin</a> and Laura Naismith, at the Centre for Educational Technology and Distance Learning, at the University of Birmingham</td></tr> </table> <h2>Obtaining the STACK code</h2> STACK code is hosted on <a href="http://sourceforge.net/projects/stack">sourceforge</a>. The <a href="http://phpdoc.org/index.php">PHPDoc</a> auto-generated documentation is available <a href="api/">here</a>. <h2>Areas in which you can help</h2> Collaborators of all kinds are welcome to come and help out with this project. There are a number of areas in which you can contribute. For example: <UL> <li>Writing and contributing questions.</li> <li>Developing the front end - stand alone or in a VLE <li>Translations to non-English languages</li> <li>New question types and formats <li>New answer tests in Maxima's language. <li>Documentation and authoring guides.</li> </ul> <h2>Coding Guidelines</h2> <p>These have been copied and adapted from the <a href="http://moodle.org/">Moodle</a> coding guidelines and they are here to provide a goal for all code to strive to. It's true that some code falls short in a few areas, but it will all be fixed eventually. All new code definitely must adhere to these standards as closely as possible.</p> <h2>General Rules</h2> <ol class="normaltext"> <li class="spaced">All code files should use the .php extension.</li> <li class="spaced">All template files should use the .html extension.</li> <li class="spaced">All text files should use Unix-style text format (most text editors have this as an option).</li> <li class="spaced">All php tags must be 'full' tags like <font color="#339900"><?php ?></font> ... not 'short' tags like <font color="#339900"><? ?></font>. </li> <li class="spaced">All existing copyright notices must be retained. You can add your own if necessary.</li> <li class="spaced">Each file should include the main stackstd.php configuration file.</li> <li class="spaced">Each frontend file should check that the user is authenticated correctly.</li> <li class="spaced">All variables should be initialised or at least tested for existence using isset() or empty() before they are used.</li> </li> </ol> <h2>Coding Style</h2> <p>I know it can be a little annoying to change your style if you're used to something else, but balance that annoyance against the annoyance of all the people trying later on to make sense of STACK code with mixed styles. There are obviously many good points for and against any style that people use, but the current style just <strong>is</strong>, so please stick to it. </p> <ol class="normaltext"> <li class="spaced"><strong>Indenting</strong> should be consistently 4 spaces. Don't use tabs AT ALL. </li> <li class="spaced"><strong>Variable names</strong> should always be easy-to-read, meaningful lowercase English words. If you really need more than one word then run them together, but keep them short as possible. Use plural names for arrays of objects. <p class="examplecode"><font color="#006600">GOOD: $quiz<br /> GOOD: $errorstring<br /> GOOD: $assignments (for an array of objects)<br /> GOOD: $i (but only in little loops)<br /> <br /> BAD: $Quiz <br /> BAD: $aReallyLongVariableNameWithoutAGoodReason<br /> BAD: $error_string</font></p> </li> <li class="spaced"><strong>Function names</strong> should be simple English lowercase words, and start with the name of the stack and then the module to avoid conflicts, either with othe parts of the code or future applications. Words should be separated by underscores. Parameters should always have sensible defaults if possible. Note there is no space between the function name and the following (brackets). <br /> <p class="examplecode"> <font color="#007700">function </font><font color="#0000BB">forum_set_display_mode</font><font color="#007700">(</font><font color="#0000BB">$mode</font><font color="#007700">=</font><font color="#0000BB">0</font><font color="#007700">) {<br /> global </font><font color="#0000BB">$USER</font><font color="#007700">, </font><font color="#0000BB">$CFG</font><font color="#007700">;<br /> <br /> if (</font><font color="#0000BB">$mode</font><font color="#007700">) {<br /> </font><font color="#0000BB">$USER</font><font color="#007700">-></font><font color="#0000BB">mode </font><font color="#007700">= </font><font color="#0000BB">$mode</font><font color="#007700">;<br /> } else if (empty(</font><font color="#0000BB">$USER</font><font color="#007700">-></font><font color="#0000BB">mode</font><font color="#007700">)) {<br /> </font><font color="#0000BB">$USER</font><font color="#007700">-></font><font color="#0000BB">mode </font><font color="#007700">= </font><font color="#0000BB">$CFG</font><font color="#007700">-></font><font color="#0000BB">forum_displaymode</font><font color="#007700">;<br /> }<br /> }</font></p> </li> <li class="spaced"><strong>Blocks</strong> must always be enclosed in curly braces (even if there is only one line). STACK uses Moodle's style: <p class="examplecode"> <font color="#006600">if (</font><font color="#0000CC">$quiz</font><font color="#006600">-></font><font color="#0000CC">attempts</font><font color="#006600">) {<br /> if (</font><font color="#0000CC">$numattempts </font><font color="#006600">> </font><font color="#0000CC">$quiz</font><font color="#006600">-></font><font color="#0000CC">attempts</font><font color="#006600">) {<br /> </font><font color="#0000CC">error</font><font color="#006600">(</font><font color="#0000BB">$strtoomanyattempts</font><font color="#006600">, </font><font color="#CC0000">"view.php?id=$cm</font><font color="#006600">-></font><font color="#CC0000">id"</font><font color="#006600">);<br /> }<br /> }</font></p> </li> <li class="spaced"><strong>Strings</strong> should be defined using single quotes where possible, for increased speed.<br /> <p class="examplecode"> <font color="#006600">$var = 'some text without any variables';<br /> $var = "with special characters like a new line \n";<br /> $var = 'a very, very long string with a '.$single.' variable in it';<br /> $var = "some $text with $many variables $within it"; </font></p> </li> <li class="spaced"><strong>Comments</strong> should use two or three slashes and line up nicely with the code. <p class="examplecode"><font color="#006600">function </font><font color="#0000BB">forum_get_ratings_mean</font><font color="#007700">(</font><font color="#0000BB">$postid</font><font color="#007700">, </font><font color="#0000BB">$scale</font><font color="#007700">, </font><font color="#0000BB">$ratings</font><font color="#007700">=</font><font color="#0000BB">NULL</font><font color="#007700">) {<br /> </font><font color="#FF8000">/// Return the mean rating of a post given to the current user by others.<br /> /// Scale is an array of possible ratings in the scale<br /> /// Ratings is an optional simple array of actual ratings (just integers)<br /> <br /> </font><font color="#007700">if (!</font><font color="#0000BB">$ratings</font><font color="#007700">) {<br /> </font><font color="#0000BB">$ratings </font><font color="#007700">= array(); </font><font color="#FF8000">// Initialize the empty array</font><font color="#007700"><br /> if (</font><font color="#0000BB">$rates </font><font color="#007700">= </font><font color="#0000BB">get_records</font><font color="#007700">(</font><font color="#DD0000">"forum_ratings"</font><font color="#007700">, </font><font color="#DD0000">"post"</font><font color="#007700">, </font><font color="#0000BB">$postid</font><font color="#007700">)) {<br /> </font><font color="#FF8000">// Process each rating in turn</font><font color="#007700"><br /> foreach (</font><font color="#0000BB">$rates </font><font color="#007700">as </font><font color="#0000BB">$rate</font><font color="#007700">) {</font> <br /> ....etc </p> </li> <li class="spaced"><strong>Space</strong> should be used liberally - don't be afraid to spread things out a little to gain some clarity. Generally, there should be one space between brackets and normal statements, but no space between brackets and variables or functions:<br /> <p class="examplecode"> <font color="#007700">foreach (</font><font color="#0000BB">$objects </font><font color="#007700">as </font><font color="#0000BB">$key </font><font color="#007700">=></font><font color="#0000BB"> $thing</font><font color="#007700">)</font><font color="#006600"> {<br /> </font><font color="#007700"> </font><font color="#0000BB">process($thing);</font><font color="#006600"> <br /> } <br /> <br /> </font><font color="#007700">if (</font><font color="#0000BB">$x </font><font color="#007700">== </font><font color="#0000BB">$y</font><font color="#007700">)</font><font color="#006600"> {<br /> </font><font color="#007700"> </font><font color="#0000BB">$a </font><font color="#007700">= </font><font color="#0000BB">$b</font><font color="#007700">;</font><font color="#006600"><br /> } else if (</font><font color="#0000BB">$x </font><font color="#007700">== </font><font color="#0000BB">$z</font><font color="#006600">) {<br /> </font><font color="#007700"> </font><font color="#0000BB">$a </font><font color="#007700">= </font><font color="#0000BB">$c</font><font color="#007700">;</font><font color="#006600"><br /> } else {<br /> </font><font color="#007700"> </font><font color="#0000BB">$a </font><font color="#007700">= </font><font color="#0000BB">$d</font><font color="#007700">;</font><font color="#006600"><br /> } </font></p> </li> </ol> <p> </p> --- NEW FILE: author_questionfields.php --- <?php /** * Describes the data structure stackQuestion * * @package documentation * @subpackage Stack */ include('en_doc.php'); ?> <h1>Question documentation</h1> <p>A <tt>stackQuestion</tt> is the basic object in the system. Indeed, STACK is designed as a vehicle to manage these questions. Each question contains a number of fields. This page is a reference for each field. </p> <p>If you would like some examples of how to author questions, please refer to the authoring guide instead.</p> <p>Each field in the question has attributes. There is a <tt>type</tt>, and whether or not the field is <tt>required</tt> in a valid question. (Note, the type of a field, should not be confused with the "type" of a question!)</p> <h3><tt>type</tt></h3> There are four main types which occur in a <tt>stackQuestion</tt>. Other types occur as required. <ul> <li> <tt>casstring</tt> is an expression which will be processed by the cas, and is required to be in CAS syntax. Hence in a particular question, this information may well be (indeed is likely to be) cas-specific. <br />When processed by the cas, the result is stored as an array containing the <tt>value</tt>, essentially an un-parsed form of the evaluated expression suitable to be fed back to the CAS, together with a <tt>display</tt> field which is the HTML (or MathML) code for the displayed expression. An <tt>errors</tt> field may or may not be present. There are two processes of checking for errors. <ol> <li> PHP-side processing. This checks for mis-matched parentheses, missing * signs and generally does its best not to attempt to evaluate a syntactically incorrect expression.</li> <li> cas-side processing, of course may generate errors when the evaluation takes place. </li></ol> <li> <tt>castext</tt> is a LaTeX string in which some computer algebra strings have been embedded. These strings are embedded between @ characters. Each of these is treated as a <tt>casstring</tt>. For example, <pre> The expansion of $(x-1)^6$ is @expand( (x-1)^6 )@.</pre> There is a filter which processes <tt>castext</tt> in the context in which it occurs. This context includes a list of variables, and options for the display. </li> <li> <tt>rawkeyval</tt> and <tt>keyval</tt> pair. These fields always occur together. The former is the string input, typed by the user. The latter is the PHP array of values. An example is the field <tt>questionVars</tt>. </li> <li> <tt>meta</tt> These fields are information <em>about</em> the question. For example, the questionID number, who edited the question and so on. These fields appear in the database directlty, while the others are serialized together and stored in the <font color=orange><tt>questionBody</tt></font>. Indeed, this field is used to create the database tables in the first place. </li> </ul> <?php foreach( $stackQuestion as $field => $q_field) { $fd = 'stackQuestion_'.$field; $fd = get_string($fd,'stack',''); echo "<h3>$fd</h3>"; echo $q_field['doc']; echo "<p>"; echo "Name of field: <font color=orange><tt>$field</tt></font>. Type of field: <font color=orange><tt>$q_field[type]</tt></font>. Required: <font color=orange><tt>$q_field[required]</tt></font>."; } ?> <h2>Data type stackQuestionInst</h2> <p>A <tt>stackQuestionInst</tt> is an instantiated version of a <tt>stackQuestion</tt>. It inherits many fields from the <tt>stackQuestion</tt>. There are also many fields with the string \"<tt>Inst</tt>\" appended to the field name, to indicate they are instantiated versions. <p>For example, <font color=orange><tt>questionVarsInst</tt></font> are the <font color=orange><tt>questionVars</tt></font> with their values assigned. <p>Fields in a <tt>stackQuestion</tt> of type <font color=orange><tt>rawkeyvals</tt></font> are <em> not inherited</em> by the </tt>stackQuestionInst</tt>. There is no point storing stings, when we have the parsed, validated <font color=orange><tt>keyvals</tt></font> fields to work with. <?php foreach( $stackQuestionInst as $field => $q_field) { if (array_key_exists('doc',$q_field)) { echo '<br />'.$q_field['doc']; } echo "<p>"; echo "Name of field: <font color=orange><tt>$field</tt></font>. Type of field: <font color=orange><tt>$q_field[type]</tt></font>. Required: <font color=orange><tt>$q_field[required]</tt></font>."; } ?> <h2>Data type stackQuestionAttempt</h2> This holds data about each student's attempts as a particular <font color=orange><tt>questionInst</tt></font>. Note that in a fully correct relational database, these would be held in a separate table. However, since each student will generate a new instance, it seems better to store the attempts as an array subfield of the <font color=orange><tt>questionInst</tt></font> itself. This field is <?php foreach( $stackQuestionAttempt as $field => $q_field) { echo "<p>Name of field: <font color=orange><tt>$field</tt></font>. Type of field: <font color=orange><tt>$q_field[type]</tt></font>. <br />"; if (array_key_exists('doc',$q_field)) { echo '<br />'.$q_field['doc']; } } //echo "<pre>";print_r($stackQuestionInst);echo "</pre>"; ?> --- NEW FILE: author_gettingstarted.php --- <?php /** * An authoring guide for STACK questions. * * @package documentation * @subpackage Stack */ require('html/trypopupform.html'); include_once("$stack_root/scripts/stackAuthor.php"); include_once("{$stack_root}/scripts/maxima/maximafun.php"); /** * Display an example of the stack question * * * @question The question to be displayed. * */ function stack_doc_dispexample($question) { global $stackQuestion; //show_array($question); echo "<table border='1'>\n"; foreach ($question as $key => $val) { $fieldname = 'stackQuestion_'.$key; $descript = get_string($fieldname,'stack'); echo "<tr>\n <td>"; echo "<a href=\"javascript:HelpPopup('$key','stackQuestion');\">{$descript}</a></td>\n"; echo " <td><tt>$val</tt> </td>\n</tr>\n"; } echo "</table>\n"; } /** * Display, with hyperlinking, the STACK question field name and a link to the help pop-up. * * * @param string $command The command to be displayed * @param string $stackhelp Optional: the help file which contains the field. */ function stack_doc_dispstackqfield($command,$stackhelp='stackQuestion') { global $stackQuestion,$stackQuestionPotResp,$stackOptions; if ('stackQuestion' == $stackhelp) { $fieldname = 'stackQuestion_'.$command; $descript = get_string($fieldname,'stack'); } else if ('stackQuestionPotResp' == $stackhelp) { $fieldname = 'stackQuestion_PR_'.$command; $descript = get_string($fieldname,'stack'); } else if ('stackOptions' == $stackhelp) { $fieldname = 'stackOptions_'.$command; $descript = get_string($fieldname,'stack'); } echo "<a href=\"javascript:HelpPopup('$command','$stackhelp');\">$descript</a> "; } /** * Display, with hyper-linking, the STACK command * * * @param string $command The command to be displayed */ function stack_doc_dispstackcommand($command) { echo "<a href=\"#STACK_command_{$command}\"><font color=\"orange\"><tt>$command</tt></font></a> "; } ?> <h1><a name=\"author\">Authoring a STACK question</a></h1> <p>A <tt>stackQuestion</tt> is the basic object in the system. Indeed, STACK is designed as a vehicle to manage these questions. This page explains the process of authoring a question, by working through an example. This example uses the online form method. It is possible to edit XML files directly, but this process is not explained here.</p> <h2>A minimal example</h2> <p>Start with a <a href="javascript:NewPopup();">New question</a>. This link will open a pop-up window in which you can edit the question. This link also occurs in the Demonstration >> Question Bank page. Do not be put off by the fact this form looks complicated. There are lots of fields, but only two are compulsory: <ol> <li>The <?php stack_doc_dispstackqfield('questionStem'); ?> is the string actually displayed to the student. ie this is "the question".</li> <li>The <?php stack_doc_dispstackqfield('questionAns'); ?> is the answer to the question.</li> </ol> </p> <p>We are now ready to edit a new question. Into these two fields, enter the following information. It should be possible to cut and paste. <?php $question = array(); $question['questionStem'] = 'Differentiate $(x-1)^3$ with respect to $x$.'; $question['questionAns'] = '3*(x-1)^2'; stack_doc_dispexample($question); ?> Scroll down and click the "edit question" link. Now check for any errors, which should appear under the respective field in red, if so correct them and press "edit question" again. When you are in a position to, click the "Try this question" link. This will take you into another view: the "teacher's view" mode. Click on "validate" and "mark" with different answers. Of course, you can return to the edit form by pressing "edit". The "new_version" is to create a different random version, something we shall cover in a moment.</p> <p>You now have a minimal question working.</p> <p>Note, this question will only remain as long as you are in a session. In order to store the question in STACK's database you need to be logged in as the admin user. Note that currently if you want to store a question you need to login <em>before</em> you start to edit. If you forget to do this all is not lost: download your temporary question as an XML file from the question edit page, and login. They you can import is back to the database.</p> <h2>CAS-enabled text: <tt>castext</tt></h2> <p>Before we consider in detail how to add more features to the question we introduce a datatype <tt>castext</tt>. Many of the fields in a STACK question, such as the <?php stack_doc_dispstackqfield('questionStem'); ?> are of this nominal type, which can be thought of as <em>CAS-enabled text</em>. This is simply LaTeX text, in which CAS commands can be embedded. These CAS commands are executed before the question is displayed to the user.</p> <p><em>Use only simple LaTeX structures, and equations.</em> Only core LaTeX is supported, and experienced users may feel a little disappointed that not all the more complex environments, (such as \begin{eqnarray}) work. If you do not know how to use LaTeX, some simple examples are given in the <a href="#FAQ">FAQ</a>. </p> <p>The following things to remember about <tt>castext</tt>: <ul> <li>Anything enclosed between @ symbols is evaluated by the CAS, and displayed using the display option as an inline equation. This is analogous to using LaTeX's $'s. Note however, that you don't need to use <tt>$@ stuff @$</tt>, and that <tt>@ stuff @</tt> is sufficient.</li> <li>To get a displayed equation centered on a line of its own, use either <tt>$$@ stuff @$$</tt>, <tt>\[@ stuff @\]</tt>,as in LaTeX.</li> <li> Anything between <tt>< html> stuff < html></tt> structures is kept as HTML, and not interpreted as LaTeX. This enables URL's to be included in the text, as well as external images etc. </li> </ul></p> <h2>Random questions</h2> <p>It is common to want to use random numbers in questions. This is straight forward to do, and we make use of the optional <?php stack_doc_dispstackqfield('questionVarsRaw'); ?> field. Please click on the link to the left to read the specific documentation on this field. More examples are given in the documentation for <?php stack_doc_dispstackqfield('questionVarsRaw'); ?> <p>To create a random question we need to modify the previous one slightly so that the fields consist of the following. Note, that while a little more complex, this question is no different from the one before. <?php $question = array(); $question['questionVarsRaw'] = 'p = (x-1)^3'; $question['questionStem'] = 'Differentiate @p@ with respect to $x$.'; $question['questionAns'] = 'diff(p,x)'; stack_doc_dispexample($question); ?> Notice that now we have defined a local variable <em>p</em>, and used the <em>value</em> of this in the <?php stack_doc_dispstackqfield('questionStem'); ?>. Hence, the user will not see a "<em>p</em>" on the screen when the question is instantiated, but the <em>value</em> of <em>p</em>.</p> <p>Notice also that in the <?php stack_doc_dispstackqfield('questionAns'); ?>, there is a CAS command to differentiate the value of <em>p</em> with respect to <em>x</em>. It is necessary for the CAS to work out the answer in a random question.</p> <p>We are now in a position to generate a random question. Use the data, as follows.</p> <?php $question = array(); $question['questionVarsRaw'] = "n = 2+rand(3); p = (x-1)^n"; $question['questionStem'] = 'Differentiate @p@ with respect to $x$.'; $question['questionAns'] = 'diff(p,x)'; stack_doc_dispexample($question); ?> <p>In this new example, we have an extra variable <em>n</em> which is defined to be a random number. This is then used to define the variable <em>p</em> which is in turn used in the question itself. Edit your trial question, and in the Teacher's trial window use the "new version" button to get new random versions of the question.</p> <p>When generating random questions in CAA we talk about <em>random numbers</em> when we really mean <em>pseudo-random numbers</em>. To keep track of which random numbers are generated for each user, there is a special command in STACK, which you should use instead of Maxima's random command. This is the <?php stack_doc_dispstackcommand("rand"); ?> command which is a general "random thing" generator. It can be used to generate random numbers and also to make selections from a list. <p>As a specific example of some of these features, try the question illustrated below. This contains random numbers, and also examples of variables and expressions selected from a list. <?php $question = array(); $question['questionVarsRaw'] = "n = rand(5)+3; v = rand([x,s,t]); p = rand([sin(n*v),cos(n*v)])"; $question['questionStem'] = 'Differentiate @p@ with respect to @v@.'; $question['questionAns'] = 'diff(p,v)'; stack_doc_dispexample($question); ?> </p> <h2><a name="author_potential_response">Better feedback via the potential response tree</a></h2> <p>So far we have just compared the student's answer with that of the teacher. This gives the minimum possible feedback, along the lines of "correct" or "incorrect". STACK has a mechanism for you to provide better feedback, and this facility is one of STACK's more important features. In our question we need to find the section of the form which looks like <hr /> <a href="#author_potential_response">Add</a> <input type="input" name="questionPotResp[add]" value="0" size="3" /> <a href="javascript:HelpPopup('all','stackQuestionPotResp');">potential responses.</a> (distracters etc).<br /> <hr /> In this change the 0 to a 2 in the box on the question edit form (not above!) and activate either the "Add" or "Edit question" links. The question edit form will become quite significantly more complex as now you have just added two <a href="javascript:HelpPopup('all','stackQuestionPotResp');">potential responses.</a> It is worth reading the documentation about the <a href="javascript:HelpPopup('all','stackQuestionPotResp');">potential responses</a> before we proceed to examples which illustrate this.</p> <p>As an example, we shall provide feedback which checks <ol> <li>For the correct answer.</li> <li>To see if the student integrated by mistake.</li> </ol> First, check that a variable name appears in the <?php stack_doc_dispstackqfield('questionAnsKey'); ?>, it will probably read <tt>ans1</tt>. Use this variable name to refer to the student's answer in all subsequent work.</p> <p>Ignore, for now, the <?php stack_doc_dispstackqfield('questionAnsVarsRaw'); ?> field, since we do not need to process the student's answer yet.</p> <p>Check the first potential response box, indexed with a No. 0 in the top left hand corner. Assuming you have been following this tutorial, you should find that the box <?php stack_doc_dispstackqfield('SAns','stackQuestionPotResp'); ?> contains the student's answer, expressed as <tt>ans1</tt> and that <?php stack_doc_dispstackqfield('TAns','stackQuestionPotResp'); ?> contains the teacher's answer <tt>diff(p,x)</tt>. Notice that this depends on the variable <tt>p</tt> and also contains a CAS command <tt>diff</tt>, as before.</p> <p>Change the <?php stack_doc_dispstackqfield('AnsTest','stackOptions'); ?> to be <tt>AlgEquiv</tt> (algebraic equivalence test), since although this is the default, we now want to be certain this test is actually used. Leave the <?php stack_doc_dispstackqfield('AnsTestOpt','stackOptions'); ?> blank, since in this case we need no options for the Answer Test.</p> <p><em>DO NOT check the Del box!</em> which would result in this potential response being deleted on the next edit cycle.</p> <p>We are now in a position to decide what outcomes we would like. If the result of this answer test is true, we have established the student's answer is correct. Hence we would like to give one mark. This is achieved by setting the <?php stack_doc_dispstackqfield('RawMarkMod','stackQuestionPotResp'); ?> (labelled "Mark") to be '=', and the <?php stack_doc_dispstackqfield('RawMark','stackQuestionPotResp'); ?> to be 1. Notice, these fields already assume these values by default, so you should not need to do anything. Since we have established that the answer is correct we end the process by choosing the Next field to be -1. Again it already is.</p> <p>What if the answer test was false? We would like to check that the student has not integrated by mistake, and we achieve this by applying another answer test in the potential response node No. 1. To jump to this node, from the false branch of Node No 0., make sure that the "Next" field is set to be 1. This fragment is shown below. <hr /> <table> <tr align=top><td>If...</td> <td><a href="javascript:HelpPopup('RawMarkMod','stackQuestionPotResp');">Mark</a></td> <td><a href="javascript:HelpPopup('RawMark','stackQuestionPotResp');">Value</a></td> <td><a href="javascript:HelpPopup('Penalty','stackQuestionPotResp');">Penalty</a></td> <td colspan='2'><a href="javascript:HelpPopup('FeedBack','stackQuestionPotResp');">Feedback</a></td> <td><a href="javascript:HelpPopup('ApLat','stackQuestionPotResp');">Next</a></td> <td></td></tr> <tr> <td colspan = '4'>............</td></tr> <tr><td>false</td><td> <select name="questionPotResp[0][false][RawMarkMod]"> <option value="=" selected>=</option> <option value="+">+</option> <option value="-">-</option> <option value="=AT">=AT</option> </select></td> <td><input type='text' name='questionPotResp[0][false][RawMark]' size ='4' value='0' /></td> <td><input type='text' name='questionPotResp[0][false][Penalty]' value ='' size =' 3' /></td> <td colspan='2'><textarea name='questionPotResp[0][false][FeedBack]' rows ='1' cols='50'></textarea></td> <td> <select name="questionPotResp[0][false][ApLat]"> <option value="-1">-1</option> <option value="0">0</option> <option value="1" selected>1</option> </selected></td> </tr></table><hr /> We are now in a position to implement the second test, before we do this we need to decide what we want.</p> <p>If the student has integrated, they may or may not have added a constant of integration. If that have added such a constant we don't know what they have used! So, the best way to solve this problem is to differentiate their answer and compare it to the question. This is achieved with the following potential response node. You should examine this carefully, and transfer the values to your question template. <?php $pr = array( 'SAns' => 'diff(ans1,x)','TAns' => 'p','AnsTest' => 'AlgEquiv', 'order' => '1', 'true' => array( 'RawMarkMod' => '=', 'RawMark' => '0', 'FeedBack' => 'It looks like you have integrated instead! Please try again.', 'ApLat' => '-1'), 'false' => array( 'RawMarkMod' => '=', 'RawMark' => '0', 'ApLat' => '-1') ); $errors = array(); @stack_question_edit_potresp('1',$pr,'2',$errors); ?> <p>Another common problem is that, even if the student has given the correct answer, they may have used a quite inappropriate method. For example, they may have expanded out the polynomial and hence give the answer in unfactored form. In this situation, we might like to provide some encouraging feedback to explain to the student what they have done wrong.</p> <p>First, we need to add another potential response: after all, we need to apply another answer test. To do this, go back and Add 1 potential response in a similar way as before. After you have re-loaded the page with the "Add" or "Edit question" link, you should have three potential responses for this question.</p> <p>To use this potential response, edit Node 0, and now change the true branch to make the Next node point to the new Node 2. If we enter Node 2, we know the student has the correct answer. We only need to establish if it is factored or not.</p> <p>To establish that the student's answer is factored we need to use a different <?php stack_doc_dispstackqfield('AnsTest','stackOptions'); ?> In this case we choose <tt>SA_factored</tt> which establishes that the Student's Answer is in factored form. Note that this is similar to the <tt>FacForm</tt> answer test, but it does not provide feedback. Since the purpose of this question is not to see if a student can factor the answer we wish to provide our own feedback. We need to add <tt>x</tt> to the <?php stack_doc_dispstackqfield('AnsTestOpt','stackOptions'); ?> to indicate which variable we are using.</p> <p>We also need to update the marks, since we know the student has the answer correct, we should make sure they get marks in both branches of the potential response node.</p> <p>Last, but certainly not least, we add some positive and encouraging feedback to the false branch. For reference, my node 2. is shown below.</p> <?php $pr = array( 'SAns' => 'ans1','TAns' => 'diff(p,x)','AnsTest' => 'SA_factored', 'AnsTestOpt' => 'x', 'order' => '2', 'true' => array( 'RawMarkMod' => '=', 'RawMark' => '1', 'ApLat' => '-1'), 'false' => array( 'RawMarkMod' => '=', 'RawMark' => '1', 'FeedBack' => 'You should keep your answer in factored form. In this case there is no need to expand out your answer, since the chain rule will help you to differentiate the expression directly.', 'ApLat' => '-1') ); $errors = array(); @stack_question_edit_potresp('1',$pr,'2',$errors); ?> <p>Of course, you can continue to add more potential responses as the need arises. These can test for more subtle errors, based upon the common mistakes student's make. In each case an <?php stack_doc_dispstackqfield('AnsTest','stackOptions'); ?> can be used to make a different kind of distinction between answers. You can also define <?php stack_doc_dispstackqfield('questionAnsVarsRaw'); ?> before the response processing tree is traversed to perform calculations on the student's answer. </p> <h2>Options</h2> <p>There is a tension between system flexibility and the simplicity of the question authoring process. At one end of this spectrum, it should be possible in each question to alter every system feature, from the question stem, answer and number of marks available right through to the fonts used, teacher's email address and the URL for a help page. At the other end of the spectrum, questions need to be authored with a maximum of efficiency. Really, the only compulsory fields need be: <ol> <li>the question stem: i.e. the actual "question" posed to the student, and</li> <li>the answer.</li> </ol> One challenge was to make it possible to author a viable question by only entering this information, and provide a mechanism for other features to adopt sensible default values taken from a context.</p> <p>The solution is a cascading options structure. Options are essentially global variables available for use by questions and quizzes. They assume a default value at the system level which can be overridden at the quiz level, or again at the question level. Although we conceived of a "subject", "quiz", "question" hierarchy, the cascading options structure is flexible enough to cope with any navigation system which is essentially a tree structure. When authoring a question or quiz, you can use the default values to create new questions and quizzes quickly and consistently. In fact, most things turn out to be best represented as an option, including the <?php stack_doc_dispstackqfield('QuVal','stackOptions'); ?> (no. of marks), <?php stack_doc_dispstackqfield('Penalty','stackOptions'); ?>, and even the <?php stack_doc_dispstackqfield('AnsTest','stackOptions'); ?>. There are a wide variety of options, with specific documentation available <a href="index.php?action=help&field=stackOptions">here</a>. </p> <p>The options allow a single question to behave in quite different ways, depending on the values set. Adding new options is a reasonably straightforward, and if STACK does not behave in the way you would like, please propose an alternative and it may be added as an option for others to enjoy. Note that this option structure is somewhat at odds with the ISM Question and Test Interpretability (QTI) view of an assessment item as being entirely self contained. </p> <?php // Examples and documentation for the Question Variables. $descript = get_string('stackQuestion_questionVarsRaw','stack'); echo "<h2><a name=\"qvars_ex\">$descript: Examples</a></h2>\n"; echo $stackQuestion['questionVarsRaw']['doc']; ?> <p>Simple assignments are of the form <tt>key = value</tt>, for example, <pre>n = rand(3)+2 p = (n-1)^n</pre> Of course, these assignments can make use of Maxima's functions to manipulate expressions. <pre>p = expand( (x-3)*(x-4) )</pre></p> <p>You can use Maxima's looping structures within Question variables, although the syntax requires this to be of the form <tt>key = value</tt>. In this case, the <tt>key</tt> will be assigned the value <tt>DONE</tt> at the end of the process, unless another value is returned. For example <pre>n = 1 dum1 = FOR a:-3 THRU 26 STEP 7 DO n:n+a </pre> Note, you must use Maxima's syntax <tt>a:-3</tt> here for assignment of <tt>-3</tt> to the variable <tt>a</tt>. The assignment to the dummy variable <tt>dum1</tt> is to ensure every command is of the form <tt>key = value</tt>. Please look at Maxima's documentation for the command <?php $url = $maxima_cmd['DO']['urls'][0]; echo " <a href='maximadocs/maxdoc/$url'>DO</a>.</p> "; ?> You should also look at Maxima's <?php $url = $maxima_cmd['BLOCK']['urls'][0]; echo " <a href='maximadocs/maxdoc/$url'>BLOCK</a>"; ?> which may be useful here for more complex manipulations. Here is another example, which generates a random polynomial. <pre> m = rand([y,x,t]) p = rand(7)+1 q = 0 dum1 = block(for i:1 while i<=p do (q:q+rand(9)*m^p,p:p-1),return(q)) r = int(q,m) </pre> <p>It is also possible to define functions within the Question Variables for use within a question. This is not recommended, and has not been widely tested. For example <pre>dum1 = f(x) := x^2 n = f(4)</pre> Again, the syntax requires this to be of the form <tt>key = value</tt>, so that another dummy assignment has taken place. Please look at Maxima's documentation for <?php $url = $stack_web_url."maximadocs/maxdoc/maxima_39.html#SEC120"; echo " <a href='$url'>functions</a>.</p> "; ?> --- NEW FILE: student_practicemode.php --- <a name="practice"><h2>Practice mode</h2></a> If a test is set up in practice mode, it will say so in the test selection menu, and also at the top of the test page. If so, you can do the same set of questions repeatedly, and mark them by clicking the <b>Mark</b> button at the bottom of the page. The system will tell you whether your answers are right or wrong (except for multiple choice questions) and may give some feedback about any answers that are wrong, but it will not tell you the right answers. You can click the <b>Back</b> button on your browser to get back to the page where you filled in your answers, correct any mistakes, and try again. Alternatively, you can go away and come back some other time; Stack will remember your previous answers, so you can correct any that were wrong, and leave the others as they are. The system will give you a numerical mark for your work which you may find informative, but it does not officially count for anything. For more information about the marking system, see the section on assessment mode. <br /><br /> If you want to see the solutions, you can click the <b>Solutions</b> button at the bottom of the page instead of the <b>Mark</b> button. If you try the test again after doing this, you will get slightly different questions. --- NEW FILE: student_overview.php --- <H1>Help with STACK</H1> <a name="overview"><h2>Overview</h2></a> <b>Stack</b> is a computer system that assists in the teaching of some parts of University mathematics. <br /><br /> The basic idea is that you follow the links and then Stack will present you with a list of questions. There is detailed advice below on how to enter your answers. You can then click the <b>Mark</b> button at the bottom of the page to mark your work. The details of how this works depend on whether Stack is running in practice mode or assessment mode. --- NEW FILE: about_install.php --- <?php /** * Details of how to install STACK. * * @package documentation * @subpackage STACK * */ ?> <h1>Installing STACK</h1> STACK is a collection of PHP scripts, which link together the user, a CAS, and a database over the internet. Hence the system itself requires of a number of extra components. <h3>Platform</h3> The scripts currently released will run on a Linux (or unix) machine or a Microsoft (Windows) platform. <ul> <li><b>Linux:</b> STACK has been tested on a <a href="http://fedora.redhat.com/">Fedora</a> based Linux system running the Apache web server.</li> <li><b>Microsoft:</b> STACK has been tested on Windows XP and Windows 2000 using IIS and <a href="http://www.easyphp.org/">EasyPHP</a>. EasyPHP is by far the easiest platform on which to install STACK. However, this does not seem to be as efficient as Linux and may not be suitable for a production server.</li> </ul> <h3>Components</h3> Regardless of which operating system used, you will need the following components. <ul> <li>A web server, such as <a href="http://www.apache.org/">Apache</a>, running <a href="http://www.php.net/">PHP</a> (at least version 4.3.9), <!--(version 5 if using the CAS Pool)--></li> and <a href="http://www.mysql.com/">MySQL</a> server (at least version 4).<br /> Windows users could use <a href="http://www.easyphp.org/">EasyPHP</a>.</li> <li>You need to convex LaTeX to HTML with <a href="http://hutchinson.belmont.ma.us/tth/">TtH</a>. <li>The computer algebra system (<a href="#cas">see below</a>) <a href="http://maxima.sourceforge.net/">Maxima</a>. Version 5.9.1 (or later) is needed to include graphical support. (Note, for those on a Microsoft platform, the <a href="http://wxmaxima.sourceforge.net/">wxMaxima</a> front end is much better than that distributed with Maxima itself and is well worth installing for testing CAS code outside STACK)</li> <li>For graphical support we have used the <a href="http://www.gnuplot.info/">GNUPLOT</a> package. (Note, this is already supplied on Fedora 3 distributions, and comes with Maxima 5.9.1 on Windows) </ul> Finally of course <ul> <li>The STACK scripts themselves.</li> </ul> <p>The <em>latest</em> stack scripts can be obtained from the CVS on <tt>sourceforge</tt>. For example, anonymous access is via</p> <p><tt>cvs -z3 -d:pserver:ano...@cv...:/cvsroot/stack co -P <?php echo $stack_ver['cvsmodule'] ?> </tt></p> <p> Developer access can be obtained via SSH by</p> <p><tt>export CVS_RSH=ssh<br /> cvs -z3 -d:ext:</tt><em>developername</em><tt>@cvs.sourceforge.net:/cvsroot/stack co -P <?php echo $stack_ver['cvsmodule'] ?> </tt></p> <p>Users of a Microsoft platform should consider using the <a href="http://www.tortoisecvs.org/">tortoise CVS</a> application to obtain the scripts. Details of fields to fill in are available on this <a href="doc/stackcvs.png">screen shot</a>. Note: the module name (underlined in red) should read <font color="red"><?php echo $stack_ver['cvsmodule'] ?></font> <h2>Security</h2> <p><font color="red">WARNING! What these scripts attempt to do is inherently insecure.</font> This system is designed to execute arbitrary third party CAS code on your server, to create mathematical questions. This is inherently insecure, and you should be aware of the dangers. These are <em>in addition</em> to the normal security problems associated with interactive, database driven web sites.</p> <p>The array <pre>$stack_cas['globalForbid']</pre> is generated automatically and contains strings the system attempts not to execute. You should look at the file <tt>scripts/maxima/maximafun.php</tt> and the array distributed, together with the CAS documentation, to decide which CAS commands you wish to prevent from being executed on your server. This list is not comprehensive, and you should make your own decisions here. <font color="red"><em>You have been ... [truncated message content] |
From: Chris S. <san...@us...> - 2005-06-20 15:43:08
|
Update of /cvsroot/stack/stack-1-0/lang/nl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20897/lang/nl Added Files: stack.php Log Message: Major changes to the font end. Attempt 1. --- NEW FILE: stack.php --- <?php $string['TrySTACKQuiz'] = 'Probeer een STACK quiz'; $string['STACKHomePage'] = 'STACK startpagina'; $string['Home'] = 'Start'; $string['ClickHereTryQuiz'] = 'Klik hier om een nieuwe quiz te proberen.'; $string['ChooseQuiz'] = 'Kies een quiz'; $string['Focus'] = 'Focus'; $string['FocusExplain'] = 'Klik hier om per keer 1 vraag te zien.'; $string['UnFocus'] = 'Geen focus'; $string['UnFocusExplain'] = 'Klik hier om alle vragen in de quiz te zien.'; $string['Score'] = 'Score'; $string['Mark'] = 'Kijk na'; $string['MarkThisQ'] = 'Kijk na'; $string['MarkQ'] = 'Nakijken vraag '; $string['MarkExplain'] = 'Klik hier om de antwoorden na te kijken.'; $string['Validate'] = 'Valideer'; $string['ValidateExplain'] = 'Klik hier om controleren of uw antwoorden geen syntaxfouten bevat en het systeem ze verwerkt op de manier die u bedoelde.'; $string['ValidateExplain2'] = '(Merk op dat uw antwoorden opgeslagen worden als u valideert.)'; $string['Solutions'] = 'Oplossingen'; $string['SolutionsExplain'] = 'Klik hier om de hele quiz na te kijken en alle oplossingen te tonen.'; $string['SolutionsExplain2'] = '(Nieuwe pogingen worden niet meer toegestaan)'; $string['NewVersion'] = 'Nieuwe versie'; $string['NewVersionExplain'] = 'Klik hier om een nieuwe versie van deze quiz te proberen.'; $string['MarkSummary'] = 'Score Samenvatting'; $string['Question'] = 'Vraag'; $string['Value'] = 'Waarde'; // Aantal scores per vraag $string['Total'] = 'Totaal'; $string['Help'] = 'Help'; $string['End'] = 'Einde'; $string['ThisSTACKVer'] = 'Dit is STACK versie'; $string['ThisPageTook'] = 'Deze pagina werd in'; $string['seconds'] = 'seconden gemaakt'; $string['STACKlogo'] = 'STACK logo'; $string['QValidRequiredField'] = 'Dit is een verplicht veld, maar kent geen waarde.'; $string['QValidDefaultValue'] = 'Een standaardwaarde is toegekend.'; $string['QValidquestionnotar'] = '$question variabele bestaat niet!'; $string['QValidMaximaName'] = 'is een Maxima functie.'; $string['QInstCASError'] = 'CAS FOUT bij het uitvoeren!'; $string['CASError'] = 'CAS FOUT!'; $string['QMarkBailOut'] = 'WAARSCHUWING! STACK sluit af, aangezien de volgende prn meer dan eens bezocht is:'; $string['QTestTeacherInfo'] = 'Informatie voor de docent'; $string['QTestQuestionNote'] = 'Opmerkingen bij de vraag'; $string['Seed'] = 'Seed'; $string['QTestTeacherAns'] = "Antwoord van de docent"; $string['YourLastAns'] = 'Uw laatste antwoord was:'; $string['YouHaveNotAns'] = 'Waarschuwing: u heeft nog niet beantwoord.'; $string['InvalidAns'] = 'Dit is een ongeldig antwoord.'; $string['AttemptNoPenalty'] = 'Deze poging wordt zonder strafpunten genegeerd.'; $string['YourMarkFor'] = 'Uw score voor deze poging is'; $string['WithPenaltiesAnd'] = 'Met strafpunten, en vorige pogingen, geeft dit de score {$a[\'mark\']} uit {$a[\'QuVal\']}'; $string['YourMarkIs'] = 'Uw score is{$a[\'mark\']}, uit {$a[\'QuVal\']}.'; $string['InvalidNoMark'] = 'Uw antwoord is ongeldig, daarom is er geen score of strafpunt voor deze poging.'; $string['InvalidPreviousMark'] = 'Vorige pogingen geven een score van {$a[\'mark\']} uit {$a[\'QuVal\']}'; $string['InputTool'] = 'Formule editor'; $string['SyntaxHint'] = 'Syntax hint'; $string['TeacherAnsIs'] = 'Het antwoord van de docent is'; $string['ThisCanDisplay'] = 'Dit kan ingevoerd worden als'; $string['WorkedSolution'] = 'Oplosssing'; $string['NoSolution'] = '[Geen oplossing beschikbaar]'; $string['YourAttemptsWere'] = 'Uw pogingen voor deze vraag waren als volgt.'; $string['Answer'] = 'Antwoord'; $string['NoAttemptsAtQ'] = 'Uw heeft deze vraag nog niet geprobeerd.'; $string['ShowAt_RawAns'] = 'Ruwe antwoord'; $string['ShowAt_Action'] = 'Actie'; $string['ShowAt_Valid'] = 'Geldig ?'; $string['ShowAt_Ans'] = 'Antwoord'; $string['ShowAt_RawMark'] = 'Ruwe score'; $string['ShowAt_Penalty'] = 'Strafpunten'; $string['ShowAt_FeedBack'] = 'Feedback'; $string['ShowAt_AnswerNote'] = 'Opmerkingen bij het antwoord'; $string['SeriousForbid'] = 'De tekst <tt><font color=\'orange\'></font></tt> is niet toegestaan!<br />'; $string['MissingRightBracket'] = 'Het antwoord mist een rechter haakje.'; $string['MissingLeftBracket'] = 'Het antwoord mist een linker haakje.'; $string['IllegalSpaces'] = 'Het antwoord heeft witruimte tussen termen in uw expressie. Controleer het antwoord.'; $string['MissingStars'] = 'Het antwoord mist *\'en.<br /> Bedoelde u eigenlijk '; $string['BadAmps'] = 'Het antwoord mag geen @\'en bevatten. '; $string['BadAbsFun'] = 'Het antwoord mag geen |\'en bevatten. Voor absoluutstrepen kunt u de <tt>abs()</tt> CAS functie gebruiken.'; $string['UnknownFun'] = 'De tekst <tt><font color=\'orange\'>{$a[\'key\']}</font></tt> komt niet voor in de lijst met toegestane functies. Wellicht bent u vermenigvuldigingstekens, of haakjes vergeten. Bij problemen en vragen kunt u contact opnemen met de beheerder.'; $string['NotSupported'] = 'De tekst <tt><font color=\'orange\'>{$a[\'key\']}</font></tt> is een geldig CAS commando, maar wordt niet door STACK ondersteund. Wellicht is er een alternatief. Bij problemen en vragen kunt u contact opnemen met de beheerder.'; $string['EmptyCASString'] = 'Het antwoord is een lege <tt>casstring</tt>, hetgeen niet toegestaan is.'; $string['ErrorCASString'] = 'De tekst <font color=\'orange\'><tt>@{$a[\'key\']}@</tt></font> genereerde de volgende fout(en)'; $string['OddAmpCASString'] = 'Het antwoord bevat een oneven aantal @en, hetgeen niet toegestaan is.'; $string['IncorrectPassword'] = 'Incorrect wachtwoord!'; $string['IncorrectAdminPsd'] = 'Incorrect Admin wachtwoord'; $string['UnknownUserName'] = 'Gebruikersnaam bestaat niet!'; $string['MisMatchPassword'] = 'De twee wachtwoorden zijn niet hetzelfde!'; $string['OldPasswordUnch'] = 'Uw oude wachtwoord is niet veranderd.'; $string['USR_Username'] = 'Gebruikersnaam'; $string['USR_NewPassword'] = 'Nieuwe wachtwoord'; $string['USR_ConfirmPsswd'] = '(bevestig)'; $string['USR_FirstName'] = 'Voornaam'; $string['USR_LastName'] = 'Achternaam'; $string['USR_Email'] = 'Email'; $string['USR_OptionalInformation'] = 'Optionele Informatie'; $string['USR_Phone'] = 'Telefoon'; $string['USR_StudentID'] = 'Studentnummer'; $string['USR_Address'] = 'Adres'; $string['USR_Department'] = 'Faculteit'; $string['USR_Institution'] = 'Instelling'; $string[''] = ''; $string[''] = ''; $string[''] = ''; $string[''] = ''; $string[''] = ''; //get_string('ThisSTACKVer','stack','') ?> |
From: Chris S. <san...@us...> - 2005-06-20 13:35:52
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17704/lang/en Added Files: Tag: frontend_dev README Log Message: --- NEW FILE: README --- ENGLISH ------- STACK uses a very similar language system to that of Moodle. English is the default language of STACK, and this language pack is the "master" set against which other packs are compared. If a string is missing for any reason from another language then the English version will be used. If you are thinking of translating STACK to another language, please contact Chris Sangwin! |
From: Chris S. <san...@us...> - 2005-06-20 12:51:52
|
Update of /cvsroot/stack/stack-1-0/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28493/lang Added Files: Tag: frontend_dev languages.php Log Message: --- NEW FILE: languages.php --- <?php // languages.php, from Moodle. $LANGUAGES = array ( "aa" => "Afar", "ab" => "Abkhazian", "ae" => "Avestan", "af" => "Afrikaans", "am" => "Amharic", "ar" => "Arabic", "as" => "Assamese", "ay" => "Aymara", "az" => "Azerbaijani", "ba" => "Bashkir", "be" => "Belarussian", "bg" => "Bulgarian", "bh" => "Bihari", "bi" => "Bislama", "bn" => "Bengali", "bo" => "Tibetan", "br" => "Breton", "bs" => "Bosnian", "ca" => "Catalan", "ce" => "Chechen", "ch" => "Chamorro", "co" => "Corsican", "cs" => "Czech", "cu" => "Church Slavic", "cv" => "Chuvash", "cy" => "Welsh", "da" => "Danish", "de" => "German", "dz" => "Dzongkha", "el" => "Modern Greek", "en" => "English", "eo" => "Esperanto", "es" => "Spanish", "et" => "Estonian", "eu" => "Basque", "fa" => "Persian", "fi" => "Finnish", "fj" => "Fijian", "fo" => "Faroese", "fr" => "French", "fy" => "Frisian", "ga" => "Irish", "gd" => "Scots Gaelic", "gl" => "Gallegan ", "gn" => "Guarani", "gu" => "Gujarati", "gv" => "Manx", "ha" => "Hausa", "he" => "Hebrew", "hi" => "Hindi", "ho" => "Hiri Motu", "hr" => "Croatian", "hu" => "Hungarian", "hy" => "Armenian", "hz" => "Herero", "ia" => "Interlingua", "id" => "Indonesian ", "ie" => "Interlingue", "ik" => "Inupiaq ", "is" => "Icelandic", "it" => "Italian", "iu" => "Inuktitut", "ja" => "Japanese", "jw" => "Javanese", "ka" => "Georgian", "ki" => "Kikuyu", "kj" => "Kuanyama", "kk" => "Kazakh", "kl" => "Kalaallisut", "km" => "Khmer", "kn" => "Kannada", "ko" => "Korean", "ks" => "Kashmiri", "ku" => "Kurdish", "kv" => "Komi", "kw" => "Cornish", "ky" => "Kirghiz", "la" => "Latin", "lb" => "Luxembourgish", "ln" => "Lingala", "lo" => "Lao ", "lt" => "Lithuanian", "lv" => "Latvian ", "mg" => "Malagasy", "mh" => "Marshall", "mi" => "Maori", "mk" => "Macedonian", "ml" => "Malayalam", "mn" => "Mongolian", "mo" => "Moldavian", "mr" => "Marathi", "ms" => "Malay", "mt" => "Maltese", "my" => "Burmese", "na" => "Nauru", "nb" => "Norwegian Bokmål", "nd" => "Ndebele, North", "ne" => "Nepali", "ng" => "Ndonga", "nl" => "Dutch", "nn" => "Norwegian Nynorsk", "no" => "Norwegian", "nr" => "Ndebele, South", "nv" => "Navajo", "ny" => "Chichewa", "oc" => "Occitan", "om" => "Oromo", "or" => "Oriya", "os" => "Ossetian", "pa" => "Panjabi", "pi" => "Pali", "pl" => "Polish", "ps" => "Pushto", "pt" => "Portuguese", "pt_br" => "Portuguese (Brazil)", "qu" => "Quechua", "rm" => "Raeto-Romance", "rn" => "Rundi", "ro" => "Romanian", "ru" => "Russian", "rw" => "Kinyarwanda", "sa" => "Sanskrit", "sc" => "Sardinian", "sd" => "Sindhi", "se" => "Northern Sami", "sg" => "Sangho", "si" => "Sinhalese", "sk" => "Slovak", "sl" => "Slovenian", "sm" => "Samoan", "sn" => "Shona", "so" => "Somali", "sq" => "Albanian", "sr" => "Serbian", "ss" => "Swati", "st" => "Sesotho", "su" => "Sundanese", "sv" => "Swedish", "sw" => "Swahili", "ta" => "Tamil", "te" => "Telugu", "tg" => "Tajik", "th" => "Thai", "tk" => "Turkmen", "tl" => "Tagalog", "tn" => "Tswana", "tr" => "Turkish", "ts" => "Tsonga", "tt" => "Tatar", "tw" => "Twi", "ty" => "Tahitian", "ug" => "Uighur", "uk" => "Ukrainian", "ur" => "Urdu", "uz" => "Uzbek", "vi" => "Vietnamese", "vo" => "Volap", "wo" => "Wolof", "xh" => "Xhosa", "yi" => "Yiddish", "za" => "Zhuang", "zh" => "Chinese", "zu" => "Zulu"); ?> |
From: Chris S. <san...@us...> - 2005-06-20 12:36:24
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/html Modified Files: Tag: frontend_dev quizjava.html Log Message: Index: quizjava.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/quizjava.html,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** quizjava.html 20 Jun 2005 12:25:26 -0000 1.7.4.2 --- quizjava.html 20 Jun 2005 12:36:13 -0000 1.7.4.3 *************** *** 5,12 **** document.forms.quizform.submit(); } ! function tryquiz(c,n) { ! document.forms.tryform.action.value = c; ! document.forms.tryform.quizid.value = n; ! document.forms.tryform.submit(); } function addquestions() { --- 5,12 ---- document.forms.quizform.submit(); } ! function quiztry(c,n) { ! document.forms.quiztryform.action.value = c; ! document.forms.quiztryform.quizid.value = n; ! document.forms.quiztryform.submit(); } function addquestions() { |
From: Chris S. <san...@us...> - 2005-06-20 12:36:23
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/frontend_general Modified Files: Tag: frontend_dev editquiz_display.php Log Message: Index: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_display.php,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** editquiz_display.php 20 Jun 2005 12:25:26 -0000 1.1.2.5 --- editquiz_display.php 20 Jun 2005 12:36:13 -0000 1.1.2.6 *************** *** 30,36 **** */ function stack_display_editquiz_select($quiz_store, $PostTo) { ! global $stackQuiz; if (is_array($quiz_store)) { ! echo "<p>\n<form name='tryform' action='quiz.php' method='POST'> <input type='hidden' name='quizid' value='-1' /> <input type='hidden' name='action' value='quiz_choose' /></form>"; --- 30,37 ---- */ function stack_display_editquiz_select($quiz_store, $PostTo) { ! global $stackQuiz,$stack_web_url; if (is_array($quiz_store)) { ! ! echo "<p>\n<form name='quiztryform' action='{$stack_web_url}quiz.php' method='POST'> <input type='hidden' name='quizid' value='-1' /> <input type='hidden' name='action' value='quiz_choose' /></form>"; *************** *** 52,56 **** echo "<tr><td>{$qID}</td><td>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; ! echo "<td><a href=\"javascript:tryquiz('continue_quiz','$qID');\">try</a></td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_xml','$qID');\">xml</a></td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>del</font></a></td></tr>\n"; --- 53,57 ---- echo "<tr><td>{$qID}</td><td>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; ! echo "<td><a href=\"javascript:quiztry('continue_quiz','$qID');\">try</a></td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_xml','$qID');\">xml</a></td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>del</font></a></td></tr>\n"; |
From: Chris S. <san...@us...> - 2005-06-20 12:25:48
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13988/frontend_general Modified Files: Tag: frontend_dev edit_quiz_util.php editquiz_display.php frontend_util.php question_bank_util.php Log Message: Index: frontend_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/frontend_util.php,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** frontend_util.php 18 Jun 2005 21:01:01 -0000 1.1.2.5 --- frontend_util.php 20 Jun 2005 12:25:26 -0000 1.1.2.6 *************** *** 111,113 **** --- 111,131 ---- } + /* + * Gets the questionbank filter if this has been set. + * TO DO: This also sets $SESSION['bank_filter']. This should really + * be in a separate function. Also should have a $source parameter + * @return array question_bank_filter The Question Bank Filter + */ + 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: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_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 *** editquiz_display.php 17 Jun 2005 16:25:27 -0000 1.1.2.4 --- editquiz_display.php 20 Jun 2005 12:25:26 -0000 1.1.2.5 *************** *** 32,39 **** 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> --- 32,43 ---- global $stackQuiz; if (is_array($quiz_store)) { + echo "<p>\n<form name='tryform' action='quiz.php' method='POST'> + <input type='hidden' name='quizid' value='-1' /> + <input type='hidden' name='action' value='quiz_choose' /></form>"; + 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> *************** *** 46,54 **** } $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'>Delete Quiz</font></a></td></tr>\n"; } ! echo "\n</table>\n\n</p>"; } else { --- 50,60 ---- } $qID = $quiz['quizid']; ! echo "<tr><td>{$qID}</td><td>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; ! echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; ! echo "<td><a href=\"javascript:tryquiz('continue_quiz','$qID');\">try</a></td>\n"; ! echo "<td><a href=\"javascript:takeaction('quiz_xml','$qID');\">xml</a></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></form>"; } else { Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/question_bank_util.php,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** question_bank_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 --- question_bank_util.php 20 Jun 2005 12:25:26 -0000 1.1.2.5 *************** *** 118,139 **** /* - * Gets the questionbank filter if this has been set. - * TO DO: This also sets $SESSION['bank_filter']. This should really - * be in a separate function. Also should have a $source parameter - * @return array question_bank_filter The Question Bank Filter - */ - 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; - } - - /* * Gets the selected questions * @return array $quiz The questions selected --- 118,121 ---- Index: edit_quiz_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/edit_quiz_util.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** edit_quiz_util.php 20 Jun 2005 10:43:45 -0000 1.1.2.1 --- edit_quiz_util.php 20 Jun 2005 12:25:26 -0000 1.1.2.2 *************** *** 1,26 **** <?php - /** - * - * Welcome to STACK. A system for teaching and assessment using a - * computer algebra kernel. - * <br> - * This file is licensed under the GPL License. - * <br> - * A copy of the license is in your STACK distribution called - * license.txt. If you are missing this file you can obtain - * it from: - * http://www.stack.bham.ac.uk/license.txt - * <br> - * Copyright (c) 2005, Christopher James Sangwin - * - * @author Chris Sangwin C.J...@bh... - * @author Laura Naismith L.N...@bh... - * @author Juliette White jv...@jv... - * @package Stack - * - * This file contains utility functions used by edit_quiz.php - * TO DO: Some of these functions needs to be consolidated with the functions - * in the other utility files. - */ /* --- 1,3 ---- |
From: Chris S. <san...@us...> - 2005-06-20 12:25:47
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13988 Modified Files: Tag: frontend_dev editquiz.php Log Message: Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.10 retrieving revision 1.10.2.11 diff -C2 -d -r1.10.2.10 -r1.10.2.11 *** editquiz.php 17 Jun 2005 16:25:26 -0000 1.10.2.10 --- editquiz.php 20 Jun 2005 12:25:26 -0000 1.10.2.11 *************** *** 58,68 **** } //////////////////////////////////////////////// // (2) Take any actions required on entry to the page //////////////////////////////////////////////// - // TO DO: Much of this code would be better replaced by a switch statement - // with the functions factored out - // Possible values of $action are // quiz_edit Edit a quiz --- 58,70 ---- } + // Work out the correct value for any filter to be applied to the question + // bank. This is not needed by all actions, but it is harmless to set it. + $question_bank_filter = stack_get_questionbank_filter(); + + //////////////////////////////////////////////// // (2) Take any actions required on entry to the page //////////////////////////////////////////////// // Possible values of $action are // quiz_edit Edit a quiz *************** *** 106,137 **** } ! $question_bank_filter = stack_get_qb_filter($filter_source); ! ! if ('quiz_delete' == $action and $quizid != '') { ! stack_db_quiz_delete($quizid); ! $action = 'quiz_choose'; ! } ! ! if ('filter' == $action and $quizid != '') { ! $action = 'quiz_edit_addqs'; ! stack_set_session_question_bank_filter($question_bank_filter); } ! 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'; ! } //////////////////////////////////////////////// --- 108,136 ---- } ! ! if ('quiz_delete' == $action and $quizid != '') { ! stack_db_quiz_delete($quizid); ! $action = 'quiz_choose'; } + 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 ('filter' == $action and '' != $quizid ) { ! $action = 'quiz_edit_addqs'; ! } ! if ('quiz_new' == $action) { ! $quiz['quizid'] = $quizid; ! $action = 'quiz_edit'; ! } //////////////////////////////////////////////// *************** *** 152,155 **** --- 151,156 ---- stack_display_editquiz_add_questions($PostTo, $quizid, $question_bank_filter); break; + case 'quiz_xml'; + echo "This feature is not yet implemented."; } |
From: Chris S. <san...@us...> - 2005-06-20 12:25:47
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13988/scripts Modified Files: Tag: frontend_dev stackUtility.php Log Message: Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.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 *** stackUtility.php 18 Jun 2005 21:01:04 -0000 1.22.2.3 --- stackUtility.php 20 Jun 2005 12:25:26 -0000 1.22.2.4 *************** *** 930,936 **** echo "</font></em></p>"; - if ($stack_stand_alone) { // Then print a footer - echo "\n</body></html>"; - } } --- 930,933 ---- |
From: Chris S. <san...@us...> - 2005-06-20 12:25:47
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13988/html Modified Files: Tag: frontend_dev quizjava.html Log Message: Index: quizjava.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/quizjava.html,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -C2 -d -r1.7.4.1 -r1.7.4.2 *** quizjava.html 17 Jun 2005 10:54:52 -0000 1.7.4.1 --- quizjava.html 20 Jun 2005 12:25:26 -0000 1.7.4.2 *************** *** 5,8 **** --- 5,13 ---- document.forms.quizform.submit(); } + function tryquiz(c,n) { + document.forms.tryform.action.value = c; + document.forms.tryform.quizid.value = n; + document.forms.tryform.submit(); + } function addquestions() { document.forms.stackquizeditform.action.value = "quiz_edit_addqs"; |
From: Juliette W. <jv...@us...> - 2005-06-20 10:43:57
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24515/frontend_general Added Files: Tag: frontend_dev edit_quiz_util.php Log Message: Added file forgot to add previously. --- NEW FILE: edit_quiz_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... * @author Juliette White jv...@jv... * @package Stack * * This file contains utility functions used by edit_quiz.php * TO DO: Some of these functions needs to be consolidated with the functions * in the other utility files. */ /* * Gets the question bank filter * @param string $source - Must be 'post' or 'session' * @return array $question_bank_filter */ function stack_get_qb_filter($source) { if ('post' == $source) { $question_bank_filter = nsf($_POST, 'bank_filter'); } else if ('session' == $source) { $question_bank_filter = nsf($_SESSION, 'bank_filter'); } return $question_bank_filter; } /* * Sets the session question bank field * @param array $question_bank_filter * @return void */ function stack_set_qb_filter_in_session($question_bank_filter) { $_SESSION['bank_filter'] = $question_bank_filter; } // $quizid only set if $sourc eis 'database' /* * Gets the quiz * @param string $source - Must be 'post' or 'database' * @param int $quizid This is only set if the $source is 'database', is set * to the quiz id * @return array $quiz */ function stack_get_quiz($source, $quizid) { if ('post' == $source) { $quiz = nsf($_POST, 'quiz'); } else if ('database' == $source) { $quiz = stack_db_quiz_get($quizid); } return $quiz; } /* * Gets the quiz id * @param string $source - Must be 'post', 'database' or 'quiz' * @param int $quiz This is only set if the $source is 'quiz', is set * to the quiz to get the quiz id from * @return array $quiz */ function stack_get_quizid($source, $quiz) { $quizid = ''; if ('quiz' == $source) { $quizid = nsf($quiz,'quizid'); } else if ('database' == $source) { $quizid = stack_db_quiz_update(array()); } else if ('post' == $source) { $quizid = nsf($_POST, 'quizid'); } return $quizid; } ?> |
From: Chris S. <san...@us...> - 2005-06-20 09:41:52
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19951 Removed Files: Tag: frontend_dev qb_preview.php Log Message: --- qb_preview.php DELETED --- |
From: Chris S. <san...@us...> - 2005-06-20 08:54:34
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25585/html Modified Files: Tag: frontend_dev index-menu.txt Log Message: Index: index-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/index-menu.txt,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** index-menu.txt 18 Jun 2005 21:01:02 -0000 1.2.2.3 --- index-menu.txt 20 Jun 2005 08:54:20 -0000 1.2.2.4 *************** *** 17,21 **** ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ..Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... --- 17,21 ---- ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..Forum|http://mantis.york.ac.uk/moodle/course/view.php?id=21|_blank ..Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... |
From: Chris S. <san...@us...> - 2005-06-18 21:01:46
|
Update of /cvsroot/stack/stack-1-0/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/doc Modified Files: Tag: frontend_dev about_general.php author_maxima.php student_input.php student_practicemode.php Log Message: Index: about_general.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/doc/Attic/about_general.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 *** about_general.php 13 Jun 2005 13:04:21 -0000 1.1.2.1 --- about_general.php 18 Jun 2005 21:01:01 -0000 1.1.2.2 *************** *** 9,24 **** ?> ! <p>The STACK system is a sophisticated computer aided assessment ! package for mathematics, which evaluates the student's answer ! using a computer algebra system. Hence the student is required ! to provide their own answer, rather than relying on their ! selection from a teacher-provided list. Using CAS is a natural ! tool for random generation of structured problems, establishing ! mathematical properties of student's answers (eg equivalence with ! a correct answer) and providing feedback.</p> ! <p>This system was conceived by <a ! href='email:ch...@sa...'>Chris Sangwin</a>, and is now part ! of the <a href='http://maths.york.ac.uk/serving_maths/'>Serving ! Mathematics in a distributed e-learning environment</a> ! project.</p> --- 9,52 ---- ?> ! <p>The STACK system is a computer aided assessment package for mathematics.</p> ! <p>In computer aided assessment (CAA), there are two classes of <em>question types</em>. ! <ul> ! <li><em>Teacher-provided answer questions</em><br /> ! In these questions, a student makes a selection from, or interacts with, potential answers ! which the teacher has selected. Examples include multiple choice, multiple response and so on. ! </li> ! <li><em>Student-provided answer questions</em><br /> ! In these questions the student's answer contains the content. It is not a selection. ! Examples of these are numeric questions. ! </li> ! </ul> ! ! STACK concentrates on student-provided answers which are ! mathematical expressions. For example, a student might respond ! to a question with a polynomial or matrix. Essantially STACK ! asks for mathematical expressions and evaluates these using ! computer algebra. The prototype test is the following ! pseudo-code. ! <pre>If ! simplify(student_answer-teacher_answer) = 0 ! then ! mark = 1, ! else ! mark = 0. ! </pre> ! ! A CAS provides a library of functions with which to manipulate ! students' answers and generate outcomes such as providing ! feedback. Establishing algebraic equivalence with a correct ! answer is only one kind of manipluation which is possible. ! Using CAS can also help generate random yet structured problems, ! and corresponding worked solutions. ! ! <p>In STACK a lot of attention has been paid to allowing teachers to author ! and manage their own questions. You can try this for yourself by looking ! at the question bank demo, authoring guide and other options available here.</p> ! ! <!-- Please do not remove this public credit. CJS, June 2005 --> ! <p>This system is the brain child of ! <a href='email:ch...@sa...'>Chris Sangwin</a>.</p> Index: author_maxima.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/doc/Attic/author_maxima.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 *** author_maxima.php 13 Jun 2005 13:04:22 -0000 1.1.2.1 --- author_maxima.php 18 Jun 2005 21:01:01 -0000 1.1.2.2 *************** *** 12,23 **** <p>A CAS is a complex beast, and has its own syntax. Remember, this is a programming language in its own right. However, for learning and teaching, CAS systems share a lot in common, ! so for ease of interoperability there is for some functions a <a href="stackCommonSyntax.php">CAS common syntax.</a></p> <p>As part of the Stack distribution, the complete online documentaion for Maxima is also distributed. This can be accessed in two ways <ul> ! <li>An <a href="../maximadocs/intromax.html">introduction</a> to Maxima.</li> ! <li>The actual <a href="../maximadocs/maxdoc/maxima_toc.html">documentation</a></li> ! <li><a href="../maximadocs/functions.php">Lists of commands</a>, and who may use them</li> </ul> - --- 12,22 ---- <p>A CAS is a complex beast, and has its own syntax. Remember, this is a programming language in its own right. However, for learning and teaching, CAS systems share a lot in common, ! so for ease of interoperability there is for some functions a <a href="documentation.php?action=author_commonsyntax">CAS common syntax.</a></p> <p>As part of the Stack distribution, the complete online documentaion for Maxima is also distributed. This can be accessed in two ways <ul> ! <li>An <a href="maximadocs/intromax.html">introduction</a> to Maxima.</li> ! <li>The actual <a href="maximadocs/maxdoc/maxima_toc.html">documentation</a></li> ! <li><a href="documentation.php?action=functions">Lists of commands</a>, and who may use them</li> </ul> Index: student_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/doc/Attic/student_input.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 *** student_input.php 13 Jun 2005 13:04:22 -0000 1.1.2.1 --- student_input.php 18 Jun 2005 21:01:01 -0000 1.1.2.2 *************** *** 14,18 **** be sufficient. Stack tries quite hard to give helpful information about syntax errors. You can also learn about the right syntax by ! doing tests in <a href="#practice">practice mode</a> and asking for the solutions; as well as displaying the right answers in ordinary mathematical notation, Stack will tell you how they could be --- 14,18 ---- be sufficient. Stack tries quite hard to give helpful information about syntax errors. You can also learn about the right syntax by ! doing tests in practice mode and asking for the solutions; as well as displaying the right answers in ordinary mathematical notation, Stack will tell you how they could be *************** *** 217,219 **** </li> </ul> - --- 217,218 ---- Index: student_practicemode.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/doc/Attic/student_practicemode.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 *** student_practicemode.php 13 Jun 2005 13:04:22 -0000 1.1.2.1 --- student_practicemode.php 18 Jun 2005 21:01:01 -0000 1.1.2.2 *************** *** 18,22 **** find informative, but it does not officially count for anything. For more information about the marking system, see the section on ! <a href="#assessment">assessment mode</a>. <br /><br /> --- 18,22 ---- find informative, but it does not officially count for anything. For more information about the marking system, see the section on ! assessment mode. <br /><br /> *************** *** 26,28 **** If you try the test again after doing this, you will get slightly different questions. - --- 26,27 ---- |
From: Chris S. <san...@us...> - 2005-06-18 21:01:46
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/html Modified Files: Tag: frontend_dev admin-menu.txt index-menu.txt student-menu.txt Log Message: Index: index-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/index-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 *** index-menu.txt 16 Jun 2005 11:44:45 -0000 1.2.2.2 --- index-menu.txt 18 Jun 2005 21:01:02 -0000 1.2.2.3 *************** *** 5,14 **** .Register|index.php?action=registration_screen .About STACK|documentation.php?action=about_general ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..Question Bank Demo|question_bank.php ! ..CAS online Demo|chat.php ! ..STACK at Sourceforge|http://sourceforge.net/projects/stack|_blank ! ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo --- 5,22 ---- .Register|index.php?action=registration_screen .About STACK|documentation.php?action=about_general + ..Question bank|question_bank.php + ...New question|question_bank.php?action=edit_new + ...Author doc|documentation.php?action=author_gettingstarted + ...Syntax|documentation.php?action=author_commonsyntax + ...Options|documentation.php?action=author_options + ...Answer tests|documentation.php?action=author_answertest + ...FAQ|documentation.php?action=author_faq + ...Maxima|documentation.php?action=author_maxima + ...CAS functions|documentation.php?action=functions + ..CAS online|chat.php ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ! ..Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo Index: student-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/student-menu.txt,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** student-menu.txt 16 Jun 2005 12:13:37 -0000 1.2.2.3 --- student-menu.txt 18 Jun 2005 21:01:02 -0000 1.2.2.4 *************** *** 8,21 **** ..Practice Mode|documentation.php?action=student_practicemode ..Assessment Mode|documentation.php?action=student_assessmentmode - ..Question formatting|documentation.php?action=student_understandingoutput ..Answer Input|documentation.php?action=student_input ..Forbidden Answers|documentation.php?action=student_forbidden .About STACK |documentation.php?action=about_general - ..Install|documentation.php?action=about_install - ..Develop|documentation.php?action=about_develop ..Question Bank Demo|question_bank.php ..CAS online Demo|chat.php ! ..STACK at Sourceforge|http://sourceforge.net/projects/stack|_blank ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo --- 8,21 ---- ..Practice Mode|documentation.php?action=student_practicemode ..Assessment Mode|documentation.php?action=student_assessmentmode ..Answer Input|documentation.php?action=student_input + ..Stack's output|documentation.php?action=student_understandingoutput ..Forbidden Answers|documentation.php?action=student_forbidden .About STACK |documentation.php?action=about_general ..Question Bank Demo|question_bank.php ..CAS online Demo|chat.php ! ..Install|documentation.php?action=about_install ! ..Develop|documentation.php?action=about_develop ..STACK Forum|http://mantis.york.ac.uk/moodle/mod/forum/index.php?id=21|_blank + ..STACK at Sourceforge|http://sourceforge.net/projects/stack|_blank ..Contact|mailto:ch...@sa... . <img src="pics/logo.png" width='120' alt="STACK logo" />|documentation.php?action=logo Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.8.2.8 retrieving revision 1.8.2.9 diff -C2 -d -r1.8.2.8 -r1.8.2.9 *** admin-menu.txt 16 Jun 2005 14:30:16 -0000 1.8.2.8 --- admin-menu.txt 18 Jun 2005 21:01:02 -0000 1.8.2.9 *************** *** 10,26 **** .Logout|index.php?action=logout .Help|documentation.php ! ..Getting Started|documentation.php?action=author_gettingstarted ! ..Common Syntax|documentation.php?action=author_commonsyntax ..Question fields|documentation.php?action=author_questionfields ..Options|documentation.php?action=author_options ! ..Answer Tests|documentation.php?action=author_answertest ..Potential responses|documentation.php?action=author_potresp ..FAQ|documentation.php?action=author_faq ..Maxima|documentation.php?action=author_maxima ! ..Enabled Maxima functions|documentation.php?action=functions .About STACK |documentation.php?action=about_general ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..CAS online Demo|chat.php ..MathML Demo|chat_mathml.php ..Sourceforge|http://sourceforge.net/projects/stack|_blank --- 10,26 ---- .Logout|index.php?action=logout .Help|documentation.php ! ..Author doc|documentation.php?action=author_gettingstarted ! ..Syntax|documentation.php?action=author_commonsyntax ..Question fields|documentation.php?action=author_questionfields ..Options|documentation.php?action=author_options ! ..Answer tests|documentation.php?action=author_answertest ..Potential responses|documentation.php?action=author_potresp ..FAQ|documentation.php?action=author_faq ..Maxima|documentation.php?action=author_maxima ! ..CAS functions|documentation.php?action=functions .About STACK |documentation.php?action=about_general ..Install|documentation.php?action=about_install ..Develop|documentation.php?action=about_develop ! ..CAS online|chat.php ..MathML Demo|chat_mathml.php ..Sourceforge|http://sourceforge.net/projects/stack|_blank |
From: Chris S. <san...@us...> - 2005-06-18 21:01:46
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/frontend_general Modified Files: Tag: frontend_dev front_end_display.php frontend_util.php loginregister.php qb_display.php Log Message: Index: frontend_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/frontend_util.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 *** frontend_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 --- frontend_util.php 18 Jun 2005 21:01:01 -0000 1.1.2.5 *************** *** 111,115 **** } - - ?> --- 111,113 ---- Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.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 *** qb_display.php 18 Jun 2005 09:54:12 -0000 1.1.2.7 --- qb_display.php 18 Jun 2005 21:01:01 -0000 1.1.2.8 *************** *** 63,85 **** <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; } - - /* - * Displays the page with the file to export - * @param array $name The name of the file - * @return void - */ - function stack_display_qb_export($name) { - global $stack_web_url; - echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; - } ! /* ! * Displays a message saying that no questions have been selected ! * @return void ! */ ! function stack_display_error_no_questions_selected() { ! echo "<p>Could not get any ticked questions! Please try again.</p>"; ! } ! /* * Displays the edit metadate form --- 63,68 ---- <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; } ! /* * Displays the edit metadate form *************** *** 89,93 **** function stack_display_qb_edit_metadata($question_bank_filter) { global $stack_root; - $options = ''; include("{$stack_root}/html/qselectform.php"); --- 72,75 ---- *************** *** 97,110 **** - - /* - * Displays a message saying that the user is not the admin - * @return void - */ - function stack_display_qb_error_not_admin() { - echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; - } - - /* * Displays the form for importing a file --- 79,82 ---- *************** *** 149,152 **** --- 121,129 ---- if ($errc) { echo "<td><font color=\"red\">Invalid question</font></td>"; + echo "</tr></tbody></table>\n\n"; + echo stack_question_errstr($errs[$key]); + echo "\n\n<table><thead><tr>"; + echo '<th>ID</th><th>Name</th> <th>Description</th> <th>Key words</th> <th></th>'; + echo '</tr></thead><tbody>'; } else { echo "<td><font color=\"greed\">Valid question</font></td>"; *************** *** 159,178 **** } - /* - * Displays an error messages saying the the import failed - * @return void - */ - function stack_display_qb_error_upload_failure() { - echo '<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; - } - - /* - * Displays an error messages saying that the question validation failed - * @return void - */ - function stack_display_qb_error_validation_failure() { - echo '<p>Could not instantiate the question, because of errors. - <br />Try to edit the question instead.</p>'; - } /* --- 136,139 ---- Index: loginregister.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/loginregister.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 *** loginregister.php 17 Jun 2005 16:25:28 -0000 1.1.2.2 --- loginregister.php 18 Jun 2005 21:01:01 -0000 1.1.2.3 *************** *** 27,32 **** */ - include_once($stack_root."/scripts/stackUser.php"); - // Log user into STACK if ('login' == $action) { --- 27,30 ---- *************** *** 102,108 **** $_SESSION['user'] = $user; - - - ?> - --- 100,102 ---- 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.8 retrieving revision 1.1.2.9 diff -C2 -d -r1.1.2.8 -r1.1.2.9 *** front_end_display.php 17 Jun 2005 16:25:28 -0000 1.1.2.8 --- front_end_display.php 18 Jun 2005 21:01:01 -0000 1.1.2.9 *************** *** 79,91 **** /* - * Displays an error message saying that a non-logged in user cannot update their information. - * @return void - */ - function stack_display_main_error_update_userinfo() { - echo '<h1>Update user information</h1>'; - echo '<p>Please logout and login as a personal user first to update your information.</p>'; - } - - /* * Displays the registration screen * @param string $username --- 79,82 ---- *************** *** 104,173 **** } - /* - * Displays a logout message - * @return void - */ - function stack_display_main_logout() { - echo '<h1>Thank you</h1><p>Thank you for using STACK.'; - } - /* - * Displays the student quiz selection screen - * @param array $quize_store The store of quizzes - * @param $user - * @return void - */ - function stack_display_main_select_quiz($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>"; - } - } - /* - * Displays an error message if there was a problem with login or registrations - * @param array $error - * @return void - */ - function stack_display_main_error_login($error) { - echo "There was an error with the login or registration"; - echo $error; - } - - /* - * Displays a welcome message - * @param array $user The user to be welcomed - * @return void - */ - function stack_display_main_welcome($user) { - echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; - } ?> --- 95,100 ---- |
From: Chris S. <san...@us...> - 2005-06-18 21:01:22
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/lang/en Modified Files: Tag: frontend_dev stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/Attic/stack.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 *** stack.php 17 Jun 2005 12:24:58 -0000 1.1.2.1 --- stack.php 18 Jun 2005 21:01:03 -0000 1.1.2.2 *************** *** 43,46 **** --- 43,50 ---- $string['QValidquestionnotar'] = '$question variable does not exist!'; $string['QValidMaximaName'] = 'is a Maxima function name.'; + $string['QValidSummaryTable0'] = 'The item is invalid, and the following field(s) contain errors.'; + $string['QValidSummaryTable1'] = 'One or more of the <b>{$a}</b> contained error(s), as follows.'; + $string['QValidSummaryTable2'] = 'The variable \'$a\':'; + $string['QValidSummaryTable3'] = 'Potential response \'$a\''; $string['QInstCASError'] = 'The CAS generated errors when creating a question version.'; $string['CASError'] = 'CAS ERROR!'; *************** *** 191,194 **** --- 195,206 ---- $string['stackOptions_ShowSol'] = 'Show solution'; + + //////////////////////////////////// + // Question bank. + //////////////////////////////////// + + $string['qp_notadmin'] = "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; + + //////////////////////////////////// // Interactions with the CAS |
From: Chris S. <san...@us...> - 2005-06-18 21:01:19
|
Update of /cvsroot/stack/stack-1-0/maximadocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/maximadocs Modified Files: Tag: frontend_dev functions.php Log Message: Index: functions.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/maximadocs/functions.php,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** functions.php 6 Jun 2005 09:38:34 -0000 1.6 --- functions.php 18 Jun 2005 21:01:03 -0000 1.6.4.1 *************** *** 13,18 **** together with the extent to which they are supported by STACK.</p> - <p><a href="maximadocs/maxdoc/maxima_toc.html">Complete maxima documentation</a> <a href="../doc/">STACK documentation</a></p> - <p>Some whole libraries have been excluded from STACK. Hence, there may be no good reason why a function you would like has been excluded from this list. If you think this is the case, please --- 13,16 ---- |