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-10-20 13:26:07
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1616/scripts Modified Files: stackQuestion.php Log Message: Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** stackQuestion.php 20 Oct 2005 12:53:36 -0000 1.44 --- stackQuestion.php 20 Oct 2005 13:25:59 -0000 1.45 *************** *** 1724,1727 **** --- 1724,1732 ---- } + if ('true' != $this_PRattempt['Valid']) { + $NoErrors = FALSE; + $this_attempt['Valid'] = 'false'; + } + $this_attempt['AnswerNote'] .= ' '.stack_castext_to_display($this_PRattempt['AnswerNote'],$all_locs_Inst,$options,$errors); $this_attempt['FeedBack'] .= ' '.stack_castext_to_display($this_PRattempt['FeedBack'],$all_locs_Inst,$options,$errors); *************** *** 1734,1773 **** } ! // Modify the marks ! if ('=' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] = $potresp[$branch]['RawMark']; ! } else if ('+' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] += $potresp[$branch]['RawMark']; ! } else if ('-' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] -= $potresp[$branch]['RawMark']; ! } else if ('=AT' == $potresp[$branch]['RawMarkMod']) { ! // If the AnswerTest has assigned partial credit, we need to use it. ! if (array_key_exists('RawMark',$this_PRattempt)) { ! $this_attempt['RawMark'] = $this_PRattempt['RawMark']; ! } else if ($this_PRattempt['Result']) { ! $this_attempt['RawMark'] = 1; ! } else { ! $this_attempt['RawMark'] = 0; } - } ! // Add any penalty ! if (array_key_exists('Penalty',$potresp[$branch])) { ! $this_attempt['Penalty'] += $potresp[$branch]['Penalty']; ! } // If there is no penalty set, we use the default, *AT THE END* ! // Generate any FeedBack ! if (array_key_exists('FeedBack',$potresp[$branch])) { ! $out = ' '.stack_castext_inst($potresp[$branch]['FeedBack'],$all_locs_Inst,$options,$errors); ! $this_attempt['FeedBack'] .= $out; ! } ! // Generate any AnswerNote. if (array_key_exists('AnswerNote',$potresp[$branch])) { ! $out = ' '.stack_castext_inst($potresp[$branch]['AnswerNote'],$all_locs_Inst,$options,$errors); ! $this_attempt['AnswerNote'] .= $out; ! } ! // Need to check "Continue?" condition. $exed[$prn] = 0; --- 1739,1778 ---- } ! // Modify the marks ! if ('=' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] = $potresp[$branch]['RawMark']; ! } else if ('+' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] += $potresp[$branch]['RawMark']; ! } else if ('-' == $potresp[$branch]['RawMarkMod']) { ! $this_attempt['RawMark'] -= $potresp[$branch]['RawMark']; ! } else if ('=AT' == $potresp[$branch]['RawMarkMod']) { ! // If the AnswerTest has assigned partial credit, we need to use it. ! if (array_key_exists('RawMark',$this_PRattempt)) { ! $this_attempt['RawMark'] = $this_PRattempt['RawMark']; ! } else if ($this_PRattempt['Result']) { ! $this_attempt['RawMark'] = 1; ! } else { ! $this_attempt['RawMark'] = 0; ! } } ! // Add any penalty ! if (array_key_exists('Penalty',$potresp[$branch])) { ! $this_attempt['Penalty'] += $potresp[$branch]['Penalty']; ! } // If there is no penalty set, we use the default, *AT THE END* ! // Generate any FeedBack ! if (array_key_exists('FeedBack',$potresp[$branch])) { ! $out = ' '.stack_castext_inst($potresp[$branch]['FeedBack'],$all_locs_Inst,$options,$errors); ! $this_attempt['FeedBack'] .= $out; ! } ! // Generate any AnswerNote. if (array_key_exists('AnswerNote',$potresp[$branch])) { ! $out = ' '.stack_castext_inst($potresp[$branch]['AnswerNote'],$all_locs_Inst,$options,$errors); ! $this_attempt['AnswerNote'] .= $out; ! } ! // Need to check "Continue?" condition. $exed[$prn] = 0; *************** *** 1775,1786 **** if (array_key_exists($prn,$exed)) { ! if(0==$exed[$prn]) { // ERROR! we have been here before $this_attempt['AnswerNote'] .= get_string('QMarkBailOut','stack','')." ".$prn; } ! } else { // We have nowhere to go! ! $exed[$prn] = 0; ! } ! } while (1==$exed[$prn] and $NoErrors); // Finished processing each PR. --- 1780,1791 ---- if (array_key_exists($prn,$exed)) { ! if(0==$exed[$prn]) { // ERROR! we have been here before $this_attempt['AnswerNote'] .= get_string('QMarkBailOut','stack','')." ".$prn; } ! } else { // We have nowhere to go! ! $exed[$prn] = 0; ! } ! } while (1==$exed[$prn] and $NoErrors); // Finished processing each PR. *************** *** 1794,1798 **** $this_attempt['Penalty'] = 0; } ! } }// End If != error in Ans --- 1799,1803 ---- $this_attempt['Penalty'] = 0; } ! } }// End If != error in Ans |
From: Chris S. <san...@us...> - 2005-10-20 13:26:07
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1616/scripts/maxima Modified Files: stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** stackmaxima.mac 7 Oct 2005 06:26:38 -0000 1.37 --- stackmaxima.mac 20 Oct 2005 13:25:59 -0000 1.38 *************** *** 420,423 **** --- 420,425 ---- else return(ATEquation(SA,SB)), + /* Did the student type in an equation, but the teacher did not? */ + if equationp(SA) then return(StackReturnOb("false","0","ATAlgEquiv_SA_not_equation",StackAddFeedback("","ATAlgEquiv_TA_not_equation"))), /* Are we dealing with an equation? */ if inequalityp(SB) then |
From: Chris S. <san...@us...> - 2005-10-20 12:53:49
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25721/scripts Modified Files: stackDatabase.php stackFrontend.php stackQuestion.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** stackDatabase.php 11 Oct 2005 17:35:38 -0000 1.52 --- stackDatabase.php 20 Oct 2005 12:53:36 -0000 1.53 *************** *** 1488,1492 **** if ('' == $quizid) { ! $query = "SELECT $query FROM stackQuiz"; } else { $query = "SELECT $query FROM stackQuiz WHERE quizid = '$quizid'"; --- 1488,1492 ---- if ('' == $quizid) { ! $query = "SELECT $query FROM stackQuiz ORDER BY quizName"; } else { $query = "SELECT $query FROM stackQuiz WHERE quizid = '$quizid'"; Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** stackFrontend.php 20 Oct 2005 10:40:40 -0000 1.8 --- stackFrontend.php 20 Oct 2005 12:53:36 -0000 1.9 *************** *** 235,240 **** --- 235,243 ---- echo "\n<tr><th></th><th>".get_string('stackQuiz_quizName','stack','')."</th> <th>".get_string('stackQuiz_quizDescription','stack','')."</th><th></th></tr>"; + + $trcol = FALSE; foreach ($quiz_store as $qs => $quiz) { + $trcol = !$trcol; $qname = $quiz['quizName']; if ('' == trim($qname)) { *************** *** 242,246 **** } $qID = $quiz['quizid']; ! echo "<tr><td>{$qID}</td><td>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; echo "<td><a href=\"javascript:quiztry('continue_quiz','$qID');\">try</a></td>\n"; --- 245,251 ---- } $qID = $quiz['quizid']; ! if ($trcol) { echo "\n<tr bgcolor='#DDDDDD'>\n"; } else { echo "\n<tr bgcolor='#DDDDFF'>\n"; } ! ! echo "<td>{$qID}</td><td>{$qname}</td><td>".$quiz['quizDescription']."</td>\n"; echo "<td><a href=\"javascript:takeaction('quiz_edit','$qID');\">edit</a></td>\n"; echo "<td><a href=\"javascript:quiztry('continue_quiz','$qID');\">try</a></td>\n"; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** stackQuestion.php 20 Oct 2005 10:40:40 -0000 1.43 --- stackQuestion.php 20 Oct 2005 12:53:36 -0000 1.44 *************** *** 260,263 **** --- 260,264 ---- $stackQuestion['questionGUID']['metatag']='identifier'; $stackQuestion['questionGUID']['metatype']='dublincore'; + // 'Name'; $stackQuestion['questionName']['type']='meta'; *************** *** 266,269 **** --- 267,271 ---- $stackQuestion['questionName']['metatag']='title'; $stackQuestion['questionName']['metatype']='dublincore'; + // 'Description'; $stackQuestion['questionDescription']['type']='meta'; *************** *** 279,286 **** --- 281,290 ---- $stackQuestion['questionKeywords']['metatag']='keyword'; $stackQuestion['questionKeywords']['metatype']='lom'; + // 'Body'; $stackQuestion['questionBody']['type']='meta'; $stackQuestion['questionBody']['required']='system'; $stackQuestion['questionBody']['mysql']='TEXT'; + // 'Last edited by'; $stackQuestion['questionUserLastEdited']['type']='meta'; *************** *** 289,292 **** --- 293,297 ---- $stackQuestion['questionUserLastEdited']['metatag']='creator'; $stackQuestion['questionUserLastEdited']['metatype']='dublincore'; + //Publisher $stackQuestion['questionPublisher']['type']='meta'; *************** *** 384,389 **** //Type of question: Default to algebraicExpression as that is only type of question atm, but provides extensibility $stackQuestion['questionExcerciseType']['type']='meta'; ! $stackQuestion['questionExcerciseType']['values']=array('algebraicExpression','mcqSingleAnswer','mcqMultipleAnswer', ! 'fillInBlank','unspecified'); $stackQuestion['questionExcerciseType']['required']='optional'; $stackQuestion['questionExcerciseType']['mysql']='TINYTEXT'; --- 389,393 ---- //Type of question: Default to algebraicExpression as that is only type of question atm, but provides extensibility $stackQuestion['questionExcerciseType']['type']='meta'; ! $stackQuestion['questionExcerciseType']['values']=array('algebraicExpression','mcqSingleAnswer','mcqMultipleAnswer', 'fillInBlank','unspecified'); $stackQuestion['questionExcerciseType']['required']='optional'; $stackQuestion['questionExcerciseType']['mysql']='TINYTEXT'; |
From: Chris S. <san...@us...> - 2005-10-20 10:40:51
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26144 Modified Files: question_bank.php Log Message: Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** question_bank.php 7 Oct 2005 06:26:38 -0000 1.16 --- question_bank.php 20 Oct 2005 10:40:40 -0000 1.17 *************** *** 51,54 **** --- 51,57 ---- $RawAns = ''; + //show_array($_SESSION); + + /************************************************************ * (2) Perform any actions on entering the page *************** *** 125,128 **** --- 128,132 ---- if ($get_question) { $question = stack_question_get($source); + $_SESSION['question'] = $question; if (!$new_question) { stack_question_validate($question,$errors); *************** *** 217,228 **** ! // 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'; } --- 221,232 ---- ! //// 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'; } *************** *** 232,236 **** $RawAns=$_POST['RawAns']; } else { ! $error['RawAns'] = '<font color="red">You have not entered an answer!</font>'; } } --- 236,240 ---- $RawAns=$_POST['RawAns']; } else { ! $error['RawAns'] = '<font color="red">'.get_string('YouHaveNotAns','stack','').'</font>'; } } *************** *** 257,261 **** } } else { - $RawAns = $questionInst['questionAnsInst']['value']; } --- 261,264 ---- *************** *** 263,267 **** if (''!=$errors) { ! echo '<p>Could not instantiate the question, because of errors.<br />Try to edit the question instead.</p>'; $action='edit'; } --- 266,270 ---- if (''!=$errors) { ! echo '<p>'.get_string('QInstCASError','stack','').'</p>'; $action='edit'; } *************** *** 277,281 **** 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); --- 280,283 ---- |
From: Chris S. <san...@us...> - 2005-10-20 10:40:51
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26144/scripts Modified Files: stackFrontend.php stackQuestion.php Log Message: Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stackFrontend.php 14 Oct 2005 16:07:43 -0000 1.7 --- stackFrontend.php 20 Oct 2005 10:40:40 -0000 1.8 *************** *** 80,84 **** { $question['questionUserLastEdited'].=' <'.$user['email'].'>'; ! } } return $question; --- 80,85 ---- { $question['questionUserLastEdited'].=' <'.$user['email'].'>'; ! } ! } return $question; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** stackQuestion.php 11 Oct 2005 17:35:38 -0000 1.42 --- stackQuestion.php 20 Oct 2005 10:40:40 -0000 1.43 *************** *** 295,298 **** --- 295,299 ---- $stackQuestion['questionPublisher']['metatag']='publisher'; $stackQuestion['questionPublisher']['metatype']='dublincore'; + //Type: Hidden from user $stackQuestion['type']['type']='meta'; *************** *** 302,305 **** --- 303,307 ---- $stackQuestion['type']['metatag']='type'; $stackQuestion['type']['metatype']='dublincore'; + //Format: Hidden from user, selected by script - should be text/xml for the purposes of import/export $stackQuestion['questionFormat']['type']='meta'; *************** *** 311,314 **** --- 313,317 ---- $stackQuestion['questionFormat']['metatag']='format'; $stackQuestion['questionFormat']['metatype']='dublincore'; + //Language: Defaulted to current system language, but user definable $stackQuestion['questionLanguage']['type']='meta'; |
From: pkiddie <pk...@us...> - 2005-10-20 10:32:41
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23804/scripts Modified Files: stackXML.php Log Message: Commented the lib.php file extensively Fixed bug where importing code implied 0 was empty, when in fact this is not always true! Index: stackXML.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackXML.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** stackXML.php 30 Aug 2005 13:51:55 -0000 1.20 --- stackXML.php 20 Oct 2005 10:32:25 -0000 1.21 *************** *** 960,967 **** //Only import node if it does actually have any text behind it, in metadata this will assume defaults ! if (!empty($val)) { $array[$nodeName]=$val; } - } --- 960,967 ---- //Only import node if it does actually have any text behind it, in metadata this will assume defaults ! //Check that node is NOT empty but override it if that node is not actually empty and equal to 0 ! if (!empty($val) || $val==0) { $array[$nodeName]=$val; } } *************** *** 1062,1068 **** { $val = $node->getText(); //Do not write question field if there is no text behind it ! if (!empty($val)) { $array[$nodeName]=$val; } --- 1062,1070 ---- { $val = $node->getText(); + + show_array($val); //Do not write question field if there is no text behind it ! if (!empty($val) || $val==0) { $array[$nodeName]=$val; } |
From: pkiddie <pk...@us...> - 2005-10-20 10:32:41
|
Update of /cvsroot/stack/stack-1-0/scripts/rqp/moodle_16_rqp/quiz/questiontypes/rqp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23804/scripts/rqp/moodle_16_rqp/quiz/questiontypes/rqp Modified Files: editquestion.php lib.php options.php Log Message: Commented the lib.php file extensively Fixed bug where importing code implied 0 was empty, when in fact this is not always true! Index: editquestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/moodle_16_rqp/quiz/questiontypes/rqp/editquestion.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editquestion.php 5 Oct 2005 11:43:44 -0000 1.2 --- editquestion.php 20 Oct 2005 10:32:25 -0000 1.3 *************** *** 5,12 **** $strbacktoquiz = get_string("backtoquiz", "quiz"); $struseroptions = get_string("userOptions", "quiz"); - - //Here we must decide whether to display the RQP servers authoring form, or use the generic one - //If current selected server has authoring in serverProperties=false, then use rqp.html - //Otherwise we use HTML from rendering function if (empty($question->id)) { //Authoring a new question --- 5,8 ---- *************** *** 35,45 **** else { ! ! //If desired server can author ! if ($server->properties & RQP_SERVER_AUTHORING) { //Set up render variables ! $render['source'] = $question->options->source; ! $render['options'] = array ( 'admin' => '' , 'teacher' => '', 'user' => '', --- 31,41 ---- else { ! //Here we must decide whether to display the RQP servers authoring form, or use the generic one ! //If current selected server has an authoring form available, use that, otherwise use rqp.html ! if ($server->properties & RQP_SERVER_AUTHORING) { //If server can author questions //Set up render variables ! $render['source'] = $question->options->source; //Get any existing source ! $render['options'] = array ( 'admin' => '' , //No options to set 'teacher' => '', 'user' => '', *************** *** 49,53 **** if (!empty($SESSION->persistent_data)) { ! $render['persistentData']= $SESSION->options->persistent_data; //not used in authoring } --- 45,49 ---- if (!empty($SESSION->persistent_data)) { ! $render['persistentData']= $SESSION->options->persistent_data; //not used in authoring } *************** *** 56,71 **** $render['directives'] = array('edit'); ! ! $render['mimetypes'] = array('text/html');; ! $render['namePrefix'] = $type->name; //STACK $render['itemBase'] = ''; $render['resourceBase'] = $CFG->dataroot . '/moddata/quiz/rqp/resource/'; $render['tempfileBase'] = $CFG->dataroot . '/moddata/quiz/rqp/temp/'; ! //Check presence of form fields which are to be processed if (empty($form)) { $render['inputData']=array(); } else { $render['inputData']=quiz_rqp_parse_input($form,$render['namePrefix']); --- 52,67 ---- $render['directives'] = array('edit'); ! $render['mimetypes'] = array('text/html'); //Default to text/html ! $render['namePrefix'] = $type->name; //Prefix with name of server type $render['itemBase'] = ''; $render['resourceBase'] = $CFG->dataroot . '/moddata/quiz/rqp/resource/'; $render['tempfileBase'] = $CFG->dataroot . '/moddata/quiz/rqp/temp/'; ! //Are there any form fields to be processed? if (empty($form)) { $render['inputData']=array(); } + //Send each form fields as item in key/val array via render else { $render['inputData']=quiz_rqp_parse_input($form,$render['namePrefix']); *************** *** 103,112 **** } ! if ("complete"!=$response['outcomeVars']['completion']) { $QUIZ_QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz); $QUIZ_QTYPES[$question->qtype]->print_question_form_end($question); } ! //if server has indicated the session has come to a close else { echo '<tr valign="top"> --- 99,108 ---- } ! if ("complete"!=$response['outcomeVars']['completion']) { //Check status of completion variable $QUIZ_QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz); $QUIZ_QTYPES[$question->qtype]->print_question_form_end($question); } ! //If server has indicated authoring session has come to a close else { echo '<tr valign="top"> Index: options.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/moodle_16_rqp/quiz/questiontypes/rqp/options.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options.php 5 Oct 2005 11:43:44 -0000 1.2 --- options.php 20 Oct 2005 10:32:25 -0000 1.3 *************** *** 1,3 **** ! <?php /* This page is responsible for the setting of options */ require_once('../../../../config.php'); --- 1,3 ---- ! <?php // $Id$ /* This page is responsible for the setting of options */ require_once('../../../../config.php'); Index: lib.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/rqp/moodle_16_rqp/quiz/questiontypes/rqp/lib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lib.php 5 Oct 2005 11:43:44 -0000 1.2 --- lib.php 20 Oct 2005 10:32:25 -0000 1.3 *************** *** 11,15 **** */ ! define('RQP_SERVER_RENDERING', 1); define('RQP_SERVER_IMPLICITCLONING', 2); define('RQP_SERVER_EXPLICITCLONING', 4); --- 11,15 ---- */ ! define('RQP_SERVER_RENDERING', 1); //Define server property flags define('RQP_SERVER_IMPLICITCLONING', 2); define('RQP_SERVER_EXPLICITCLONING', 4); *************** *** 18,27 **** define('RQP_SERVER_TEACHEROPTIONS', 32); define('RQP_SERVER_USEROPTIONS', 64); ! ! //Define RQP version <TODO>: Should this be in the client ! define ('RQP_VER','1.0'); ! ! //This global array holds an ordered, up to date list of all RQP types ! $rqpTypes = array(); /** --- 18,23 ---- define('RQP_SERVER_TEACHEROPTIONS', 32); define('RQP_SERVER_USEROPTIONS', 64); ! define ('RQP_VER','1.0'); //Define RQP version <TODO>: Should this be in the client ! $rqpTypes = array(); //This global array holds an ordered, up to date list of all RQP types /** *************** *** 53,57 **** } ! //For a specified type, retrieve the administrators options function quiz_rqp_get_admin_options($typeid) { --- 49,60 ---- } ! /** ! * For a specified question type, retrieve the administrator options set within the ! * RQP question type web form. ! * ! * @param int $typeid the RQP question type id ! * @return mixed false if no administrator options set for that type, ! * otherwise a server specific options string ! */ function quiz_rqp_get_admin_options($typeid) { *************** *** 63,67 **** } ! //For a specified user and RQP server type, retrieve the user options function quiz_rqp_get_user_options($userid, $typeid) { if (!$userOptions = get_record('quiz_rqp_user_options', 'userid', $userid, 'typeid', $typeid)) { --- 66,78 ---- } ! /** ! * For a specified question type and user id, retrieve any options the user has set within the ! * user options accessible whenever that type remotely renders. ! * ! * @param int $typeid the RQP question type id ! * @param int $userid the user id ! * @return mixed false if no user options set for that type/user combination, ! * otherwise a server specific options string ! */ function quiz_rqp_get_user_options($userid, $typeid) { if (!$userOptions = get_record('quiz_rqp_user_options', 'userid', $userid, 'typeid', $typeid)) { *************** *** 72,76 **** } ! //For a specified quiz and RQP server type, retrieve the quiz options (part of the teacher options) function quiz_rqp_get_quiz_options($quizid, $typeid) { if (!$quizOptions = get_record('quiz_rqp_quiz_options', 'quizid', $quizid, 'typeid', $typeid)) { --- 83,94 ---- } ! /** ! * For a specified question type and quiz id, retrieve any options the teacher has set at the quiz level ! * ! * @param int $typeid the RQP question type id ! * @param int $quizid the quiz id ! * @return mixed false if no user options set for that type within the current quiz, ! * otherwise a server specific options string ! */ function quiz_rqp_get_quiz_options($quizid, $typeid) { if (!$quizOptions = get_record('quiz_rqp_quiz_options', 'quizid', $quizid, 'typeid', $typeid)) { *************** *** 81,85 **** } ! //For a specified course and RQP server type, retrieve the course options (part of the teacher options) function quiz_rqp_get_course_options($courseid, $typeid) { if (!$courseOptions = get_record('quiz_rqp_course_options', 'courseid', $courseid, 'typeid', $typeid)) { --- 99,111 ---- } ! /** ! * For a specified question type and course id, retrieve any options the teacher has set globally within ! * the current course. ! * ! * @param int $typeid the RQP question type id ! * @param int $courseid the course id ! * @return mixed false if no course options set for that type/course combination, ! * otherwise a server specific options string ! */ function quiz_rqp_get_course_options($courseid, $typeid) { if (!$courseOptions = get_record('quiz_rqp_course_options', 'courseid', $courseid, 'typeid', $typeid)) { *************** *** 90,98 **** } ! //For a specified course, quiz and RQP server type, retrieve the teachers options (quiz options, if they exist ! //override the course options ! //TODO: Some options manipulation here, as course options and quiz options under umbrella of 'teacher' options. ! //These options strings are RQP server specific, in STACK's case each option represented in as a value in an array ! //So this is the functionality atm function quiz_rqp_get_teacher_options($quizid, $courseid, $typeid) { --- 116,129 ---- } ! /** ! * For a specified question type and quiz and course id, retrieve any teacher options set ! * In this case quiz options override those set at the course level. ! * ! * @param int $typeid the RQP question type id ! * @param int $quizid the quiz id ! * @param int $courseid the course id ! * @return mixed false if no teahcer options set at either quiz/course level ! * otherwise a server specific options string ! */ function quiz_rqp_get_teacher_options($quizid, $courseid, $typeid) { *************** *** 103,108 **** } ! return $teacherOptions; //false if no quiz/course options found for RQP type ! //otherwise serialsied options string } --- 134,138 ---- } ! return $teacherOptions; } *************** *** 111,124 **** * optionType can be one of userOptions, teacherOptions, adminOptions */ function quiz_rqp_optionsDialog($optionType, $type="", $course="", $user="", $quiz="") { global $CFG; ! //Echo javascript to open an optionsDialog with specified parameters $jsOpenOptions = '<script language="javascript" type="text/javascript">'; $jsOpenOptions .= 'javascript:'; $jsOpenOptions .= "window.open('".s($CFG->wwwroot)."/mod/quiz/questiontypes/rqp/options.php?optionstype=$optionType&typeid=$type&courseid=$course&userid=$user&quizid=$quiz','optionspopup', 'left=20,top=20,width=500,height=500,toolbar=0,resizable=1,scrollbars=yes')"; - $jsOpenOptions .= '</script>'; --- 141,167 ---- * optionType can be one of userOptions, teacherOptions, adminOptions */ + + /** + * Create an options popup dialog, passing the required parameters to the options.php script. + * + * Not all parameters are required for each 'optionType', i.e. if optionType=adminOptions, + * $type should only be set + * + * @param string $optionType one of 'userOptions','teacherOptions','adminOptions' + * @param int $type the RQP question type id + * @param int $course the course id + * @param int $user the user id + * @param int $quiz the quiz id + * @return void + */ function quiz_rqp_optionsDialog($optionType, $type="", $course="", $user="", $quiz="") { global $CFG; ! //Echo javascript to open an optionsDialog popup with specified parameters $jsOpenOptions = '<script language="javascript" type="text/javascript">'; $jsOpenOptions .= 'javascript:'; $jsOpenOptions .= "window.open('".s($CFG->wwwroot)."/mod/quiz/questiontypes/rqp/options.php?optionstype=$optionType&typeid=$type&courseid=$course&userid=$user&quizid=$quiz','optionspopup', 'left=20,top=20,width=500,height=500,toolbar=0,resizable=1,scrollbars=yes')"; $jsOpenOptions .= '</script>'; *************** *** 126,131 **** } ! //Get a list of RQP question types from the quiz_rqp_types table and return to calling function ! //Used in course/quiz level options, to set the options for a particular RQP question type function quiz_rqp_get_types() { --- 169,180 ---- } ! /** ! * Get a list of RQP question types from the quiz_rqp_types table and return these. This ! * representation of RQP question types is required for course/quiz level options drop down ! * box ! * ! * @param void ! * @return array $rqpQuestionTypes ! */ function quiz_rqp_get_types() { *************** *** 264,267 **** --- 313,322 ---- } + /** + * Prints a server information table to calling web form, based on the $serverInfo return parameters + * + * @param object $serverInfo return parameters from a server information call (also serverInfo db return params) + * @return void + */ function quiz_rqp_print_serverinfo($serverinfo) { $info->align = array('right', 'left'); *************** *** 273,281 **** } ! //Used in types.php to ensure that the server can be communicated to, before sending web service request function quiz_rqp_check_server($url, $serverid=0) { $timeLimit = 20; ! if ($serverid!=0) { $server = get_record('quiz_rqp_servers', 'id', $serverid); $urldata = parse_url($server->url); --- 328,346 ---- } ! /** ! * Ensures the specified server can be communicated to, before sending any web service requests. ! * ! * Accepts either an URL or the particular serverid, which can then be referenced to an URL. Attempt to open ! * a socket. To an unreachable host, this will fail. The '@' signs before fsockopen quieten the function. ! * ! * @param string $url The URL of the server to check communications with ! * @param int $serverid The id of the server to retrieve the URL for ! * @return bool True if a connection could be established, false otherwise ! */ function quiz_rqp_check_server($url, $serverid=0) { $timeLimit = 20; ! //$serverid=0 is EMPTY ! if (empty($serverid)) { $server = get_record('quiz_rqp_servers', 'id', $serverid); $urldata = parse_url($server->url); *************** *** 305,312 **** } } function quiz_rqp_initialise() { global $rqpTypes; ! //Go through each type and each server, adding [] -> [type] -> [serverid],[url] to $rqpType array if ($types = get_records('quiz_rqp_types')) { --- 370,388 ---- } } + + /** + * Manages a list of all RQP question types by manipulation of the $rqpTypes global array. + * + * Iterates through each question type, adding each server from the rqp_servers db within that type to an array. + * Enables us to prioritise particular servers of particular types. This is useful where a server is not + * responding, in which case, it moves to the bottom of the list of servers for that particular type. + * + * @param void + * @return void + */ function quiz_rqp_initialise() { global $rqpTypes; ! //Go through each type and each server, adding [type] -> [serverid] to $rqpType array if ($types = get_records('quiz_rqp_types')) { *************** *** 324,329 **** } ! //Will be called by the types.php function, if a server is added/removed ! //Check that this type exists within $rqpTypes, if not, add it and the new server function quiz_rqp_add_server($typeid, $serverid) { global $rqpTypes; --- 400,409 ---- } ! /** ! * Adds a server to the $rqpTypes global array, where the user has added one via the types.php web form. ! * ! * @param void ! * @return void ! */ function quiz_rqp_add_server($typeid, $serverid) { global $rqpTypes; *************** *** 332,340 **** } ! //This function called by types.php function if a server is removed ! //In this case, check if there are any other servers of a type, if not remove that type function quiz_rqp_remove_server($typeid, $serverid) { global $rqpTypes; if(array_key_exists($typeid, $rqpTypes)) { $servers = $rqpTypes[$typeid]; --- 412,429 ---- } ! /** ! * Removes a server from the $rqpTypes global array, where the user has requested to remove ! * via the types.php web form. ! * ! * Iterates through the $rqpTypes[$typeid] global array, removing the $serverid entry. ! * ! * @param int $typeid RQP question type id ! * @param int $serverid Server id ! * @return void ! */ function quiz_rqp_remove_server($typeid, $serverid) { global $rqpTypes; + //Check type exists if(array_key_exists($typeid, $rqpTypes)) { $servers = $rqpTypes[$typeid]; *************** *** 342,345 **** --- 431,435 ---- for ($i=0;$i<count($servers);$i++) { + //Match a server entry if($servers[$i]==$serverid) { //We have found our match, now remove it *************** *** 350,354 **** } ! //Count the nunber of $servers left if(count($servers)==0) { array_delete($rqpTypes, $typeid); --- 440,444 ---- } ! //Count the nunber of $servers left and remove the type if there are 0 if(count($servers)==0) { array_delete($rqpTypes, $typeid); *************** *** 362,366 **** } ! //Removes an item indexed by a $item key. Then re-orders function array_delete($array, $item) { if (isset($array[$item])) --- 452,464 ---- } ! /** ! * Removes an item from an array and then re-orders the array ! * ! * Iterates through the $rqpTypes[$typeid] global array, removing the $serverid entry. ! * ! * @param array $array Array of servers ! * @param string $item Server key to remove ! * @return array The re-ordered array. ! */ function array_delete($array, $item) { if (isset($array[$item])) *************** *** 368,375 **** return array_merge($array); - } ! //Responsible for initialising server list and keeping up to date, with servers that work the best up the top! function quiz_rqp_get_server($typeid) { global $rqpTypes; --- 466,479 ---- return array_merge($array); } ! /** ! * Retrieve a server of a particular question type to perform the render operation ! * ! * Initialises the $rqpTypes global array which stores a preferentially ordered list of servers and respective type ! * ! * @param int $typeid The type of server to get. ! * @return mixed A $server object, otherwise false if no servers could be communicated with ! */ function quiz_rqp_get_server($typeid) { global $rqpTypes; *************** *** 377,381 **** $timeLimit = 20; ! if (empty($rqpTypes)) { quiz_rqp_initialise(); } --- 481,485 ---- $timeLimit = 20; ! if (empty($rqpTypes)) { //First run, so initialise the $rqpTypes array quiz_rqp_initialise(); } *************** *** 393,397 **** $urldata['port']=80; } ! $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, $timeLimit); --- 497,502 ---- $urldata['port']=80; } ! ! //Check we can communicate with particular server $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, $timeLimit); *************** *** 410,414 **** } ! //No connection could be established, keep iterating else if (!$sock) { $server=false; --- 515,519 ---- } ! //No connection could be established, keep iterating through list of servers till one found else if (!$sock) { $server=false; *************** *** 430,485 **** return $server; //either false or an actual server! } - - - //Returns a server url given a specified type, by randomly selecting a server - //<TODO>Need to keep a single list of servers, possibly within session variable, check with Gustav - //takes rqpType as a global array - function quiz_rqp_get_server_old($typeid) { - global $rqpTypes; - - $timeLimit = 20; //default time limit before timeout for particular server - - //Initialise list of servers within $rqpTypes, which will be managed by this function - if (empty($rqpTypes)) { - quiz_rqp_initialise(); - } - - if (!$servers = get_records('quiz_rqp_servers', 'typeid', $typeid)) - { - return false; - } - - shuffle($servers); //put servers in a random order - - foreach ($servers as $server) { - //go through each of them and try to communicate with server till successful - $urldata = parse_url($server->url); - if(!array_key_exists('port', $urldata)) { - $urldata['port']=80; - } - - $sock = fsockopen($urldata['host'],$urldata['port'], $errno, $errmsg, $timeLimit); - - stream_set_timeout($sock, 2); - stream_set_blocking($sock, false); - - //If connection established - if ($sock) { - fclose($sock); - - //push this server up to the top of the new list - break; - } - - //No connection could be established - //Keep iterating - //<TODO> What do we do with this dead server - else if (!$sock) { - $server=false; - fclose($sock); - } - } - - return $server; //either false or an actual server! - } ?> --- 535,537 ---- |
From: Chris S. <san...@us...> - 2005-10-14 16:07:55
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7126/scripts Modified Files: stackFrontend.php Log Message: Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** stackFrontend.php 14 Oct 2005 15:42:27 -0000 1.6 --- stackFrontend.php 14 Oct 2005 16:07:43 -0000 1.7 *************** *** 386,390 **** $qname = $quiz['quizName']; $qID = $quiz['quizid']; ! echo " <th><a href=\"javascript:quizreport($qID,$subjectID);\">$qname</a></th>\n"; } } --- 386,390 ---- $qname = $quiz['quizName']; $qID = $quiz['quizid']; ! echo " <th><font size=-3><a href=\"javascript:quizreport($qID,$subjectID);\">$qID</a></font></th>\n"; } } *************** *** 396,400 **** $uID = $user['id']; ! echo "<tr>\n <td> $username </td>"; foreach ($subject_store as $key => $subject) { --- 396,400 ---- $uID = $user['id']; ! echo "<tr>\n <td nowrap='nowrap'> $username </td>"; foreach ($subject_store as $key => $subject) { |
From: Chris S. <san...@us...> - 2005-10-14 15:42:38
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32018 Modified Files: user.php Log Message: Index: user.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/user.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** user.php 11 Oct 2005 17:35:38 -0000 1.12 --- user.php 14 Oct 2005 15:42:27 -0000 1.13 *************** *** 113,117 **** stack_db_user_delete($user_stu); echo get_string('FE_user_deleted','stack',''); ! break;} include('html/pagefoot.php'); --- 113,121 ---- stack_db_user_delete($user_stu); echo get_string('FE_user_deleted','stack',''); ! break; ! case 'marksheet': ! stack_marksheet(); ! break; ! } include('html/pagefoot.php'); |
From: Chris S. <san...@us...> - 2005-10-14 15:42:38
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32018/scripts Modified Files: stackAuthor.php stackFrontend.php Log Message: Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** stackAuthor.php 11 Oct 2005 17:35:38 -0000 1.46 --- stackAuthor.php 14 Oct 2005 15:42:27 -0000 1.47 *************** *** 1288,1292 **** echo " <td><input type=\"text\" name=\"subject[quizzes][$qn][order]\" size=\"3\" value=\"{$qo}\" /></td>\n"; echo " <td><input type=\"hidden\" name=\"subject[quizzes][$qn][quizid]\" value=\"{$qID}\" />$qID</td>\n"; ! echo " <td>$qname</td>\n <td>$qkw</td>\n <td><a href=\"javascript:quizreview($qID,$subjectID);\">Review</a></td>\n</tr>\n"; } --- 1288,1292 ---- echo " <td><input type=\"text\" name=\"subject[quizzes][$qn][order]\" size=\"3\" value=\"{$qo}\" /></td>\n"; echo " <td><input type=\"hidden\" name=\"subject[quizzes][$qn][quizid]\" value=\"{$qID}\" />$qID</td>\n"; ! echo " <td>$qname</td>\n <td>$qkw</td>\n <td><a href=\"javascript:quizreport($qID,$subjectID);\">Review</a></td>\n</tr>\n"; } Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stackFrontend.php 11 Oct 2005 17:35:38 -0000 1.5 --- stackFrontend.php 14 Oct 2005 15:42:27 -0000 1.6 *************** *** 345,348 **** } ! ?> --- 345,432 ---- } ! ! ! /** ! * Displays the marksheet ! * @param int $subjectID ! * @return void ! */ ! function stack_marksheet() { ! global $stack_root, $stackQuiz; ! ! include($stack_root.'/html/quizchoose.html'); ! require_once("{$stack_root}/html/quizjava.html"); ! require_once("{$stack_root}/html/subjectjava.html"); ! ! $subject_store = stack_db_subject_get(); ! $subject_store = stack_zone_subjects_order($subject_store); ! ! $stack_users = stack_user_listall(); ! ! echo "\n<table cellpadding='2' border = '1'>\n"; ! echo "<tr>\n <th></th>\n"; ! ! //echo "\n<tr><th>".get_string('stackQuiz_quizName','stack','')."</th><th>".get_string('stackQuiz_quizDescription','stack','')."</th><th>".get_string('FE_quiz_lastmark','stack','')."</th><th>".get_string('stackQuiz_quizDueDate','stack','')."</th>\n</tr>\n"; ! ! foreach ($subject_store as $key => $subject) { ! $subjectID = $subject['subjectID']; ! $subject_store[$key]['quiz_store'] = stack_db_subject_quiz_list_student($subjectID); ! ! $quiz_count = count($subject_store[$key]['quiz_store']); ! echo "<th align='center' colspan = '$quiz_count'>".$subject['subjectName']."</th>"; ! ! } ! echo "</tr>\n\n<tr>\n <th></th>\n"; ! ! foreach ($subject_store as $key => $subject) { ! $quiz_store = $subject['quiz_store']; ! $subjectID = $subject['subjectID']; ! ! foreach ($quiz_store as $qs => $quiz) { ! $qname = $quiz['quizName']; ! $qID = $quiz['quizid']; ! echo " <th><a href=\"javascript:quizreport($qID,$subjectID);\">$qname</a></th>\n"; ! } ! } ! echo "</tr>\n\n"; ! ! ! foreach ($stack_users as $user) { ! $username = $user['name']; ! $uID = $user['id']; ! ! echo "<tr>\n <td> $username </td>"; ! ! foreach ($subject_store as $key => $subject) { ! $subjectID = $subject['subjectID']; ! ! $quiz_store = $subject['quiz_store']; ! ! foreach ($quiz_store as $qs => $quiz) { ! $qname = $quiz['quizName']; ! $qID = $quiz['quizid']; ! $mark = '-'; ! ! $userinfo = stack_db_quiz_quizattempt_getlast($subjectID,$qID,$uID); ! if (is_array($userinfo)) { ! if (NULL != $userinfo['mark']) { ! $mark = round(100*$userinfo['mark']/$userinfo['maxmark'],2); ! } ! } ! ! if ('-' == $mark) { ! echo " <td>{$mark}</td>\n"; ! } else { ! echo " <td><a href=\"javascript:quizreview('$uID','$qID','$subjectID');\">{$mark}</a></td>\n"; ! } ! } ! } ! echo "</tr>\n"; ! } ! ! echo "\n</table>\n</p>"; ! ! return NULL; ! } ! ?> |
From: Chris S. <san...@us...> - 2005-10-14 15:42:38
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32018/lang/en Modified Files: stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/stack.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** stack.php 11 Oct 2005 17:35:38 -0000 1.30 --- stack.php 14 Oct 2005 15:42:27 -0000 1.31 *************** *** 352,355 **** --- 352,356 ---- $string['menu_PR'] = 'Potential responses'; $string['menu_User'] = 'User'; + $string['menu_Marksheet'] = 'Mark sheet'; |
From: Chris S. <san...@us...> - 2005-10-14 15:42:35
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32018/html Modified Files: admin-menu.txt subjectjava.html Log Message: Index: admin-menu.txt =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/admin-menu.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** admin-menu.txt 4 Sep 2005 19:24:57 -0000 1.16 --- admin-menu.txt 14 Oct 2005 15:42:27 -0000 1.17 *************** *** 11,14 **** --- 11,15 ---- ..menu_New|editsubject.php?action=subject_new .menu_Zone|editzone.php + ..menu_Marksheet|user.php?action=marksheet .menu_Reporting|analysis.php .menu_User|user.php Index: subjectjava.html =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/subjectjava.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** subjectjava.html 4 Sep 2005 21:26:18 -0000 1.2 --- subjectjava.html 14 Oct 2005 15:42:27 -0000 1.3 *************** *** 10,20 **** document.forms.stacksubjecteditform.submit(); } ! function quizreview(n,m) { ! document.forms.quizreview.quizid.value = n; ! document.forms.quizreview.subjectID.value = m; ! document.forms.quizreview.submit(); } </script> ! <form name='quizreview' action='editquiz.php' method='POST'> <input type='hidden' name='quizid' value='-1'> <input type='hidden' name='subjectID' value='-1'> --- 10,20 ---- document.forms.stacksubjecteditform.submit(); } ! function quizreport(n,m) { ! document.forms.quizreport.quizid.value = n; ! document.forms.quizreport.subjectID.value = m; ! document.forms.quizreport.submit(); } </script> ! <form name='quizreport' action='editquiz.php' method='POST'> <input type='hidden' name='quizid' value='-1'> <input type='hidden' name='subjectID' value='-1'> |
From: Chris S. <san...@us...> - 2005-10-11 17:35:36
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26708/scripts Modified Files: stackAuthor.php stackDatabase.php stackFrontend.php stackQuestion.php stackQuiz.php stackUser.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** stackDatabase.php 20 Sep 2005 16:32:24 -0000 1.51 --- stackDatabase.php 11 Oct 2005 17:35:38 -0000 1.52 *************** *** 961,965 **** function stack_db_attempt_get($questionID,$seed,$user,&$errors) { ! $question_attempts = NULL; // Gets the $questionID, with $seed, for $user // Returns the $question_attempts array of $this_attempts. --- 961,965 ---- function stack_db_attempt_get($questionID,$seed,$user,&$errors) { ! $question_attempts = NULL; // Gets the $questionID, with $seed, for $user // Returns the $question_attempts array of $this_attempts. Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** stackAuthor.php 11 Oct 2005 09:57:44 -0000 1.45 --- stackAuthor.php 11 Oct 2005 17:35:38 -0000 1.46 *************** *** 1244,1248 **** //Check that within current field there is no type tag, otherwise skip $err = ''; ! $keyname = 'stackQuiz_'.$key; echo "<tr><td><b>".get_string($keyname,'stack','')."</b></td>\n"; if ('subjectID' == $key) { --- 1244,1248 ---- //Check that within current field there is no type tag, otherwise skip $err = ''; ! $keyname = 'stackSubject_'.$key; echo "<tr><td><b>".get_string($keyname,'stack','')."</b></td>\n"; if ('subjectID' == $key) { Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** stackQuestion.php 11 Oct 2005 09:57:44 -0000 1.41 --- stackQuestion.php 11 Oct 2005 17:35:38 -0000 1.42 *************** *** 1509,1513 **** // Construct this attempt - $this_attempt['RawAns'] =$RawAns; $this_attempt['RawMark'] = 0; $this_attempt['Penalty'] = 0; --- 1509,1512 ---- *************** *** 1518,1526 **** if ('' != trim($RawAns) ) { - $err = validate_casstring($RawAns,'s'); // parse the student's raw answer - if ('' != $err) { - $errors['RawAns']= $err; - } - // Check for forbidden words $forbidden = stack_options_forbidden($options); --- 1517,1520 ---- *************** *** 1540,1543 **** --- 1534,1548 ---- } } + + // Validate the casstring, which might be changed as a result of this. + $err = validate_casstring($RawAns,'s'); // parse the student's raw answer + show_array($err); + if ('' != $err) { + $errors['RawAns']= $err; + } + + // Stars may have been inserted here in validate_casstring. + $this_attempt['RawAns'] = $RawAns; + } else { *************** *** 1704,1708 **** $ta = $all_locs_Inst[$tan]['value']; - //echo "$sa,$ta,{$answertest[$prn]},{$answertestopt[$prn]}"; $this_PRattempt = stack_apply_answertest($sa,$ta,$answertest[$prn],$answertestopt[$prn],$options,$errors); //show_array($this_PRattempt); --- 1709,1712 ---- *************** *** 2237,2241 **** $options = stack_options_set($question,$quiz_options); $questionInst = stack_question_inst($question,$seed,$options,$errors); ! $qAtts = stack_db_attempt_get($questionID,$seed,$user,$errors); if (is_array($qAtts)) { $questionInst['questionAttempts']=$qAtts; --- 2241,2246 ---- $options = stack_options_set($question,$quiz_options); $questionInst = stack_question_inst($question,$seed,$options,$errors); ! $qseed = $questionInst['questionSeedInst']; ! $qAtts = stack_db_attempt_get($questionID,$qseed,$user,$errors); if (is_array($qAtts)) { $questionInst['questionAttempts']=$qAtts; Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** stackQuiz.php 11 Oct 2005 09:57:44 -0000 1.16 --- stackQuiz.php 11 Oct 2005 17:35:38 -0000 1.17 *************** *** 243,247 **** $quiz_res = ''; ! echo "<h1>Quiz results: {$quiz['quizName']}</h1>"; // Print a summary of the context of this quiz. --- 243,248 ---- $quiz_res = ''; ! $a = $quiz['quizName']; ! echo '<h1>'.get_string('FE_quiz_results','stack',$a).'</h1>'; // Print a summary of the context of this quiz. *************** *** 257,261 **** } if (NULL == $quiz_questions) { ! echo 'There are no questions in this quiz! Please contact your administrator.'; return NULL; } --- 258,262 ---- } if (NULL == $quiz_questions) { ! echo get_string('FE_quiz_no_questions','stack',''); return NULL; } *************** *** 281,285 **** $qn = $options['QuVal']; echo ' <th>'.$qn."</th>\n"; ! $qtot = $qtot + $qn; } // end foreach echo " <th>$qtot</th>\n</tr>\n"; --- 282,286 ---- $qn = $options['QuVal']; echo ' <th>'.$qn."</th>\n"; ! $qtot += $qn; } // end foreach echo " <th>$qtot</th>\n</tr>\n"; *************** *** 319,326 **** echo " <td align='center'>".$mark."</td>\n"; } // end foreach ! $percent = round(100*$tot/$qtot,2); ! echo " <td align='center'>".$tot."</td>\n"; ! echo " <td align='center'>".$percent."</td>\n"; ! echo "</tr>\n"; } --- 320,327 ---- echo " <td align='center'>".$mark."</td>\n"; } // end foreach ! $percent = round(100*$tot/$qtot,2); ! echo " <td align='center'>".$tot."</td>\n"; ! echo " <td align='center'>".$percent."</td>\n"; ! echo "</tr>\n"; } *************** *** 331,335 **** echo "\n</table>\n"; } else { ! echo "<p>You have no users in your database.</p>"; } --- 332,336 ---- echo "\n</table>\n"; } else { ! echo '<p>'.get_string('FE_user_nousers','stack','').'</p>'; } *************** *** 401,407 **** $var = round(pow($var,0.5),4); ! echo "Number of attempts: $noatt. mean: $average, variance: $var"; } else { ! echo "Number of attempts: 0"; } --- 402,409 ---- $var = round(pow($var,0.5),4); ! $a = array(0 => $noatt, 1 => $average, 2=> $var); ! echo get_string('FE_analysis_qu_stats','stack',$a); } else { ! echo get_string('FE_analysis_qu_noatt','stack',''); } *************** *** 412,416 **** } else { ! echo "<p>There are no attempts at any questions in this quiz.</p>"; } --- 414,418 ---- } else { ! echo '<p>'.get_string('FE_analysis_qu_noatts','stack','').'</p>'; } Index: stackUser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUser.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** stackUser.php 11 Oct 2005 09:57:44 -0000 1.18 --- stackUser.php 11 Oct 2005 17:35:38 -0000 1.19 *************** *** 370,378 **** if(is_array($stack_users)) { ! echo "<tr><td>User ID</td>\n"; echo "<td><select name=\"userID\">\n"; - echo "userID"; - if ($anyUser) { $spec_users=array('(any)','>0'); --- 370,376 ---- if(is_array($stack_users)) { ! echo "<tr><td>".get_string('USR_StudentID','stack','')."</td>\n"; echo "<td><select name=\"userID\">\n"; if ($anyUser) { $spec_users=array('(any)','>0'); Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackFrontend.php 11 Oct 2005 09:57:44 -0000 1.4 --- stackFrontend.php 11 Oct 2005 17:35:38 -0000 1.5 *************** *** 250,254 **** } 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' /> --- 250,254 ---- } else { ! echo '<p>'.get_string('FE_quiz_none','stack','').'</p>'; echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='-1' /> *************** *** 294,298 **** } else { ! echo "<p>You have no subjects available to try.</p>"; echo "<p>\n<form name='subjectform' action='$PostTo' method='POST'> <input type='hidden' name='subjectid' value='-1' /> --- 294,298 ---- } else { ! echo '<p>'.get_string('FE_subject_none','stack','').'</p>'; echo "<p>\n<form name='subjectform' action='$PostTo' method='POST'> <input type='hidden' name='subjectid' value='-1' /> *************** *** 313,317 **** echo '<h1>'.get_string('FE_notadmin','stack').'</h1>'; echo '<p>'.get_string('FE_needadmin','stack',$user['username']).'</p>'; ! echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; include('html/pagefoot.php'); die(); --- 313,317 ---- echo '<h1>'.get_string('FE_notadmin','stack').'</h1>'; echo '<p>'.get_string('FE_needadmin','stack',$user['username']).'</p>'; ! echo '<p>'.get_string('FE_loginhere','stack',$user['username']).'</p>'; include('html/pagefoot.php'); die(); |
From: Chris S. <san...@us...> - 2005-10-11 17:35:35
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26708/lang/en Modified Files: stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/stack.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** stack.php 11 Oct 2005 09:57:44 -0000 1.29 --- stack.php 11 Oct 2005 17:35:38 -0000 1.30 *************** *** 27,30 **** --- 27,31 ---- $string['MarkExplain'] = 'Click here to mark your answers.'; $string['Validate'] = 'Validate'; + $string['Valid'] = 'Valid'; $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.)'; *************** *** 41,44 **** --- 42,46 ---- $string['Top'] = 'Top'; $string['Bottom'] = 'Bottom'; + $string['Count'] = 'Count'; $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 />'; $string['quiz_page_created'] = 'Page created'; *************** *** 161,165 **** $string['stackQuestion_questionMetadata'] = 'Metadata'; $string['stackQuestion_questionNote'] = 'Question note'; ! $string['stackQuestion_questionID'] = 'Unique question ID'; $string['stackQuestion_questionGUID'] = 'Globally unique question ID'; $string['stackQuestion_questionName'] = 'Name'; --- 163,167 ---- $string['stackQuestion_questionMetadata'] = 'Metadata'; $string['stackQuestion_questionNote'] = 'Question note'; ! $string['stackQuestion_questionID'] = 'Question ID'; $string['stackQuestion_questionGUID'] = 'Globally unique question ID'; $string['stackQuestion_questionName'] = 'Name'; *************** *** 244,247 **** --- 246,250 ---- $string['stackSubject_subjectHTMLHead'] = 'Subject page header'; $string['stackSubject_subjectHTMLFoot'] = 'Subject page footer'; + $string['stackSubject_subjectKeywords'] = 'Keywords'; // <PDK> $stackQuestion metadata added *************** *** 423,429 **** --- 426,438 ---- $string['FE_notadmin'] = 'Not permitted!'; $string['FE_needadmin'] = 'You need to be logged in as the administrator, but seem to be user {$a}.'; + $string['FE_loginhere'] = 'Please login <a href=\'index.php?action=login\'>here</a>'; + $string['FE_errors_exist'] = 'Errors exist!'; $string['FE_errors_field'] = 'The field $a, gave the following error.'; + $string['FE_ALL'] = 'ALL'; + $string['FE_(none)'] = '(none)'; + $string['FE_Any'] = 'Any'; + // Page header $string['FE_pagehead_loggedin'] = 'Logged in as<br />{$a}'; *************** *** 453,458 **** $string['FE_index_register_instruct'] = 'To register as a STACK user, please provide the following information.'; // Strings associated with quizzes. ! $string['FE_quiz_lastmark'] = 'Last mark'; $string[''] = ''; --- 462,510 ---- $string['FE_index_register_instruct'] = 'To register as a STACK user, please provide the following information.'; + $string['FE_user_nousers'] = 'You have no users in your database.'; + // Strings associated with quizzes. ! $string['FE_quiz_title'] = 'Quiz page'; ! $string['FE_quiz_download'] = 'Please download the following file.'; ! $string['FE_quiz_lastmark'] = 'Last mark'; ! $string['FE_quiz_none'] = 'You have no quizzes available to try.'; ! $string['FE_quiz_results'] = 'Quiz results: {$a}'; ! $string['FE_quiz_no_questions'] = 'There are no questions in this quiz. You may need to contact your administrator.'; ! $string['FE_quiz_no_atttempts'] = 'There are no attempts at this quiz.'; ! ! // Strings associated with subjects. ! $string['FE_subject_title'] = 'Subject page'; ! $string['FE_subject_none'] = 'You have no subjects available to try.'; ! ! $string['FE_analysis_qu_title'] = 'Analysis for the following question:'; ! $string['FE_analysis_qu_err'] = 'This is an error: this question should exist but does not!'; ! $string['FE_analysis_qu_notadmin'] = '<font color=\'red\'>Warning!</font> You are not the admin user and so may only view attempts by guests.'; ! $string['FE_analysis_qu_stats'] = 'Number of attempts: {$a[0]}. mean: {$a[1]}, variance: {$a[2]}'; ! $string['FE_analysis_qu_noatt'] = 'Number of attempts: 0'; ! $string['FE_analysis_qu_noatts'] = 'There are no attempts at any questions in this quiz.'; ! $string['FE_analysis_qu_mark'] = 'Marks obtained'; ! $string['FE_analysis_qu_mark_full'] = 'Full marks'; ! $string['FE_analysis_qu_mark_nfm'] = 'Not full marks'; ! $string['FE_analysis_qu_mark_nz'] = 'Not zero marks'; ! $string['FE_analysis_qu_mark_zm'] = 'Zero marks'; ! $string['FE_analysis_qu_start'] = 'Start time'; ! $string['FE_analysis_qu_start_ex'] = 'eg \'Oct 17 2004 16:34\', or \'now -1 day\''; ! $string['FE_analysis_qu_end'] = 'End time'; ! $string['FE_analysis_qu_button'] = 'Analysis'; ! $string['FE_analysis_choose_title'] = 'Analysis of answers to a single question</h1>'; ! $string['FE_analysis_choose_info'] = 'Enter the information for the student answers that you would like to see:'; ! $string['FE_analysis_action'] = 'Action requested'; ! $string['FE_Valid_only'] = 'Valid only'; ! $string['FE_Invalid_only'] = 'Invalid only'; ! ! $string['FE_user_title'] = 'User management'; ! $string['FE_user_title_warn'] = 'Note, there is no \'undo\' option.'; ! $string['FE_user_action'] = 'Action'; ! $string['FE_user_action_review'] = 'Review'; ! $string['FE_user_action_update'] = 'Update'; ! $string['FE_user_action_delete'] = 'Delete'; ! $string['FE_user_action_submit'] = 'Submit'; ! $string['FE_user_review'] = 'Review the work of $a'; ! $string['FE_user_deleted'] = 'User deleted permanently. There is no \'undo\' option.'; $string[''] = ''; |
From: Chris S. <san...@us...> - 2005-10-11 17:35:33
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26708 Modified Files: analysis.php editquiz.php editsubject.php quiz.php user.php Log Message: Index: analysis.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/analysis.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** analysis.php 29 Aug 2005 18:41:03 -0000 1.19 --- analysis.php 11 Oct 2005 17:35:38 -0000 1.20 *************** *** 81,86 **** // Carry out the analysis requested in $_POST //////////////////////////////////////////////// ! echo '<h1>Analysis of answers to a single question</h1>'; ! if (''!= $questionID and '(none)' != $questionID) { if ( 'ALL' != $questionID ) { --- 81,86 ---- // Carry out the analysis requested in $_POST //////////////////////////////////////////////// ! echo '<h1>'.get_string('FE_analysis_choose_title','stack','').'</h1>'; ! if (''!= $questionID and '(none)' != $questionID) { if ( 'ALL' != $questionID ) { *************** *** 102,113 **** $qkw = stripslashes($row[3]); ! echo "<p> <b>Analysis for the following question:</b> </p>"; echo "<hr /><table> ! <tr> <td> <b>Question:</b> </td> <td> $qname (ID: {$row[0]} ) </td> </tr> ! <tr> <td> <b>Description:</b> </td> <td> $qdes </td> </tr> ! <tr> <td> <b>Keywords: </b> </td> <td> $qkw </td> </tr> </table><hr />"; --- 102,113 ---- $qkw = stripslashes($row[3]); ! echo '<p><b>'.get_string('FE_analysis_qu_title','stack','').'</b></p>'; echo "<hr /><table> ! <tr> <td> <b>".get_string('stackQuestion_questionName','stack','').":</b> </td> <td> $qname (ID: {$row[0]} ) </td> </tr> ! <tr> <td> <b>".get_string('stackQuestion_questionDescription','stack','').":</b> </td> <td> $qdes </td> </tr> ! <tr> <td> <b>".get_string('stackQuestion_questionKeywords','stack','').":</b> </td> <td> $qkw </td> </tr> </table><hr />"; *************** *** 115,119 **** } } else { ! echo "<p><font color=\"red\">This is an error: this question should exist but does not!</font></p>"; } } --- 115,119 ---- } } else { ! echo "<p><font color=\"red\">".get_string('FE_analysis_qu_err','stack','')."</font></p>"; } } *************** *** 136,140 **** // Who's answer are we permitted to view? if ('admin' != $user['username']) { ! echo "<p><font color='red'>Warning!</font> You are not the admin user and so may only view attempts by guests."; $query .= " AND userID = 0 "; } else { --- 136,140 ---- // Who's answer are we permitted to view? if ('admin' != $user['username']) { ! echo '<p>'.get_string('FE_analysis_qu_notadmin','stack','').'</p>'; $query .= " AND userID = 0 "; } else { *************** *** 213,218 **** if (0 != mysql_num_rows($questions)) { ! echo "<table>\n"; ! echo " <tr><th><b>ID</b></th><th><b>questionNote</b></th><th><b>RawAns</b></th><th><b>Count</b></th></tr>"; // Various variables to only print out each questionID once. $qi = ''; --- 213,220 ---- if (0 != mysql_num_rows($questions)) { ! echo "<table>\n <tr>\n <th><b>ID</b></th>\n"; ! echo " <th><b>".get_string('stackQuestion_questionNote','stack','')."</b></th>\n"; ! echo " <th><b>".get_string('ShowAt_RawAns','stack','')."</b></th>\n"; ! echo " <th><b>".get_string('Count','stack','')."</b></th>\n </tr>\n"; // Various variables to only print out each questionID once. $qi = ''; *************** *** 283,289 **** ! echo "<hr /><p>Enter the information for the student answers that you would like to see:</p>\n ! <form name='stackanalysisform' action='' method='POST'>\n"; ! echo "<table>\n"; --- 285,291 ---- ! echo "<hr /><p>"; ! echo get_string('FE_analysis_choose_info','stack',''); ! echo "</p>\n<form name='stackanalysisform' action='' method='POST'>\n"; echo "<table>\n"; *************** *** 302,318 **** if(0 != mysql_num_rows($questions)) { ! echo "<tr><td><span id=SectionText>QuestionID</span></td>\n"; echo "<td><select name=\"questionID\">\n"; if (''==$questionID or '(none)' == $questionID ) { ! echo " <option value=\"(none)\" selected>(none)</option>\n"; } else { ! echo " <option value=\"(none)\">(none)</option>\n"; } if ('ALL' == $questionID ) { ! echo " <option value=\"ALL\" selected>ALL</option>\n"; } else { ! echo " <option value=\"ALL\" >ALL</option>\n"; } --- 304,320 ---- if(0 != mysql_num_rows($questions)) { ! echo '<tr><td>'.get_string('stackQuestion_questionID','stack','')."</td>\n"; echo "<td><select name=\"questionID\">\n"; if (''==$questionID or '(none)' == $questionID ) { ! echo " <option value=\"(none)\" selected>".get_string('FE_(none)','stack','')."</option>\n"; } else { ! echo " <option value=\"(none)\">".get_string('FE_(none)','stack','')."</option>\n"; } if ('ALL' == $questionID ) { ! echo " <option value=\"ALL\" selected>".get_string('FE_ALL','stack','')."</option>\n"; } else { ! echo " <option value=\"ALL\" >".get_string('FE_ALL','stack','')."</option>\n"; } *************** *** 338,346 **** } ! echo "<tr><td><span id=SectionText>Action requested</span></td>\n"; echo "<td><select name=\"actionreq\">\n ! <option value='any' ".nsf($s,'any').">Any</option>\n ! <option value='validate' ".nsf($s,'validate').">Validate</option>\n ! <option value='mark' ".nsf($s,'mark').">Mark</option></select></td></tr>"; --- 340,348 ---- } ! echo "<tr><td>".get_string('FE_analysis_action','stack','')."</span></td>\n"; echo "<td><select name=\"actionreq\">\n ! <option value='any' ".nsf($s,'any').">".get_string('FE_Any','stack','')."</option>\n ! <option value='validate' ".nsf($s,'validate').">".get_string('Validate','stack','')."</option>\n ! <option value='mark' ".nsf($s,'mark').">".get_string('Mark','stack','')."</option></select></td></tr>"; *************** *** 353,361 **** } ! echo "<tr><td><span id=SectionText>Valid</span></td>\n"; echo "<td><select name=\"Valid\">\n ! <option value='any' ".nsf($s,'any').">Any</option>\n ! <option value='true' ".nsf($s,'true').">Valid only</option>\n ! <option value='false' ".nsf($s,'false').">Invalid only</option></select></td></tr>"; // Add mark --- 355,363 ---- } ! echo "<tr><td>".get_string('Valid','stack','')."</td>\n"; echo "<td><select name=\"Valid\">\n ! <option value='any' ".nsf($s,'any').">".get_string('FE_Any','stack','')."</option>\n ! <option value='true' ".nsf($s,'true').">".get_string('FE_Valid_only','stack','')."</option>\n ! <option value='false' ".nsf($s,'false').">".get_string('FE_Invalid_only','stack','')."</option></select></td></tr>"; // Add mark *************** *** 367,386 **** } ! echo "<tr><td><span id=SectionText>Marks obtained</span></td>\n"; echo "<td><select name=\"RawMark\">\n ! <option value='any' ".nsf($s,'any').">Any</option>\n ! <option value='full' ".nsf($s,'full').">Full marks</option>\n ! <option value='partial' ".nsf($s,'partial').">Not full marks</option>\n ! <option value='nonzero' ".nsf($s,'nonzero').">Non zero</option> ! <option value='zero' ".nsf($s,'zero').">Zero</option> </select></td></tr> ! <tr><td>Start time</td> <td><input type='text' name='StartTime' value='$stimestr' size='30' /> ! eg 'Oct 17 2004 16:34', or 'now -1 day'</td></tr> ! <tr><td>End time</td> <td><input type='text' name='EndTime' value='$etimestr' size='30' /></td></tr> </table>\n ! <input type=\"submit\" name=\"action\" value=\"Analysis\"> </form>"; --- 369,388 ---- } ! echo "<tr><td>".get_string('FE_analysis_qu_mark','stack','')."</td>\n"; echo "<td><select name=\"RawMark\">\n ! <option value='any' ".nsf($s,'any').">".get_string('FE_Any','stack','')."</option>\n ! <option value='full' ".nsf($s,'full').">".get_string('FE_analysis_qu_mark_full','stack','')."</option>\n ! <option value='partial' ".nsf($s,'partial').">".get_string('FE_analysis_qu_mark_nfm','stack','')."</option>\n ! <option value='nonzero' ".nsf($s,'nonzero').">".get_string('FE_analysis_qu_mark_nz','stack','')."</option> ! <option value='zero' ".nsf($s,'zero').">".get_string('FE_analysis_qu_mark_zm','stack','')."</option> </select></td></tr> ! <tr><td>".get_string('FE_analysis_qu_start','stack','')."</td> <td><input type='text' name='StartTime' value='$stimestr' size='30' /> ! ".get_string('FE_analysis_qu_start_ex','stack','')."</td></tr> ! <tr><td>".get_string('FE_analysis_qu_end','stack','')."</td> <td><input type='text' name='EndTime' value='$etimestr' size='30' /></td></tr> </table>\n ! <input type=\"submit\" name=\"action\" value=\"".get_string('FE_analysis_qu_button','stack','')."\"> </form>"; Index: editsubject.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editsubject.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editsubject.php 4 Sep 2005 21:26:18 -0000 1.2 --- editsubject.php 11 Oct 2005 17:35:38 -0000 1.3 *************** *** 128,132 **** //////////////////////////////////////////////// ! echo "<h1>Subject page</h1>"; // (3.1) Display any errors. --- 128,132 ---- //////////////////////////////////////////////// ! echo '<h1>'.get_string('FE_subject_title','stack','').'</h1>'; // (3.1) Display any errors. *************** *** 139,143 **** case 'subject_xml': { ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } case 'subject_choose': --- 139,143 ---- case 'subject_xml': { ! echo '<p>'.get_string('FE_quiz_download','stack',''). "<a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } case 'subject_choose': Index: editquiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** editquiz.php 4 Sep 2005 21:26:18 -0000 1.22 --- editquiz.php 11 Oct 2005 17:35:38 -0000 1.23 *************** *** 150,154 **** //////////////////////////////////////////////// ! echo "<h1>Quiz page</h1>"; // (3.1) Display any errors. --- 150,154 ---- //////////////////////////////////////////////// ! echo '<h1>'.get_string('FE_quiz_title','stack','').'</h1>'; // (3.1) Display any errors. *************** *** 161,165 **** case 'quiz_xml': { ! echo "<p>Please download the file <a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } case 'quiz_choose': --- 161,165 ---- case 'quiz_xml': { ! echo '<p>'.get_string('FE_quiz_download','stack',''). "<a href='{$stack_web_url}tmp/{$name}'>$name</a>.</p>"; } case 'quiz_choose': Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** quiz.php 19 Sep 2005 08:23:22 -0000 1.42 --- quiz.php 11 Oct 2005 17:35:38 -0000 1.43 *************** *** 145,152 **** if (NULL == $quiz_questions) { $action = 'quiz_error'; ! $error['quiz'] = 'There are no questions in this quiz! Please contact your administrator.'; } } ! } // (4.4) At this point we should have a $quiz and $quizInst to work on. --- 145,153 ---- if (NULL == $quiz_questions) { $action = 'quiz_error'; ! $error['quiz'] = get_string('FE_quiz_no_questions','stack',''); } } ! } ! // (4.4) At this point we should have a $quiz and $quizInst to work on. *************** *** 234,240 **** } } // end foreach } else if ('review' == $action) { // We have not attempted the quiz $action = 'quiz_error'; ! $error['quiz'] = 'There are no attempts at this quiz.'; } else { $action='new_quiz_version'; --- 235,242 ---- } } // end foreach + } else if ('review' == $action) { // We have not attempted the quiz $action = 'quiz_error'; ! $error['quiz'] = get_string('FE_quiz_no_atttempts','stack',''); } else { $action='new_quiz_version'; Index: user.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/user.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** user.php 19 Sep 2005 08:23:22 -0000 1.11 --- user.php 11 Oct 2005 17:35:38 -0000 1.12 *************** *** 65,80 **** switch ($action) { case 'none': ! echo "<h1>User management</h1>\n Note, there is no 'undo' option."; echo "<form name='stackuserform' action='' method='POST'>\n"; echo "<table>"; stack_user_select_formfrag($userID,FALSE); $s[$action] = 'selected'; ! echo "<td>Action</td>"; echo "<td><select name=\"action\">\n ! <option value='review' {nsf($s,'review')}>Review</option> ! <option value='userupdate_choose' {nsf($s,'update')}>Update</option> ! <option value='delete' {nsf($s,'delete')}>Delete</option></select></td></tr>"; echo "</table>"; ! echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">"; echo "</form>"; break; --- 65,80 ---- switch ($action) { case 'none': ! echo '<h1>'.get_string('FE_user_title','stack','')."</h1>\n<p>".get_string('FE_user_title_warn','stack','').'</p>'; echo "<form name='stackuserform' action='' method='POST'>\n"; echo "<table>"; stack_user_select_formfrag($userID,FALSE); $s[$action] = 'selected'; ! echo "<td>".get_string('FE_user_action','stack','')."</td>"; echo "<td><select name=\"action\">\n ! <option value='review' {nsf($s,'review')}>".get_string('FE_user_action_review','stack','')."</option> ! <option value='userupdate_choose' {nsf($s,'update')}>".get_string('FE_user_action_update','stack','')."</option> ! <option value='delete' {nsf($s,'delete')}>".get_string('FE_user_action_delete','stack','')."</option></select></td></tr>"; echo "</table>"; ! echo "<input type=\"submit\" name=\"submit\" value=\"".get_string('FE_user_action_submit','stack','')."\">"; echo "</form>"; break; *************** *** 91,97 **** $name = "{$user_stu['username']} ({$user_stu['firstname']} {$user_stu['lastname']})"; ! echo "<h1>Review the work of $name</h1>\n\n"; ! echo "<p>\n<b>Subjects</b>\n\n"; foreach ($subject_store as $subject) { $subjectID = $subject['subjectID']; --- 91,97 ---- $name = "{$user_stu['username']} ({$user_stu['firstname']} {$user_stu['lastname']})"; ! echo '<h1>'.get_string('FE_user_review','stack',$name)."</h1>\n\n"; ! echo "<p>\n<b>".get_string('stackSubject_subjectName','stack','')."</b>\n\n"; foreach ($subject_store as $subject) { $subjectID = $subject['subjectID']; *************** *** 112,116 **** case 'delete': stack_db_user_delete($user_stu); ! echo "User deleted permanently. There is no 'undo' option."; break;} --- 112,116 ---- case 'delete': stack_db_user_delete($user_stu); ! echo get_string('FE_user_deleted','stack',''); break;} |
From: Chris S. <san...@us...> - 2005-10-11 09:57:45
|
Update of /cvsroot/stack/stack-1-0/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2925/html Modified Files: pagehead.php Log Message: Index: pagehead.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/html/pagehead.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pagehead.php 4 Sep 2005 19:24:57 -0000 1.13 --- pagehead.php 11 Oct 2005 09:57:44 -0000 1.14 *************** *** 33,39 **** echo '<br /><font size=-3>'; if (isset($user['loggedin']) && ($user['loggedin'])) { ! echo "<p>Logged in as<br />{$user['username']}.</p>"; } else { ! echo "<p>Not logged in.</p>"; } echo "</font>\n"; --- 33,40 ---- echo '<br /><font size=-3>'; if (isset($user['loggedin']) && ($user['loggedin'])) { ! $a = $user['username']; ! echo '<p>'.get_string('FE_pagehead_loggedin','stack',$a).'</p>'; } else { ! echo '<p>'.get_string('FE_pagehead_notloggedin','stack','').'</p>'; } echo "</font>\n"; *************** *** 54,68 **** { if ('admin' == $username) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); ! } else if ($user['loggedin']) { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); ! } else { ! ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); ! } } --- 55,63 ---- { if ('admin' == $username) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/admin-menu.txt"); } else if ($user['loggedin']) { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/student-menu.txt"); } else { ! $menu = new ListMenu('/'.$stack_basepath.'/',"html/index-menu.txt"); } } |
From: Chris S. <san...@us...> - 2005-10-11 09:57:45
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2925/scripts Modified Files: stackAuthor.php stackFrontend.php stackQuestion.php stackQuiz.php stackSubject.php stackUser.php Log Message: Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** stackAuthor.php 12 Sep 2005 08:07:47 -0000 1.44 --- stackAuthor.php 11 Oct 2005 09:57:44 -0000 1.45 *************** *** 816,820 **** //Check that within current field there is no type tag, otherwise skip $err = ''; ! echo "<tr><td><b>{$stackQuiz[$key]['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>'; --- 816,821 ---- //Check that within current field there is no type tag, otherwise skip $err = ''; ! $fnamekey = 'stackQuiz_'.$key; ! echo "<tr><td><b>".get_string($fnamekey,'stack','')."</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>'; *************** *** 1243,1247 **** //Check that within current field there is no type tag, otherwise skip $err = ''; ! echo "<tr><td><b>{$stackSubject[$key]['descript']}</b></td>\n"; if ('subjectID' == $key) { echo "<td><input type=\"hidden\" name=\"subject[$key]\" value=\"{$subject[$key]}\" alt=\"$key\" />{$subject[$key]}</td><td>".$err.'</td></tr>'; --- 1244,1249 ---- //Check that within current field there is no type tag, otherwise skip $err = ''; ! $keyname = 'stackQuiz_'.$key; ! echo "<tr><td><b>".get_string($keyname,'stack','')."</b></td>\n"; if ('subjectID' == $key) { echo "<td><input type=\"hidden\" name=\"subject[$key]\" value=\"{$subject[$key]}\" alt=\"$key\" />{$subject[$key]}</td><td>".$err.'</td></tr>'; *************** *** 1543,1550 **** echo "\n<table cellpadding='1'>\n"; echo "\n<tr>\n"; ! echo " <th>{$stackSubject['subjectOrder']['descript']}</th>\n <th>ID</th>\n"; ! echo " <th>{$stackSubject['subjectName']['descript']}</th>\n"; ! echo " <th>{$stackSubject['subjectMode']['descript']}</th>\n"; ! echo " <th>{$stackSubject['subjectDescription']['descript']}</th>\n</tr>\n"; $trcol = FALSE; --- 1545,1552 ---- echo "\n<table cellpadding='1'>\n"; echo "\n<tr>\n"; ! echo " <th>".get_string('stackSubject_subjectOrder','stack','')."</th>\n <th>ID</th>\n"; ! echo " <th>".get_string('stackSubject_subjectName','stack','')."</th>\n"; ! echo " <th>".get_string('stackSubject_subjectMode','stack','')."</th>\n"; ! echo " <th>".get_string('stackSubject_subjectDescription','stack','')."</th>\n</tr>\n"; $trcol = FALSE; Index: stackSubject.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackSubject.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** stackSubject.php 4 Sep 2005 21:26:18 -0000 1.2 --- stackSubject.php 11 Oct 2005 09:57:44 -0000 1.3 *************** *** 11,20 **** */ // 'Unique quiz ID - local mySQL value' - $stackSubject['subjectID']['descript'] = 'Subject ID number'; $stackSubject['subjectID']['mysql'] = 'INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'; $stackSubject['subjectID']['type'] = 'meta'; // 'Subject name' - $stackSubject['subjectName']['descript'] = 'Subject name'; $stackSubject['subjectName']['mysql'] = 'TINYTEXT'; $stackSubject['subjectName']['type'] = 'meta'; --- 11,18 ---- *************** *** 23,27 **** // 'Subject description' - $stackSubject['subjectDescription']['descript'] = 'Description'; $stackSubject['subjectDescription']['mysql'] = 'TINYTEXT'; $stackSubject['subjectDescription']['type'] = 'meta'; --- 21,24 ---- *************** *** 30,53 **** // 'Subject options' - $stackSubject['subjectOptions']['descript'] = 'Subject options'; $stackSubject['subjectOptions']['mysql'] = 'TEXT'; $stackSubject['subjectOptions']['type'] = 'other'; // 'Subject mode' - $stackSubject['subjectMode']['descript'] = 'Mode'; $stackSubject['subjectMode']['mysql'] = 'TINYTEXT'; $stackSubject['subjectMode']['type'] = 'string'; // 'Subject mode' - $stackSubject['subjectOrder']['descript'] = 'Order in Zone'; $stackSubject['subjectOrder']['mysql'] = 'INT(11)'; $stackSubject['subjectOrder']['type'] = 'int'; // Page header and footers - $stackSubject['subjectHTMLHead']['descript'] = 'Subject page header'; $stackSubject['subjectHTMLHead']['mysql'] = 'TEXT'; $stackSubject['subjectHTMLHead']['type'] = 'html'; - $stackSubject['subjectHTMLFoot']['descript'] = 'Subject page header'; $stackSubject['subjectHTMLFoot']['mysql'] = 'TEXT'; $stackSubject['subjectHTMLFoot']['type'] = 'html'; --- 27,45 ---- *************** *** 67,71 **** $stackSubject['subjectKeywords']['metatag'] = 'keyword'; //lom:keyword $stackSubject['subjectKeywords']['metatype'] = 'lom'; - $stackSubject['subjectKeywords']['descript'] = 'Keywords'; //<PDK>Need for display purposes // 'Last edited by'; --- 59,62 ---- *************** *** 211,216 **** echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr>\n <th>{$stackSubject['subjectName']['descript']}</th>\n"; ! echo " <th>{$stackSubject['subjectDescription']['descript']}</th>\n</tr>\n"; foreach ($subject_store as $qs => $subject) { $sID = $subject['subjectID']; --- 202,207 ---- echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr>\n <th>".get_string('stackSubject_subjectName','stack','')."</th>\n"; ! echo " <th>".get_string('stackSubject_subjectDescription','stack','')."</th>\n</tr>\n"; foreach ($subject_store as $qs => $subject) { $sID = $subject['subjectID']; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** stackQuestion.php 26 Sep 2005 10:15:35 -0000 1.40 --- stackQuestion.php 11 Oct 2005 09:57:44 -0000 1.41 *************** *** 1101,1118 **** */ function stack_question_inst($question,$seed,$options,&$errors) { - // This function actually instantiates a $question with the given $options global $stackQuestion, $stackAnswerTest; $err_when_inst = "<br /><font color=\"red\">".get_string('QInstCASError','stack','')."</font> "; $errs = FALSE; - - $questionInst['questionIDInst'] = $question['questionID']; - $questionInst['questionSeedInst'] = $seed; ! // Create an offset seed. This prevents all questions in a // quiz from having the same seed. Otherwise random number generation // is poor, and plots (which rely on random numbers) do not work. $seedoffset = 0; if (array_key_exists('questionGUID',$question)) { - // Do something useful. $guid = $question['questionGUID']; for ($i = 0; $i < 20; $i+=4) { --- 1101,1114 ---- */ function stack_question_inst($question,$seed,$options,&$errors) { global $stackQuestion, $stackAnswerTest; + $err_when_inst = "<br /><font color=\"red\">".get_string('QInstCASError','stack','')."</font> "; $errs = FALSE; ! // (0) Create an offset seed. This prevents all questions in a // quiz from having the same seed. Otherwise random number generation // is poor, and plots (which rely on random numbers) do not work. $seedoffset = 0; if (array_key_exists('questionGUID',$question)) { $guid = $question['questionGUID']; for ($i = 0; $i < 20; $i+=4) { *************** *** 1124,1131 **** $seed += $seedoffset; ! // Get the implicit local variables, and the stings if ( array_key_exists('questionVars',$question) ) { $locals = $question['questionVars']; ! } else { $locals = ''; } $implicit_locals=''; --- 1120,1147 ---- $seed += $seedoffset; ! // (1) Construct the $questionInst array. ! ! $questionInst['questionIDInst'] = $question['questionID']; ! $questionInst['questionSeedInst'] = $seed; ! ! // Transfer the values from question to instance in a clean way. ! foreach($stackQuestion as $qfield => $val) { ! if (array_key_exists($qfield,$question)) { ! if ('' != $question[$qfield]) { ! $questionInst[$qfield]=$question[$qfield]; ! } ! } ! // except for rawkeyals, ! if ('rawkeyvals' == $stackQuestion[$qfield]['type']) { ! unset($questionInst[$qfield]); // We don't need the rawkeyvals in an instantiated question ! } ! } ! ! // (1) Get the implicit local variables, and the stings if ( array_key_exists('questionVars',$question) ) { $locals = $question['questionVars']; ! } else { ! $locals = ''; ! } $implicit_locals=''; *************** *** 1141,1148 **** } $fname = $qfield.'Inst'; ! $question[$fname]=$ilocs[0]; // Store the replaced string. } else { // There are no substitutions, so we just store the original string. ! $question["{$qfield}Inst"]=$question[$qfield]; ! } }// end if 'castext' } // end of grab implicit locvars loop. --- 1157,1164 ---- } $fname = $qfield.'Inst'; ! $questionInst[$fname]=$ilocs[0]; // Store the replaced string. } else { // There are no substitutions, so we just store the original string. ! $questionInst["{$qfield}Inst"]=$question[$qfield]; ! } }// end if 'castext' } // end of grab implicit locvars loop. *************** *** 1170,1186 **** $imp_locs_Inst = stack_process_vars($all_locals,$seed,$options,$errors); - // Transfer the values from question to instance in a clean way. - foreach($stackQuestion as $qfield => $val) { - if (array_key_exists($qfield,$question)) { - if ('' != $question[$qfield]) { - $questionInst[$qfield]=$question[$qfield]; - } - } - // except for rawkeyals, - if ('rawkeyvals' == $stackQuestion[$qfield]['type']) { - unset($questionInst[$qfield]); // We don't need the rawkeyvals in an instantiated question - } - } - // Get instantiated version of the answer, and any AnswerTest options. foreach($imp_locs_Inst as $lk => $loc ) { --- 1186,1189 ---- *************** *** 1233,1237 **** // Now put the implicit question variables back into the castext strings. // The result of this should be strings suitable to be echo'd to the student. ! $err_when_inst = "<br /><font color=\"red\">CAS ERROR when instantiated!</font> "; $displayed = $options['Display']; --- 1236,1240 ---- // Now put the implicit question variables back into the castext strings. // The result of this should be strings suitable to be echo'd to the student. ! $err_when_inst = "<br /><font color=\"red\">".get_string('CASERRInst','stack','')."</font> "; $displayed = $options['Display']; *************** *** 1240,1244 **** 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; --- 1243,1247 ---- if ('castext' == $stackQuestion[$qfield]['type'] and array_key_exists($qfield,$question)) { $errct = ''; ! $questionInst["{$qfield}Inst"] = stack_castext_to_display($questionInst["{$qfield}Inst"], $imp_locs_Inst, $displayed , $errct); if ('' != $errct) { // We have some errors! $errors[$qfield]=$err_when_inst.$errct; *************** *** 1247,1250 **** --- 1250,1283 ---- } // end of put the implicit locals back + // We do not want the student to be able to type in one of the question variables. + // Hence we add these to the forbidden strings. + // A teacher could always allow these if needed. + if ( array_key_exists('questionVarsInst',$questionInst) ) { + + // (1) Construct a comma separated list of variable keys. + $forbidvars = ''; + foreach($questionInst['questionVarsInst'] as $var) { + $forbidvars .= ', '.$var['key']; + } + + // (2) Get any pre-existing options + $forbid = ''; + if (array_key_exists('questionOptions',$questionInst)) { + if (array_key_exists('Forbid',$questionInst['questionOptions'])) { + $forbid = $questionInst['questionOptions']['Forbid']; + } + } + + // (3) Sort out any comma problems. + if ('' == $forbid) { // knock off the comma + $forbid = substr($forbidvars, 1, strlen($forbidvars)-1); + } else { + $forbid .= $forbidvars; + } + + // (4) Insert these + $questionInst['questionOptions']['Forbid'] = $forbid; + } + // ************************* // End Instantiate question *************** *** 1255,1258 **** --- 1288,1292 ---- } + //show_array($questionInst); return($questionInst); } *************** *** 1474,1522 **** // Returns a $this_attempt if ('' != trim($RawAns) ) { $err = validate_casstring($RawAns,'s'); // parse the student's raw answer ! if ('' != $err) {$errors['RawAns']= $err;} // Check for forbidden words $forbidden = stack_options_forbidden($options); ! if (is_array($forbidden)) { // There are some forbidden words foreach ($forbidden as $key => $fword) { if ( FALSE != strstr( $RawAns, $fword ) ) {// We have the forbidden word ! $errors['Forbid'] .= "<br />Your answer contains the forbidden word <tt> $fword</tt>."; } } } - $this_attempt['Valid']='true'; } else { // An empty answer. $this_attempt['Valid'] = 'false'; $this_attempt['Ans']['display'] = $RawAns; ! $this_attempt['AnswerNote'] = '(n/a)'; ! $this_attempt['RawMark'] = 0; ! $this_attempt['Penalty'] = 0; ! } - // Construct this attempt - $this_attempt['RawAns']=$RawAns; // Check for PHP parser errors. if (stack_check_for_error('RawAns',$errors) ) { ! $this_attempt['Valid']='false'; ! $this_attempt['Ans']['display']=$RawAns; ! $this_attempt['AnswerNote']= ' PHP parse error(s).'; ! $this_attempt['FeedBack']=$errors['RawAns']; ! $this_attempt['Penalty']=0; ! $this_attempt['RawMark']=0; } if ( stack_check_for_error('Forbid',$errors) ) { ! $this_attempt['Valid']='false'; ! $this_attempt['Ans']['display']= $RawAns; ! $this_attempt['AnswerNote'] .= ' Forbidden word(s).'; ! $this_attempt['FeedBack'] .= $errors['Forbid']; ! $this_attempt['Penalty']=0; ! $this_attempt['RawMark']=0; } --- 1508,1568 ---- // Returns a $this_attempt + // Construct this attempt + $this_attempt['RawAns'] =$RawAns; + $this_attempt['RawMark'] = 0; + $this_attempt['Penalty'] = 0; + $this_attempt['Valid'] = 'true'; + $this_attempt['AnswerNote'] = ''; + $this_attempt['FeedBack'] = ''; + + if ('' != trim($RawAns) ) { $err = validate_casstring($RawAns,'s'); // parse the student's raw answer ! if ('' != $err) { ! $errors['RawAns']= $err; ! } // Check for forbidden words $forbidden = stack_options_forbidden($options); ! $foundforbidden = FALSE; ! if (is_array($forbidden)) { // There are some forbidden words + $errstr = ''; foreach ($forbidden as $key => $fword) { if ( FALSE != strstr( $RawAns, $fword ) ) {// We have the forbidden word ! $errstr .= '<br />'.get_string('ForbidWord','stack',$fword); ! ! $foundforbidden = TRUE; } } + if ($foundforbidden) { + $errors['Forbid'] = $errstr; + } } } else { // An empty answer. $this_attempt['Valid'] = 'false'; $this_attempt['Ans']['display'] = $RawAns; ! $this_attempt['Ans']['value'] = $RawAns; ! $this_attempt['AnswerNote'] .= '(n/a)'; ! } // Check for PHP parser errors. if (stack_check_for_error('RawAns',$errors) ) { ! $this_attempt['Valid'] = 'false'; ! $this_attempt['Ans']['display'] = $RawAns; ! $this_attempt['Ans']['value'] = $RawAns; ! $this_attempt['AnswerNote'] .= ' PHP parse error(s).'; ! $this_attempt['FeedBack'] .= $errors['RawAns']; } if ( stack_check_for_error('Forbid',$errors) ) { ! $this_attempt['Valid'] = 'false'; ! $this_attempt['Ans']['display'] = $RawAns; ! $this_attempt['Ans']['value'] = $RawAns; ! $this_attempt['AnswerNote'] .= ' ForbidWord'; ! $this_attempt['FeedBack'] .= $errors['Forbid']; } Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** stackQuiz.php 12 Sep 2005 08:07:47 -0000 1.15 --- stackQuiz.php 11 Oct 2005 09:57:44 -0000 1.16 *************** *** 11,20 **** */ // 'Unique quiz ID - local mySQL value' - $stackQuiz['quizid']['descript'] = 'Quiz ID number'; $stackQuiz['quizid']['mysql'] = 'INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'; $stackQuiz['quizid']['type'] = 'meta'; // 'Quiz name' - $stackQuiz['quizName']['descript'] = 'Quiz name'; $stackQuiz['quizName']['mysql'] = 'TINYTEXT'; $stackQuiz['quizName']['type'] = 'meta'; --- 11,18 ---- *************** *** 23,27 **** // 'Quiz description' - $stackQuiz['quizDescription']['descript'] = 'Description'; $stackQuiz['quizDescription']['mysql'] = 'TINYTEXT'; $stackQuiz['quizDescription']['type'] = 'meta'; --- 21,24 ---- *************** *** 30,44 **** // 'Quiz options' - $stackQuiz['quizOptions']['descript'] = 'Quiz options'; $stackQuiz['quizOptions']['mysql'] = 'TEXT'; $stackQuiz['quizOptions']['type'] = 'other'; // 'Quiz due date' - $stackQuiz['quizDueDate']['descript'] = 'Due date'; $stackQuiz['quizDueDate']['mysql'] = 'int(10)'; $stackQuiz['quizDueDate']['type'] = 'date'; // 'Quiz mode' - $stackQuiz['quizMode']['descript'] = 'Mode'; $stackQuiz['quizMode']['mysql'] = 'TINYTEXT'; $stackQuiz['quizMode']['type'] = 'string'; --- 27,38 ---- *************** *** 58,62 **** $stackQuiz['quizKeywords']['metatag'] = 'keyword'; //lom:keyword $stackQuiz['quizKeywords']['metatype'] = 'lom'; - $stackQuiz['quizKeywords']['descript'] = 'Keywords'; //<PDK>Need for display purposes // 'Last edited by'; --- 52,55 ---- *************** *** 199,203 **** echo "\n<table cellpadding='2'>\n"; ! echo "\n<tr><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th>Last mark (%)</th><th>{$stackQuiz['quizDueDate']['descript']}</th>\n</tr>\n"; foreach ($quiz_store as $qs => $quiz) { --- 192,197 ---- echo "\n<table cellpadding='2'>\n"; ! ! echo "\n<tr><th>".get_string('stackQuiz_quizName','stack','')."</th><th>".get_string('stackQuiz_quizDescription','stack','')."</th><th>".get_string('FE_quiz_lastmark','stack','')."</th><th>".get_string('stackQuiz_quizDueDate','stack','')."</th>\n</tr>\n"; foreach ($quiz_store as $qs => $quiz) { Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** stackFrontend.php 4 Sep 2005 21:26:18 -0000 1.3 --- stackFrontend.php 11 Oct 2005 09:57:44 -0000 1.4 *************** *** 231,236 **** 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) { --- 231,237 ---- echo "\n<table cellpadding='2'>\n"; ! ! echo "\n<tr><th></th><th>".get_string('stackQuiz_quizName','stack','')."</th> ! <th>".get_string('stackQuiz_quizDescription','stack','')."</th><th></th></tr>"; foreach ($quiz_store as $qs => $quiz) { *************** *** 273,279 **** echo "\n<table cellpadding='2'>\n"; echo "\n<tr>\n"; ! echo " <th>ID</th>\n <th>{$stackSubject['subjectOrder']['descript']}</th>\n"; ! echo " <th>{$stackSubject['subjectName']['descript']}</th> ! <th>{$stackSubject['subjectDescription']['descript']}</th><th></th></tr>"; foreach ($subject_store as $qs => $subject) { --- 274,280 ---- echo "\n<table cellpadding='2'>\n"; echo "\n<tr>\n"; ! echo " <th>ID</th>\n <th>".get_string('stackSubject_subjectOrder','stack','')."</th>\n"; ! echo " <th>".get_string('stackSubject_subjectName','stack','')."</th> ! <th>".get_string('stackSubject_subjectDescription','stack','')."</th><th></th></tr>"; foreach ($subject_store as $qs => $subject) { Index: stackUser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUser.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** stackUser.php 29 Sep 2005 11:03:01 -0000 1.17 --- stackUser.php 11 Oct 2005 09:57:44 -0000 1.18 *************** *** 267,273 **** include_once($stack_root.'/html/helpform.php'); ! echo '<h1>Update user information</h1>'; echo "<form action=\"\" method=\"post\" name=\"register\" id=\"register\">"; ! echo '<p>To update your information, please complete the following form.<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td></td></tr>'; stack_user_edit_form($user,$errors,$admin); --- 267,273 ---- include_once($stack_root.'/html/helpform.php'); ! echo '<h1>'.get_string('FE_index_update_info_title','stack','').'</h1>'; echo "<form action=\"\" method=\"post\" name=\"register\" id=\"register\">"; ! echo '<p>'.get_string('FE_index_update_info_instruct','stack','').'<p>'; echo '<table><tr><td>Username </td><td><input type="hidden" name="user[username]" size="25" value="'.stack_s($user['username']).'" alt="User name" />'.stack_s($user['username']).'</td><td></td></tr>'; stack_user_edit_form($user,$errors,$admin); *************** *** 283,287 **** echo '</table>'; ! echo '<input type="hidden" name="action" value="userupdate" /><input type="submit" value="Update" /></form>'; } --- 283,287 ---- echo '</table>'; ! echo '<input type="hidden" name="action" value="userupdate" /><input type="submit" value="'.get_string('FE_index_update_button','stack','').'" /></form>'; } |
From: Chris S. <san...@us...> - 2005-10-11 09:57:45
|
Update of /cvsroot/stack/stack-1-0/lang/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2925/lang/en Modified Files: stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/stack.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** stack.php 7 Oct 2005 06:26:38 -0000 1.28 --- stack.php 11 Oct 2005 09:57:44 -0000 1.29 *************** *** 52,61 **** $string['subject_nonetochoose'] = 'You have no subjects available.'; - // Stack page footer. - $string['ThisSTACKVer'] = 'This is STACK version'; - $string['ThisPageTook'] = 'This page took approximately'; - $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.'; --- 52,55 ---- *************** *** 110,113 **** --- 104,108 ---- $string['SeriousForbid'] = 'The string <tt><font color=\'orange\'></font></tt> is forbidden!<br />'; + $string['ForbidWord'] = 'Your answer contains the forbidden word <tt> $a</tt>.'; $string['MissingRightBracket'] = 'You have a missing right bracket.'; $string['MissingLeftBracket'] = 'You have a missing left bracket.'; *************** *** 120,123 **** --- 115,120 ---- $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.'; + $string['CASERRInst'] = 'CAS ERROR when instantiated!'; + // 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 @ @." *************** *** 133,136 **** --- 130,134 ---- $string['USR_Username'] = 'Username'; + $string['USR_Password'] = 'Password'; $string['USR_NewPassword'] = 'New password'; $string['USR_ConfirmPsswd'] = '(confirm)'; *************** *** 215,221 **** // Quiz //////////////////////////////////// $string['stackQuiz_quizName'] = 'Quiz name'; - // <PDK> $stackQuestion metadata added $string['stackQuiz_quizPublisher'] = 'Server published'; $string['stackQuiz_quizType'] = 'Nature of content'; --- 213,224 ---- // Quiz //////////////////////////////////// + $string['stackQuiz_quizid'] = 'Quiz ID number'; $string['stackQuiz_quizName'] = 'Quiz name'; + $string['stackQuiz_quizDescription'] = 'Description'; + $string['stackQuiz_quizOptions'] = 'Quiz options'; + $string['stackQuiz_quizDueDate'] = 'Due date'; + $string['stackQuiz_quizMode'] = 'Mode'; + $string['stackQuiz_quizKeywords'] = 'Keywords'; $string['stackQuiz_quizPublisher'] = 'Server published'; $string['stackQuiz_quizType'] = 'Nature of content'; *************** *** 234,237 **** --- 237,247 ---- //////////////////////////////////// $string['stackSubject_subjectName'] = 'Subject name'; + $string['stackSubject_subjectID'] = 'Subject ID number'; + $string['stackSubject_subjectDescription'] = 'Description'; + $string['stackSubject_subjectOptions'] = 'Subject options'; + $string['stackSubject_subjectMode'] = 'Mode'; + $string['stackSubject_subjectOrder'] = 'Order in Zone'; + $string['stackSubject_subjectHTMLHead'] = 'Subject page header'; + $string['stackSubject_subjectHTMLFoot'] = 'Subject page footer'; // <PDK> $stackQuestion metadata added *************** *** 416,419 **** --- 426,461 ---- $string['FE_errors_field'] = 'The field $a, gave the following error.'; + // Page header + $string['FE_pagehead_loggedin'] = 'Logged in as<br />{$a}'; + $string['FE_pagehead_notloggedin'] = 'Not logged in.'; + + // Stack page footer. + $string['ThisSTACKVer'] = 'This is STACK version'; + $string['ThisPageTook'] = 'This page took approximately'; + $string['seconds'] = 'seconds'; + $string['STACKlogo'] = 'STACK logo'; + + // index.php + + $string['FE_index_logout'] = '<h1>Thank you</h1><p>Thank you for using STACK.'; + $string['FE_index_welcome'] = '<h1>Welcome</h1> <p>Welcome to STACK, {$a[0]} {$a[1]}.</p>'; + $string['FE_index_loginerr'] = '<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$a}</tt> for the following reason.</p>'; + $string['FE_index_loginscreen_title'] = 'Please Login'; + $string['FE_index_loginscreen_guestok'] = 'You may login with the username \"guest\" and an empty password.'; + $string['FE_index_loginscreen_pleasereg'] = 'Register with this STACK sever:'; + $string['FE_index_button_login'] = 'Login'; + $string['FE_index_button_register'] = 'Register'; + $string['FE_index_update_info_title'] = 'Update user information'; + $string['FE_index_update_info_instruct'] = 'To update your information, please complete the following form.'; + $string['FE_index_update_button'] = 'Update'; + $string['FE_index_update_info_guest'] = 'Please logout and login as a personal user first to update your information.'; + $string['FE_index_register_title'] = 'Register as a new user'; + $string['FE_index_register_instruct'] = 'To register as a STACK user, please provide the following information.'; + + // Strings associated with quizzes. + $string['FE_quiz_lastmark'] = 'Last mark'; + + $string[''] = ''; + $string[''] = ''; $string[''] = ''; $string[''] = ''; |
From: Chris S. <san...@us...> - 2005-10-11 09:57:45
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2925 Modified Files: index.php Log Message: Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** index.php 7 Sep 2005 14:19:35 -0000 1.30 --- index.php 11 Oct 2005 09:57:44 -0000 1.31 *************** *** 84,93 **** 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>"; if ('admin' != $user['username']) { $action = 'choose_subject'; --- 84,96 ---- if ('logout' == $action) { ! echo get_string('FE_index_logout','stack',''); $action = 'loginscreen'; } if ('welcome' == $action) { ! $a = array(); ! $a[0] = $user['firstname']; ! $a[1] = $user['lastname']; ! echo get_string('FE_index_welcome','stack',$a); if ('admin' != $user['username']) { $action = 'choose_subject'; *************** *** 96,100 **** if ('loginerr' == $action) { ! echo "<h1>Problems with your login.</h1> <p>You could not be logged into STACK as <tt>{$user['username']}</tt> for the following reason.</p>"; echo $errors['user']; $action = 'loginscreen'; --- 99,104 ---- if ('loginerr' == $action) { ! $a = $user['username']; ! echo get_string('FE_index_loginerr','stack',$a); echo $errors['user']; $action = 'loginscreen'; *************** *** 115,144 **** switch ($action) { case 'loginscreen': ! echo '<h1>Login</h1><form action="index.php" method="post" name="login" id="login"><table><tr><td align="right">Username:</td>'; ! echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td>'; ! echo '</tr><tr><td>Password:</td>'; echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td>'; echo '</tr><tr><td> <input type="hidden" name="action" value="login" /> ! <input type="submit" value="Login" /> </td></tr> </table></form>'; ! echo 'You may login with the username "guest" and an empty password.'; ! echo '<form action="index.php" method="post" name="guestlogin"> ! Register with this STACK sever: ! <input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="registration_screen" /> ! <input type="submit" value="Register" /> </form>'; break; case 'update_info': if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { stack_user_update_info($user, $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; --- 119,151 ---- switch ($action) { case 'loginscreen': ! echo '<h1>'.get_string('FE_index_loginscreen_title','stack','').'</h1>'; ! echo '<form action="index.php" method="post" name="login" id="login"><table><tr>'; ! echo '<td align="right">'.get_string('USR_Username','stack','').'</td>'; ! echo "<td><input type=\"text\" name=\"username\" size=\"15\" value=\"{$username}\" alt=\"Username\" /></td><td>".$errun.'</td></tr><tr>'; ! echo '<td align="right">'.get_string('USR_Password','stack','').'</td>'; echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td>'; echo '</tr><tr><td> <input type="hidden" name="action" value="login" /> ! <input type="submit" value="'.get_string('FE_index_button_login','stack','').'" /> </td></tr> </table></form>'; ! echo get_string('FE_index_loginscreen_guestok','stack',''); ! echo '<form action="index.php" method="post" name="guestlogin">'; ! echo get_string('FE_index_loginscreen_pleasereg','stack',''); ! echo '<input type="hidden" name="username" value="guest" /> <input type="hidden" name="password" value="guest" /> <input type="hidden" name="action" value="registration_screen" /> ! <input type="submit" value="'.get_string('FE_index_button_register','stack','').'" /> </form>'; break; + case 'update_info': if (stack_is_logged_in($user) and !stack_user_is_guest($user)) { stack_user_update_info($user, $errors); } else { ! echo '<h1>'.get_string('FE_index_update_info_title','stack','').'</h1>'; ! echo '<p>'.get_string('FE_index_update_info_guest','stack','').'</p>'; } break; *************** *** 146,155 **** include_once($stack_root."/scripts/stackUser.php"); ! echo "<h1>Register as a new user</h1><form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; ! echo '<p>To register as a STACK user, please provide the following information.<p>'; ! echo '<table><tr><td>Username </td><td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; // TO DO: Need to fix typo in this form - institution stack_user_edit_form($user,$errors); ! echo '</table><input type="hidden" name="action" value="register" /><input type="submit" value="Register" /></form>'; break; --- 153,167 ---- include_once($stack_root."/scripts/stackUser.php"); ! echo '<h1>'.get_string('FE_index_register_title','stack','').'</h1>'; ! echo "<form action=\"index.php\" method=\"post\" name=\"register\" id=\"register\">"; ! echo '<p>'.get_string('FE_index_register_instruct','stack','').'</p>'; ! echo '<table><tr>'; ! echo '<td>'.get_string('USR_Username').'</td>'; ! echo '<td><input type="text" name="user[username]" size="25" value="'.stack_s($username).'" alt="User name" /></td><td>'.$err.'</td></tr>'; // TO DO: Need to fix typo in this form - institution stack_user_edit_form($user,$errors); ! echo '</table><input type="hidden" name="action" value="register" />'; ! echo '<input type="submit" value="'.get_string('FE_index_button_register','stack','').'" />'; ! echo '</form>'; break; |
From: Chris S. <san...@us...> - 2005-10-10 16:19:58
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29754/scripts Modified Files: stackUtility.php Log Message: Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** stackUtility.php 9 Oct 2005 16:19:44 -0000 1.34 --- stackUtility.php 10 Oct 2005 16:19:51 -0000 1.35 *************** *** 434,443 **** // $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! - $patterns[] = "|(\*[A-Za-eh-z])(\()|"; - $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( $missstar = NULL; foreach ($patterns as $pat) { --- 434,447 ---- // $patterns[] = "|(\))(\()|"; // Simply the pattern ")(". Must be wrong! $patterns[] = "|([0-9]+)([A-Za-eh-z])|"; // eg 3x $patterns[] = "|([0-9])([A-Za-z]\()|"; // eg 3 x ( $patterns[] = "|([0-9]+)(\()|"; // eg 3212 ( + if ('s' == $seclevel) { + // Teachers have more options for functions + $patterns[] = "|(^[A-Za-eh-z])(\()|"; // eg a( , that is a single letter. + $patterns[] = "|(\*[A-Za-eh-z])(\()|"; + } + $missstar = NULL; foreach ($patterns as $pat) { |
From: Chris S. <san...@us...> - 2005-10-09 16:20:53
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20259/scripts Modified Files: stackCAS.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stackCAS.php 9 Oct 2005 16:19:44 -0000 1.5 --- stackCAS.php 9 Oct 2005 16:20:39 -0000 1.6 *************** *** 291,295 **** $parsed = CASParseCASOutput($varResponse); ! show_array($parsed); // Get the CAS's values of the locals into an array. --- 291,295 ---- $parsed = CASParseCASOutput($varResponse); ! //show_array($parsed); // Get the CAS's values of the locals into an array. *************** *** 343,347 **** } ! show_array($locals_inst); return $locals_inst; } --- 343,347 ---- } ! //show_array($locals_inst); return $locals_inst; } |
From: Chris S. <san...@us...> - 2005-10-09 16:19:58
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19871/scripts Modified Files: stackCAS.php stackUtility.php Log Message: Index: stackCAS.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackCAS.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackCAS.php 13 Sep 2005 08:35:04 -0000 1.4 --- stackCAS.php 9 Oct 2005 16:19:44 -0000 1.5 *************** *** 276,280 **** return NULL; } - $t = time(); --- 276,279 ---- *************** *** 292,345 **** $parsed = CASParseCASOutput($varResponse); ! //show_array($parsed); // Get the CAS's values of the locals into an array. ! // Get the CAS's values of the locals into an array. foreach ($locals as $lk => $locvar) { ! if (array_key_exists($lk,$parsed['questionVarsInst'])) { ! $locals_inst[$lk] = $locals[$lk]; ! $locals_inst[$lk]['display'] = ''; ! foreach ($parsed['questionVarsInst'][$lk] as $lkk => $lvv) { ! $locals_inst[$lk][$lkk] = $lvv; ! } ! } else { ! $locals_inst[$lk] = $locals[$lk]; ! $locals_inst[$lk]['error'] = 'CAS-error (no output)'; ! $locals_inst[$lk]['display'] = ''; ! } ! // Maxima typesets strings with a & at the front. This breaks TeX, so we ! // need to get rid of it..... ! if (array_key_exists('display',$locals_inst[$lk])) { ! if ( '&' == substr($locals_inst[$lk]['display'],0,1)) { ! $locals_inst[$lk]['display'] = substr($locals_inst[$lk]['display'],1); ! } ! } ! if (isset($locals_inst[$lk]['error'])) { // There is a CAS error! ! // Get the command that went in. ! $val = $locvar['value']; ! if ('' == $locals_inst[$lk]['display']) { ! // This must be a genuine error, since nothing is displayed. ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! $locals_inst[$lk]['display'] = $val; // Restore the un-CASed value ! } else if (strstr($locals_inst[$lk]['error'],'Plot error')) { ! // This must be a genuine error, since we created it! ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! } else if (FALSE != strstr($val,'plot')) { ! // We asked for a plot, these always generate an error! (HACK) ! unset($locals_inst[$lk]['error']); ! $locals_inst[$lk]['display'] = $locals_inst[$lk]['value']; ! } else { ! // This must also be a genuine error, but keep the display, since we have it. ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! } ! } } } ! //show_array($locals_inst); return $locals_inst; - } --- 291,348 ---- $parsed = CASParseCASOutput($varResponse); ! show_array($parsed); // Get the CAS's values of the locals into an array. ! $locals_inst = array(); foreach ($locals as $lk => $locvar) { ! $locals_inst[$lk] = $locals[$lk]; ! $locals_inst[$lk]['error'] = 'CAS-error (no output)'; ! $locals_inst[$lk]['display'] = ''; ! } ! if (is_array($parsed)) { ! if (array_key_exists('questionVarsInst',$parsed)) { ! foreach ($locals as $lk => $locvar) { ! if (array_key_exists($lk,$parsed['questionVarsInst'])) { ! unset($locals_inst[$lk]['error']); ! foreach ($parsed['questionVarsInst'][$lk] as $lkk => $lvv) { ! $locals_inst[$lk][$lkk] = $lvv; ! } ! } ! // Maxima typesets strings with a & at the front. This breaks TeX, so we ! // need to get rid of it..... ! if (array_key_exists('display',$locals_inst[$lk])) { ! if ( '&' == substr($locals_inst[$lk]['display'],0,1)) { ! $locals_inst[$lk]['display'] = substr($locals_inst[$lk]['display'],1); ! } ! } ! ! if (isset($locals_inst[$lk]['error'])) { // There is a CAS error! ! // Get the command that went in. ! $val = $locvar['value']; ! if ('' == $locals_inst[$lk]['display']) { ! // This must be a genuine error, since nothing is displayed. ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! $locals_inst[$lk]['display'] = $val; // Restore the un-CASed value ! } else if (strstr($locals_inst[$lk]['error'],'Plot error')) { ! // This must be a genuine error, since we created it! ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! } else if (FALSE != strstr($val,'plot')) { ! // We asked for a plot, these always generate an error! (HACK) ! unset($locals_inst[$lk]['error']); ! $locals_inst[$lk]['display'] = $locals_inst[$lk]['value']; ! } else { ! // This must also be a genuine error, but keep the display, since we have it. ! $locals_inst[$lk]['value'] = $val; // Restore the un-CASed value ! } ! } ! } ! } } } ! show_array($locals_inst); return $locals_inst; } Index: stackUtility.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUtility.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** stackUtility.php 1 Sep 2005 08:13:57 -0000 1.33 --- stackUtility.php 9 Oct 2005 16:19:44 -0000 1.34 *************** *** 669,673 **** $errs = TRUE; // Hack: should do something more useful here! ! } // (2) Now put the implicit question variables back into the castext strings. --- 669,673 ---- $errs = TRUE; // Hack: should do something more useful here! ! } // (2) Now put the implicit question variables back into the castext strings. *************** *** 719,722 **** --- 719,724 ---- global $stack_web_url; + $errs = ''; + // (1) Looks for the name of each $local as such a dummy string if (is_array($locals)) { *************** *** 724,732 **** foreach ($locals as $key => $loc) { $locname = $loc['key']; if (array_key_exists('display', $loc)) { $locdisplay = $loc['display']; ! } else { ! $locdisplay = ''; ! } $dummy = '@'.$locname.'@'; --- 726,733 ---- foreach ($locals as $key => $loc) { $locname = $loc['key']; + $locdisplay = ''; if (array_key_exists('display', $loc)) { $locdisplay = $loc['display']; ! } $dummy = '@'.$locname.'@'; *************** *** 735,742 **** if (array_key_exists('error',$loc)) { if (array_key_exists('value',$loc)) { $a = array('key' => $loc['value']); $errs .= '<br />'.get_string('ErrorCASString','stack',$a).'<br />'.$loc['error']; } else { ! $displayed = ' \verb$'.$dummy.'$ '; // Otherwise just use its name $a = array('key' => $displayed); $errs .= '<br />'.get_string('ErrorCASString','stack',$a).'<br />'.$loc['error']; --- 736,744 ---- if (array_key_exists('error',$loc)) { if (array_key_exists('value',$loc)) { + $displayed = ' {\color{red} \verb$'.$loc['value'].'$} '; $a = array('key' => $loc['value']); $errs .= '<br />'.get_string('ErrorCASString','stack',$a).'<br />'.$loc['error']; } else { ! $displayed = ' {\color{red} \verb$'.$dummy.'$} '; // Otherwise just use its name $a = array('key' => $displayed); $errs .= '<br />'.get_string('ErrorCASString','stack',$a).'<br />'.$loc['error']; |
From: Chris S. <san...@us...> - 2005-10-07 06:26:46
|
Update of /cvsroot/stack/stack-1-0/lang/en/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27355/lang/en/doc Modified Files: author_commonsyntax.php author_factsformula.php author_gettingstarted.php author_potresp.php student_factsformula.php Log Message: Index: author_factsformula.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_factsformula.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** author_factsformula.php 14 Jul 2005 18:05:04 -0000 1.4 --- author_factsformula.php 7 Oct 2005 06:26:38 -0000 1.5 *************** *** 21,33 **** again, STACK had provided a mechanism to link to them. To use any of the facts and formulae, type ! <pre> ! <hint>key</hint> ! </pre> in any of the CAS-text fields, eg a worked solution.</p> ! <p>For example, the CAS-text</p> <p><tt>The chain rule <hint>calc_chain_rule</hint> can be used ....</tt></p> <?php --- 21,35 ---- again, STACK had provided a mechanism to link to them. To use any of the facts and formulae, type ! ! <p><hint>key</hint></p> ! in any of the CAS-text fields, eg a worked solution.</p> ! <p>For example, if the the CAS-text</p> <p><tt>The chain rule <hint>calc_chain_rule</hint> can be used ....</tt></p> + is used, then the result displayed to the student will be as follows. Try clicking on the question mark. + <?php *************** *** 53,57 **** $errors = ''; ! echo ' <h3>'.$fact['name'].' <tt>('.$key.')</tt></h3>'; echo ' <p> '.stack_castext_to_display($fact['fact'],$locals,$options['Display'],$errors).'</p>'; } --- 55,59 ---- $errors = ''; ! echo ' <table width=100%><tr bgcolor=\'#DDDDDD\'><td>'.$fact['name'].' <tt>('.$key.')</tt></td></tr></table>'; echo ' <p> '.stack_castext_to_display($fact['fact'],$locals,$options['Display'],$errors).'</p>'; } Index: author_commonsyntax.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_commonsyntax.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** author_commonsyntax.php 12 Sep 2005 08:07:47 -0000 1.4 --- author_commonsyntax.php 7 Oct 2005 06:26:38 -0000 1.5 *************** *** 13,17 **** ?> ! <h1>Common syntax, and STACK commands</h1> <p>Every CAS system is unique, and they all have different a syntax for doing --- 13,17 ---- ?> ! <h1>STACK commands</h1> <p>Every CAS system is unique, and they all have different a syntax for doing *************** *** 20,29 **** details of which are given in the invaluable <a href="doc/dev/Rosetta.pdf">Rosetta.pdf</a>. ! This makes moving from one to the other a difficult task! ! Since many CAS systems allow a synonym (or alias) to be set ! up, adapting the function name is not an overwhelming task. ! Furthermore, the vast majority of tasks we need in single variable calculus and ! algebra CAA can be reduced to these tasks. ! So by adopting this common syntax more than expected can be achieved. </p> --- 20,28 ---- details of which are given in the invaluable <a href="doc/dev/Rosetta.pdf">Rosetta.pdf</a>. ! This makes moving from one to the other a difficult task. ! </p> ! <p>This document details functions defined in Maxima unique to STACK, and ! synonyms (or alias) which have been set ! up. </p> *************** *** 54,58 **** if ($type == $vals['type']) { echo "<tr><td nowrap='nowrap' align='top'><b><a NAME=\"STACK_command_$fun\">$fun</a></b></td> ! <td nowrap='nowrap' align='top'>{$vals['syntax']}</tt></td> <td>{$vals['doc']}</td></tr>\n"; } --- 53,57 ---- if ($type == $vals['type']) { echo "<tr><td nowrap='nowrap' align='top'><b><a NAME=\"STACK_command_$fun\">$fun</a></b></td> ! <td nowrap='nowrap' align='top'><tt>{$vals['syntax']}</tt></td> <td>{$vals['doc']}</td></tr>\n"; } *************** *** 70,74 **** <h2>Sets, lists and matrices</h2> ! <p> Lists are entered using brackets, eg <tt>[1,2,3]</tt>. These are native to Maxima.</p> <p> Sets are implemented using the Maxima package <tt>nset</tt> which is automatically loaded by STACK. See the <a href="maximadocs/maxdoc/nset.html">specific documentation</a>. --- 69,78 ---- <h2>Sets, lists and matrices</h2> ! <p> Lists are entered using brackets, eg <tt>[1,2,3]</tt>. These are native to Maxima. ! ! <?php disp_cas('list') ?> ! ! </p> ! <p> Sets are implemented using the Maxima package <tt>nset</tt> which is automatically loaded by STACK. See the <a href="maximadocs/maxdoc/nset.html">specific documentation</a>. *************** *** 92,100 **** CAS, but probably not best suited for more elementary school assessment. Similarly <tt>log</tt> is a natural logarithm. </p> - <table> ! <tr> <td> <b>Trig </br> </td> <td><tt>sin(x), cos(x), tan(x)</tt></td> <td> The angular measure is always assumed to be <em>radians</em>.</td> </tr> ! <tr> <td> <b>Hyperbolic </br> </td> <td><tt>sinh(x), cosh(x), tanh(x)</tt></td></tr> ! <tr> <td> <b>Logarithms </br> </td> <td><tt>log(x), exp(x)</tt></td> <td> Natural logarithms, and exponential function.</td></tr> </table> --- 96,106 ---- CAS, but probably not best suited for more elementary school assessment. Similarly <tt>log</tt> is a natural logarithm. </p> <table> ! <tr> <td> <b>Trig </b> </td> <td><tt>sin(x), cos(x), tan(x)</tt></td> <td> The angular measure is always assumed to be <em>radians</em>.</td> </tr> ! <tr> <td> <b>Inverse trig </b> </td> <td><tt>asin(x)</tt> etc</td> <td> The angular measure is always assumed to be <em>radians</em>. These functions are displayed as sin<sup>-1</sup>(x) etc.</td> </tr> ! <tr> <td> <b>Hyperbolic </b> </td> <td><tt>sinh(x), cosh(x), tanh(x)</tt></td></tr> ! <tr> <td> <b>Logarithms </b> </td> <td><tt>log(x), exp(x)</tt> </td> <td> Natural logarithms, and exponential function.</td></tr> ! <tr> <td> <b> </b> </td> <td><tt>ln(x)</tt> </td> <td> Natural logarithm.</td></tr> ! <tr> <td> <b> </b> </td> <td><tt>sqrt(x)</tt> </td> <td> Square root.</td></tr> </table> *************** *** 103,110 **** <?php disp_cas('algebra') ?> - <h2>Calculus</h2> - - <?php disp_cas('calculus') ?> - <h2>Random numbers</h2> --- 109,112 ---- *************** *** 146,147 **** --- 148,153 ---- <a href='maximadocs/maxdoc/maxima_38.html#IDX948'>MAKELIST</a> command <pre>@(p(k):=x^k,pl:makelist(p(k),k,1,5),plot(pl,[x,-1,1]))@</pre> + + <h2>Calculus and Analysis</h2> + + <?php disp_cas('calculus') ?> Index: author_potresp.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_potresp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** author_potresp.php 14 Jul 2005 18:05:05 -0000 1.2 --- author_potresp.php 7 Oct 2005 06:26:38 -0000 1.3 *************** *** 33,39 **** The student's answer is assigned to variable named as Student's answer key. ! This variable name can appear in the list of Feedback variables, together with ! the question variables. Hence, quite sophisticated ! processing is possible before any of the answer tests are applied in the potential response tree itself.</p> --- 33,39 ---- The student's answer is assigned to variable named as Student's answer key. ! This variable can be used in the list of Feedback variables and using it together with ! the question variables allows quite sophisticated ! processing before any of the answer tests are applied in the potential response tree itself.</p> Index: author_gettingstarted.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/author_gettingstarted.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** author_gettingstarted.php 12 Sep 2005 08:07:47 -0000 1.6 --- author_gettingstarted.php 7 Oct 2005 06:26:38 -0000 1.7 *************** *** 15,20 **** include_once("{$stack_root}/scripts/maxima/maximafun.php"); - - ?> --- 15,18 ---- *************** *** 93,96 **** --- 91,99 ---- <p>The following things to remember about <tt>castext</tt>: <ul> + <li>Anything enclosed beteeen $ symbols is treated as an <em>inline equation</em>, as is the + case with normal LaTeX.</li> + <li>Anything enclosed beteeen $$ symbols, or matching \[ and \] is treated as a + <em>displayed equation</em>, in the centre of a new line. Again, this is the + case with LaTeX.</li> <li>Anything enclosed between @ symbols is evaluated by the CAS, and displayed using the display option as an inline equation. This is analogous to using LaTeX's $'s. *************** *** 101,104 **** --- 104,109 ---- <li> Anything between <tt><html> stuff </html></tt> structures is kept as HTML, and not interpreted as LaTeX. This enables URL's to be included in the text, as well as external images etc. </li> + <li> A specific key between <tt><hint> key </hint></tt> will allow access to the facts + and formula sheet. See <a href="documentation.php?action=author_factsformula&expand=20">here</a> for more details. </li> </ul></p> *************** *** 395,400 **** ?> - - <p>Simple assignments are of the form <tt>key = value</tt>, for example, --- 400,403 ---- *************** *** 406,409 **** --- 409,428 ---- <pre>p = expand( (x-3)*(x-4) )</pre></p> + <p>Another common task is that of <em>substitution</em>. This can be performed with + Maxima's <?php + $url = $maxima_cmd['SUBST']['urls'][0]; + echo " <a href='maximadocs/maxdoc/$url'>SUBST</a>"; + ?> + command. This is quite useful, for example if we define <tt>p</tt> as follows, + in the <?php stack_doc_dispstackqfield('questionAnsVarsRaw'); ?> + then we can use this in reqponse processing to determine if the student's answer is odd. + <pre>p = ans1 + subst(-x,x,ans1)</pre></p> + All sorts of properties can be checked for in this way. For example, interpolates. Another + example is a stationary point of <tt>f(x)</tt> at <tt>x=a</tt>, which can be checked for using + <pre>p = subst(a,x,diff(ans1,x))</pre></p> + Here we have assumed <tt>a</tt> is some point given to the student, <tt>ans1</tt> is + the <?php stack_doc_dispstackqfield('questionAnsKey'); ?> and that <tt>p</tt> + will be used in the response processing tree. + <p>You can use Maxima's looping structures within Question variables, although the syntax requires this to be of the form *************** *** 450,452 **** --- 469,472 ---- $url = $stack_web_url."maximadocs/maxdoc/maxima_39.html#SEC120"; echo " <a href='$url'>functions</a>.</p> "; + ?> Index: student_factsformula.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/lang/en/doc/student_factsformula.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** student_factsformula.php 29 Jul 2005 15:59:31 -0000 1.4 --- student_factsformula.php 7 Oct 2005 06:26:38 -0000 1.5 *************** *** 13,50 **** */ ! $stackFact['calc_product_rule']['name'] = 'The Product Rule'; ! $stackFact['calc_product_rule']['fact'] = 'The following rule allows one to differentiate functions built up ! by compositions. Let us assume that we have some function which we ! can choose to write as a composition $g(f(x))$. Let $u=f(x)$, then ! $$ ! \frac{\mathrm{d}}{\mathrm{d}{x}} (g(f(x)) = \left(\frac{\mathrm{d}}{\mathrm{d}{x}} f(x)\right)\left(\frac{\mathrm{d}}{\mathrm{d}{u}} g(u)\right), ! $$ or, using alternative notation, $$ (g(f(x)))\' = f\'(x)g\'(f(x)). $$'; ! ! $stackFact['calc_quotient_rule']['name'] = 'The quotient rule'; ! $stackFact['calc_quotient_rule']['fact'] = 'The quotient rule for differentiation states that for any two differentiable functions $f(x)$ and $g(x)$, ! \[\frac{d}{dx}\left(\frac{f}{g}\right)=\frac{\frac{df}{dx}\cdot g - f\cdot \frac{dg}{dx}}{g^2}. \]'; ! ! // . concatinates (joins) strings together. ! //$stackFact['calc_rules']['name'] = 'Rules of Differentiation'; ! //$stackFact['calc_rules']['fact'] = $stackFact['calc_product_rule']['fact'].$stackFact['calc_quotient_rule']['fact'] ! //.$stackFact['calc_chain_rule']['fact'].$stackFact[calc_diff_linearity_rule']['fact'].$stackFact['calc_diff_standard_derivatives']['fact']; ! ! $stackFact['calc_rules']['name'] = 'Calculus rules'; ! $stackFact['calc_rules']['fact'] = $stackFact['calc_product_rule']['fact'].'Another rule'.$stackFact['calc_quotient_rule']['fact']; ! ! ! //show_array($stackFact); ! $stackFact['calc_chain_rule']['name'] = 'The Chain Rule'; ! $stackFact['calc_chain_rule']['fact'] = 'The following rule allows one to find the derivative of a composition of two functions. ! Assume we have a function $f(x) = g(h(x))$, then the derivative of $f(x)$, $f\'(x)$, is given by: ! $$f\'(x) = \frac{df(x)}{dx} = f\'(g(x))\cdot g\'(x).$$ ! Alternatively, we can write: ! $$\frac{df(g(x))}{dx} = \frac{df(g(x))}{dg}\cdot\frac{dg}{dx}.$$'; $stackFact['alg_quadratic_formula']['name'] = 'The Quadratic Formula'; $stackFact['alg_quadratic_formula']['fact'] = 'If we have a quadratic equation of the form: $$ax^2 + bx + c = 0,$$ ! then the solution to that equation given by the quadratic formula is: $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.$$'; --- 13,65 ---- */ ! $stackFact['greek_alphabet']['name'] = 'The Greek Alphabet'; ! $stackFact['greek_alphabet']['fact'] = ' ! \begin{tabular}{ccl} ! Upper case, $\quad$& lower case, $\quad$& name \\\\ ! $A$ & $\alpha$ & alpha \\\\ ! $B$ & $\beta$ & beta \\\\ ! $\Gamma$ & $\gamma$ & gamma \\\\ ! $\Delta$ & $\delta$ & delta \\\\ ! $E$ & $\epsilon$ & epsilon \\\\ ! $Z$ & $\zeta$ & zeta \\\\ ! $H$ & $\eta$ & eta \\\\ ! $\Theta$ & $\theta$ & theta \\\\ ! $K$ & $\kappa$ & kappa \\\\ ! $M$ & $\mu$ & mu \\\\ ! $N$ & $\nu$ & nu \\\\ ! $\Xi$ & $\xi$ & xi \\\\ ! $O$ & $o$ & omicron \\\\ ! $\Pi$ & $\pi$ & pi \\\\ ! $I$ & $\iota$ & iota \\\\ ! $P$ & $\rho$& rho \\\\ ! $\Sigma$ & $\sigma$ & sigma \\\\ ! $\Lambda$ & $\lambda$ & lambda \\\\ ! $T$ & $\tau$ & tau \\\\ ! $\Upsilon$ & $\upsilon$ & upsilon \\\\ ! $\Phi$ & $\phi$ & phi \\\\ ! $X$ & $\chi$ & chi \\\\ ! $\Psi$ & $\psi$ &psi \\\\ ! $\Omega$ & $\omega$ & omega ! \end{tabular}'; ! $stackFact['alg_inequalities']['name'] = 'Inequalities'; ! $stackFact['alg_inequalities']['fact'] = '$$ ! a>b \hbox{ means } a \hbox{ is greater than } b ! $$ ! \vskip-0.2in ! $$ ! a<b \hbox{ means } a \hbox{ is less than } b ! $$ ! $$ ! a\geq b \hbox{ means } a \hbox{ is greater than or equal to } b ! $$ ! $$ ! a\leq b \hbox{ means } a \hbox{ is less than or equal to } b ! $$'; $stackFact['alg_quadratic_formula']['name'] = 'The Quadratic Formula'; $stackFact['alg_quadratic_formula']['fact'] = 'If we have a quadratic equation of the form: $$ax^2 + bx + c = 0,$$ ! then the solution(s) to that equation given by the quadratic formula are: $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.$$'; *************** *** 57,259 **** $$a^{-m} = \frac{1}{a^m}$$ $$a^{\frac{1}{n}} = \sqrt[n]{a}$$ ! $$a^{\frac{m}{n}} = (\sqrt[n]{a})^m$$'; $stackFact['alg_logarithms']['name'] = 'The Laws of Logarithms'; $stackFact['alg_logarithms']['fact'] = 'For any positive base $b$ (with $b \neq 1$): ! $$\log_bA = c \mbox{ means } A = b^c$$ ! $$\log_bA + \log_bB = \log_bAB$$ ! $$\log_bA - \log_bB = \log_b\frac{A}{B}$$ ! $$n\log_bA = \log_bA^n$$ ! $$\log_b1 = 0$$ ! $$\log_bb = 1$$ The formula for a change of base is: ! $$\log_ax = \frac{\log_bx}{\log_ba}$$ Logarithms to base $e$, denoted $\log_e$ or alternatively $\ln$ are called natural logarithms. The letter $e$ represents the exponential constant which is approximately 2.718.'; - $stackFact['alg_inequalities']['name'] = 'Inequalities'; - $stackFact['alg_inequalities']['fact'] = '$$ - a>b \hbox{ means } a \hbox{ is greater than } b - $$ - \vskip-0.2in - $$ - a<b \hbox{ means } a \hbox{ is less than } b - $$ - $$ - a\geq b \hbox{ means } a \hbox{ is greater than or equal to } b - $$ - $$ - a\leq b \hbox{ means } a \hbox{ is less than or equal to } b - $$'; $stackFact['alg_partial_fractions']['name'] = 'Partial Fractions'; ! $stackFact['alg_partial_fractions']['fact'] = '\noindent For {\sl proper fractions} ${P(x)\over Q(x)}$ ! where $P$ and $Q$ are polynomials with the degree of $P$ less than the degree of $Q$: \smallbreak \noindent a {\sl linear factor} $ax+b$ in the denominator ! produces a partial fraction of the form ${A\over ax+b}$ \smallbreak \noindent {\sl repeated linear factors} $(ax+b)^2$ in the denominator ! produce partial fractions of the form ${A\over ax+b}+{B\over (ax+b)^2}$ \smallbreak \noindent a {\sl quadratic factor} $ax^2+bx+c$ in the denominator produces a partial fraction of ! the form ${Ax+B\over ax^2+bx+c}$ \smallbreak \noindent{\sl Improper fractions} require an additional term which is a polynomial of degree $n-d$ where $n$ is ! the degree of the numerator and $d$ is the degree of ! the denominator.'; ! $stackFact['hyp_functions']['name'] = 'Hyperbolic Functions'; ! $stackFact['hyp_functions']['fact'] = 'Hyperbolic functions have similar properties to trigonometric functions but can be represented in exponential form as follows:$$ ! \cosh x={{\rm e}^x+{\rm e}^{-x}\over 2}, ! \qquad \sinh x={{\rm e}^x-{\rm e}^{-x}\over 2} ! $$ ! $$ ! \tanh x= {\sinh x\over \cosh x}={{\rm e}^x-{\rm e}^{-x} ! \over {\rm e}^x+{\rm e}^{-x}} $$ $$ ! {\rm sech\,}x={1\over \cosh x}={2\over {\rm e}^x+{\rm e}^{-x}} $$ $$ ! {\rm cosech\,} x= {1\over \sinh x}={2\over {\rm e}^x-{\rm e}^{-x}} $$ $$ ! {\rm coth\,}x ={\cosh x\over \sinh x}= ! {1\over {\rm tanh\,} x} ={{\rm e}^x+{\rm e}^{-x} ! \over {\rm e}^x-{\rm e}^{-x}} $$'; ! $stackFact['hyp_identities']['name'] = 'Hyperbolic Identities'; ! $stackFact['hyp_identities']['fact'] = 'The similarity between the way hyperbolic and trigonometric functions behave is apparent when observing some basic hyperbolic identities: ! \noindent ${\rm e}^x=\cosh x+\sinh x, \quad {\rm e}^{-x}=\cosh x-\sinh x$ ! \noindent $\cosh^2x -\sinh^2x =1$ ! \noindent $1-{\rm tanh}^2x={\rm sech}^2 x$ ! \noindent ${\rm coth}^2 x-1={\rm cosech}^2x$ - \noindent $\sinh(x\pm y)=\sinh x\cosh y\pm \cosh x\sinh y$ ! \noindent $\cosh(x\pm y)=\cosh x\cosh y\pm \sinh x\sinh y$ ! \noindent $\sinh 2x=2\sinh x\cosh x$ - \noindent $\cosh 2x=\cosh^2x+\sinh^2x$ - \noindent $\cosh^2x={\cosh 2x+1\over 2}$ - \vskip0.07in - \noindent $\sinh^2x={\cosh 2x-1\over 2}$'; ! $stackFact['hyp_inverse_functions']['name'] = 'Inverse Hyperbolic Functions'; ! $stackFact['hyp_inverse_functions']['fact'] = '\noindent $\cosh^{-1}x=\ln(x+\sqrt{x^2-1})$\quad for $x\geq 1$ ! \noindent $\sinh^{-1}x=\ln(x+\sqrt{x^2+1})$ ! \noindent ${\rm tanh}^{-1}x = {1\over 2}\ln\left({1+x\over ! 1-x}\right)$ \quad for $-1<x<1$'; ! $stackFact['greek_alphabet']['name'] = 'The Greek Alphabet'; ! $stackFact['greek_alphabet']['fact'] = '\noindent\begin{tabular}{cclcclccl} \hline ! &&&&&&&&\\[-8pt] ! $A$ & $\alpha$& alpha & $I$ & $\iota$& iota & $P$ & $\rho$& rho \\ ! $B$ &$\beta$ & beta & $K$ & $\kappa$ & kappa & $\Sigma$ & $\sigma$ & sigma \\ ! $\Gamma$ & $\gamma$ & gamma & $\Lambda$ & $\lambda$ & lambda & $T$ ! & ! $\tau$ & tau \\ ! $\Delta$ & $\delta$ & delta & $M$ & $\mu$ & mu & $\Upsilon$ & ! $\upsilon$ ! & upsilon \\ ! $E$ & $\epsilon$ & epsilon & $N$ & $\nu$ & nu & $\Phi$ & $\phi$ & ! phi \\ ! $Z$ & $\zeta$ & zeta & $\Xi$ & $\xi$ & xi & $X$ & $\chi$ & chi \\ ! $H$ & $\eta$ & eta & $O$ & $o$ & omicron & $\Psi$ & $\psi$ ! &psi \\ ! $\Theta$ & $\theta$ & theta & $\Pi$ & $\pi$ & pi & $\Omega$ & $\omega$ & omega\\ ! \hline ! \end{tabular}'; ! $stackFact['calc_diff_standard_derivatives']['name'] = 'Standard Derivatives'; ! $stackFact['calc_diff_standard_derivatives']['fact'] = 'The following table displays the derivatives of some standard functions. It is useful to learn these standard derivatives as they are used frequently in calculus. ! $y=f(x)$ $${{\rm d}y\over {\rm d}x}=f\'(x)$$\\ ! $k$, constant 0 \\ ! $x^n$, any constant $n$ $$nx^{n-1}$$\\ ! $e^x$ $e^x$\\ ! $\ln x=\log_{\rm e}x$ $$\frac{1}{x}$$\\ ! $\sin x$ $\cos x$\\ ! $\cos x$ $-\sin x$\\ ! $\tan x = {\sin x\over \cos x}$ $\sec^2 x$\\ ! cosec$\,x={1\over \sin x}$ $-$cosec$\, x\,$cot $x$\\ ! $\sec x={1\over \cos x}$ $\sec x\tan x$\\ ! cot$\, x={\cos x\over \sin x}$ $-$cosec$^2x$\\ ! $\sin^{-1}x$ ${1\over \sqrt{1-x^2}}$\\ ! $\cos^{-1}x$ ${-1\over \sqrt{1-x^2}}$\\ ! $\tan^{-1}x$ ${1\over 1+x^2}$\\ ! $\cosh x$ $\sinh x$\\ ! $\sinh x$ $\cosh x$\\ ! $\tanh x$ sech$^2x$\\ ! sech$\,x$ $-$sech$\,x\tanh x$\\ ! cosech$\,x$ $-$cosech\,$x$\,coth\,$x$\\ ! coth$\,x$ $-$cosech$^2x$\\ ! $\cosh^{-1}x$ ${1\over \sqrt{x^2-1}}$\\ ! $\sinh^{-1}x$ ${1\over \sqrt{x^2+1}}$\\ ! $\tanh^{-1}x$ ${1\over 1-x^2}$\\ ! \hline '; ! $stackFact['calc_diff_linearity_rule']['name'] = 'The Linearity Rule for Differentiation'; ! $stackFact['calc_diff_linearity_rule']['fact'] = '$$ ! {{\rm d}\,\over {\rm d}x}(au+bv)=a{{\rm d}u\over {\rm d}x} ! +b{{\rm d}v\over {\rm d}x}\quad a,b {\rm\ constant} ! $$'; $stackFact['calc_int_standard_integrals']['name'] = 'Standard Integrals'; ! $stackFact['calc_int_standard_integrals']['fact'] = '\begin{table}[h] ! \begin{tabular}{lll}\hline ! &\\[-8pt] ! $f(x)$ & $\int f(x)\,{\rm d}x=F(x)+c$&\\[4pt] ! \hline ! $k$, constant &$kx +c$&\\ ! $x^n$, ($n\ne -1)$ & ${x^{n+1}\over n+1}+c$& ! \\ ! $x^{-1}={\frac{1}{x}}$ & $\left\{\matrix{\ln x+c & x>0\cr ! \ln(-x)+c & x<0\cr}\right.$&\\ ! e$^x$& e$^x+c$&\\ ! $\cos x$ & $\sin x+c$ &\\ ! $\sin x$ & $-\cos x+c$ &\\ ! $\tan x$ & $\ln(\sec x)+c$ & $ ! -{\pi\over 2}<x<{\pi\over 2}$\\ ! $\sec x$ & $\ln (\sec x+\tan x)+c$ & $ ! -{\pi\over 2}<x<{\pi\over 2}$\\ ! cosec$\, x$ & $\ln ($cosec$\,x-$cot$\,x)+c$ & ! \,\,\,\, $0<x<\pi$\\ ! cot$\,x$ & $\ln(\sin x)+c$ & \,\,\,\, $0<x<\pi$\\ ! $\cosh x$ & $\sinh x+c$& ! \\ ! $\sinh x$ & $\cosh x + c$ &\\ ! $\tanh x$ & $\ln \cosh x+c$&\\ ! coth$\,x$ & $\ln \sinh x+c $& $x>0$\\ ! ${1\over x^2+a^2}$ & ${1\over a}\tan^{-1}{x\over a}+c$&$a>0$\\[2pt] ${1\over x^2-a^2}$ & ${1\over 2a}\ln{x-a\over x+a}+c$ ! & $|x|>a>0$\\[2pt] ! ${1\over a^2-x^2}$ & ${1\over 2a}\ln{a+x\over a-x}+c$ & $|x|<a$\\[3pt] ! ${1\over \sqrt{x^2+a^2}}$ & $\sinh^{-1}{x\over a} + c$ &$a>0$ \\ ! ${1\over \sqrt{x^2-a^2}}$ & $\cosh^{-1}{x\over a} + c$ & $x\geq a>0$ \\ ! ${1\over \sqrt{x^2+k}}$ & $\ln (x+\sqrt{x^2+k})+c$&\\ ! ${1\over \sqrt{a^2-x^2}}$ & $\sin^{-1}{x\over a}+c$& $-a\leq ! x\leq a$ \\[4pt] ! \hline ! &\\[-8pt] ! $f(ax+b)$ & ${1\over a}F(ax+b) +c$ & $a\ne 0$ \\[4pt] ! e.g. $\cos(2x-3)$ & ${1\over 2}\sin(2x-3)+c$ & \\[4pt] ! \hline ! ! \end{tabular} ! \end{table}'; $stackFact['calc_int_linearity_rule']['name'] = 'The Linearity Rule for Integration'; --- 72,273 ---- $$a^{-m} = \frac{1}{a^m}$$ $$a^{\frac{1}{n}} = \sqrt[n]{a}$$ ! $$a^{\frac{m}{n}} = \left(\sqrt[n]{a}\right)^m$$'; $stackFact['alg_logarithms']['name'] = 'The Laws of Logarithms'; $stackFact['alg_logarithms']['fact'] = 'For any positive base $b$ (with $b \neq 1$): ! $$\log_b(a) = c \mbox{, means } a = b^c$$ ! $$\log_b(a) + \log_b(b) = \log_b(ab)$$ ! $$\log_b(a) - \log_b(b) = \log_b\left(\frac{a}{b}\right)$$ ! $$n\log_b(a) = \log_b\left(a^n\right)$$ ! $$\log_b(1) = 0$$ ! $$\log_b(b) = 1$$ The formula for a change of base is: ! $$\log_a(x) = \frac{\log_b(x)}{\log_b(a)}$$ Logarithms to base $e$, denoted $\log_e$ or alternatively $\ln$ are called natural logarithms. The letter $e$ represents the exponential constant which is approximately 2.718.'; $stackFact['alg_partial_fractions']['name'] = 'Partial Fractions'; ! $stackFact['alg_partial_fractions']['fact'] = '\noindent {\sl Proper fractions} occur with $${\frac{P(x)}{Q(x)}}$$ ! when $P$ and $Q$ are polynomials with the degree of $P$ less than the degree of $Q$. This this case, we proceed ! as follows: write $Q(x)$ in factored form, \smallbreak \noindent a {\sl linear factor} $ax+b$ in the denominator ! produces a partial fraction of the form $${A\over ax+b}$$ \smallbreak \noindent {\sl repeated linear factors} $(ax+b)^2$ in the denominator ! produce partial fractions of the form $${A\over ax+b}+{B\over (ax+b)^2}$$ \smallbreak \noindent a {\sl quadratic factor} $ax^2+bx+c$ in the denominator produces a partial fraction of ! the form $${Ax+B\over ax^2+bx+c}$$ \smallbreak \noindent{\sl Improper fractions} require an additional term which is a polynomial of degree $n-d$ where $n$ is ! the degree of the numerator (ie $P(x)$) and $d$ is the degree of ! the denominator (ie $Q(x)$).'; ! $stackFact['trig_degrees_radians']['name'] = 'Degrees and Radians'; ! $stackFact['trig_degrees_radians']['fact'] = '$$ ! 360^\circ= 2\pi \hbox{ radians},\quad ! 1^\circ={2\pi\over 360}={\pi\over 180}\hbox{ radians} $$ $$ ! 1 \hbox{ radian} = {180\over \pi} \hbox{ degrees} ! \approx 57.3^\circ ! $$'; ! ! $stackFact['trig_standard_values']['name'] = 'Standard Trigonometric Values'; ! $stackFact['trig_standard_values']['fact'] = ' ! $$\sin(45^\circ)={1\over \sqrt{2}}, \qquad \cos(45^\circ) = {1\over \sqrt{2}},\qquad ! \tan( 45^\circ)=1 $$ $$ ! \sin (30^\circ)={1\over 2}, \qquad \cos (30^\circ)={\sqrt{3}\over 2},\qquad ! \tan (30^\circ)={1\over \sqrt{3}} $$ $$ ! \sin (60^\circ)={\sqrt{3}\over 2}, \qquad \cos (60^\circ)={1\over 2},\qquad ! \tan (60^\circ)={ \sqrt{3}} $$'; ! $stackFact['trig_standard_identities']['name'] = 'Standard Trigonometric Identities'; ! $stackFact['trig_standard_identities']['fact'] = '$$\sin(a\pm b)\ = \ \sin(a)\cos(b)\ \pm\ \cos(a)\sin(b)$$ ! $$\cos(a\ \pm\ b)\ = \ \cos(a)\cos(b)\ \mp \\sin(a)\sin(b)$$ ! $$\tan (a\ \pm\ b)\ = \ {\tan (a)\ \pm\ \tan (b)\over1\ \mp\ \tan (a)\tan (b)}$$ ! $$ 2\sin(a)\cos(b)\ = \ \sin(a+b)\ +\ \sin(a-b)$$ ! $$ 2\cos(a)\cos(b)\ = \ \cos(a-b)\ +\ \cos(a+b)$$ ! $$ 2\sin(a)\sin(b) \ = \ \cos(a-b)\ -\ \cos(a+b)$$ ! $$ \sin^2(a)+\cos^2(a)\ = \ 1$$ ! $$ 1+{\rm cot}^2(a)\ = \ {\rm cosec}^2(a),\quad \tan^2(a) +1 \ = \ \sec^2(a)$$ ! $$ \cos(2a)\ = \ \cos^2(a)-\sin^2(a)\ = \ 2\cos^2(a)-1\ = \ 1-2\sin^2(a)$$ ! $$ \sin(2a)\ = \ 2\sin(a)\cos(a)$$ ! $$ \sin^2(a) \ = \ {1-\cos (2a)\over 2}, \qquad \cos^2(a)\ = \ {1+\cos(2a)\over 2}$$'; ! $stackFact['hyp_functions']['name'] = 'Hyperbolic Functions'; ! $stackFact['hyp_functions']['fact'] = 'Hyperbolic functions have similar properties to trigonometric functions but can be represented in exponential form as follows: ! $$ \cosh(x) = \frac{e^x+e^{-x}}{2}, \qquad \sinh(x)=\frac{e^x-e^{-x}}{2} $$ ! $$ \tanh(x) = \frac{\sinh(x)}{\cosh(x)} = \frac{{e^x-e^{-x}}}{e^x+e^{-x}} $$ ! $$ {\rm sech}(x) ={1\over \cosh(x)}={2\over {\rm e}^x+{\rm e}^{-x}}, \qquad {\rm cosech}(x)= {1\over \sinh(x)}={2\over {\rm e}^x-{\rm e}^{-x}} $$ ! $$ {\rm coth}(x) ={\cosh(x)\over \sinh(x)} = {1\over {\rm tanh}(x)} ={{\rm e}^x+{\rm e}^{-x}\over {\rm e}^x-{\rm e}^{-x}}$$'; ! $stackFact['hyp_identities']['name'] = 'Hyperbolic Identities'; ! $stackFact['hyp_identities']['fact'] = 'The similarity between the way hyperbolic and trigonometric functions behave is apparent when observing some basic hyperbolic identities: ! $${\rm e}^x=\cosh(x)+\sinh(x), \quad {\rm e}^{-x}=\cosh(x)-\sinh(x)$$ ! $$\cosh^2(x) -\sinh^2(x) = 1$$ ! $$1-{\rm tanh}^2(x)={\rm sech}^2(x)$$ ! $${\rm coth}^2(x)-1={\rm cosech}^2(x)$$ ! $$\sinh(x\pm y)=\sinh(x)\ \cosh(y)\ \pm\ \cosh(x)\ \sinh(y)$$ ! $$\cosh(x\pm y)=\cosh(x)\ \cosh(y)\ \pm\ \sinh(x)\ \sinh(y)$$ ! $$\sinh(2x)=2\,\sinh(x)\cosh(x)$$ ! $$\cosh(2x)=\cosh^2(x)+\sinh^2(x)$$ ! $$\cosh^2(x)={\cosh(2x)+1\over 2}$$ ! $$\sinh^2(x)={\cosh(2x)-1\over 2}$$'; ! $stackFact['hyp_inverse_functions']['name'] = 'Inverse Hyperbolic Functions'; ! $stackFact['hyp_inverse_functions']['fact'] = '$$\cosh^{-1}(x)=\ln\left(x+\sqrt{x^2-1}\right) \quad \mbox{ for } x\geq 1$$ ! $$\sinh^{-1}(x)=\ln\left(x+\sqrt{x^2+1}\right)$$ ! $${\rm tanh}^{-1}(x) = {1\over 2}\ln\left({1+x\over 1-x}\right) \quad \mbox{ for } -1<x<1$$'; ! $stackFact['calc_diff_standard_derivatives']['name'] = 'Standard Derivatives'; ! $stackFact['calc_diff_standard_derivatives']['fact'] = 'The following table displays the derivatives of some standard functions. It is useful to learn these standard derivatives as they are used frequently in calculus. ! \begin{tabular}{ll} ! {\large\bf $f(x)$} & {\large\bf $f\'(x)$}\\\\ ! $k$, constant & $0$ \\\\ ! $x^n$, any constant $n$ & $nx^{n-1}$\\\\ ! $e^x$ & $e^x$\\\\ ! $\ln(x)=\log_{\rm e}(x)$ & $\frac{1}{x}$ \\\\ ! $\sin(x)$ & $\cos(x)$ \\\\ ! $\cos(x)$ & $-\sin(x)$ \\\\ ! $\tan(x) = \frac{\sin(x)}{\cos(x)}$ & $\sec^2(x)$ \\\\ ! $cosec(x)=\frac{1}{\sin(x)}$ & $-cosec(x)\cot(x)$ \\\\ ! $\sec(x)=\frac{1}{\cos(x)}$ & $\sec(x)\tan(x)$ \\\\ ! $\cot(x)=\frac{\cos(x)}{\sin(x)}$ & $-cosec^2(x)$ \\\\ ! $\cosh(x)$ & $\sinh(x)$ \\\\ ! $\sinh(x)$ & $\cosh(x)$ \\\\ ! $\tanh(x)$ & $sech^2(x)$ \\\\ ! $sech(x)$ & $-sech(x)\tanh(x)$ \\\\ ! $cosech(x)$ & $-cosech(x)\coth(x)$ \\\\ ! $coth(x)$ & $-cosech^2(x)$ \\\\ ! \end{tabular} ! $$ \frac{d}{dx}\left(\sin^{-1}(x)\right) = \frac{1}{\sqrt{1-x^2}}$$ ! $$ \frac{d}{dx}\left(\cos^{-1}(x)\right) = \frac{-1}{\sqrt{1-x^2}}$$ ! $$ \frac{d}{dx}\left(\tan^{-1}(x)\right) = \frac{1}{1+x^2}$$ ! $$ \frac{d}{dx}\left(\cosh^{-1}(x)\right) = \frac{1}{\sqrt{x^2-1}}$$ ! $$ \frac{d}{dx}\left(\sinh^{-1}(x)\right) = \frac{1}{\sqrt{x^2+1}}$$ ! $$ \frac{d}{dx}\left(\tanh^{-1}(x)\right) = \frac{1}{1-x^2}$$ ! '; ! $stackFact['calc_diff_linearity_rule']['name'] = 'The Linearity Rule for Differentiation'; ! $stackFact['calc_diff_linearity_rule']['fact'] = '$$ ! {{\rm d}\,\over {\rm d}x}\big(af(x)+bg(x)\big)=a{{\rm d}f(x)\over {\rm d}x} ! +b{{\rm d}g(x)\over {\rm d}x}\quad a,b {\rm\ constant} ! $$'; ! $stackFact['calc_product_rule']['name'] = 'The Product Rule'; ! $stackFact['calc_product_rule']['fact'] = 'The following rule allows one to differentiate functions which are ! multiplied together. Assume that we wish to differentiate $f(x)g(x)$ with respect to $x$. ! $$ \frac{\mathrm{d}}{\mathrm{d}{x}} \big(f(x)g(x)\big) = f(x) \cdot \frac{\mathrm{d} g(x)}{\mathrm{d}{x}} + g(x)\cdot \frac{\mathrm{d} f(x)}{\mathrm{d}{x}},$$ or, using alternative notation, $$ (f(x)g(x))\' = f\'(x)g(x)+f(x)g\'(x). $$'; ! $stackFact['calc_quotient_rule']['name'] = 'The Quotient Rule'; ! $stackFact['calc_quotient_rule']['fact'] = 'The quotient rule for differentiation states that for any two differentiable functions $f(x)$ and $g(x)$, ! \[\frac{d}{dx}\left(\frac{f(x)}{g(x)}\right)=\frac{g(x)\cdot\frac{df(x)}{dx}\ \ - \ \ f(x)\cdot \frac{dg(x)}{dx}}{g(x)^2}. \]'; ! //show_array($stackFact); ! $stackFact['calc_chain_rule']['name'] = 'The Chain Rule'; ! $stackFact['calc_chain_rule']['fact'] = 'The following rule allows one to find the derivative of a composition of two functions. ! Assume we have a function $f(g(x))$, then defining $u=g(x)$, the derivative with respect to $x$ is given by: ! $$\frac{df(g(x))}{dx} = \frac{dg(x)}{dx}\cdot\frac{df(u)}{du}.$$ ! Alternatively, we can write: ! $$\frac{df(x)}{dx} = f\'(g(x))\cdot g\'(x).$$ '; ! $stackFact['calc_rules']['name'] = 'Calculus rules'; ! $stackFact['calc_rules']['fact'] = '{\bf '.$stackFact['calc_product_rule']['name'].'}\par '.$stackFact['calc_product_rule']['fact']; ! $stackFact['calc_rules']['fact'] .= '{\bf '.$stackFact['calc_quotient_rule']['name'].'}\par '.$stackFact['calc_quotient_rule']['fact']; ! $stackFact['calc_rules']['fact'] .= '{\bf '.$stackFact['calc_chain_rule']['name'].'}\par '.$stackFact['calc_chain_rule']['fact']; $stackFact['calc_int_standard_integrals']['name'] = 'Standard Integrals'; ! $stackFact['calc_int_standard_integrals']['fact'] = ' ! ! $$\int k\ dx = kx +c, \mbox{ where k is constant.}$$ ! $$\int x^n\ dx = \frac{x^{n+1}}{n+1}+c, \quad (n\ne -1)$$ ! $$\int x^{-1}\ dx = \int {\frac{1}{x}}\ dx = \left\{\matrix{\ln(x)+c & x>0\cr ! \ln(-x)+c & x<0\cr}\right.$$ ! ! \begin{tabular}{lll} ! {\large\bf $f(x)$} & {\large\bf $\int f(x)\ dx$}\\\\ ! e$^x$& e$^x+c$&\\\\ ! $\cos(x)$ & $\sin(x)+c$ &\\\\ ! $\sin(x)$ & $-\cos(x)+c$ &\\\\ ! $\tan(x)$ & $\ln(\sec(x))+c$ & $ ! -{\pi\over 2}<x<{\pi\over 2}$\\\\ ! $\sec x$ & $\ln (\sec(x)+\tan(x))+c$ & $ ! -{\pi\over 2}<x<{\pi\over 2}$\\\\ ! cosec$\, x$ & $\ln ($cosec$(x)-\cot(x))+c$ & ! \,\,\,\, $0<x<\pi$\\\\ ! cot$\,x$ & $\ln(\sin(x))+c$ & \,\,\,\, $0<x<\pi$\\\\ ! $\cosh(x)$ & $\sinh(x)+c$& ! \\\\ ! $\sinh(x)$ & $\cosh(x) + c$ &\\\\ ! $\tanh(x)$ & $\ln(\cosh(x))+c$&\\\\ ! coth$(x)$ & $\ln(\sinh(x))+c $& $x>0$\\\\ ! ${1\over x^2+a^2}$ & ${1\over a}\tan^{-1}{x\over a}+c$&$a>0$\\\\[2pt] ${1\over x^2-a^2}$ & ${1\over 2a}\ln{x-a\over x+a}+c$ ! & $|x|>a>0$\\\\[2pt] ! ${1\over a^2-x^2}$ & ${1\over 2a}\ln{a+x\over a-x}+c$ & $|x|<a$\\\\[3pt] ! ${1\over \sqrt{x^2+a^2}}$ & $\sinh^{-1}\left(\frac{x}{a}\right) + c$ &$a>0$ \\\\ ! ${1\over \sqrt{x^2-a^2}}$ & $\cosh^{-1}\left(\frac{x}{a}\right) + c$ & $x\geq a>0$ \\\\ ! ${1\over \sqrt{x^2+k}}$ & $\ln (x+\sqrt{x^2+k})+c$&\\\\ ! ${1\over \sqrt{a^2-x^2}}$ & $\sin^{-1}\left(\frac{x}{a}\right)+c$& $-a\leq ! x\leq a$ \\\\ ! \end{tabular}'; $stackFact['calc_int_linearity_rule']['name'] = 'The Linearity Rule for Integration'; *************** *** 278,355 **** d}x}\left\{\int g(x){\rm d}x\right\}{\rm d}x $$'; - $stackFact['trig_degrees_radians']['name'] = 'Degrees and Radians'; - $stackFact['trig_degrees_radians']['fact'] = '$$ - 360^\circ= 2\pi \hbox{ radians},\quad - 1^\circ={2\pi\over 360}={\pi\over 180}\hbox{ radians} - $$ - $$ - 1 \hbox{ radian} = {180\over \pi} \hbox{ degrees} - \approx 57.3^\circ - $$'; - - $stackFact['trig_standard_values']['name'] = 'Standard Trigonometric Values'; - $stackFact['trig_standard_values']['fact'] = '$$ - \sin 45^\circ={1\over \sqrt{2}}, \qquad \cos 45^\circ = {1\over \sqrt{2}},\qquad - \tan 45^\circ=1 - $$ - $$ - \sin 30^\circ={1\over 2}, \qquad \cos 30^\circ={\sqrt{3}\over 2},\qquad - \tan 30^\circ={1\over \sqrt{3}} - $$ - $$ - \sin 60^\circ={\sqrt{3}\over 2}, \qquad \cos 60^\circ={1\over 2},\qquad - \tan 60^\circ={ \sqrt{3}} - $$'; - - $stackFact['trig_standard_identities']['name'] = 'Standard Trigonometric Identities'; - $stackFact['trig_standard_identities']['fact'] = '\noindent $\sin(A\pm B)=\sin A\cos B\pm \cos A\sin B$ - \smallbreak - \noindent $\cos(A\pm B)=\cos A\cos B\mp\sin A\sin B - $ - \smallbreak - \noindent $\tan (A\pm B)={\tan A\pm \tan B\over - 1\mp \tan A\tan B} - $ - \vskip0.05in - \noindent $2\sin A\cos B=\sin(A+B)+\sin(A-B)$ - \smallbreak - \noindent $2\cos A\cos B=\cos(A-B)+\cos(A+B)$ - \smallbreak - \noindent $2\sin A\sin B =\cos(A-B)-\cos(A+B)$ - \smallbreak - \noindent $\sin^2 A+\cos^2 A=1$ - \smallbreak - \noindent $1+{\rm cot}^2 A={\rm cosec}^2 A,\quad - \tan^2 A +1 = \sec^2A$ - \smallbreak - \noindent $\cos 2A=\cos^2A-\sin^2A=2\cos^2A-1=1-2\sin^2A$ - \smallbreak - \noindent $\sin 2A=2\sin A\cos A$ - \smallbreak - \noindent $\sin^2A ={1-\cos 2A\over 2}, \qquad - \cos^2A={1+\cos 2A\over 2}$'; - - $stackFact['part_frac']['name'] = 'Partial Fraction Form'; - $stackFact['part_frac']['fact'] = '\noindent - Partial Fraction Form is the result of reversing the process of adding fractions. - It involves splitting a complicated rational expression into the sum of two or - more simpler ones.\smallbreak \noindent - Example: Find the partial form of - $$\frac{5x + 14}{(x+1)(x+4)}$$ - $$\frac{5x + 14}{(x+1)(x+2)} = \frac{A}{x+1} + \frac{B}{x+4}$$ - $$5X+14=A(x+4) + B(x+1)$$ - Let $$x=-4$$ - Then $$5(-4) + 14 = 0 + B(-3)$$ - $$-6 = -3B$$ - $$B=2$$ - Let $$x =-1$$ - Then $$5(-1) + 14 = A(3) + 0$$ - $$9 = 3A$$ - $$A=3$$ - Hence the partial fraction form of - $$\frac{5x + 14}{(x+1)(x+4)}$$ is - $$\frac{3}{x+1} + \frac{2}{x+4}$$.'; - - ?> --- 292,295 ---- |
From: Chris S. <san...@us...> - 2005-10-07 06:26:46
|
Update of /cvsroot/stack/stack-1-0/pics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27355/pics Modified Files: logo_sm.gif logo_sm.png Log Message: Index: logo_sm.png =================================================================== RCS file: /cvsroot/stack/stack-1-0/pics/logo_sm.png,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsxsW8dU and /tmp/cvsihpLa7 differ Index: logo_sm.gif =================================================================== RCS file: /cvsroot/stack/stack-1-0/pics/logo_sm.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsNeOqLX and /tmp/cvsA8lOKa differ |
From: Chris S. <san...@us...> - 2005-10-07 06:26:46
|
Update of /cvsroot/stack/stack-1-0/scripts/maxima In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27355/scripts/maxima Modified Files: stackfun.php stackmaxima.mac Log Message: Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackmaxima.mac,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** stackmaxima.mac 26 Sep 2005 10:15:34 -0000 1.36 --- stackmaxima.mac 7 Oct 2005 06:26:38 -0000 1.37 *************** *** 83,87 **** /* Makes a complex j if needed */ ! make_complexJ(OPT_COMPLEXJ) := if OPT_COMPLEXJ=j then (j:%i,load("complexj.lisp")) else i:%i; /* ARRGH! */ --- 83,88 ---- /* Makes a complex j if needed */ ! i:%i; ! make_complexJ(OPT_COMPLEXJ) := if OPT_COMPLEXJ=j then (j:%i,load("complexj.lisp")); /* ARRGH! */ *************** *** 381,391 **** - /* allinteger(l) returns true if all of the list are integers */ - allinteger(l) := BLOCK([ret], - ret:TRUE, - if listp(l) then for i:1 thru length(l) do (ret:ret AND integerp(l[i])) else ret:"FAIL", - RETURN(ret) )$ - - /* A general all purpose function Takes two objects and returns true if they are equal, and false otherwise --- 382,385 ---- Index: stackfun.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/maxima/stackfun.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stackfun.php 12 Jun 2005 09:13:28 -0000 1.1 --- stackfun.php 7 Oct 2005 06:26:38 -0000 1.2 *************** *** 18,21 **** --- 18,26 ---- $stack_cmd['e']['use'] = 's'; + $stack_cmd['i']['doc'] = 'As usual i<sup>2</sup>=-1. There is an option to redefine this so that j can be used instead both as input and display.'; + $stack_cmd['i']['syntax'] = 'i'; + $stack_cmd['i']['type'] = 'num'; + $stack_cmd['i']['use'] = 's'; + $stack_cmd['float']['doc'] = 'Converts <tt>n</tt> into a floating point number.'; $stack_cmd['float']['syntax'] = 'float(n)'; *************** *** 23,31 **** $stack_cmd['float']['use'] = 's'; - $stack_cmd['anyfloat']['doc'] = 'Takes a list of number <tt>l</tt> and returns TRUE if any of them are floating point numbers.'; - $stack_cmd['anyfloat']['syntax'] = 'anyfloat(l)'; - $stack_cmd['anyfloat']['type'] = 'num'; - $stack_cmd['anyfloat']['use'] = 's'; - $stack_cmd['round']['doc'] = 'An alias for Maxima\'s lisp based <tt>?round</tt> command.'; $stack_cmd['round']['syntax'] = 'round(n)'; --- 28,31 ---- *************** *** 38,41 **** --- 38,86 ---- $stack_cmd['truncate']['use'] = 's'; + $stack_cmd['decimalplaces']['doc'] = 'Rounds a floating point number x to n decimal places.'; + $stack_cmd['decimalplaces']['syntax'] = 'decimalplaces(x,n)'; + $stack_cmd['decimalplaces']['type'] = 'num'; + $stack_cmd['decimalplaces']['use'] = 's'; + + $stack_cmd['commonfaclist']['doc'] = 'Takes a list and returns the highest common factor of all the numbers.'; + $stack_cmd['commonfaclist']['syntax'] = 'commonfaclist(l)'; + $stack_cmd['commonfaclist']['type'] = 'num'; + $stack_cmd['commonfaclist']['use'] = 't'; + + $stack_cmd['anyfloat']['doc'] = 'Takes a list of number <tt>l</tt> and returns TRUE if any of them are floating point numbers.'; + $stack_cmd['anyfloat']['syntax'] = 'anyfloat(l)'; + $stack_cmd['anyfloat']['type'] = 'list'; + $stack_cmd['anyfloat']['use'] = 's'; + + $stack_cmd['all_listp']['doc'] = 'Takes a predicate <tt>p</tt> and applies to to every element of a list <tt>l</tt>. Returns TRUE if all elements are TRUE and FALSE otherwise.'; + $stack_cmd['all_listp']['syntax'] = 'all_listp(p,l)'; + $stack_cmd['all_listp']['type'] = 'list'; + $stack_cmd['all_listp']['use'] = 't'; + + $stack_cmd['any_listp']['doc'] = 'Takes a predicate <tt>p</tt> and applies to to every element of a list <tt>l</tt>. Returns TRUE if all elements are TRUE and FALSE otherwise.'; + $stack_cmd['any_listp']['syntax'] = 'any_listp(p,l)'; + $stack_cmd['any_listp']['type'] = 'list'; + $stack_cmd['any_listp']['use'] = 't'; + + $stack_cmd['equationp']['doc'] = "Expands Maxima's predicate functions. Returns TRUE if the top operation is an '=', and FALSE otherwise."; + $stack_cmd['equationp']['syntax'] = 'equationp(ex)'; + $stack_cmd['equationp']['type'] = 'algebra'; + $stack_cmd['equationp']['use'] = 't'; + + $stack_cmd['inequalityp']['doc'] = "Expands Maxima's predicate functions. Returns TRUE if the expression is an inequality, and FALSE otherwise."; + $stack_cmd['inequalityp']['syntax'] = 'inequalityp(ex)'; + $stack_cmd['inequalityp']['type'] = 'algebra'; + $stack_cmd['inequalityp']['use'] = 't'; + + $stack_cmd['anyfloatex']['doc'] = 'Takes an expression <tt>ex</tt> and returns TRUE if any of the coefficients are floating point numbers.'; + $stack_cmd['anyfloatex']['syntax'] = 'anyfloatex(ex)'; + $stack_cmd['anyfloatex']['type'] = 'algebra'; + $stack_cmd['anyfloatex']['use'] = 't'; + + $stack_cmd['deg']['doc'] = 'The algebraic degree of the expression <tt>ex</tt>'; + $stack_cmd['deg']['syntax'] = 'dex(ex)'; + $stack_cmd['deg']['type'] = 'algebra'; + $stack_cmd['deg']['use'] = 't'; + $stack_cmd['expand']['doc'] = 'Expand the algebraic expression <tt>p</tt>.'; $stack_cmd['expand']['syntax'] = 'expand(p)'; *************** *** 75,78 **** --- 120,133 ---- $stack_cmd['int']['use'] = 's'; + $stack_cmd['continuousp']['doc'] = 'This determines if an expression <tt>ex</tt> is continuous in the variable <tt>v</tt> at the point <tt>v=xp</tt>. This test relies on the <tt>limit</tt> function which Maxima supplies, and hence is not totally robust. Returns either TRUE or FALSE.'; + $stack_cmd['continuousp']['syntax'] = 'continuousp(ex,v,xp)'; + $stack_cmd['continuousp']['type'] = 'calculus'; + $stack_cmd['continuousp']['use'] = 't'; + + $stack_cmd['diffp']['doc'] = 'This determines if an expression <tt>ex</tt> is differentiable (n times) in the variable <tt>v</tt> at the point <tt>v=xp</tt>. If <tt>n</tt> is ommitted it is assumed to be 1. This test relies on the <tt>limit</tt> function which Maxima supplies, and hence is not totally robust. Returns either TRUE or FALSE.'; + $stack_cmd['diffp']['syntax'] = 'diffp(ex,v,xp,[n])'; + $stack_cmd['diffp']['type'] = 'calculus'; + $stack_cmd['diffp']['use'] = 't'; + $stack_cmd['rand']['doc'] = 'Generate a random object. See below.'; $stack_cmd['rand']['syntax'] = 'rand(x)'; |