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-18 21:01:19
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957 Modified Files: Tag: frontend_dev index.php qb_preview.php question_bank.php Log Message: Index: qb_preview.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_preview.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** qb_preview.php 18 Jun 2005 09:54:12 -0000 1.1.2.6 --- qb_preview.php 18 Jun 2005 21:01:02 -0000 1.1.2.7 *************** *** 1,96 **** <?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 question_bank.php - * TO DO: This code should really be factored out into functions and the logic - * returned to question_bank.php - * TO DO: There appears to be no difference between the behaviour of 'mark' and - * 'validate' as an action - is there are reason why there are separate actions? - * @package frontend - * @subpackage Stack - */ - - // 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) { - stack_display_qb_error_validation_failure(); - $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); - } ?> --- 1,3 ---- Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.22 retrieving revision 1.3.2.23 diff -C2 -d -r1.3.2.22 -r1.3.2.23 *** question_bank.php 18 Jun 2005 09:54:12 -0000 1.3.2.22 --- question_bank.php 18 Jun 2005 21:01:02 -0000 1.3.2.23 *************** *** 65,69 **** // export_xml_db Export single question as xml from the database. // export_xml_list Export the list of selected questions as a single XML file ! // import Deal with an uploaded file. // edit_metadata Edit all the meta data fields in the question bank. // questionbank_screen Begin again. --- 65,70 ---- // 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. *************** *** 94,98 **** } ! if ('export_xml_db' == $action) { $action = 'export_xml'; } --- 95,99 ---- } ! if ('export_xml_db' == $action) { $action = 'export_xml'; } *************** *** 126,133 **** // Work out the correct value for any filter to be applied to the question ! // bank $question_bank_filter = stack_get_questionbank_filter(); - $upload_successful = FALSE; if ('uploaded_xml' == $action) { --- 127,133 ---- // 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) { *************** *** 149,181 **** } } - - // Export a whole list of questions. - $multiple_questions = FALSE; ! if ('export_xml_list'==$action) { ! $multiple_questions = TRUE; ! $action = 'export_xml'; } ! ! if ('export_xml'==$action) { ! if ($multiple_questions) { ! $questions_to_export = stack_get_selected_questions(); ! } else { ! stack_question_validate($question,$errors); ! } ! include_once("{$stack_root}/scripts/stackXML.php"); ! ! if ($multiple_questions) { $name = stack_xml_write_quiz_file($questions_to_export, "{$stack_root}/tmp/"); ! } else { ! $name = stack_xml_write_question_file($question, "{$stack_root}/tmp/"); ! } } if ('edit_metadata' == $action ) { ! if (!$admin) { ! stack_display_qb_error_not_admin(); ! } else { // If needed update the database if (array_key_exists('edit_metadata',$_POST)) { --- 149,173 ---- } } ! 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)) { *************** *** 223,228 **** stack_display_qb_show_imported($quiz); } else { ! stack_display_qb_error_upload_failure(); } break; case 'import': --- 215,221 ---- 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': *************** *** 231,246 **** case 'export_xml': if (NULL == $questions_to_export) { ! stack_display_error_no_questions_selected(); ! $action = 'questionbank_screen'; } ! stack_display_qb_export($name); break; case 'edit_metadata': stack_display_qb_edit_metadata($question_bank_filter); break; } ! // Deal with actions connected with previewing questions ! include('qb_preview.php'); switch ($action) { --- 224,310 ---- 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) { *************** *** 249,252 **** --- 313,319 ---- break; case 'edit': + if (!$admin) { + print_string('qp_notadmin','stack'); + } stack_display_qb_edit($question, $errors); break; Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.12 retrieving revision 1.17.2.13 diff -C2 -d -r1.17.2.12 -r1.17.2.13 *** index.php 18 Jun 2005 09:54:12 -0000 1.17.2.12 --- index.php 18 Jun 2005 21:01:02 -0000 1.17.2.13 *************** *** 44,47 **** --- 44,48 ---- session_unregister('user'); unset($_SESSION['user']); + $_GET['expand'] = 0; } *************** *** 59,68 **** if ('logout' == $action) { ! stack_display_main_logout(); $action = 'loginscreen'; } if ('welcome' == $action) { ! stack_display_main_welcome($user); $action = 'choose_quiz'; } --- 60,69 ---- 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'; } *************** *** 81,93 **** stack_display_main_update_userinfo($user, $err, $errors); } else { ! stack_display_main_error_update_userinfo(); } break; case 'error': ! stack_display_main_error_login($error); break; case 'choose_quiz': $quiz_store = stack_db_quiz_get(); ! stack_display_main_select_quiz($quiz_store, $user); break; } --- 82,95 ---- 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; } |
From: Chris S. <san...@us...> - 2005-06-18 21:01:19
|
Update of /cvsroot/stack/stack-1-0/scripts/CASpool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/scripts/CASpool Modified Files: Tag: frontend_dev stackCAS.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/CASpool/stackCAS.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** stackCAS.php 12 Jun 2005 16:10:00 -0000 1.4 --- stackCAS.php 18 Jun 2005 21:01:04 -0000 1.4.2.1 *************** *** 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-18 21:01:19
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/scripts Modified Files: Tag: frontend_dev stackQuestion.php stackQuiz.php stackUtility.php stackXML.php Log Message: Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.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 *** stackQuiz.php 17 Jun 2005 10:54:52 -0000 1.1.2.1 --- stackQuiz.php 18 Jun 2005 21:01:04 -0000 1.1.2.2 *************** *** 26,28 **** --- 26,71 ---- $stackQuiz['quizMode']['mysql'] = 'TINYTEXT'; + /* + * Displays the student quiz selection screen + * @param array $quize_store The list of quizzes + * @param $user + * @return void + */ + function stack_quiz_student_select($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>"; + } + } + + ?> Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** stackXML.php 1 Apr 2005 18:59:31 -0000 1.2 --- stackXML.php 18 Jun 2005 21:01:05 -0000 1.2.4.1 *************** *** 66,70 **** $xml .= $pad." <{$tag}_ord order=\"$key\">\n".stack_xml_create_question_frag($orderdata,$depth+6)."$pad </{$tag}_ord>\n"; } ! $xml .= $pad."</$tag>\n";; } else { // Just a regular open tag. --- 66,70 ---- $xml .= $pad." <{$tag}_ord order=\"$key\">\n".stack_xml_create_question_frag($orderdata,$depth+6)."$pad </{$tag}_ord>\n"; } ! $xml .= $pad."</$tag>\n"; } else { // Just a regular open tag. *************** *** 127,132 **** function stack_xml_write_quiz_file($quiz, $directory) { // takes a $stackQuestion array and writes it to an XML file in $directory ! ! $xml_file_name = 'stack_quiz.xml'; // create the file we will use for writing --- 127,133 ---- function stack_xml_write_quiz_file($quiz, $directory) { // takes a $stackQuestion array and writes it to an XML file in $directory ! ! ! $xml_file_name = 'stack_quiz_'.time().'.xml'; // create the file we will use for writing Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.php,v retrieving revision 1.22.2.2 retrieving revision 1.22.2.3 diff -C2 -d -r1.22.2.2 -r1.22.2.3 *** stackUtility.php 18 Jun 2005 09:54:13 -0000 1.22.2.2 --- stackUtility.php 18 Jun 2005 21:01:04 -0000 1.22.2.3 *************** *** 14,17 **** --- 14,18 ---- } require_once("{$stack_root}/scripts/stackQuiz.php"); + require_once("{$stack_root}/scripts/stackUser.php"); require_once("{$stack_root}/frontend_general/frontend_util.php"); *************** *** 27,31 **** /** ! * Synonym for the PHP function htmlspecialchars * * @param string $str The input string. --- 28,32 ---- /** ! * Synonym for the PHP function htmlspecialchars. See the Moodle function s(.) * * @param string $str The input string. *************** *** 109,113 **** * @return array Field [0] contains the string between the two characters, Field [1] contains the start position of -1 if it does not exist and Field [2] contains the end position of -1 if there was no match. */ ! function GrabBetween($strin,$leftc,$rightc,$start) { // Starting at $start, (a number) // Find the first occurance of $leftc, match with an occurance of --- 110,114 ---- * @return array Field [0] contains the string between the two characters, Field [1] contains the start position of -1 if it does not exist and Field [2] contains the end position of -1 if there was no match. */ ! function stack_util_grabbetween($strin,$leftc,$rightc,$start) { // Starting at $start, (a number) // Find the first occurance of $leftc, match with an occurance of Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.19.2.3 retrieving revision 1.19.2.4 diff -C2 -d -r1.19.2.3 -r1.19.2.4 *** stackQuestion.php 18 Jun 2005 09:54:13 -0000 1.19.2.3 --- stackQuestion.php 18 Jun 2005 21:01:04 -0000 1.19.2.4 *************** *** 331,335 **** } } else { ! $errors[$qfield] = get_string('QValidRequiredField','stack','');; $question[$qfield] = ''; } --- 331,335 ---- } } else { ! $errors[$qfield] = get_string('QValidRequiredField','stack',''); $question[$qfield] = ''; } *************** *** 443,447 **** foreach ($cas_keywords as $cas_kw) { if (in_array($locvar['key'],$stack_cas[$cas_kw])) { ! $errors[$keyvals_name_raw][$locvar['key']] = $locvar['key']." ".get_string('QValidMaximaName','stack','');; } } --- 443,447 ---- foreach ($cas_keywords as $cas_kw) { if (in_array($locvar['key'],$stack_cas[$cas_kw])) { ! $errors[$keyvals_name_raw][$locvar['key']] = $locvar['key']." ".get_string('QValidMaximaName','stack',''); } } *************** *** 595,601 **** global $stackQuestion,$stackQuestionPotResp; $errstr = ''; - if (is_array($errors)) { ! $errstr = "<b>The item is invalid, and the following field(s) contain errors.</b><br />\n\n"; $errstr .= "<table border='1' cellpadding='2'>"; foreach ($errors as $qfield => $err) { --- 595,600 ---- global $stackQuestion,$stackQuestionPotResp; $errstr = ''; if (is_array($errors)) { ! $errstr = '<b>'.get_string('QValidSummaryTable0','stack')."</b><br />\n\n"; $errstr .= "<table border='1' cellpadding='2'>"; foreach ($errors as $qfield => $err) { *************** *** 603,607 **** if ('questionPotResp' == $qfield) { foreach($err as $varname => $varerr) { ! $errstr .= "\n<tr><td colspan='2'><b>Potential response '$varname' </b></td></tr>\n"; foreach ($varerr as $prf => $pre) { if (is_array($pre) ) { --- 602,606 ---- if ('questionPotResp' == $qfield) { foreach($err as $varname => $varerr) { ! $errstr .= "\n<tr><td colspan='2'><b>".get_string('QValidSummaryTable3','stack',$varname)." </b></td></tr>\n"; foreach ($varerr as $prf => $pre) { if (is_array($pre) ) { *************** *** 620,627 **** } ! if ('questionVarsRaw' == $qfield) { ! $errstr .= "\n<tr><td colspan='2'>One or more of the <b>".$stackQuestion[$qfield]['descript']."</b> contained error(s), as follows.</td></tr>"; foreach($err as $varname => $varerr) { ! $errstr .= "\n<tr><td>The variable '$varname': </td><td>".$varerr."</td></tr>\n"; } $errstr .= "<tr><td> </td><td> </td></tr>\n"; --- 619,627 ---- } ! if ('questionVarsRaw' == $qfield or 'questionAnsVarsRaw' == $qfield) { ! $a = get_string('stackQuestion_'.$qfield,'stack'); ! $errstr .= "\n<tr><td colspan='2'>".get_string('QValidSummaryTable1','stack',$a).'</td></tr>'; foreach($err as $varname => $varerr) { ! $errstr .= "\n<tr><td>".get_string('QValidSummaryTable2','stack',$varname)."</td><td>".$varerr."</td></tr>\n"; } $errstr .= "<tr><td> </td><td> </td></tr>\n"; *************** *** 629,633 **** } else { ! $errstr .= '<tr><td><b>'.$stackQuestion[$qfield]['descript'].":</b></td><td> ".$err."</td></tr>\n\n"; } --- 629,634 ---- } else { ! $fname = get_string('stackQuestion_'.$qfield,'stack'); ! $errstr .= '<tr><td><b>'.$fname.":</b></td><td> ".$err."</td></tr>\n\n"; } *************** *** 1845,1849 **** echo $options['FeedBackGenericCorrect']; } else if (0==$this_attempt['RawMark']) { ! echo $options['FeedBackGenericIncorrect'];; } else { echo $options['FeedBackGenericPCorrect']; --- 1846,1850 ---- echo $options['FeedBackGenericCorrect']; } else if (0==$this_attempt['RawMark']) { ! echo $options['FeedBackGenericIncorrect']; } else { echo $options['FeedBackGenericPCorrect']; |
From: Chris S. <san...@us...> - 2005-06-18 09:54:26
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/scripts/install Modified Files: Tag: frontend_dev sample_questions.xml Log Message: Index: sample_questions.xml =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/sample_questions.xml,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** sample_questions.xml 25 Apr 2005 18:09:46 -0000 1.5 --- sample_questions.xml 18 Jun 2005 09:54:12 -0000 1.5.4.1 *************** *** 800,805 **** </assessmentItem_ord> <assessmentItem_ord order="15"> ! <questionVarsRaw>a = 1;b = 1;c = -1*(1+rand(3));d = 1+rand(3);p = x*abs(x);xl = -2;xr = 3-c;yu = 3+d;yl = -2;q = a*subst( b*x+c,x,p)+d</questionVarsRaw> ! <questionStem>One function $f(x)=@p@$ is plotted in blue. A transformed version of the form \[ af(bx+c)+d,\] --- 800,805 ---- </assessmentItem_ord> <assessmentItem_ord order="15"> ! <questionVarsRaw>aa = 1;bb = 1;cc = -1*(1+rand(3));dd = 1+rand(3);p = x*abs(x);xl = -2;xr = 3-cc;yu = 3+dd;yl = -2;q = aa*subst( bb*x+cc,x,p)+dd</questionVarsRaw> ! <questionStem>One function $f(x)=@p@$ is plotted in blue. A transformed version of the form \[ af(bx+c)+d,\] *************** *** 808,1011 **** What is this transform?\par Enter your answer as the transformed $f$, not the expression for the red function itself.</questionStem> ! <questionAns>a*f(b*x+c)+d</questionAns> ! <questionAnsKey>sa</questionAnsKey> ! <questionAnsVarsRaw>l = fntrans_unpack(sa)</questionAnsVarsRaw> ! <questionPotResp> ! <questionPotResp_ord order="0"> ! <SAns>sa</SAns> ! <TAns>a*f(b*x+c)+d</TAns> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>1</RawMark> ! <ApLat>-1</ApLat> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <AnswerNote>@l@</AnswerNote> ! <ApLat>1</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="1"> ! <SAns>l[1]</SAns> ! <TAns>TRUE</TAns> ! <AnsTest>SA_True</AnsTest> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>2</ApLat> ! <FeedBack>Your answer isn't correct. The original function is plotted in blue, the transformed function in red, and your function in green. @plot([p,q, l[2]*subst( l[3]*x+l[4],x,p)+l[5]],[x,xl,xr],[y,yl,yu])@</FeedBack> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <Penalty>0</Penalty> ! <ApLat>7</ApLat> ! <FeedBack>Your answer does not seem to be in the correct form $af(bx+c)+d$.</FeedBack> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="2"> ! <SAns>l[2]</SAns> ! <TAns>a</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>3</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>3</ApLat> ! <FeedBack>Your value of $a$ is not correct.</FeedBack> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="3"> ! <SAns>l[3]</SAns> ! <TAns>b</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>4</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>4</ApLat> ! <FeedBack>Your value of $b$ is not correct.</FeedBack> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="4"> ! <SAns>l[4]</SAns> ! <TAns>c</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>6</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>5</ApLat> ! <FeedBack>Your value of $c$ is not correct.</FeedBack> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="5"> ! <SAns>l[4]</SAns> ! <TAns>-c</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <AnswerNote>Horz shift wrong way!</AnswerNote> ! <ApLat>6</ApLat> ! <FeedBack>You have simply shifted the wrong way!</FeedBack> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>6</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="6"> ! <SAns>l[5]</SAns> ! <TAns>d</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>-1</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>-1</ApLat> ! <FeedBack>Your value of $d$ is not correct.</FeedBack> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="7"> ! <SAns>sa</SAns> ! <TAns>q</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>-1</ApLat> ! <FeedBack>You have actually typed in the {\em formula} for the function shown, not the {\em transformation.} This is good, but not what you were asked to do. Please try again.</FeedBack> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>-1</ApLat> ! </false> ! </questionPotResp_ord> ! </questionPotResp> ! <questionOptions> ! <InsertStars>FALSE</InsertStars> ! </questionOptions> ! <questionNote>@p@, @[a,b,c,d]@</questionNote> ! <questionVars> ! <questionVars_ord order="0"> ! <key>a</key> ! <value>1</value> ! </questionVars_ord> ! <questionVars_ord order="1"> ! <key>b</key> ! <value>1</value> ! </questionVars_ord> ! <questionVars_ord order="2"> ! <key>c</key> ! <value>-1*(1+rand(3))</value> ! </questionVars_ord> ! <questionVars_ord order="3"> ! <key>d</key> ! <value>1+rand(3)</value> ! </questionVars_ord> ! <questionVars_ord order="4"> ! <key>p</key> ! <value>x*abs(x)</value> ! </questionVars_ord> ! <questionVars_ord order="5"> ! <key>xl</key> ! <value>-2</value> ! </questionVars_ord> ! <questionVars_ord order="6"> ! <key>xr</key> ! <value>3-c</value> ! </questionVars_ord> ! <questionVars_ord order="7"> ! <key>yu</key> ! <value>3+d</value> ! </questionVars_ord> ! <questionVars_ord order="8"> ! <key>yl</key> ! <value>-2</value> ! </questionVars_ord> ! <questionVars_ord order="9"> ! <key>q</key> ! <value>a*subst( b*x+c,x,p)+d</value> ! </questionVars_ord> ! </questionVars> ! <questionAnsVars> ! <questionAnsVars_ord order="0"> ! <key>l</key> ! <value>fntrans_unpack(sa)</value> ! </questionAnsVars_ord> ! </questionAnsVars> ! <questionGUID>MTExMjE3NjE0NTM1MTY3Mz</questionGUID> ! <questionName>graphic_transform_1</questionName> ! <questionDescription>Find the transform between two graphs.</questionDescription> ! <questionKeywords>demo, graphical</questionKeywords> ! <questionDateLastEdited>2005-04-25 17:23:13</questionDateLastEdited> </assessmentItem_ord> <assessmentItem_ord order="16"> --- 808,964 ---- What is this transform?\par Enter your answer as the transformed $f$, not the expression for the red function itself.</questionStem> ! <questionAns>aa*f(bb*x+cc)+dd</questionAns> ! <questionAnsKey>sa</questionAnsKey> ! <questionAnsVarsRaw>l = fntrans_unpack(sa)</questionAnsVarsRaw> ! <questionPotResp> ! <questionPotResp_ord order="0"> ! <SAns>sa</SAns> ! <TAns>aa*f(bb*x+cc)+dd</TAns> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>1</RawMark> ! <ApLat>-1</ApLat> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>1</ApLat> ! <AnswerNote>@l@</AnswerNote> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="1"> ! <SAns>l[1]</SAns> ! <TAns>TRUE</TAns> ! <AnsTest>SA_True</AnsTest> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>Your answer isn't correct. The original function is plotted in blue, the transformed function in red, and your function in green. @plot([p,q, l[2]*subst( l[3]*x+l[4],x,p)+l[5]],[x,xl,xr],[y,yl,yu])@</FeedBack> ! <ApLat>2</ApLat> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <Penalty>0</Penalty> ! <FeedBack>Your answer does not seem to be in the correct form $af(bx+c)+d$.</FeedBack> ! <ApLat>7</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="2"> ! <SAns>l[2]</SAns> ! <TAns>a</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>3</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>Your value of $a$ is not correct.</FeedBack> ! <ApLat>3</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="3"> ! <SAns>l[3]</SAns> ! <TAns>b</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>4</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>Your value of $b$ is not correct.</FeedBack> ! <ApLat>4</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="4"> ! <SAns>l[4]</SAns> ! <TAns>c</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>6</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>Your value of $c$ is not correct.</FeedBack> ! <ApLat>5</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="5"> ! <SAns>l[4]</SAns> ! <TAns>-cc</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>You have simply shifted the wrong way!</FeedBack> ! <ApLat>6</ApLat> ! <AnswerNote>Horz shift wrong way!</AnswerNote> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>6</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="6"> ! <SAns>l[5]</SAns> ! <TAns>dd</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0.25</RawMark> ! <ApLat>-1</ApLat> ! </true> ! <false> ! <RawMarkMod>+</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>Your value of $d$ is not correct.</FeedBack> ! <ApLat>-1</ApLat> ! </false> ! </questionPotResp_ord> ! <questionPotResp_ord order="7"> ! <SAns>sa</SAns> ! <TAns>q</TAns> ! <AnsTest>AlgEquiv</AnsTest> ! <true> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <FeedBack>You have actually typed in the {\em formula} for the function shown, not the {\em transformation.} This is good, but not what you were asked to do. Please try again.</FeedBack> ! <ApLat>-1</ApLat> ! </true> ! <false> ! <RawMarkMod>=</RawMarkMod> ! <RawMark>0</RawMark> ! <ApLat>-1</ApLat> ! </false> ! </questionPotResp_ord> ! </questionPotResp> ! <questionOptions> ! <InsertStars>FALSE</InsertStars> ! <SyntaxHint>a*f(b*x+c)+d</SyntaxHint> ! </questionOptions> ! <questionNote>@p@, @[a,b,c,d]@</questionNote> ! <questionGUID>MTExMTkzNTY3NzUyOTczNT</questionGUID> ! <questionName>graphic_transform_1</questionName> ! <questionDescription>Find the transform between two graphs.</questionDescription> ! <questionKeywords>demo, graphical</questionKeywords> ! <questionDateLastEdited>1119077575</questionDateLastEdited> </assessmentItem_ord> <assessmentItem_ord order="16"> |
From: Chris S. <san...@us...> - 2005-06-18 09:54:26
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/scripts/maxima Modified Files: Tag: frontend_dev stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -C2 -d -r1.13.2.1 -r1.13.2.2 *** stackmaxima.mac 14 Jun 2005 11:36:07 -0000 1.13.2.1 --- stackmaxima.mac 18 Jun 2005 09:54:12 -0000 1.13.2.2 *************** *** 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 ]"); |
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/scripts Modified Files: Tag: frontend_dev stackAuthor.php stackDatabase.php stackQuestion.php stackUser.php stackUtility.php Removed Files: Tag: frontend_dev en.php nl.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.16.2.6 retrieving revision 1.16.2.7 diff -C2 -d -r1.16.2.6 -r1.16.2.7 *** stackDatabase.php 17 Jun 2005 10:54:52 -0000 1.16.2.6 --- stackDatabase.php 18 Jun 2005 09:54:13 -0000 1.16.2.7 *************** *** 150,154 **** echo "<th></th><th><input type='text' name='bank_filter[name]' value='$filter_name' /> </th> <th> <input type='text' name='bank_filter[kw]' value='$filter_kw' /> ! </th></tr></thead><tbody>"; } for ($i = 0; $i < mysql_num_rows($result); $i++) { --- 150,154 ---- echo "<th></th><th><input type='text' name='bank_filter[name]' value='$filter_name' /> </th> <th> <input type='text' name='bank_filter[kw]' value='$filter_kw' /> ! </th> </tr></thead><tbody>"; } for ($i = 0; $i < mysql_num_rows($result); $i++) { --- en.php DELETED --- Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.php,v retrieving revision 1.22.2.1 retrieving revision 1.22.2.2 diff -C2 -d -r1.22.2.1 -r1.22.2.2 *** stackUtility.php 13 Jun 2005 16:34:21 -0000 1.22.2.1 --- stackUtility.php 18 Jun 2005 09:54:13 -0000 1.22.2.2 *************** *** 14,17 **** --- 14,18 ---- } require_once("{$stack_root}/scripts/stackQuiz.php"); + require_once("{$stack_root}/frontend_general/frontend_util.php"); /** *************** *** 159,162 **** --- 160,165 ---- return $ret; } + + // ********************************************************** Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.19.2.2 retrieving revision 1.19.2.3 diff -C2 -d -r1.19.2.2 -r1.19.2.3 *** stackQuestion.php 17 Jun 2005 13:16:41 -0000 1.19.2.2 --- stackQuestion.php 18 Jun 2005 09:54:13 -0000 1.19.2.3 *************** *** 1019,1032 **** $err_when_inst = "<br /><font color=\"red\">CAS ERROR when instantiated!</font> "; foreach($stackQuestion as $qfield => $val) { if ('castext' == $stackQuestion[$qfield]['type'] and array_key_exists($qfield,$question)) { $errct = ''; ! if (array_key_exists($options, 'Display')) { ! $displayed = $options['Display']; ! $questionInst["{$qfield}Inst"]= stack_castext_to_display($question["{$qfield}Inst"], $imp_locs_Inst, $displayed , $errct); ! } else { ! echo "Error - Display not set in options variable"; ! } ! if (''!=$errct) { // We have some errors! $errors[$qfield]=$err_when_inst.$errct; } --- 1019,1029 ---- $err_when_inst = "<br /><font color=\"red\">CAS ERROR when instantiated!</font> "; + $displayed = $options['Display']; + foreach($stackQuestion as $qfield => $val) { if ('castext' == $stackQuestion[$qfield]['type'] and array_key_exists($qfield,$question)) { $errct = ''; ! $questionInst["{$qfield}Inst"] = stack_castext_to_display($question["{$qfield}Inst"], $imp_locs_Inst, $displayed , $errct); ! if ('' != $errct) { // We have some errors! $errors[$qfield]=$err_when_inst.$errct; } *************** *** 1743,1747 **** $RawAns = $this_attempt['RawAns']; - // (2) Pose the ``question" stack_question_inst_displayq($questionInst); --- 1740,1743 ---- --- nl.php DELETED --- Index: stackUser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUser.php,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** stackUser.php 8 Jun 2005 08:31:18 -0000 1.8 --- stackUser.php 18 Jun 2005 09:54:13 -0000 1.8.4.1 *************** *** 210,212 **** --- 210,214 ---- + + ?> Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.22.2.4 retrieving revision 1.22.2.5 diff -C2 -d -r1.22.2.4 -r1.22.2.5 *** stackAuthor.php 17 Jun 2005 10:54:52 -0000 1.22.2.4 --- stackAuthor.php 18 Jun 2005 09:54:13 -0000 1.22.2.5 *************** *** 192,201 **** // Buttons to go somewhere next if ($stack_stand_alone) { if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preview')\">Preview Question</a> \n"; ! echo "<a href=\"javascript:EditQ('export_xml')\">Export Question</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('save')\">Save Question</a>\n ! <a href=\"javascript:EditQ('save_as')\">Save Question As...</a>\n"; } } --- 192,202 ---- // Buttons to go somewhere next if ($stack_stand_alone) { + echo "<a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preview')\">Try question</a> \n"; ! echo "<a href=\"javascript:EditQ('export_xml')\">Export as XML</a> \n"; if ('admin'==$user['username']) { ! echo "<a href=\"javascript:EditQ('save')\">Store question</a>\n ! <a href=\"javascript:EditQ('save_as')\">Store as a new question </a>\n"; } } *************** *** 270,276 **** // Potential responses ! echo "<br /><a href=\"javascript:EditQ('edit')\">Add</a>\n"; echo '<input type="input" name="questionPotResp[add]" value="0" size="3" />'; ! echo " potential responses<a href=\"javascript:HelpPopup('all','stackQuestionPotResp');\"><img align=\"middle\" border=\"0\" height=\"17\" width=\"17\" src=\"pics/help.gif\" /></a> (distractors etc).<br />"; if (array_key_exists('questionPotResp',$question)) { --- 271,277 ---- // Potential responses ! echo "<br /><a href=\"javascript:EditQ('edit')\">Edit</a> and add \n"; echo '<input type="input" name="questionPotResp[add]" value="0" size="3" />'; ! echo " potential responses<a href=\"javascript:HelpPopup('all','author_potresp');\"><img align=\"middle\" border=\"0\" height=\"17\" width=\"17\" src=\"pics/help.gif\" /></a> (distractors etc).<br />"; if (array_key_exists('questionPotResp',$question)) { *************** *** 319,324 **** echo "<p><a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preveiw')\">Try this question</a> \n"; ! echo "<a href=\"javascript:EditQ('export_xml')\">Export XML</a> \n"; if ('admin'==$user['username']) { echo "<a href=\"javascript:EditQ('save')\">Store question</a>\n --- 320,325 ---- echo "<p><a href=\"javascript:EditQ('edit')\">Edit question</a> \n"; if (''==$errors) { ! echo "<a href=\"javascript:EditQ('preveiw')\">Try question</a> \n"; ! echo "<a href=\"javascript:EditQ('export_xml')\">Export as XML</a> \n"; if ('admin'==$user['username']) { echo "<a href=\"javascript:EditQ('save')\">Store question</a>\n |
From: Chris S. <san...@us...> - 2005-06-18 09:54:25
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637 Modified Files: Tag: frontend_dev index.php qb_preview.php question_bank.php quiz.php Log Message: Index: qb_preview.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_preview.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 *** qb_preview.php 17 Jun 2005 16:25:27 -0000 1.1.2.5 --- qb_preview.php 18 Jun 2005 09:54:12 -0000 1.1.2.6 *************** *** 1,93 **** ! <?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 question_bank.php ! * TO DO: This code should really be factored out into functions and the logic ! * returned to question_bank.php ! * TO DO: There appears to be no difference between the behaviour of 'mark' and ! * 'validate' as an action - is there are reason why there are separate actions? ! * @package frontend ! * @subpackage Stack ! */ ! ! ! // 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(); ! // TO DO: There was a bug originally in the code that is still here ! // where the Display field of $options does not get set. As a result ! // the preview code does not work ! ! $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) { ! stack_display_qb_error_validation_failure(); ! $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; ! stack_display_qb_preview($questionInst); ! stack_question_inst_try_test($questionInst,$this_attempt,$options,$errors); ! } ! ?> --- 1,96 ---- ! <?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 question_bank.php ! * TO DO: This code should really be factored out into functions and the logic ! * returned to question_bank.php ! * TO DO: There appears to be no difference between the behaviour of 'mark' and ! * 'validate' as an action - is there are reason why there are separate actions? ! * @package frontend ! * @subpackage Stack ! */ ! ! // 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) { ! stack_display_qb_error_validation_failure(); ! $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); ! } ! ?> Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.22.2.5 retrieving revision 1.22.2.6 diff -C2 -d -r1.22.2.5 -r1.22.2.6 *** quiz.php 17 Jun 2005 10:54:51 -0000 1.22.2.5 --- quiz.php 18 Jun 2005 09:54:12 -0000 1.22.2.6 *************** *** 564,568 **** // (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)) { Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.21 retrieving revision 1.3.2.22 diff -C2 -d -r1.3.2.21 -r1.3.2.22 *** question_bank.php 17 Jun 2005 16:25:27 -0000 1.3.2.21 --- question_bank.php 18 Jun 2005 09:54:12 -0000 1.3.2.22 *************** *** 78,82 **** if ('edit_new' == $action) { $new_question = TRUE; ! $action = 'edit'; } --- 78,82 ---- if ('edit_new' == $action) { $new_question = TRUE; ! $action = 'edit'; } *************** *** 99,113 **** $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'; --- 99,114 ---- $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'; *************** *** 120,126 **** if ($get_question) { $question = stack_get_question($source); ! ! $options = stack_options_set($question); ! $questionInst = stack_get_questionInst(); } --- 121,125 ---- if ($get_question) { $question = stack_get_question($source); ! $options = stack_options_set($question); $questionInst = stack_get_questionInst(); } *************** *** 260,265 **** ////////////////////////////////////////////////////////////// ! ! if ('questionbank_screen'==$action or 'edit_metadata' == $action) { session_unregister('question'); session_unregister('questionInst'); --- 259,263 ---- ////////////////////////////////////////////////////////////// ! if ('questionbank_screen'==$action or 'edit_metadata' == $action){ session_unregister('question'); session_unregister('questionInst'); Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.11 retrieving revision 1.17.2.12 diff -C2 -d -r1.17.2.11 -r1.17.2.12 *** index.php 17 Jun 2005 16:25:26 -0000 1.17.2.11 --- index.php 18 Jun 2005 09:54:12 -0000 1.17.2.12 *************** *** 32,38 **** include('stackstd.php'); $default_action = 'loginscreen'; - include($stack_root.'/frontend_general/process_input.php'); include_once($stack_root.'/frontend_general/front_end_display.php'); ! include_once($stack_root.'/frontend_general/frontend_util.php'); /////////////////////////////////////////////////////////////// --- 32,37 ---- include('stackstd.php'); $default_action = 'loginscreen'; include_once($stack_root.'/frontend_general/front_end_display.php'); ! include($stack_root.'/frontend_general/process_input.php'); /////////////////////////////////////////////////////////////// *************** *** 48,52 **** include('frontend_general/loginregister.php'); ! $err = stack_get_err($errors); $errun = stack_get_errun($err); $errps = stack_get_errps($err); --- 47,51 ---- include('frontend_general/loginregister.php'); ! $err = nsf($errors,'user'); $errun = stack_get_errun($err); $errps = stack_get_errps($err); |
From: Chris S. <san...@us...> - 2005-06-18 09:54:25
|
Update of /cvsroot/stack/stack-1-0/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/doc Modified Files: Tag: frontend_dev help_popup.php Log Message: Index: help_popup.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/doc/Attic/help_popup.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 *** help_popup.php 14 Jun 2005 18:12:02 -0000 1.1.2.1 --- help_popup.php 18 Jun 2005 09:54:11 -0000 1.1.2.2 *************** *** 50,55 **** include('student_input.php'); ! } ! else if('all'==$field) { // Then we would like a lot of documentation. --- 50,54 ---- include('student_input.php'); ! } else if('all'==$field) { // Then we would like a lot of documentation. |
From: Chris S. <san...@us...> - 2005-06-18 09:54:25
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/frontend_general Modified Files: Tag: frontend_dev frontend_util.php process_input.php qb_display.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.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** frontend_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 --- frontend_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 *************** *** 1,4 **** <?php - /** * --- 1,3 ---- *************** *** 19,23 **** * @author Juliette White jv...@jv... * - * * * This file contains utility functions used by the front end code --- 18,21 ---- *************** *** 28,33 **** */ ! include_once('scripts/stackUtility.php'); ! /* --- 26,32 ---- */ ! // ********************************************************** ! // General user related functions ! // ********************************************************** /* *************** *** 36,50 **** * @return string $username The username */ ! function stack_get_username($user) { return nsf('username',$user); } - /* - * @param array $errors, The errors array - * @return string - */ - function stack_get_err($errors) { - return nsf($errors,'user'); - } /* --- 35,42 ---- * @return string $username The username */ ! function stack_user_get_name($user) { return nsf('username',$user); } /* Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** qb_display.php 17 Jun 2005 16:25:28 -0000 1.1.2.6 --- qb_display.php 18 Jun 2005 09:54:12 -0000 1.1.2.7 *************** *** 43,48 **** 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> "; - } /* --- 43,48 ---- 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> "; } + /* *************** *** 57,65 **** include("{$stack_root}/html/qselectform.php"); stack_question_edit_form($question,$errors); ! ! echo "<p><a href=\"javascript:HelpPopup('all','stackQuestion');\">Help with question fields.</a>\n ! <a href=\"javascript:HelpPopup('all','stackOptions');\">Help with options.</a>\n ! <a href=\"javascript:HelpPopup('all','stackAnswerTest');\">Help with answer tests.</a>\n ! <a href=\"javascript:HelpPopup('all','stackQuestionPotResp');\">Help with potential responses.</a></p>"; } --- 57,65 ---- 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>"; } *************** *** 93,100 **** stack_db_listquestions('edit_metadata',$question_bank_filter); - // This line appears to be broken - it doesn't save the metadata! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } /* * Displays a message saying that the user is not the admin --- 93,101 ---- stack_db_listquestions('edit_metadata',$question_bank_filter); echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } + + /* * Displays a message saying that the user is not the admin *************** *** 104,107 **** --- 105,109 ---- echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; } + /* *************** *** 153,159 **** } - // 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>"; --- 155,158 ---- 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.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** question_bank_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 --- question_bank_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 *************** *** 102,109 **** if ('default' == $source) { $question = stack_get_question_from_session(); ! $question = stack_get_question_from_post(); } else if ('database' == $source) { $questionID = $_POST['questionID']; ! $question=stack_db_getquestion($questionID); } --- 102,111 ---- 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); } Index: process_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/process_input.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 *** process_input.php 17 Jun 2005 16:25:28 -0000 1.1.2.7 --- process_input.php 18 Jun 2005 09:54:12 -0000 1.1.2.8 *************** *** 25,29 **** * @subpackage Stack */ - include_once('frontend_general/frontend_util.php'); $errors = ''; --- 25,28 ---- *************** *** 74,86 **** // (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??? include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } ! $username = stack_get_username($user); ?> --- 73,86 ---- // (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); ?> |
From: Juliette W. <jv...@us...> - 2005-06-17 16:25:39
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31005/frontend_general Modified Files: Tag: frontend_dev editquiz_display.php front_end_display.php frontend_util.php loginregister.php process_input.php qb_display.php question_bank_util.php Log Message: Added docs/comments. Index: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_display.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** editquiz_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.3 --- editquiz_display.php 17 Jun 2005 16:25:27 -0000 1.1.2.4 *************** *** 1,9 **** <?php ! ! // ! // @param $quiz_store ! // @param $PostTo function stack_display_editquiz_select($quiz_store, $PostTo) { global $stackQuiz; --- 1,32 ---- <?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; *************** *** 34,47 **** } 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' />"; } 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'>"; --- 57,81 ---- } + /* + * 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'>"; *************** *** 57,76 **** } ! 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'>"; } function stack_display_editquiz_error($errors) { ! echo "<font color=\"red\">"; show_array($errors); ! echo "</font>"; } function stack_display_editquiz_error_not_admin($user) { ! echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; --- 91,125 ---- } ! /* ! * 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>"; 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.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** front_end_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.7 --- front_end_display.php 17 Jun 2005 16:25:28 -0000 1.1.2.8 *************** *** 1,4 **** --- 1,34 ---- <?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>'; *************** *** 31,34 **** --- 61,71 ---- } + /* + * 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>'; *************** *** 40,43 **** --- 77,85 ---- } + + /* + * 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>'; *************** *** 45,48 **** --- 87,98 ---- } + /* + * 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\">"; *************** *** 54,61 **** --- 104,121 ---- } + /* + * 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; *************** *** 64,98 **** global $stackQuiz; if (is_array($quiz_store)) { ! ! ! echo "<p>\n<form name='quizform' action='quiz.php' method='POST'> <input type='hidden' name='quizid' value='-1'> <input type='hidden' name='action' value='continue_quiz'>"; ! ! echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th>Last mark (%)</th></tr>"; ! foreach ($quiz_store as $qs => $quiz) { ! $qname = $quiz['quizName']; ! $qID = $quiz['quizid']; ! $mark = '-'; ! if (is_array($user)) { ! if (array_key_exists('id',$user)) { ! $userinfo = stack_db_quiz_quizattempt_getlast($qID,$user['id']); ! if (is_array($userinfo)) { ! if (NULL != $userinfo['mark']) { ! $mark = round(100*$userinfo['mark']/$userinfo['maxmark'],2); ! } ! } ! } ! } ! echo "<tr><td><a href=\"javascript:takeaction('continue_quiz','$qID');\">{$qname}</a></td>\n"; ! echo "<td>".$quiz['quizDescription']."</td><td align='center'>$mark</td></tr>\n"; ! } ! echo "\n</table>\n</form>\n</p>"; ! } else { echo "<p>You have no quizzes available to try.</p>"; } } function stack_display_main_error_login($error) { echo "There was an error with the login or registration"; --- 124,160 ---- 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"; *************** *** 100,103 **** --- 162,170 ---- } + /* + * 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>"; Index: process_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/process_input.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** process_input.php 17 Jun 2005 10:54:51 -0000 1.1.2.6 --- process_input.php 17 Jun 2005 16:25:28 -0000 1.1.2.7 *************** *** 16,21 **** * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... * ! * @package Stack */ include_once('frontend_general/frontend_util.php'); --- 16,27 ---- * @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 */ include_once('frontend_general/frontend_util.php'); Index: frontend_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/frontend_util.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 *** frontend_util.php 17 Jun 2005 10:54:51 -0000 1.1.2.2 --- frontend_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 *************** *** 1,32 **** <?php include_once('scripts/stackUtility.php'); function stack_get_username($user) { return nsf('username',$user); } function stack_get_err($errors) { return nsf($errors,'user'); } function stack_get_errun($err) { return nsf($err,'username'); } function stack_get_errps($err){ return nsf($err,'password'); } function stack_get_err2($errors) { ! $err = ''; ! if (is_array($errors)) { ! if (array_key_exists('user',$errors)) { ! $err = $errors['user']; ! } } ! return $err; } function stack_is_logged_in($user) { if ($user['loggedin']) { --- 1,88 ---- <?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 + */ + include_once('scripts/stackUtility.php'); + + /* + * Returns the username associated with a user + * @param array $user, The user + * @return string $username The username + */ function stack_get_username($user) { return nsf('username',$user); } + /* + * @param array $errors, The errors array + * @return string + */ function stack_get_err($errors) { return nsf($errors,'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']) { *************** *** 37,40 **** --- 93,101 ---- } + /* + * 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']) { *************** *** 45,48 **** --- 106,114 ---- } + /* + * 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']) { Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_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 *** qb_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.5 --- qb_display.php 17 Jun 2005 16:25:28 -0000 1.1.2.6 *************** *** 1,59 **** <?php ! 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> "; ! } ! ! 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','stackQuestion');\">Help with question fields.</a>\n <a href=\"javascript:HelpPopup('all','stackOptions');\">Help with options.</a>\n <a href=\"javascript:HelpPopup('all','stackAnswerTest');\">Help with answer tests.</a>\n <a href=\"javascript:HelpPopup('all','stackQuestionPotResp');\">Help with potential responses.</a></p>"; ! } ! ! function stack_display_qb_export($name) { ! global $stack_web_url; ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; ! } ! ! function stack_display_error_no_questions_selected() { ! echo "<p>Could not get any ticked questions! Please try again.</p>"; ! } ! ! function stack_display_qb_edit_metadata($question_bank_filter) { ! global $stack_root; ! $options = ''; ! include("{$stack_root}/html/qselectform.php"); ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! // This line appears to be broken - it doesn't save the metadata! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! } ! function stack_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>"; ! ! } ! function stack_display_qb_import($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: --- 1,113 ---- <?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','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>"; ! } ! /* ! * 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 ! * @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; ! $options = ''; ! include("{$stack_root}/html/qselectform.php"); ! ! stack_db_listquestions('edit_metadata',$question_bank_filter); ! // This line appears to be broken - it doesn't save the metadata! ! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; ! } + /* + * 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 ! * @return void ! */ ! function stack_display_qb_import($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: *************** *** 66,70 **** } ! function stack_display_qb_show_imported($quiz) { --- 120,128 ---- } ! /* ! * Displays the imported questions ! * @param array $quiz The imported quiz ! * @return void ! */ function stack_display_qb_show_imported($quiz) { *************** *** 102,109 **** --- 160,175 ---- } + /* + * 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. *************** *** 111,114 **** --- 177,184 ---- } + /* + * Displays the preview of a question + * @return void + */ function stack_display_qb_preview($questionInst) { echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> Index: loginregister.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/loginregister.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 *** loginregister.php 13 Jun 2005 13:04:25 -0000 1.1.2.1 --- loginregister.php 17 Jun 2005 16:25:28 -0000 1.1.2.2 *************** *** 17,27 **** * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... * ! * @package Stack */ include_once($stack_root."/scripts/stackUser.php"); ! // (2.2) Log user into STACK if ('login' == $action) { if (array_key_exists('username',$_POST)) { --- 17,33 ---- * @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 */ include_once($stack_root."/scripts/stackUser.php"); ! // Log user into STACK if ('login' == $action) { if (array_key_exists('username',$_POST)) { *************** *** 40,44 **** ! // (2.3) Register as a new user if ('register' == $action) { --- 46,50 ---- ! // Register as a new user if ('register' == $action) { *************** *** 59,67 **** $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']; } } --- 65,73 ---- $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']; } } *************** *** 71,75 **** ! // (2.3) Register as a new user if ('userupdate' == $action and $user['loggedin']) { if (array_key_exists('user',$_POST)) { --- 77,81 ---- ! // Update user info if ('userupdate' == $action and $user['loggedin']) { if (array_key_exists('user',$_POST)) { *************** *** 87,100 **** } else { $errors['user']['password'] = '<font color="red">Password must be non-empty.</font>'; ! $error = $errors['user']['password']; ! $action = 'error'; } } } } - - // If user is not set make sure error message is set. - // (2.infty) Store user in the $_SESSION $_SESSION['user'] = $user; --- 93,103 ---- } else { $errors['user']['password'] = '<font color="red">Password must be non-empty.</font>'; ! $error = $errors['user']['password']; ! $action = 'error'; } } } } $_SESSION['user'] = $user; 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.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** question_bank_util.php 17 Jun 2005 13:16:41 -0000 1.1.2.2 --- question_bank_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 *************** *** 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,24 ---- * @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 *************** *** 26,32 **** ! function stack_get_question_from_session() { ! global $stackQuestion; $question = NULL; --- 26,35 ---- ! /* ! * 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; *************** *** 46,49 **** --- 49,56 ---- } + /* + * Gets the question instance that has been stored in the session + * @return array $questionInst Quiz question instance + */ function stack_get_questionInst() { $questionInst = NULL; *************** *** 58,90 **** ! function stack_get_question_from_post() { global $stackQuestion; $question = NULL; ! // Get any $_POSTED data ! // This should over write any $_SESSION data, as it may have been entered in a form. ! ! foreach($stackQuestion as $qfield => $attribs) ! { ! if (array_key_exists($qfield,$_POST) ) ! { ! if ('questionOptions' == $qfield) { ! $question[$qfield] = $_POST[$qfield]; ! } ! else if ('questionPotResp' == $qfield ) { ! $question[$qfield] = $_POST[$qfield]; ! } ! else if ( '' !=trim($_POST[$qfield]) ) { ! // We need this: all fields on form will be present in $_POST. ! $question[$qfield] = $_POST[$qfield]; } } } return $question; - } ! // $source should be 'from database', 'new' or 'default' function stack_get_question($source) { --- 65,97 ---- ! /* ! * 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) { *************** *** 108,112 **** } ! // This function also sets $SESSION['bank_filter'] if required function stack_get_questionbank_filter() { $question_bank_filter = ''; --- 115,124 ---- } ! /* ! * 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 = ''; *************** *** 121,131 **** } 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; } } --- 133,147 ---- } + /* + * 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; } } *************** *** 136,149 **** } ! 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; ! } --- 152,169 ---- } ! /* ! * 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: Juliette W. <jv...@us...> - 2005-06-17 16:25:38
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31005 Modified Files: Tag: frontend_dev documentation.php editquiz.php index.php qb_preview.php question_bank.php Log Message: Added docs/comments. Index: documentation.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/documentation.php,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -C2 -d -r1.2.2.4 -r1.2.2.5 *** documentation.php 16 Jun 2005 11:44:44 -0000 1.2.2.4 --- documentation.php 17 Jun 2005 16:25:26 -0000 1.2.2.5 *************** *** 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 */ Index: qb_preview.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_preview.php,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** qb_preview.php 17 Jun 2005 13:16:41 -0000 1.1.2.4 --- qb_preview.php 17 Jun 2005 16:25:27 -0000 1.1.2.5 *************** *** 1,69 **** ! <?php ! if ('new_version' == $action) { ! ! foreach ($stackQuestion as $qfield => $val) ! { ! if (array_key_exists($qfield,$questionInst)) ! { ! $question[$qfield] = $questionInst[$qfield]; ! } ! } ! unset($questionInst); ! ! $action = 'preview'; ! } ! // 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 ('preview'==$action) { - - stack_question_validate($question,$errors); ! if ('' == $errors) { ! if ($database) { ! $action='validate'; ! } else { ! $action = 'mark'; ! } ! ! $seed = stack_get_seed(); ! // TO DO: There was a bug originally in the code that is still here ! // where the Display field of $options does not get set. As a result ! // the preview code does not work ! ! $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) { ! stack_display_qb_error_validation_failure(); ! $action='edit'; } } ! // 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; --- 1,86 ---- ! <?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 question_bank.php ! * TO DO: This code should really be factored out into functions and the logic ! * returned to question_bank.php ! * TO DO: There appears to be no difference between the behaviour of 'mark' and ! * 'validate' as an action - is there are reason why there are separate actions? ! * @package frontend ! * @subpackage Stack ! */ ! // 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(); ! // TO DO: There was a bug originally in the code that is still here ! // where the Display field of $options does not get set. As a result ! // the preview code does not work ! $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) { ! stack_display_qb_error_validation_failure(); ! $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; Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.9 retrieving revision 1.10.2.10 diff -C2 -d -r1.10.2.9 -r1.10.2.10 *** editquiz.php 17 Jun 2005 13:16:41 -0000 1.10.2.9 --- editquiz.php 17 Jun 2005 16:25:26 -0000 1.10.2.10 *************** *** 2,8 **** /** * ! * This file contains the logic of interactions with the site as ! * an editor of quizzes. * * @package frontend * @subpackage Stack --- 2,26 ---- /** * ! * 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 *************** *** 40,62 **** } ! //////////////////////////////////////////////// ! // (2) Decide what we are trying to do. ! //////////////////////////////////////////////// ! ! // action = quiz_edit Edit a quiz ! // action = quiz_choose Choose a quiz ! // action = quiz_new Create a new quiz ! // action = quiz_delete Delete a quiz ! // action = quiz_edit_addqs Add questions to the quiz. ! // action = filter Re-display the list of questions, filtered. ! // show_array($_POST); ! ! //////////////////////////////////////////////// ! // Set $quizid and $quiz if necessary ! //////////////////////////////////////////////// $quiz = ''; $quizid_source = ''; --- 58,78 ---- } ! //////////////////////////////////////////////// ! // (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 + // quiz_choose Choose a quiz + // quiz_new Create a new quiz + // quiz_delete Delete a quiz + // quiz_edit_addqs Add questions to the quiz. + // filter Re-display the list of questions, filtered. + // Get the quiz and quiz id $quiz = ''; $quizid_source = ''; *************** *** 83,86 **** --- 99,103 ---- } + // Get the question bank filter if ('filter' == $action) { $filter_source = 'post'; *************** *** 118,124 **** } ! //////////////////////////////////////////////// ! // (4) Generate web page ! //////////////////////////////////////////////// stack_display_editquiz_error($errors); --- 135,141 ---- } ! //////////////////////////////////////////////// ! // (3) Generate web page ! //////////////////////////////////////////////// stack_display_editquiz_error($errors); Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.20 retrieving revision 1.3.2.21 diff -C2 -d -r1.3.2.20 -r1.3.2.21 *** question_bank.php 17 Jun 2005 13:16:41 -0000 1.3.2.20 --- question_bank.php 17 Jun 2005 16:25:27 -0000 1.3.2.21 *************** *** 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 *************** *** 150,154 **** } ! // (2.4) Export a whole list of questions. $multiple_questions = FALSE; --- 151,155 ---- } ! // Export a whole list of questions. $multiple_questions = FALSE; *************** *** 260,265 **** ! if ('questionbank_screen'==$action or 'edit_metadata' == $action) ! { session_unregister('question'); session_unregister('questionInst'); --- 261,265 ---- ! if ('questionbank_screen'==$action or 'edit_metadata' == $action) { session_unregister('question'); session_unregister('questionInst'); Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.10 retrieving revision 1.17.2.11 diff -C2 -d -r1.17.2.10 -r1.17.2.11 *** index.php 17 Jun 2005 13:16:41 -0000 1.17.2.10 --- index.php 17 Jun 2005 16:25:26 -0000 1.17.2.11 *************** *** 16,20 **** * @author Chris Sangwin C.J...@bh... * @author Laura Naismith L.N...@bh... ! * * @package 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 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 */ *************** *** 52,56 **** ////////////////////////////////////////////////////////////// - include('html/pagehead.php'); --- 57,60 ---- *************** *** 65,93 **** } ! if ('loginscreen' == $action) { ! stack_display_main_login($username, $errun, $errps); ! } ! ! if ('registration_screen' == $action) { ! include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); ! } ! ! if ('update_info' == $action) { ! 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 { ! stack_display_main_error_update_userinfo(); ! } ! } ! ! if ('error' == $action) { ! stack_display_main_error_login($error); ! } ! ! if ('choose_quiz' == $action) { ! $quiz_store = stack_db_quiz_get(); ! stack_display_main_select_quiz($quiz_store, $user); } --- 69,95 ---- } ! 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 { ! stack_display_main_error_update_userinfo(); ! } ! break; ! case 'error': ! stack_display_main_error_login($error); ! break; ! case 'choose_quiz': ! $quiz_store = stack_db_quiz_get(); ! stack_display_main_select_quiz($quiz_store, $user); ! break; } |
From: Juliette W. <jv...@us...> - 2005-06-17 13:16:51
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23417/scripts Modified Files: Tag: frontend_dev stackQuestion.php Log Message: Couple of fixes and made function names more consistent Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.19.2.1 retrieving revision 1.19.2.2 diff -C2 -d -r1.19.2.1 -r1.19.2.2 *** stackQuestion.php 17 Jun 2005 06:28:55 -0000 1.19.2.1 --- stackQuestion.php 17 Jun 2005 13:16:41 -0000 1.19.2.2 *************** *** 1014,1018 **** } - // Now put the implicit question variables back into the castext strings. --- 1014,1017 ---- *************** *** 1023,1028 **** if ('castext' == $stackQuestion[$qfield]['type'] and array_key_exists($qfield,$question)) { $errct = ''; ! $questionInst["{$qfield}Inst"]= stack_castext_to_display($question["{$qfield}Inst"], $imp_locs_Inst, $options['Display'] , $errct); ! if (''!=$errct) { // We have some errors! $errors[$qfield]=$err_when_inst.$errct; --- 1022,1031 ---- if ('castext' == $stackQuestion[$qfield]['type'] and array_key_exists($qfield,$question)) { $errct = ''; ! if (array_key_exists($options, 'Display')) { ! $displayed = $options['Display']; ! $questionInst["{$qfield}Inst"]= stack_castext_to_display($question["{$qfield}Inst"], $imp_locs_Inst, $displayed , $errct); ! } else { ! echo "Error - Display not set in options variable"; ! } if (''!=$errct) { // We have some errors! $errors[$qfield]=$err_when_inst.$errct; |
From: Juliette W. <jv...@us...> - 2005-06-17 13:16:51
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23417 Modified Files: Tag: frontend_dev editquiz.php index.php qb_preview.php question_bank.php Log Message: Couple of fixes and made function names more consistent Index: qb_preview.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/Attic/qb_preview.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** qb_preview.php 16 Jun 2005 14:30:17 -0000 1.1.2.3 --- qb_preview.php 17 Jun 2005 13:16:41 -0000 1.1.2.4 *************** *** 15,23 **** - // These branches need the question to be validated - if ('edit' == $action or 'preview'==$action or 'export_xml'==$action) { - stack_question_validate($question,$errors); - } - // Have the questions been marked? if ('mark' == $action or 'validate' == $action) { --- 15,18 ---- *************** *** 31,116 **** ! ! if ('preview'==$action && $database) { ! 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 ('preview'==$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.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); ! } ?> --- 26,76 ---- ! if ('preview'==$action) { ! stack_question_validate($question,$errors); ! ! if ('' == $errors) { ! if ($database) { ! $action='validate'; ! } else { ! $action = 'mark'; ! } ! ! $seed = stack_get_seed(); ! // TO DO: There was a bug originally in the code that is still here ! // where the Display field of $options does not get set. As a result ! // the preview code does not work $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) { + stack_display_qb_error_validation_failure(); $action='edit'; } } ! ! // 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); ! $_SESSION['questionInst'] = $questionInst; ! $_SESSION['question'] = $questionInst; ! stack_display_qb_preview($questionInst); ! stack_question_inst_try_test($questionInst,$this_attempt,$options,$errors); } ?> Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.8 retrieving revision 1.10.2.9 diff -C2 -d -r1.10.2.8 -r1.10.2.9 *** editquiz.php 17 Jun 2005 10:54:51 -0000 1.10.2.8 --- editquiz.php 17 Jun 2005 13:16:41 -0000 1.10.2.9 *************** *** 35,39 **** if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { ! stack_quiz_edit_not_admin($user); include('html/pagefoot.php'); die(); --- 35,39 ---- if (!stack_user_is_admin($user) or !stack_is_logged_in($user)) { ! stack_display_editquiz_error_not_admin($user); include('html/pagefoot.php'); die(); *************** *** 122,137 **** //////////////////////////////////////////////// ! stack_quiz_edit_errors($errors); switch ($action) { case 'quiz_choose': $quiz_store = stack_db_quiz_get(); ! stack_select_quiz_screen($quiz_store, $PostTo); break; case 'quiz_edit': ! stack_quiz_edit_screen($quiz,$errors,$PostTo); break; case 'quiz_edit_addqs': ! stack_add_questions_screen($PostTo, $quizid, $question_bank_filter); break; } --- 122,137 ---- //////////////////////////////////////////////// ! stack_display_editquiz_error($errors); switch ($action) { case 'quiz_choose': $quiz_store = stack_db_quiz_get(); ! stack_display_editquiz_select($quiz_store, $PostTo); break; case 'quiz_edit': ! stack_display_editquiz_edit($quiz,$errors,$PostTo); break; case 'quiz_edit_addqs': ! stack_display_editquiz_add_questions($PostTo, $quizid, $question_bank_filter); break; } Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.3.2.19 retrieving revision 1.3.2.20 diff -C2 -d -r1.3.2.19 -r1.3.2.20 *** question_bank.php 16 Jun 2005 16:50:49 -0000 1.3.2.19 --- question_bank.php 17 Jun 2005 13:16:41 -0000 1.3.2.20 *************** *** 119,123 **** --- 119,125 ---- if ($get_question) { $question = stack_get_question($source); + $options = stack_options_set($question); + $questionInst = stack_get_questionInst(); } *************** *** 174,178 **** if ('edit_metadata' == $action ) { if (!$admin) { ! stack_print_not_admin(); } else { // If needed update the database --- 176,180 ---- if ('edit_metadata' == $action ) { if (!$admin) { ! stack_display_qb_error_not_admin(); } else { // If needed update the database *************** *** 203,207 **** break; case 'edit': ! stack_question_validate($question,$errors); break; } --- 205,211 ---- break; case 'edit': ! if (!$new_question) { ! stack_question_validate($question,$errors); ! } break; } *************** *** 217,237 **** case 'uploaded_xml': if ($upload_successful) { ! stack_show_uploaded_questions_screen($quiz); } else { ! stack_upload_error_screen(); } break; case 'import': ! stack_import_questions_screen($errors); break; case 'export_xml': if (NULL == $questions_to_export) { ! stack_print_questionbank_no_questions_screen(); $action = 'questionbank_screen'; } ! stack_print_download_export_screen($name); break; case 'edit_metadata': ! stack_print_edit_metadata_screen($question_bank_filter); break; } --- 221,241 ---- case 'uploaded_xml': if ($upload_successful) { ! stack_display_qb_show_imported($quiz); } else { ! stack_display_qb_error_upload_failure(); } break; case 'import': ! stack_display_qb_import($errors); break; case 'export_xml': if (NULL == $questions_to_export) { ! stack_display_error_no_questions_selected(); $action = 'questionbank_screen'; } ! stack_display_qb_export($name); break; case 'edit_metadata': ! stack_display_qb_edit_metadata($question_bank_filter); break; } *************** *** 242,249 **** switch ($action) { case 'questionbank_screen': ! stack_print_question_bank_screen($admin, $question_bank_filter); break; case 'edit': ! stack_print_edit_screen($question, $errors); break; } --- 246,253 ---- switch ($action) { case 'questionbank_screen': ! stack_display_qb_main($admin, $question_bank_filter); break; case 'edit': ! stack_display_qb_edit($question, $errors); break; } Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.9 retrieving revision 1.17.2.10 diff -C2 -d -r1.17.2.9 -r1.17.2.10 *** index.php 17 Jun 2005 10:54:51 -0000 1.17.2.9 --- index.php 17 Jun 2005 13:16:41 -0000 1.17.2.10 *************** *** 56,93 **** if ('logout' == $action) { ! stack_logout_screen(); $action = 'loginscreen'; } if ('welcome' == $action) { ! stack_welcome_screen($user); $action = 'choose_quiz'; } if ('loginscreen' == $action) { ! stack_login_screen($username, $errun, $errps); } if ('registration_screen' == $action) { include_once($stack_root."/scripts/stackUser.php"); ! stack_registration_screen($username, $user, $errors, $err); } if ('update_info' == $action) { ! if (stack_is_logged_in($user) and !stack_user__is_guest($user)) { $err = stack_get_err2($errors); ! stack_update_info_screen($user, $err, $errors); } else { ! stack_update_info_error_screen(); } } if ('error' == $action) { ! stack_login_error_screen($error); } if ('choose_quiz' == $action) { $quiz_store = stack_db_quiz_get(); ! stack_select_quiz_screen($quiz_store, $user); } --- 56,93 ---- if ('logout' == $action) { ! stack_display_main_logout(); $action = 'loginscreen'; } if ('welcome' == $action) { ! stack_display_main_welcome($user); $action = 'choose_quiz'; } if ('loginscreen' == $action) { ! stack_display_main_login($username, $errun, $errps); } if ('registration_screen' == $action) { include_once($stack_root."/scripts/stackUser.php"); ! stack_display_main_register($username, $user, $errors, $err); } if ('update_info' == $action) { ! 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 { ! stack_display_main_error_update_userinfo(); } } if ('error' == $action) { ! stack_display_main_error_login($error); } if ('choose_quiz' == $action) { $quiz_store = stack_db_quiz_get(); ! stack_display_main_select_quiz($quiz_store, $user); } |
From: Juliette W. <jv...@us...> - 2005-06-17 13:16:51
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23417/frontend_general Modified Files: Tag: frontend_dev editquiz_display.php front_end_display.php qb_display.php question_bank_util.php Log Message: Couple of fixes and made function names more consistent Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.php,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** qb_display.php 16 Jun 2005 14:30:16 -0000 1.1.2.4 --- qb_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.5 *************** *** 1,5 **** <?php ! function stack_print_question_bank_screen($admin, $question_bank_filter) { global $stack_root; $options = ''; --- 1,5 ---- <?php ! function stack_display_qb_main($admin, $question_bank_filter) { global $stack_root; $options = ''; *************** *** 18,22 **** } ! function stack_print_edit_screen($question, $errors) { global $stack_root; include_once("{$stack_root}/scripts/stackAuthor.php"); --- 18,22 ---- } ! function stack_display_qb_edit($question, $errors) { global $stack_root; include_once("{$stack_root}/scripts/stackAuthor.php"); *************** *** 30,43 **** } ! function stack_print_download_export_screen($name) { global $stack_web_url; echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } ! function stack_print_questionbank_no_questions_screen() { echo "<p>Could not get any ticked questions! Please try again.</p>"; } ! function stack_print_edit_metadata_screen($question_bank_filter) { global $stack_root; $options = ''; --- 30,43 ---- } ! function stack_display_qb_export($name) { global $stack_web_url; echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } ! function stack_display_error_no_questions_selected() { echo "<p>Could not get any ticked questions! Please try again.</p>"; } ! function stack_display_qb_edit_metadata($question_bank_filter) { global $stack_root; $options = ''; *************** *** 49,53 **** } ! function stack_print_not_admin() { echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; --- 49,53 ---- } ! function stack_display_qb_error_not_admin() { echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; *************** *** 55,59 **** ! function stack_import_questions_screen($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: --- 55,59 ---- ! function stack_display_qb_import($errors) { echo nsf($errors,'import'); echo "Select a file to upload and edit: *************** *** 67,71 **** ! function stack_show_uploaded_questions_screen($quiz) { echo "<h2>Details of questions uploaded</h2>"; --- 67,71 ---- ! function stack_display_qb_show_imported($quiz) { echo "<h2>Details of questions uploaded</h2>"; *************** *** 102,107 **** } ! function stack_upload_error_screen() { echo '<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ?> --- 102,121 ---- } ! function stack_display_qb_error_upload_failure() { echo '<p>Could not extract a question from your uploaded file. Please edit your file carefully and try again.</p>'; ! } ! ! function stack_display_qb_error_validation_failure() { ! echo '<p>Could not instantiate the question, because of errors. ! <br />Try to edit the question instead.</p>'; ! } ! ! function stack_display_qb_preview($questionInst) { ! echo "<center><table bgcolor='#CCCCCC' width='100%' cellpadding='2'> ! <td align='left'> ! ! <b>Question: ".sf($questionInst,'questionName')."</b> (".sf($questionInst,'questionID'); ! echo ")</td><td align='right'>"; ! echo "<a href=\"javascript:HelpPopup('student','');\">Help</a></td></tr></table></center>"; ! } ?> Index: front_end_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/front_end_display.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** front_end_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.6 --- front_end_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.7 *************** *** 1,5 **** <?php ! function stack_login_screen($username, $errun, $errps) { echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; --- 1,5 ---- <?php ! function stack_display_main_login($username, $errun, $errps) { echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; *************** *** 31,35 **** } ! function stack_update_info_screen($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"index.php?\" method=\"post\" name=\"register\" id=\"register\">"; --- 31,35 ---- } ! function stack_display_main_update_userinfo($user, $err, $errors) { echo '<h1>Update user information</h1>'; echo "<form action=\"index.php?\" method=\"post\" name=\"register\" id=\"register\">"; *************** *** 40,49 **** } ! function stack_update_info_error_screen() { echo '<h1>Update user information</h1>'; echo '<p>Please logout and login as a personal user first to update your information.</p>'; } ! function stack_registration_screen($username, $user, $errors, $err) { echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; --- 40,49 ---- } ! function stack_display_main_error_update_userinfo() { echo '<h1>Update user information</h1>'; echo '<p>Please logout and login as a personal user first to update your information.</p>'; } ! function stack_display_main_register($username, $user, $errors, $err) { echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; echo '<p>To register as a STACK user, please provide the following information.<p>'; *************** *** 54,62 **** } ! function stack_logout_screen() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ! function stack_select_quiz_screen($quiz_store, $user) { global $stack_root; require_once("{$stack_root}/html/quizjava.html"); --- 54,62 ---- } ! function stack_display_main_logout() { echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } ! function stack_display_main_select_quiz($quiz_store, $user) { global $stack_root; require_once("{$stack_root}/html/quizjava.html"); *************** *** 95,104 **** } ! function stack_login_error_screen($error) { echo "There was an error with the login or registration"; echo $error; } ! function stack_welcome_screen($user) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; } --- 95,104 ---- } ! function stack_display_main_error_login($error) { echo "There was an error with the login or registration"; echo $error; } ! function stack_display_main_welcome($user) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; } Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/question_bank_util.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** question_bank_util.php 16 Jun 2005 13:09:24 -0000 1.1.2.1 --- question_bank_util.php 17 Jun 2005 13:16:41 -0000 1.1.2.2 *************** *** 136,139 **** --- 136,150 ---- } + function stack_get_seed() { + if (array_key_exists('seed',$_POST)) { + $seed=$_POST['seed']; + } else { + // HACK: this should involve the concept of a user! + $seed = time(); + } + + return $seed; + } + Index: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_display.php,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** editquiz_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.2 --- editquiz_display.php 17 Jun 2005 13:16:41 -0000 1.1.2.3 *************** *** 6,10 **** // @param $quiz_store // @param $PostTo ! function stack_select_quiz_screen($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { --- 6,10 ---- // @param $quiz_store // @param $PostTo ! function stack_display_editquiz_select($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { *************** *** 30,38 **** } else { ! stack_no_quiz_screen($PostTo); } } ! function stack_no_quiz_screen($PostTo) { echo "<p>You have no quizzes available to try.</p>"; --- 30,38 ---- } else { ! stack_display_editquiz_no_quizzes($PostTo); } } ! function stack_display_editquiz_no_quizzes($PostTo) { echo "<p>You have no quizzes available to try.</p>"; *************** *** 42,46 **** } ! function stack_add_questions_screen($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='$quizid'>"; --- 42,46 ---- } ! function stack_display_editquiz_add_questions($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='$quizid'>"; *************** *** 58,62 **** ! function stack_quiz_edit_screen($quiz,$errors,$PostTo) { stack_quiz_edit_form($quiz,$errors,$PostTo = ''); --- 58,62 ---- ! function stack_display_editquiz_edit($quiz,$errors,$PostTo) { stack_quiz_edit_form($quiz,$errors,$PostTo = ''); *************** *** 66,75 **** } ! function stack_quiz_edit_errors($errors) { echo "<font color=\"red\">"; show_array($errors); echo "</font>"; } ! function stack_quiz_edit_not_admin($user) { echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; --- 66,75 ---- } ! function stack_display_editquiz_error($errors) { echo "<font color=\"red\">"; show_array($errors); echo "</font>"; } ! function stack_display_editquiz_error_not_admin($user) { echo "<h1>Not permitted!</h1>"; echo "<p>You need to be logged in as the admin to edit quizzes, but seem to be user {$user['username']}."; |
From: Chris S. <san...@us...> - 2005-06-17 12:25:15
|
Update of /cvsroot/stack/stack-1-0/lang/nl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31272/lang/nl Added Files: Tag: frontend_dev stack.php Log Message: Language files --- 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-17 12:25:15
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31272/lang/en Added Files: Tag: frontend_dev stack.php Log Message: Language files --- NEW FILE: stack.php --- <?php // Strings associated with quizzes. $string['TrySTACKQuiz'] = 'Try a STACK quiz'; $string['STACKHomePage'] = 'STACK home page'; $string['Home'] = 'Home'; $string['ClickHereTryQuiz'] = 'Click here to try a new quiz.'; $string['ChooseQuiz'] = 'Choose quiz'; $string['Focus'] = 'Focus'; $string['FocusExplain'] = 'Click here to see one question at a time.'; $string['UnFocus'] = 'Unfocus'; $string['UnFocusExplain'] = 'Click here to see all questions in the quiz.'; $string['Score'] = 'Mark'; // Mark for a question. $string['Mark'] = 'Mark'; // Mark as an action request. $string['MarkThisQ'] = 'Mark this question'; // Mark as an action request. $string['MarkQ'] = 'Mark Q.'; // Mark as an action request. $string['MarkExplain'] = 'Click here to mark your answers.'; $string['Validate'] = 'Validate'; $string['ValidateExplain'] = 'Click here to check that your answers have no syntax errors and that the system interprets them in the way that you intended.'; $string['ValidateExplain2'] = '(Note, your answers will be stored when you validate.)'; $string['Solutions'] = 'Solutions'; $string['SolutionsExplain'] = 'Click here to mark the whole quiz and show all the solutions.'; $string['SolutionsExplain2'] = '(No further attempts will be permitted)'; $string['NewVersion'] = 'New version'; $string['NewVersionExplain'] = 'Click here to try a new version of this quiz.'; $string['MarkSummary'] = 'Mark Summary'; $string['Question'] = 'Question'; $string['Value'] = 'Value'; // Number of marks available for a question $string['Total'] = 'Total'; $string['Help'] = 'Help'; $string['End'] = 'End'; $string['Quiz_error_q'] = '<font color=\"red\">There were errors in the question.</font><br />Please contact your system administrator about questionID {$a[0]}.<br />'; // Stack page footer. $string['ThisSTACKVer'] = 'This is STACK version'; $string['ThisPageTook'] = 'This page took approximatly'; $string['seconds'] = 'seconds'; $string['STACKlogo'] = 'STACK logo'; $string['QValidRequiredField'] = 'This is a required field, but has no value.'; $string['QValidDefaultValue'] = 'A default value has been assigned for you.'; $string['QValidquestionnotar'] = '$question variable does not exist!'; $string['QValidMaximaName'] = 'is a Maxima function name.'; $string['QInstCASError'] = 'The CAS generated errors when creating a question version.'; $string['CASError'] = 'CAS ERROR!'; $string['CASError_ans'] = 'The CAS did not process your answer.'; $string['QMarkBailOut'] = 'There is an error in the marking procedure, please contact your administrator. (A potential response was visited more than once.)'; // Teacher's view to try questions. $string['QTestTeacherInfo'] = 'Information for the teacher'; $string['QTestQuestionNote'] = 'Question note'; $string['Seed'] = 'Seed'; $string['QTestTeacherAns'] = "Teacher's answer"; // $string['YourLastAns'] = 'Your last answer was interpreted as:'; $string['YouHaveNotAns'] = 'Warning: you have not answered this.'; $string['InvalidAns'] = 'This is an invalid answer.'; $string['AttemptNoPenalty'] = 'This attempt has been ignored with no penalty.'; $string['YourMarkFor'] = 'Your mark for this attempt is'; $string['WithPenaltiesAnd'] = 'With penalties, and previous attempts, this gives {$a[\'mark\']} out of {$a[\'QuVal\']}'; $string['YourMarkIs'] = 'Your mark is {$a[\'mark\']}, out of {$a[\'QuVal\']}.'; $string['InvalidNoMark'] = 'Your answer is invalid, so there is no mark or penalty for this attempt.'; $string['InvalidPreviousMark'] = 'Previous attempts give a mark of {$a[\'mark\']} out of {$a[\'QuVal\']}'; $string['InputTool'] = 'Input tool'; $string['SyntaxHint'] = 'Syntax hint'; $string['TeacherAnsIs'] = 'The teacher\'s answer is'; $string['ThisCanDisplay'] = 'This can be displayed as'; $string['WorkedSolution'] = 'Worked solution'; $string['NoSolution'] = '[No solution available]'; $string['YourAttemptsWere'] = 'Your attempts at this question were as follows.'; $string['Answer'] = 'Answer'; $string['NoAttemptsAtQ'] = 'You have made no attempts at this question.'; $string['ShowAt_RawAns'] = 'Raw answer'; $string['ShowAt_Action'] = 'Action'; $string['ShowAt_Valid'] = 'Valid ?'; $string['ShowAt_Ans'] = 'Answer'; $string['ShowAt_RawMark'] = 'Raw mark'; $string['ShowAt_Penalty'] = 'Penalty'; $string['ShowAt_FeedBack'] = 'Feedback'; $string['ShowAt_AnswerNote'] = 'Answer Note'; $string['SeriousForbid'] = 'The string <tt><font color=\'orange\'></font></tt> is forbidden!<br />'; $string['MissingRightBracket'] = 'You have a missing right bracket.'; $string['MissingLeftBracket'] = 'You have a missing left bracket.'; $string['IllegalSpaces'] = 'You have space between terms in your expression. Please check again carefully.'; $string['MissingStars'] = 'You seem to be missing *\'s.<br /> Perhaps you meant to type '; $string['BadAmps'] = 'You should not have any @\'s. '; $string['BadAbsFun'] = 'You should not have any |\'s. You may need to use the <tt>abs()</tt> CAS function instead.'; $string['UnknownFun'] = 'The string <tt><font color=\'orange\'>{$a[\'key\']}</font></tt> does not occur in the list of permitted functions. It could be that you have missed off some multiplication signs, or brackets. If you are in doubt about this, please contact the administrator.'; $string['NotSupported'] = 'The string <tt><font color=\'orange\'>{$a[\'key\']}</font></tt> is a legitimate CAS command, but does is not supported in this implementation of STACK. There may be an alternative. If you are in doubt about this, please contact the administrator.'; // Validating the CASText $string['EmptyCASString'] = 'You have included a CAS string which is empty. This is not permitted.'; // This occurs when validating CASText For example, a user might type "Factor @ @." $string['ErrorCASString'] = 'The string <font color=\'orange\'><tt>@{$a[\'key\']}@</tt></font> generated the following error(s)'; $string['OddAmpCASString'] = 'You have an odd number of @s, which is not permitted.'; $string['IncorrectPassword'] = 'Incorrect password!'; $string['IncorrectAdminPsd'] = 'Incorrect Admin password'; $string['UnknownUserName'] = 'Username does not exist!'; $string['MisMatchPassword'] = 'Your two passwords did not match!'; $string['OldPasswordUnch'] = 'Your old password (if any) is unchanged.'; $string['USR_Username'] = 'Username'; $string['USR_NewPassword'] = 'New password'; $string['USR_ConfirmPsswd'] = '(confirm)'; $string['USR_FirstName'] = 'First name'; $string['USR_LastName'] = 'Last name'; $string['USR_Email'] = 'Email'; $string['USR_OptionalInformation'] = 'Optional Information'; $string['USR_Phone'] = 'Phone'; $string['USR_StudentID'] = 'Student ID'; $string['USR_Address'] = 'Address'; $string['USR_Department'] = 'Department'; $string['USR_Institution'] = 'Instituion'; //////////////////////////////////////// // STACK data structures //////////////////////////////////////// // The $stackQuestion data structure $string['stackQuestion_questionVarsRaw'] = 'Question variables'; $string['stackQuestion_questionVars'] = '(Internal) Question variables'; $string['stackQuestion_questionStem'] = 'Question stem'; $string['stackQuestion_questionAns'] = "Teacher's answer"; $string['stackQuestion_questionAnsKey'] = "Student's answer key"; // The name of the variable to which the student's answer is assigned. $string['stackQuestion_questionAnsVarsRaw'] = 'Feedback variables'; $string['stackQuestion_questionAnsVars'] = '(Internal) Feedback variables'; $string['stackQuestion_questionPotResp'] = 'Potential responses'; $string['stackQuestion_questionSol'] = 'Worked solution'; $string['stackQuestion_questionOptions'] = 'Options'; $string['stackQuestion_questionNote'] = 'Question note'; $string['stackQuestion_questionID'] = 'Unique question ID'; $string['stackQuestion_questionGUID'] = 'Globally unique question ID'; $string['stackQuestion_questionName'] = 'Name'; $string['stackQuestion_questionDescription'] = 'Description'; $string['stackQuestion_questionKeywords'] = 'Keywords'; $string['stackQuestion_questionBody'] = 'Body'; $string['stackQuestion_questionUserLastEdited'] = 'Last edited by'; $string['stackQuestion_questionDateLastEdited'] = 'Last edited on'; // The $stackQuestionInst data structure: instantiated questions $string['stackQuestion_questionInstAttempts'] = 'Attempts at this question'; $string['stackQuestion_questionSeedInst'] = 'Random seed'; $string['stackQuestion_questionAnsTestOptInst'] = 'AnswerTest options'; // Potential Responses $string['stackQuestion_PR_SAns'] = 'Expression 1: SAns'; $string['stackQuestion_PR_TAns'] = 'Expression 2: TAns'; $string['stackQuestion_PR_AnsTest'] = 'Answer test'; $string['stackQuestion_PR_AnsTestOpt'] = 'Answer test options'; $string['stackQuestion_PR_RawMarkMod'] = 'Mark modifier operation'; $string['stackQuestion_PR_RawMark'] = 'Mark modifier'; $string['stackQuestion_PR_Penalty'] = 'Penalty'; $string['stackQuestion_PR_FeedBack'] = 'Feedback'; $string['stackQuestion_PR_AnswerNote'] = 'Answer note'; $string['stackQuestion_PR_ApLat'] = 'Apply later tests'; //////////////////////////////////// // Options //////////////////////////////////// $string['stackOptions_InsertStars'] = "Insert *s where needed"; $string['stackOptions_InformalSyntax'] = 'Allow informal syntax'; $string['stackOptions_AllowInputTool'] = 'Input tools'; $string['stackOptions_SyntaxHint'] = 'Syntax Hint'; $string['stackOptions_Display'] = 'Display'; $string['stackOptions_Language'] = 'Language'; $string['stackOptions_QuVal'] = 'Question value'; $string['stackOptions_MarkModMethod'] = 'Mark modification method'; $string['stackOptions_Penalty'] = 'Question penalty'; $string['stackOptions_Forbid'] = 'Forbidden words'; $string['stackOptions_Allow'] = 'Allowed words'; $string['stackOptions_AnsTest'] = 'Answer test'; $string['stackOptions_AnsTestOpt'] = 'Answer test options'; $string['stackOptions_TeacherEmail'] = "Teacher's email"; $string['stackOptions_FeedBackGenericCorrect'] = 'Feedback: correct'; $string['stackOptions_FeedBackGenericCorrect_def'] = "<font color='green'>Correct answer, well done.</font>"; $string['stackOptions_FeedBackGenericIncorrect'] = 'Feedback: incorrect'; $string['stackOptions_FeedBackGenericIncorrect_def'] = "<font color='red'>Incorrect answer.</font>"; $string['stackOptions_FeedBackGenericPCorrect'] = 'Feedback: partially correct'; $string['stackOptions_FeedBackGenericPCorrect_def'] = "<font color='orange'>Your answer is partially correct.</font>"; $string['stackOptions_ShowSol'] = 'Show solution'; //////////////////////////////////// // Interactions with the CAS //////////////////////////////////// $string['NEWLINE'] = ' <html><br /></html>'; //////////////////////////////////// // Answer test specific strings //////////////////////////////////// $string['ATAlgEquiv_SA_notmatrix'] = 'Your answer should be a matrix, but is not.'; $string['ATAlgEquiv_SA_notlist'] = 'Your answer should be a list, but is not. Note that the syntax to enter a list is to enclose the comma separated values with square brackets.'; $string['ATAlgEquiv_SA_notset'] = 'Your answer should be a set, but is not. Note that the syntax to enter a set is to enclose the comma separated values with curly brackets.'; $string['ATList_wronglen'] = 'Your list should have {$a[0]} elements, but it is actually has {$a[1]}. '; $string['ATList_wrongentries'] = 'The entries in red below are those which are incorrect. {$a[0]} '; $string['ATMatrix_wrongsz'] = 'Your matrix should be {$a[0]} by {$a[1]}, but it is actually {$a[2]} by {$a[3]}.'; $string['ATMatrix_wrongentries'] = 'The entries in red below are those which are incorrect. {$a[0]}'; $string['ATSet_wrongsz'] = 'Your set should have {$a[0]} different elements, but it is actually has {$a[1]}.'; $string['ATSet_wrongentries'] = 'The following entries are incorrect, although they may appear in a simplified form from that which you actually entered. {$a[0]} '; $string['irred_Q_factored'] = 'The term {$a[0]} should be unfactored, but is not.'; $string['irred_Q_commonint'] = 'You need to take out a common integer factor. '; // needs a space at the end. $string['irred_Q_optional_fac'] = 'You could do more work, since {$a[0]} can be further factored. However, you don\'t need to. '; $string['FacForm_UnPick_morework'] = 'You could still do some more work on the term {$a[0]}. '; $string['FacForm_UnPick_intfac'] = $string['irred_Q_commonint']; $string['ATFacForm_error_list'] = 'The answer test failed. Please contact your systems administrator'; $string['ATFacForm_error_degreeSA'] = 'The CAS could not establish the algebraic degree of your answer.'; $string['ATFacForm_error_float'] = 'You should not use any floating point (decimal) numbers. Please use only integers, fractions etc.'; $string['ATFacForm_isfactored'] = 'Your answer is factored, well done. '; // needs a space at the end. $string['ATFacForm_notfactored'] = 'Your answer is not factored. '; // needs a space at the end. $string['ATFacForm_notalgequiv'] = 'Note that your answer is not algebarically equivalent to the correct answer. You must have done something wrong. '; // needs a space at the end. $string['ATInt_error_list'] = $string['ATFacForm_error_list']; $string['ATInt_const_int'] = 'You need to add a constant of integration. This should be an arbitrary constant, not a number.'; $string['ATInt_const'] = 'You need to add a constant of integration, otherwise this appears to be correct. Well done.'; $string['ATInt_diff'] = 'It looks like you have differentiated instead!'; $string['ATInt_generic'] = 'The derivative of your answer should be equal to the function that you were asked to integrate, which was: {$a[0]} In fact, the derivative of your answer, with respect to {$a[1]} is: {$a[2]} so you must have done something wrong!'; $string['ATDiff_error_list'] = $string['ATFacForm_error_list']; $string['ATDiff_int'] = 'It looks like you have integrated instead!'; $string[''] = ''; $string[''] = ''; $string[''] = ''; $string[''] = ''; //get_string('ThisSTACKVer','stack','') ?> |
From: Chris S. <san...@us...> - 2005-06-17 12:25:12
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31272/scripts Modified Files: Tag: frontend_dev moodlelib.php Log Message: Language files Index: moodlelib.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/moodlelib.php,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** moodlelib.php 8 Jun 2005 08:41:29 -0000 1.2 --- moodlelib.php 17 Jun 2005 12:24:58 -0000 1.2.4.1 *************** *** 97,101 **** //In Moodle we should have a /lang/en/ dir etc. ! //$location = $stack_root.'/lang/'; // Get the current language --- 97,101 ---- //In Moodle we should have a /lang/en/ dir etc. ! $location = $stack_root.'/lang/'; // Get the current language *************** *** 107,112 **** } ! //$langfile = $location.$lang.'/'.$module.'.php'; ! $langfile = $stack_root.'/scripts/'.$lang.'.php'; if (file_exists($langfile)) { if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) { --- 107,111 ---- } ! $langfile = $location.$lang.'/'.$module.'.php'; if (file_exists($langfile)) { if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) { |
From: Chris S. <san...@us...> - 2005-06-17 12:25:10
|
Update of /cvsroot/stack/stack-1-0/lang/es In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31272/lang/es Added Files: Tag: frontend_dev stack.php Log Message: Language files --- NEW FILE: stack.php --- (This appears to be a binary file; contents omitted.) |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:02
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/scripts Modified Files: Tag: frontend_dev stackAuthor.php stackDatabase.php stackQuiz.php Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** stackQuiz.php 12 Jun 2005 09:48:37 -0000 1.1 --- stackQuiz.php 17 Jun 2005 10:54:52 -0000 1.1.2.1 *************** *** 8,13 **** */ ! $stackQuiz['quizID']['descript'] = 'Quiz ID number'; ! $stackQuiz['quizID']['mysql'] = 'INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'; $stackQuiz['quizName']['descript'] = 'Quiz name'; --- 8,13 ---- */ ! $stackQuiz['quizid']['descript'] = 'Quiz ID number'; ! $stackQuiz['quizid']['mysql'] = 'INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'; $stackQuiz['quizName']['descript'] = 'Quiz name'; Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.16.2.5 retrieving revision 1.16.2.6 diff -C2 -d -r1.16.2.5 -r1.16.2.6 *** stackDatabase.php 16 Jun 2005 14:30:17 -0000 1.16.2.5 --- stackDatabase.php 17 Jun 2005 10:54:52 -0000 1.16.2.6 *************** *** 1033,1045 **** * Confirms a quiz still exists in the database. * ! * @param int $quizID The quizID of the quuiz. * @return boolean */ ! function stack_db_confirm_quiz_exists($quizID) { $exists = FALSE; ! if ('' != $quizID ) { ! $query = 'SELECT quizName FROM stackQuiz WHERE quizID='.$quizID; $result= stack_db_query($query); --- 1033,1045 ---- * Confirms a quiz still exists in the database. * ! * @param int $quizid The quizid of the quuiz. * @return boolean */ ! function stack_db_confirm_quiz_exists($quizid) { $exists = FALSE; ! if ('' != $quizid ) { ! $query = 'SELECT quizName FROM stackQuiz WHERE quizid='.$quizid; $result= stack_db_query($query); *************** *** 1055,1065 **** * Deletes a quiz from the database. * ! * @param int $quizID The quizID of the quuiz. * @return void */ ! function stack_db_quiz_delete($quizID) { ! if ('' != $quizID ) { ! $query = "DELETE FROM stackQuiz WHERE quizID = '$quizID'"; $result= stack_db_query($query); } --- 1055,1065 ---- * Deletes a quiz from the database. * ! * @param int $quizid The quizid of the quuiz. * @return void */ ! function stack_db_quiz_delete($quizid) { ! if ('' != $quizid ) { ! $query = "DELETE FROM stackQuiz WHERE quizid = '$quizid'"; $result= stack_db_query($query); } *************** *** 1067,1086 **** /** ! * Get details of the quiz from the database. If no $quizID is supplied, then all quizzes * are listed instead. * ! * @param int $quizID The quizID number of the quiz needed. * @param boolean $allqs If set to TRUE, then all questions are returned, including hidden ones! * @return array $quiz_list Full information about the quizzes. */ ! function stack_db_quiz_get($quizID='',$allqs=TRUE) { global $stackQuiz; $quiz_list = NULL; $quiz_fields = array_keys($stackQuiz); ! if ('' == $quizID) { $query = "SELECT * FROM stackQuiz"; } else { ! $query = "SELECT * FROM stackQuiz WHERE quizID = '$quizID'"; } $result = stack_db_query($query); --- 1067,1086 ---- /** ! * Get details of the quiz from the database. If no $quizid is supplied, then all quizzes * are listed instead. * ! * @param int $quizid The quizid number of the quiz needed. * @param boolean $allqs If set to TRUE, then all questions are returned, including hidden ones! * @return array $quiz_list Full information about the quizzes. */ ! function stack_db_quiz_get($quizid='',$allqs=TRUE) { global $stackQuiz; $quiz_list = NULL; $quiz_fields = array_keys($stackQuiz); ! if ('' == $quizid) { $query = "SELECT * FROM stackQuiz"; } else { ! $query = "SELECT * FROM stackQuiz WHERE quizid = '$quizid'"; } $result = stack_db_query($query); *************** *** 1101,1107 **** // Obtain all questions in the quizzes. if ($allqs) { ! $query = "SELECT questionID, qord FROM quiz_question WHERE quizID = {$quiz['quizID']} ORDER BY qord"; } else { ! $query = "SELECT questionID, qord FROM quiz_question WHERE quizID = {$quiz['quizID']} AND qord >= 0 ORDER BY qord"; } $questions_result = stack_db_query($query); --- 1101,1107 ---- // Obtain all questions in the quizzes. if ($allqs) { ! $query = "SELECT questionID, qord FROM quiz_question WHERE quizid = {$quiz['quizid']} ORDER BY qord"; } else { ! $query = "SELECT questionID, qord FROM quiz_question WHERE quizid = {$quiz['quizid']} AND qord >= 0 ORDER BY qord"; } $questions_result = stack_db_query($query); *************** *** 1125,1129 **** } ! if ('' == $quizID) { return $quiz_list; } else { --- 1125,1129 ---- } ! if ('' == $quizid) { return $quiz_list; } else { *************** *** 1134,1142 **** /** * Update details of the quiz in the database. ! * If the quizID is blank, or the $quizID is not in the database a new * quiz is created. * * @param array $quiz The quiz. ! * @return int $quizID The quizID of the quiz in question. */ function stack_db_quiz_update($quiz) { --- 1134,1142 ---- /** * Update details of the quiz in the database. ! * If the quizid is blank, or the $quizid is not in the database a new * quiz is created. * * @param array $quiz The quiz. ! * @return int $quizid The quizid of the quiz in question. */ function stack_db_quiz_update($quiz) { *************** *** 1145,1157 **** $quiz_fields = array_keys($stackQuiz); ! $quizID = ''; ! if (array_key_exists('quizID',$quiz)) { ! $quizID = trim($quiz['quizID']); } $new_quiz = FALSE; ! if ('' == $quizID) { $new_quiz = TRUE; ! } else if(!stack_db_confirm_quiz_exists($quizID)) { $new_quiz = TRUE; } --- 1145,1157 ---- $quiz_fields = array_keys($stackQuiz); ! $quizid = ''; ! if (array_key_exists('quizid',$quiz)) { ! $quizid = trim($quiz['quizid']); } $new_quiz = FALSE; ! if ('' == $quizid) { $new_quiz = TRUE; ! } else if(!stack_db_confirm_quiz_exists($quizid)) { $new_quiz = TRUE; } *************** *** 1178,1185 **** $result = stack_db_query($query); ! // GET the last quizID $result= stack_db_query('SELECT LAST_INSERT_ID() FROM stackQuiz'); $row = mysql_fetch_row($result); ! $quizID = $row[0]; } else { --- 1178,1185 ---- $result = stack_db_query($query); ! // GET the last quizid $result= stack_db_query('SELECT LAST_INSERT_ID() FROM stackQuiz'); $row = mysql_fetch_row($result); ! $quizid = $row[0]; } else { *************** *** 1199,1208 **** $qu = substr($qu,1,strlen($qu)-1); ! $query = "UPDATE stackQuiz SET $qu WHERE quizID = '$quizID'"; $result = stack_db_query($query); } ! return $quizID; } --- 1199,1208 ---- $qu = substr($qu,1,strlen($qu)-1); ! $query = "UPDATE stackQuiz SET $qu WHERE quizid = '$quizid'"; $result = stack_db_query($query); } ! return $quizid; } *************** *** 1211,1221 **** * Add a questionID to a quiz * ! * @param int $quizID The quizID number of the quiz needed. * @param int $questionID The questionID of the question! * @return void */ ! function stack_db_quiz_add_question($quizID,$questionID) { ! $query = "INSERT INTO quiz_question (quizID, questionID) VALUES ('$quizID','$questionID')"; $result = stack_db_query($query); } --- 1211,1221 ---- * Add a questionID to a quiz * ! * @param int $quizid The quizid number of the quiz needed. * @param int $questionID The questionID of the question! * @return void */ ! function stack_db_quiz_add_question($quizid,$questionID) { ! $query = "INSERT INTO quiz_question (quizid, questionID) VALUES ('$quizid','$questionID')"; $result = stack_db_query($query); } *************** *** 1224,1235 **** * Drop a questionID from a quiz * ! * @param int $quizID The quizID number of the quiz needed. * @param int $questionID The questionID of the question! * @return int $result The number of table rows dropped. */ ! function stack_db_quiz_drop_question($quizID,$questionID) { ! if ('' != $quizID and '' != $questionID) { ! $query = "DELETE FROM quiz_question WHERE quizID = '$quizID' and questionID= '$questionID'"; $result = stack_db_query($query); } --- 1224,1235 ---- * Drop a questionID from a quiz * ! * @param int $quizid The quizid number of the quiz needed. * @param int $questionID The questionID of the question! * @return int $result The number of table rows dropped. */ ! function stack_db_quiz_drop_question($quizid,$questionID) { ! if ('' != $quizid and '' != $questionID) { ! $query = "DELETE FROM quiz_question WHERE quizid = '$quizid' and questionID= '$questionID'"; $result = stack_db_query($query); } *************** *** 1241,1256 **** * Reorder a questionID within a quiz * ! * @param int $quizID The quizID number of the quiz needed. * @param int $questionID The questionID of the question! * @param int $order * @return int $result The number of table rows dropped. */ ! function stack_db_quiz_reorder_question($quizID,$questionID,$order='NULL') { ! if ('' != $quizID and '' != $questionID) { if ('NULL' === $order) { ! $query = "UPDATE quiz_question SET qord=NULL WHERE quizID='$quizID' AND questionID='$questionID'"; } else { ! $query = "UPDATE quiz_question SET qord='$order' WHERE quizID='$quizID' AND questionID='$questionID'"; } $result = stack_db_query($query); --- 1241,1256 ---- * Reorder a questionID within a quiz * ! * @param int $quizid The quizid number of the quiz needed. * @param int $questionID The questionID of the question! * @param int $order * @return int $result The number of table rows dropped. */ ! function stack_db_quiz_reorder_question($quizid,$questionID,$order='NULL') { ! if ('' != $quizid and '' != $questionID) { if ('NULL' === $order) { ! $query = "UPDATE quiz_question SET qord=NULL WHERE quizid='$quizid' AND questionID='$questionID'"; } else { ! $query = "UPDATE quiz_question SET qord='$order' WHERE quizid='$quizid' AND questionID='$questionID'"; } $result = stack_db_query($query); *************** *** 1264,1275 **** * are listed instead. * ! * @param int $quizID The $quizID number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. * @return void */ ! function stack_db_quiz_quizattempt_store($quizID,$userID,$seed) { ! $query = "INSERT INTO quizAttempts (quizID, userID, Seed ) VALUES ('$quizID','$userID','$seed')"; $result = stack_db_query($query); } --- 1264,1275 ---- * are listed instead. * ! * @param int $quizid The $quizid number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. * @return void */ ! function stack_db_quiz_quizattempt_store($quizid,$userID,$seed) { ! $query = "INSERT INTO quizAttempts (quizid, userID, Seed ) VALUES ('$quizid','$userID','$seed')"; $result = stack_db_query($query); } *************** *** 1278,1282 **** * Record details of the mark for the last attempt. * ! * @param int $quizID The $quizID number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. --- 1278,1282 ---- * Record details of the mark for the last attempt. * ! * @param int $quizid The $quizid number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. *************** *** 1285,1291 **** * @return void */ ! function stack_db_quiz_quizattempt_updatemark($quizID,$userID,$seed,$maxmark,$mark) { ! $query = "UPDATE quizAttempts SET MaxMark='$maxmark', Mark='$mark' WHERE quizID='$quizID' AND userID='$userID' AND Seed='$seed';"; $result = stack_db_query($query); } --- 1285,1291 ---- * @return void */ ! function stack_db_quiz_quizattempt_updatemark($quizid,$userID,$seed,$maxmark,$mark) { ! $query = "UPDATE quizAttempts SET MaxMark='$maxmark', Mark='$mark' WHERE quizid='$quizid' AND userID='$userID' AND Seed='$seed';"; $result = stack_db_query($query); } *************** *** 1294,1305 **** * Record the fact the student has seen the solutions. * ! * @param int $quizID The $quizID number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. * @return void */ ! function stack_db_quiz_quizattempt_seensol($quizID,$userID,$seed) { ! $query = "UPDATE quizAttempts SET SolRequest = '1' WHERE quizID='$quizID' AND userID='$userID' AND Seed='$seed';"; $result = stack_db_query($query); } --- 1294,1305 ---- * Record the fact the student has seen the solutions. * ! * @param int $quizid The $quizid number. * @param int $userID The $userID number. * @param int $seed The $seed used to generate the questions. * @return void */ ! function stack_db_quiz_quizattempt_seensol($quizid,$userID,$seed) { ! $query = "UPDATE quizAttempts SET SolRequest = '1' WHERE quizid='$quizid' AND userID='$userID' AND Seed='$seed';"; $result = stack_db_query($query); } *************** *** 1308,1320 **** * Return the last attempt at a quiz. An array containing the seed and mark are returned. * ! * @param int $quizID The $quizID number. * @param int $userID The $userID number. * @return array $userinfo */ ! function stack_db_quiz_quizattempt_getlast($quizID,$userID) { $userinfo = NULL; ! $query = "SELECT Seed, Mark, MaxMark, SolRequest FROM quizAttempts WHERE quizID = '$quizID' and userID = '$userID'"; $result = stack_db_query($query); --- 1308,1320 ---- * Return the last attempt at a quiz. An array containing the seed and mark are returned. * ! * @param int $quizid The $quizid number. * @param int $userID The $userID number. * @return array $userinfo */ ! function stack_db_quiz_quizattempt_getlast($quizid,$userID) { $userinfo = NULL; ! $query = "SELECT Seed, Mark, MaxMark, SolRequest FROM quizAttempts WHERE quizid = '$quizid' and userID = '$userID'"; $result = stack_db_query($query); Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.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 *** stackAuthor.php 16 Jun 2005 14:30:17 -0000 1.22.2.3 --- stackAuthor.php 17 Jun 2005 10:54:52 -0000 1.22.2.4 *************** *** 659,663 **** $err = ''; echo "<tr><td><b>{$fields['descript']}</b></td>\n"; ! if ('quizID' == $key) { echo "<td><input type=\"hidden\" name=\"quiz[$key]\" value=\"{$quiz[$key]}\" alt=\"$key\" />{$quiz[$key]}</td><td>".$err.'</td></tr>'; } else if ('quizOptions' == $key){ --- 659,663 ---- $err = ''; echo "<tr><td><b>{$fields['descript']}</b></td>\n"; ! if ('quizid' == $key) { echo "<td><input type=\"hidden\" name=\"quiz[$key]\" value=\"{$quiz[$key]}\" alt=\"$key\" />{$quiz[$key]}</td><td>".$err.'</td></tr>'; } else if ('quizOptions' == $key){ *************** *** 739,747 **** function stack_quiz_edit(&$quiz,&$errors) { ! // (0) Establish the quizID ! if (array_key_exists('quizID',$quiz)) { ! $quizID = $quiz['quizID']; } else { ! $errors['quiz']['quizID'] = '<br />Could not find a quizID!'; return NULL; } --- 739,747 ---- function stack_quiz_edit(&$quiz,&$errors) { ! // (0) Establish the quizid ! if (array_key_exists('quizid',$quiz)) { ! $quizid = $quiz['quizid']; } else { ! $errors['quiz']['quizid'] = '<br />Could not find a quizid!'; return NULL; } *************** *** 758,762 **** $quID = $qu['questionID']; if (array_key_exists('drop',$qu)) { ! $nodropped = stack_db_quiz_drop_question($quiz['quizID'],$quID); unset($quiz['questions'][$key]); } --- 758,762 ---- $quID = $qu['questionID']; if (array_key_exists('drop',$qu)) { ! $nodropped = stack_db_quiz_drop_question($quiz['quizid'],$quID); unset($quiz['questions'][$key]); } *************** *** 805,811 **** } if ($ordered) { ! stack_db_quiz_reorder_question($quizID,$qu['questionID'],$qu['order']); } else { ! stack_db_quiz_reorder_question($quizID,$qu['questionID']); } } --- 805,811 ---- } if ($ordered) { ! stack_db_quiz_reorder_question($quizid,$qu['questionID'],$qu['order']); } else { ! stack_db_quiz_reorder_question($quizid,$qu['questionID']); } } *************** *** 827,831 **** if (stack_db_confirm_question_exists($quID)) { ! stack_db_quiz_add_question($quizID,$quID); $quiz['questions'][] = array('questionID'=>$quID); } else { --- 827,831 ---- if (stack_db_confirm_question_exists($quID)) { ! stack_db_quiz_add_question($quizid,$quID); $quiz['questions'][] = array('questionID'=>$quID); } else { |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:01
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/scripts/install Modified Files: Tag: frontend_dev stackInstall.php Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -C2 -d -r1.10 -r1.10.4.1 *** stackInstall.php 7 Jun 2005 09:35:15 -0000 1.10 --- stackInstall.php 17 Jun 2005 10:54:52 -0000 1.10.4.1 *************** *** 212,216 **** $qu = "CREATE TABLE IF NOT EXISTS quiz_question ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizID INT, questionID INT, qord INT ); "; --- 212,216 ---- $qu = "CREATE TABLE IF NOT EXISTS quiz_question ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizid INT, questionID INT, qord INT ); "; *************** *** 234,238 **** $qu = "CREATE TABLE IF NOT EXISTS quizAttempts ( attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizID int(11) default NULL, userID int(11) default NULL, Seed int(11) default NULL, --- 234,238 ---- $qu = "CREATE TABLE IF NOT EXISTS quizAttempts ( attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ! quizid int(11) default NULL, userID int(11) default NULL, Seed int(11) default NULL, |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:01
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/frontend_general Modified Files: Tag: frontend_dev editquiz_display.php front_end_display.php frontend_util.php process_input.php Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: frontend_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/frontend_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 *** frontend_util.php 16 Jun 2005 16:50:50 -0000 1.1.2.1 --- frontend_util.php 17 Jun 2005 10:54:51 -0000 1.1.2.2 *************** *** 1,4 **** --- 1,6 ---- <?php + include_once('scripts/stackUtility.php'); + function stack_get_username($user) { return nsf('username',$user); Index: editquiz_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/editquiz_display.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** editquiz_display.php 16 Jun 2005 16:50:50 -0000 1.1.2.1 --- editquiz_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.2 *************** *** 1,13 **** <?php function stack_select_quiz_screen($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='-1' /> <input type='hidden' name='action' value='quiz_choose' />"; echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th></th><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th></th></tr>"; foreach ($quiz_store as $qs => $quiz) { --- 1,19 ---- <?php + + + // + // @param $quiz_store + // @param $PostTo function stack_select_quiz_screen($quiz_store, $PostTo) { global $stackQuiz; if (is_array($quiz_store)) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizid' value='-1' /> <input type='hidden' name='action' value='quiz_choose' />"; echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th></th><th>{$stackQuiz['quizName']['descript']}</th> ! <th>{$stackQuiz['quizDescription']['descript']}</th><th></th></tr>"; foreach ($quiz_store as $qs => $quiz) { *************** *** 16,41 **** $qname = '[empty]'; } ! $qID = $quiz['quizID']; echo "<tr><td>{$qID}</td><td><a href=\"javascript:takeaction('quiz_edit','$qID');\">{$qname}</a></td>\n"; echo "<td>".$quiz['quizDescription']."</td>\n"; ! echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>Del</font></a></td></tr>\n"; } echo "\n</table>\n\n</p>"; } else { ! echo "<p>You have no quizzes available to try.</p>"; echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='-1' /> <input type='hidden' name='action' value='quiz_choose' />"; - - } } ! function stack_add_questions_screen($PostTo, $quizID, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizID' value='$quizID'>"; ! echo "<a href=\"javascript:takeaction('filter',{$quizID});\">Filter</a> "; echo "Name = <input type='text' name='bank_filter[name]' value='{$question_bank_filter['name']}' />"; echo " Keyword = <input type='text' name='bank_filter[kw]' value='{$question_bank_filter['kw']}' />"; --- 22,50 ---- $qname = '[empty]'; } ! $qID = $quiz['quizid']; echo "<tr><td>{$qID}</td><td><a href=\"javascript:takeaction('quiz_edit','$qID');\">{$qname}</a></td>\n"; echo "<td>".$quiz['quizDescription']."</td>\n"; ! echo "<td><a href=\"javascript:takeaction('quiz_delete','$qID');\"><font color='red'>Delete Quiz</font></a></td></tr>\n"; } echo "\n</table>\n\n</p>"; } else { ! stack_no_quiz_screen($PostTo); ! } ! } ! ! function stack_no_quiz_screen($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' />"; } ! function stack_add_questions_screen($PostTo, $quizid, $question_bank_filter) { echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> ! <input type='hidden' name='quizid' value='$quizid'>"; ! echo "<a href=\"javascript:takeaction('filter',{$quizid});\">Filter</a> "; echo "Name = <input type='text' name='bank_filter[name]' value='{$question_bank_filter['name']}' />"; echo " Keyword = <input type='text' name='bank_filter[kw]' value='{$question_bank_filter['kw']}' />"; *************** *** 53,57 **** 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'>"; } --- 62,66 ---- 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'>"; } 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.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** front_end_display.php 16 Jun 2005 16:50:50 -0000 1.1.2.5 --- front_end_display.php 17 Jun 2005 10:54:51 -0000 1.1.2.6 *************** *** 67,71 **** 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'>"; --- 67,71 ---- 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'>"; *************** *** 74,78 **** foreach ($quiz_store as $qs => $quiz) { $qname = $quiz['quizName']; ! $qID = $quiz['quizID']; $mark = '-'; if (is_array($user)) { --- 74,78 ---- foreach ($quiz_store as $qs => $quiz) { $qname = $quiz['quizName']; ! $qID = $quiz['quizid']; $mark = '-'; if (is_array($user)) { Index: process_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/process_input.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 *** process_input.php 16 Jun 2005 11:44:44 -0000 1.1.2.5 --- process_input.php 17 Jun 2005 10:54:51 -0000 1.1.2.6 *************** *** 19,23 **** * @package Stack */ ! $errors = ''; --- 19,23 ---- * @package Stack */ ! include_once('frontend_general/frontend_util.php'); $errors = ''; *************** *** 71,78 **** $username = $user['username']; } else { ! // Make sure the user is logged in as a Guest. include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } ?> --- 71,80 ---- $username = $user['username']; } else { ! // Make sure the user is logged in as a Guest. ! // Is a blank user a guest user??? include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } + $username = stack_get_username($user); ?> |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:01
|
Update of /cvsroot/stack/stack-1-0/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/api Modified Files: Tag: frontend_dev elementindex.html elementindex_data.html Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: elementindex.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/api/elementindex.html,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** elementindex.html 1 Apr 2005 20:01:33 -0000 1.1 --- elementindex.html 17 Jun 2005 10:54:51 -0000 1.1.4.1 *************** *** 9,13 **** </head> <body> ! <a name="top"></a> <h2>Full index</h2> <h3>Package indexes</h3> --- 9,14 ---- </head> <body> ! ! <a name="top"></a> <h2>Full index</h2> <h3>Package indexes</h3> *************** *** 3097,3101 **** <dd class="index-item-body"> <div class="index-item-details"><a href="data/Stack/_scripts_stackDatabase_php.html#functionstack_db_quiz_get">stack_db_quiz_get()</a> in stackDatabase.php</div> ! <div class="index-item-description">Get details of the quiz from the database. If no $quizID is supplied, then all quizzes are listed instead.</div> </dd> <dt class="field"> --- 3098,3102 ---- <dd class="index-item-body"> <div class="index-item-details"><a href="data/Stack/_scripts_stackDatabase_php.html#functionstack_db_quiz_get">stack_db_quiz_get()</a> in stackDatabase.php</div> ! <div class="index-item-description">Get details of the quiz from the database. If no $quizid is supplied, then all quizzes are listed instead.</div> </dd> <dt class="field"> *************** *** 4045,4048 **** <a class="index-letter" href="elementindex.html#w">w</a> <a class="index-letter" href="elementindex.html#x">x</a> ! </div> </body> ! </html> \ No newline at end of file --- 4046,4050 ---- <a class="index-letter" href="elementindex.html#w">w</a> <a class="index-letter" href="elementindex.html#x">x</a> ! </div> ! </body> ! </html> Index: elementindex_data.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/api/elementindex_data.html,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** elementindex_data.html 1 Apr 2005 20:01:34 -0000 1.1 --- elementindex_data.html 17 Jun 2005 10:54:51 -0000 1.1.4.1 *************** *** 9,13 **** </head> <body> ! <a name="top"></a> <h2>[data] element index</h2> <h3>Package indexes</h3> --- 9,14 ---- </head> <body> ! ! <a name="top"></a> <h2>[data] element index</h2> <h3>Package indexes</h3> *************** *** 182,186 **** <dd class="index-item-body"> <div class="index-item-details"><a href="data/Stack/_scripts_stackDatabase_php.html#functionstack_db_quiz_get">stack_db_quiz_get()</a> in stackDatabase.php</div> ! <div class="index-item-description">Get details of the quiz from the database. If no $quizID is supplied, then all quizzes are listed instead.</div> </dd> <dt class="field"> --- 183,187 ---- <dd class="index-item-body"> <div class="index-item-details"><a href="data/Stack/_scripts_stackDatabase_php.html#functionstack_db_quiz_get">stack_db_quiz_get()</a> in stackDatabase.php</div> ! <div class="index-item-description">Get details of the quiz from the database. If no $quizid is supplied, then all quizzes are listed instead.</div> </dd> <dt class="field"> *************** *** 294,297 **** <a class="index-letter" href="elementindex_data.html#b">b</a> <a class="index-letter" href="elementindex_data.html#s">s</a> ! </div> </body> ! </html> \ No newline at end of file --- 295,299 ---- <a class="index-letter" href="elementindex_data.html#b">b</a> <a class="index-letter" href="elementindex_data.html#s">s</a> ! </div> ! </body> ! </html> |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:00
|
Update of /cvsroot/stack/stack-1-0/api/data/Stack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/api/data/Stack Modified Files: Tag: frontend_dev _scripts_stackDatabase_php.html Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: _scripts_stackDatabase_php.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/api/data/Stack/_scripts_stackDatabase_php.html,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** _scripts_stackDatabase_php.html 1 Apr 2005 20:01:36 -0000 1.1 --- _scripts_stackDatabase_php.html 17 Jun 2005 10:54:50 -0000 1.1.4.1 *************** *** 9,13 **** </head> <body> ! <div class="page-body"> <h2 class="file-name">/scripts/stackDatabase.php</h2> --- 9,14 ---- </head> <body> ! <div class="page-body"> ! <h2 class="file-name">/scripts/stackDatabase.php</h2> *************** *** 263,267 **** stack_db_confirm_quiz_exists </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>) </div> --- 264,268 ---- stack_db_confirm_quiz_exists </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>) </div> *************** *** 269,273 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID of the quuiz.</span> </li> </ul> --- 270,274 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid of the quuiz.</span> </li> </ul> *************** *** 496,500 **** stack_db_quiz_add_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>) </div> --- 497,501 ---- stack_db_quiz_add_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>) </div> *************** *** 502,506 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> --- 503,507 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> *************** *** 525,529 **** stack_db_quiz_delete </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>) </div> --- 526,530 ---- stack_db_quiz_delete </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>) </div> *************** *** 531,535 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID of the quuiz.</span> </li> </ul> --- 532,536 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid of the quuiz.</span> </li> </ul> *************** *** 554,558 **** stack_db_quiz_drop_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>) </div> --- 555,559 ---- stack_db_quiz_drop_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>) </div> *************** *** 560,564 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> --- 561,565 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> *************** *** 576,580 **** <!-- ========== Info from phpDoc block ========= --> ! <p class="short-description">Get details of the quiz from the database. If no $quizID is supplied, then all quizzes are listed instead.</p> <ul class="tags"> <li><span class="field">return:</span> Full information about the quizzes.</li> --- 577,581 ---- <!-- ========== Info from phpDoc block ========= --> ! <p class="short-description">Get details of the quiz from the database. If no $quizid is supplied, then all quizzes are listed instead.</p> <ul class="tags"> <li><span class="field">return:</span> Full information about the quizzes.</li> *************** *** 586,590 **** stack_db_quiz_get </span> ! ([<span class="var-type">int</span> <span class="var-name">$quizID</span> = <span class="var-default">''</span>], [<span class="var-type">boolean</span> <span class="var-name">$allqs</span> = <span class="var-default">TRUE</span>]) </div> --- 587,591 ---- stack_db_quiz_get </span> ! ([<span class="var-type">int</span> <span class="var-name">$quizid</span> = <span class="var-default">''</span>], [<span class="var-type">boolean</span> <span class="var-name">$allqs</span> = <span class="var-default">TRUE</span>]) </div> *************** *** 592,596 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID number of the quiz needed.</span> </li> <li> <span class="var-type">boolean</span> --- 593,597 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid number of the quiz needed.</span> </li> <li> <span class="var-type">boolean</span> *************** *** 615,619 **** stack_db_quiz_quizattempt_getlast </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>) </div> --- 616,620 ---- stack_db_quiz_quizattempt_getlast </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>) </div> *************** *** 621,625 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The $quizID number.</span> </li> <li> <span class="var-type">int</span> --- 622,626 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The $quizid number.</span> </li> <li> <span class="var-type">int</span> *************** *** 644,648 **** stack_db_quiz_quizattempt_seensol </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>) </div> --- 645,649 ---- stack_db_quiz_quizattempt_seensol </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>) </div> *************** *** 650,654 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The $quizID number.</span> </li> <li> <span class="var-type">int</span> --- 651,655 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The $quizid number.</span> </li> <li> <span class="var-type">int</span> *************** *** 677,681 **** stack_db_quiz_quizattempt_store </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>) </div> --- 678,682 ---- stack_db_quiz_quizattempt_store </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>) </div> *************** *** 683,687 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The $quizID number.</span> </li> <li> <span class="var-type">int</span> --- 684,688 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The $quizid number.</span> </li> <li> <span class="var-type">int</span> *************** *** 709,713 **** stack_db_quiz_quizattempt_updatemark </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>, <span class="var-type">float</span> <span class="var-name">$maxmark</span>, <span class="var-type">float</span> <span class="var-name">$mark</span>) </div> --- 710,714 ---- stack_db_quiz_quizattempt_updatemark </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$userID</span>, <span class="var-type">int</span> <span class="var-name">$seed</span>, <span class="var-type">float</span> <span class="var-name">$maxmark</span>, <span class="var-type">float</span> <span class="var-name">$mark</span>) </div> *************** *** 715,719 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The $quizID number.</span> </li> <li> <span class="var-type">int</span> --- 716,720 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The $quizid number.</span> </li> <li> <span class="var-type">int</span> *************** *** 750,754 **** stack_db_quiz_reorder_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizID</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>, [<span class="var-type">int</span> <span class="var-name">$order</span> = <span class="var-default">'NULL'</span>]) </div> --- 751,755 ---- stack_db_quiz_reorder_question </span> ! (<span class="var-type">int</span> <span class="var-name">$quizid</span>, <span class="var-type">int</span> <span class="var-name">$questionID</span>, [<span class="var-type">int</span> <span class="var-name">$order</span> = <span class="var-default">'NULL'</span>]) </div> *************** *** 756,760 **** <li> <span class="var-type">int</span> ! <span class="var-name">$quizID</span><span class="var-description">: The quizID number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> --- 757,761 ---- <li> <span class="var-type">int</span> ! <span class="var-name">$quizid</span><span class="var-description">: The quizid number of the quiz needed.</span> </li> <li> <span class="var-type">int</span> *************** *** 776,782 **** <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Update details of the quiz in the database.</p> ! <p class="description"><p>If the quizID is blank, or the $quizID is not in the database a new quiz is created.</p></p> <ul class="tags"> ! <li><span class="field">return:</span> The quizID of the quiz in question.</li> </ul> --- 777,783 ---- <!-- ========== Info from phpDoc block ========= --> <p class="short-description">Update details of the quiz in the database.</p> ! <p class="description"><p>If the quizid is blank, or the $quizid is not in the database a new quiz is created.</p></p> <ul class="tags"> ! <li><span class="field">return:</span> The quizid of the quiz in question.</li> </ul> *************** *** 1086,1088 **** </p> </div></body> ! </html> \ No newline at end of file --- 1087,1089 ---- </p> </div></body> ! </html> |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:00
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612/html Modified Files: Tag: frontend_dev quizjava.html Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: quizjava.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/quizjava.html,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -C2 -d -r1.7 -r1.7.4.1 *** quizjava.html 21 Apr 2005 16:01:21 -0000 1.7 --- quizjava.html 17 Jun 2005 10:54:52 -0000 1.7.4.1 *************** *** 1,6 **** <script language="javascript"> function takeaction(c,n) { - document.forms.quizform.quizID.value = n; document.forms.quizform.action.value = c; document.forms.quizform.submit(); } --- 1,6 ---- <script language="javascript"> function takeaction(c,n) { document.forms.quizform.action.value = c; + document.forms.quizform.quizid.value = n; document.forms.quizform.submit(); } |
From: Juliette W. <jv...@us...> - 2005-06-17 10:55:00
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15612 Modified Files: Tag: frontend_dev editquiz.php index.php quiz.php Log Message: Fixed one of the problems. Changed quizID to quizid everywhere because I thought this might be the problem, need to decide on how to name things consistently. Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.10.2.7 retrieving revision 1.10.2.8 diff -C2 -d -r1.10.2.7 -r1.10.2.8 *** editquiz.php 16 Jun 2005 16:50:49 -0000 1.10.2.7 --- editquiz.php 17 Jun 2005 10:54:51 -0000 1.10.2.8 *************** *** 26,34 **** $default_action = 'quiz_choose'; include('frontend_general/process_input.php'); ! include('frontend_general/frontend_util.php'); ! include('frontend_general/edit_quiz_util.php'); $PostTo = 'editquiz.php'; $filter = ''; ! $quizID = NULL; include('html/pagehead.php'); --- 26,34 ---- $default_action = 'quiz_choose'; include('frontend_general/process_input.php'); ! ! include_once('frontend_general/edit_quiz_util.php'); $PostTo = 'editquiz.php'; $filter = ''; ! $quizid = NULL; include('html/pagehead.php'); *************** *** 52,57 **** // show_array($_POST); ! echo "Action is $action"; $quizid_source = ''; if ('quiz_delete' == $action or 'filter' == $action) { --- 52,63 ---- // show_array($_POST); + + //////////////////////////////////////////////// + // Set $quizid and $quiz if necessary + //////////////////////////////////////////////// ! ! ! $quiz = ''; $quizid_source = ''; if ('quiz_delete' == $action or 'filter' == $action) { *************** *** 62,83 **** $quizid_source = 'database'; } - - $quizID = stack_get_quizID($quizid_source); - - if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { ! if (array_key_exists('quiz',$_POST)) { ! $quiz = $_POST['quiz']; ! $quizID = $quiz['quizID']; ! } else if (array_key_exists('quizID',$_POST)){ ! // We have just chosen a quiz, or selected new questions, so had better fetch it. ! $quizID = $_POST['quizID']; ! $quiz = stack_db_quiz_get($quizID); ! } ! } ! echo $quizID; ! if ('filter' == $action) { $filter_source = 'post'; --- 68,86 ---- $quizid_source = 'database'; } ! if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { ! $quiz_source = 'post'; ! $quiz = stack_get_quiz('post', $quizid); ! if ('' == $quiz) { ! $quizid_source = 'post'; ! } ! } ! $quizid = stack_get_quizid($quizid_source, $quiz); ! if (('quiz_edit' == $action or 'quiz_edit_addqs' == $action) and '' == $quiz) { ! $quiz = stack_get_quiz('database', $quizid); ! } ! if ('filter' == $action) { $filter_source = 'post'; *************** *** 86,104 **** } ! $question_bank_filter = stack_get_question_bank_filter($filter_source); ! if ('quiz_delete' == $action and $quizID != NULL) { ! stack_db_quiz_delete($quizID); $action = 'quiz_choose'; } ! if ('filter' == $action and $quizID != NULL) { $action = 'quiz_edit_addqs'; stack_set_session_question_bank_filter($question_bank_filter); } - if ('quiz_edit' == $action or 'quiz_edit_addqs' == $action) { - $quiz = stack_get_quiz(); - } if ('quiz_edit' == $action) { --- 89,104 ---- } ! $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) { *************** *** 114,118 **** if ('quiz_new' == $action) { ! $quiz['quizID'] = $quizID; $action = 'quiz_edit'; } --- 114,118 ---- if ('quiz_new' == $action) { ! $quiz['quizid'] = $quizid; $action = 'quiz_edit'; } *************** *** 133,137 **** break; case 'quiz_edit_addqs': ! stack_add_questions_screen($PostTo, $quizID, $question_bank_filter); break; } --- 133,137 ---- break; case 'quiz_edit_addqs': ! stack_add_questions_screen($PostTo, $quizid, $question_bank_filter); break; } Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.22.2.4 retrieving revision 1.22.2.5 diff -C2 -d -r1.22.2.4 -r1.22.2.5 *** quiz.php 17 Jun 2005 06:28:55 -0000 1.22.2.4 --- quiz.php 17 Jun 2005 10:54:51 -0000 1.22.2.5 *************** *** 85,92 **** $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; --- 85,92 ---- $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; *************** *** 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; --- 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; *************** *** 135,139 **** // Check for the necessary informtaion incoming. ! $userinfo = stack_db_quiz_quizattempt_getlast($quizID,$user['id']); if (is_array($userinfo)) { --- 135,139 ---- // Check for the necessary informtaion incoming. ! $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); if (is_array($userinfo)) { *************** *** 177,181 **** // Record the information in the DB if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_store($quiz['quizID'],$user['id'],$seed); } --- 177,181 ---- // Record the information in the DB if ( '0' != $user['id']) { ! stack_db_quiz_quizattempt_store($quiz['quizid'],$user['id'],$seed); } *************** *** 207,211 **** if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; ! $quizID = $quiz['quizID']; $quiz_options = array(); if (array_key_exists('quizOptions',$quiz)){ --- 207,211 ---- if (array_key_exists('quiz',$_SESSION)) { $quiz = $_SESSION['quiz']; ! $quizid = $quiz['quizid']; $quiz_options = array(); if (array_key_exists('quizOptions',$quiz)){ *************** *** 240,246 **** 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'; --- 240,246 ---- 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'; *************** *** 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. --- 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. *************** *** 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. --- 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. *************** *** 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); } --- 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); } *************** *** 662,666 **** <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> --- 662,666 ---- <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> Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.17.2.8 retrieving revision 1.17.2.9 diff -C2 -d -r1.17.2.8 -r1.17.2.9 *** index.php 16 Jun 2005 16:50:49 -0000 1.17.2.8 --- index.php 17 Jun 2005 10:54:51 -0000 1.17.2.9 *************** *** 43,46 **** --- 43,50 ---- include('frontend_general/loginregister.php'); + $err = stack_get_err($errors); + $errun = stack_get_errun($err); + $errps = stack_get_errps($err); + ////////////////////////////////////////////////////////////// *************** *** 62,69 **** if ('loginscreen' == $action) { - $err = stack_get_err($errors); - $errun = stack_get_errun($err); - $errps = stack_get_errps($err); - $username = stack_get_username($user); stack_login_screen($username, $errun, $errps); } --- 66,69 ---- *************** *** 71,76 **** if ('registration_screen' == $action) { include_once($stack_root."/scripts/stackUser.php"); - $err = stack_get_err($errors); - $username = stack_get_username($user); stack_registration_screen($username, $user, $errors, $err); } --- 71,74 ---- |