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
|
Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/ui Modified Files: Tag: question_reporting frontend.php OptionsEdit.php authorTest.php questionBank.php selectAll.js DisplayItem.php AdminInterface.php questionExporter.php OptionsEditor.php questionReview.php AuthorDisplay.php report.php questionTest.php GhostWriter.php questionImporter.php questionDeploy.php Added Files: Tag: question_reporting report.css report.js Removed Files: Tag: question_reporting reportScripts.js reportStyle.css Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: selectAll.js =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/selectAll.js,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** selectAll.js 22 Oct 2009 17:37:56 -0000 1.2 --- selectAll.js 22 Nov 2010 23:05:49 -0000 1.2.2.1 *************** *** 12,20 **** f.target = '_self'; f.submit(); ! }; ! ! // requires jQuery ! function toggleSelection() { ! alert($("#filter").val()); ! // $("table").hide(); ! } \ No newline at end of file --- 12,14 ---- f.target = '_self'; f.submit(); ! }; \ No newline at end of file Index: questionImporter.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionImporter.php,v retrieving revision 1.17 retrieving revision 1.17.4.1 diff -C2 -d -r1.17 -r1.17.4.1 *** questionImporter.php 28 Jul 2009 15:39:26 -0000 1.17 --- questionImporter.php 22 Nov 2010 23:05:49 -0000 1.17.4.1 *************** *** 21,28 **** --- 21,40 ---- */ + session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + $root = $config->get('docroot'); $webroot = $config->get('webroot'); Index: AdminInterface.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AdminInterface.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** AdminInterface.php 27 Aug 2009 16:23:01 -0000 1.9 --- AdminInterface.php 22 Nov 2010 23:05:49 -0000 1.9.2.1 *************** *** 98,102 **** echo '<form action="'.$index_url.'" method="post" name="login" id="login"><table align="center"><tr>'; echo '<td>'.get_string('USR_Password','stack','').'</td>'; ! echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td></tr>'; echo '<tr><td></td><td><font color="red">'.$error_message.'</font><td></tr>'; echo '<tr><td> --- 98,102 ---- echo '<form action="'.$index_url.'" method="post" name="login" id="login"><table align="center"><tr>'; echo '<td>'.get_string('USR_Password','stack','').'</td>'; ! echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td></tr>'; echo '<tr><td></td><td><font color="red">'.$error_message.'</font><td></tr>'; echo '<tr><td> Index: authorTest.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/authorTest.php,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -C2 -d -r1.15 -r1.15.4.1 *** authorTest.php 23 Jun 2009 14:39:36 -0000 1.15 --- authorTest.php 22 Nov 2010 23:05:49 -0000 1.15.4.1 *************** *** 17,26 **** --- 17,39 ---- */ session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + require_once('AuthorDisplay.php'); + require_once $config->get('docroot').'/lib/ui/frontend.php'; + if(empty($_SESSION['authorItem']) || ($_POST == NULL)) { *************** *** 48,115 **** //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); - ?> - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - <html> - <head> - <style type="text/css" media="all"> - @import "../../styles.css"; - </style> - <script type="text/javascript" src="../../other/moo.fx/prototype.lite.js"></script> - - <script type="text/javascript" src="../../other/moo.fx/moo.fx.js"></script> - - <script type="text/javascript"> - // Initialise the effects - var metaContainer; - var optionsContainer; - var moodleContainer; - var prtContainer; - var qpContainer; - - - window.onload = function() { - metaContainer = new fx.Height('meta', {duration: 400}); - metaContainer.hide(); - optionsContainer = new fx.Height('options', {duration: 400}); - optionsContainer.hide(); - moodleContainer = new fx.Height('moptions', {duration: 400}); - moodleContainer.hide(); - prtContainer = new fx.Height('prtContainer', {duration: 400}); - qpContainer = new fx.Height('qpContainer', {duration: 400}); - - } ! </script> ! <script type="text/javascript"> ! function swapper(container, icon) ! { ! var iconPath = '<?php echo $config->get('weburl'); ?>/pix/'; ! container.toggle(icon, iconPath); ! } ! </script> ! <title>Question test</title> ! </head> <body> - <h2><?php echo get_string('stackAuthor_title'.$key,'stack') ?></h2> - - <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a></p> <form action="authorTest.php" method="POST"> ! <p> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> ! <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> </p> <?php echo $author->displayAuthor(); ?> - <p><input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /></p> </form> ! <?php - echo '<p><a href="../../index.php">'.get_string('FE_index_main','stack','').'</a></p>'; - if(function_exists('memory_get_peak_usage')) { --- 61,102 ---- //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); ! echo html_head(get_string('stackQuestion_authorEditQuestion', 'stack'),'../../',"@import \"../../styles.css\";\n", 'LaTeX', true); ! ?> <body> <form action="authorTest.php" method="POST"> ! <div id="authoringControls"> ! <a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a><p /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> + <p /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> ! <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> ! <p> ! <ul> ! <li><a href="#stem">Stem</a></li> ! <li><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a></li> ! <li><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a></li> ! <li><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a></li> ! <li><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a></li> ! <li><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a></li> ! </ul> ! <?php ! // line history ! //echo $author->displayVersionHistory(); ! ?> ! ! </div> <?php echo $author->displayAuthor(); ?> </form> ! <script language="JavaScript" type="text/javascript"> ! $(document).ready(function() { ! $('#authoringControls').append($('#versionHistory').detach().html()); ! }); ! </script> <?php if(function_exists('memory_get_peak_usage')) { Index: DisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/DisplayItem.php,v retrieving revision 1.89 retrieving revision 1.89.2.1 diff -C2 -d -r1.89 -r1.89.2.1 *** DisplayItem.php 20 Oct 2009 14:44:47 -0000 1.89 --- DisplayItem.php 22 Nov 2010 23:05:49 -0000 1.89.2.1 *************** *** 82,93 **** * * - * @var string - * @access protected - */ - protected $questionForDisplay; - - /** - * - * * @var StudentAns * @access protected --- 82,85 ---- *************** *** 178,189 **** private $logger; - /** - * - * - * @var state - * @access protected - */ - protected $state; - /** * --- 170,173 ---- *************** *** 247,253 **** $this->updateAnsBoxes(); } - - // set question display state - $this->state = new ItemState($this->studentAnswers, $this->answerBox, $this->itemOpts); } --- 231,234 ---- *************** *** 309,313 **** /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No caching; that logic is handled higher up. * * @param array $posted values --- 290,294 ---- /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No display caching; that logic is handled higher up. * * @param array $posted values *************** *** 327,331 **** if($this->answerBox == NULL) { ! $xhtml = '<p>'.get_string('stackQuestion_noQuestionParts','stack','')."</p> $this->cachedQuestionStem"; } else --- 308,312 ---- if($this->answerBox == NULL) { ! $xhtml = '<div class="secondaryFeedback">'.get_string('stackQuestion_noQuestionParts','stack','').'</div>'.$this->cachedQuestionStem; } else *************** *** 385,388 **** --- 366,370 ---- //check status, $status = $IE->getStatus(); + $hideFeedback = 'true' == $this->item->questionPart[$label]->getHideFeedback()->getSelected(); switch($status) *************** *** 391,395 **** $all_elements_at_score_WS = false; $disp = $IE->getDisplayValue(); - $feedback = $IE->getFeedback(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); --- 373,376 ---- *************** *** 397,404 **** $full .= $disp.'</p>'; //$full .= " #$label# ".'<span class="feedback">'.$feedback.'</span>'; ! $full .= '<span class="feedback">'.$feedback.'</span>'; $full .= "</div>\n\n"; //$full .= '<span class="solutionButton"> '.get_string('stackQuestionDisplay_viewSolution','stack','').'<input type="checkbox" value="true" name="'."SR__$label".'" />'; $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; --- 378,391 ---- $full .= $disp.'</p>'; //$full .= " #$label# ".'<span class="feedback">'.$feedback.'</span>'; ! $feedback = $IE->getFeedback(); ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } $full .= "</div>\n\n"; //$full .= '<span class="solutionButton"> '.get_string('stackQuestionDisplay_viewSolution','stack','').'<input type="checkbox" value="true" name="'."SR__$label".'" />'; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 410,414 **** $full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_invalid','stack','').'" alt="'.get_string('stackIcon_invalid_alt','stack','').'" width="40" height="36" /> </span>'; $feedback = $IE->getFeedback(); ! $full .= '<span class="feedback">'.$feedback.' </span>'; //$full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack','').'</p>'; --- 397,403 ---- $full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_invalid','stack','').'" alt="'.get_string('stackIcon_invalid_alt','stack','').'" width="40" height="36" /> </span>'; $feedback = $IE->getFeedback(); ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } //$full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack','').'</p>'; *************** *** 419,422 **** --- 408,414 ---- $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 424,434 **** case 'score': $disp = $IE->getDisplayValue(); - $feedback = $IE->getFeedback(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); //$full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_valid','stack','').'" alt="'.get_string('stackIcon_valid_alt','stack','').'" /> </span>'; $full .= $disp.'</p>'; ! $full .= '<span class="feedback">'.$feedback.'</span>'; $full .= "</div>\n\n"; $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; --- 416,430 ---- case 'score': $disp = $IE->getDisplayValue(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); //$full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_valid','stack','').'" alt="'.get_string('stackIcon_valid_alt','stack','').'" /> </span>'; $full .= $disp.'</p>'; ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 447,450 **** --- 443,449 ---- $full .= '<br />'.get_string('stackQuestionDisplay_ThisCanDisplay','stack','').' <span class="SyntaxExample2">'.$this->cachedTAnsValue[$label].'</span> '; $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); *************** *** 488,492 **** // but first check that there is a worked solution to display $rawWS = $this->item->workedSolution->getRawCasText(); ! if(($this->workedSolutionRequested == true || $this->expired == true) && !empty($rawWS)) { $xhtml .= '<div class="secondaryFeedback">'; --- 487,498 ---- // but first check that there is a worked solution to display $rawWS = $this->item->workedSolution->getRawCasText(); ! $OptWorkedSol = $this->item->getItemOption('OptWorkedSol'); ! ! if(null !== $OptWorkedSol) { ! $OptWorkedSol = $OptWorkedSol->getSelected(); ! } else { ! $OptWorkedSol = 'true'; ! } ! if(($this->workedSolutionRequested == true || $this->expired == true) && !empty($rawWS)) { $xhtml .= '<div class="secondaryFeedback">'; *************** *** 500,504 **** //.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" />'; } ! elseif(!empty($rawWS) && $all_elements_at_score_WS) { $xhtml .= '<div class="secondaryFeedback">'.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" /></div>'; --- 506,510 ---- //.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" />'; } ! elseif(!empty($rawWS) && $all_elements_at_score_WS && 'true'===$OptWorkedSol) { $xhtml .= '<div class="secondaryFeedback">'.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" /></div>'; *************** *** 514,520 **** } while ($count > 0); - return $xhtml; } // endif has answerboxes } // endif valid item } --- 520,526 ---- } while ($count > 0); } // endif has answerboxes } // endif valid item + return $xhtml; } *************** *** 672,676 **** foreach($posted as $label => $post) { ! $exploded = explode('-', $label); if(count($exploded) == 1) --- 678,682 ---- foreach($posted as $label => $post) { ! $exploded = explode('|', $label); if(count($exploded) == 1) *************** *** 722,732 **** protected function updateSAnswer($posted, $process=true) { ! //preprocess the students answers, if required by the answertest used //for example the matrix input type needs to join multiple answers into one maxima command. $posted = $this->filterInputs($posted); //update the studentsAnswers or create if does not exist - if($this->studentAnswers === NULL) { --- 728,739 ---- protected function updateSAnswer($posted, $process=true) { ! //preprocess the students answers, if required by the input element used //for example the matrix input type needs to join multiple answers into one maxima command. + //echo "<pre>";print_r($posted); $posted = $this->filterInputs($posted); + //print_r($posted);echo "</pre>"; //update the studentsAnswers or create if does not exist if($this->studentAnswers === NULL) { *************** *** 756,759 **** --- 763,767 ---- //var_dump($implicitForbid); $this->studentAnswers->syntaxCheck($this->itemOpts, $this->item->getQuestionPartsByStudentAnsKey(), $implicitForbid); + $this->studentAnswers->scoreIfValid($this->item->getQuestionPartsByStudentAnsKey()); $this->studentAnswers->casValidate($this->itemOpts, $this->item->getSeed(), $this->item->getQuestionPartsByStudentAnsKey(), $this->cachedTAnsValue); *************** *** 1293,1296 **** --- 1301,1305 ---- } + public function getTestInput($test) { *************** *** 1349,1356 **** } ! //echo "<pre>"; print_r($postcalc); echo "</pre>"; ! foreach ($test as $key => $val) { ! $test_post[$key] = $postcalc[$key]; ! } return $test_post; --- 1358,1377 ---- } ! ! //echo "<pre>.."; print_r($testIE); echo "..</pre>"; ! $questionParts = $this->item->getQuestionPartsByStudentAnsKey(); ! $test_post=array(); ! if(!empty($questionParts)) ! { ! foreach($questionParts as $SA => $QP) ! { ! $type = $QP->getInputType(); ! $inputType = new InputTypeController($type,$SA); ! $result = $inputType->getTestPostData($postcalc[$SA]); ! foreach($result as $key => $val) { ! $test_post['sAns__'.$key] = $val; ! } ! } ! } return $test_post; *************** *** 1374,1378 **** // Generate header row for table. ! $table .="\n<table class='interactionElementsTable' border='1' cellpadding='2' cellspacing='0''>\n<tr>\n"; foreach($qpNames as $name) { $table .= '<td class="tableTitle" colspan="3">'.$name.'</td>'; --- 1395,1399 ---- // Generate header row for table. ! $table .="\n<table class='interactionElementsTable' border='1' cellpadding='2' cellspacing='0'>\n<tr>\n"; foreach($qpNames as $name) { $table .= '<td class="tableTitle" colspan="3">'.$name.'</td>'; *************** *** 1394,1400 **** if($PRTs != NULL) { foreach($PRTs as $name => $PRT) { ! $table .= '<td class="tableTitle">M</td>'; ! $table .= '<td class="tableTitle">P</td>'; ! $table .= '<td class="tableTitle">N</td>'; } } --- 1415,1421 ---- if($PRTs != NULL) { foreach($PRTs as $name => $PRT) { ! $table .= '<td class="tableTitle">Mark</td>'; ! $table .= '<td class="tableTitle">Penalty</td>'; ! $table .= '<td class="tableTitle">Answer note and feedback</td>'; } } *************** *** 1446,1455 **** $table .= '<td>'.$attempt->getPenalty($name).'</td>'; $table .= "\n<td>"; ! if (array_key_exists($name,$feedback)) { ! $table .= '<img src="'.$config->get('weburl').'/pix/page.png" alt="'.htmlentities($feedback[$name]).'" width="16" height="16" />'; ! } ! if (array_key_exists($name,$ansNote)) { $table .= ' '.$ansNote[$name]; } $table .= "\n</td>\n"; } --- 1467,1478 ---- $table .= '<td>'.$attempt->getPenalty($name).'</td>'; $table .= "\n<td>"; ! if (array_key_exists($name,$ansNote)) { $table .= ' '.$ansNote[$name]; } + if (array_key_exists($name,$feedback)) { + //$table .= '<img src="'.$config->get('weburl').'/pix/page.png" alt="'.htmlentities($feedback[$name]).'" width="16" height="16" />'; + $table .= '<a href="#" onClick="javascript:$(this).siblings(\'div\').slideToggle(\'fast\'); return false;" />'.get_string('stack_show/hide_feedback','stack','').'</a><div style="display:none">'.$feedback[$name].'</div>'; + } + $table .= "\n</td>\n"; } *************** *** 1477,1481 **** } } ! if($showKey) { $table .="<table>\n"; --- 1500,1504 ---- } } ! /* if($showKey) { $table .="<table>\n"; *************** *** 1487,1490 **** --- 1510,1514 ---- $table .="\n</table>\n"; } + */ } *************** *** 1531,1535 **** $QTs = $this->item->itemTests->getTests(); ! $qpNames = array_keys($this->item->questionPart); $PRTs = $this->item->getPRTs(); --- 1555,1561 ---- $QTs = $this->item->itemTests->getTests(); ! if (is_array($this->item->questionPart)) { ! $qpNames = array_keys($this->item->questionPart); ! } $PRTs = $this->item->getPRTs(); *************** *** 1541,1552 **** foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE']['sAns__'.$name] = $QT['IE_'.$name]; } } ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } } } --- 1567,1580 ---- foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE'][$name] = $QT['IE_'.$name]; } } ! if (!empty($PRTs)) { ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } ! } } } *************** *** 1565,1568 **** --- 1593,1600 ---- } + public function getVersion() { + return $this->item->getVersion(); + } + /* Actually perform the tests on the item */ private function getTestOutcomes() *************** *** 1588,1596 **** // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } } --- 1620,1630 ---- // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! if (array_key_exists('PRT',$test)) { ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } ! } } Index: AuthorDisplay.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AuthorDisplay.php,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -C2 -d -r1.65 -r1.65.2.1 *** AuthorDisplay.php 27 Aug 2009 16:23:01 -0000 1.65 --- AuthorDisplay.php 22 Nov 2010 23:05:49 -0000 1.65.2.1 *************** *** 26,33 **** --- 26,35 ---- require_once $root.'/lib/ui/DisplayItem.php'; require_once $root.'/lib/translator.php'; + require_once $root.'/lib/stringUtil.php'; require_once $root.'/lib/XML/ExportStackTwoItem.php'; require_once $root.'/lib/ui/inputTypes/InputTypeController.php'; require_once($root.'/lib/database/MoodleDB.php'); require_once($root.'/lib/database/StackDBCache.php'); + require_once($root.'/lib/database/StackDBItem.php'); /** *************** *** 109,113 **** else { ! //load a question from the database, if it exists. (loads the itemOptions form the database too. $this->item = new Item(NULL, $questionId); } --- 111,115 ---- else { ! //load a question from the database, if it exists (loads the itemOptions form the database too). $this->item = new Item(NULL, $questionId); } *************** *** 138,141 **** --- 140,146 ---- $display = ''; } + + $display .= $this->displayJS(); + $display .= $this->displayStem(); *************** *** 152,155 **** --- 157,161 ---- $display .= $this->displayMeta(); $display .= $this->displayMoodleAuthor($engineID); + $display .= $this->displayVersionHistory($engineID); return $display; *************** *** 166,182 **** private function displayStem() { ! $stem = '<div class="section">'; ! ! // var_dump($this); ! ! if($this->item->getQuestionId() != NULL) ! { ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qid', 'stack','').' </span><span class="formw">'.$this->item->getQuestionId().'</span></div>'; ! } $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' </span><span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) --- 172,184 ---- private function displayStem() { ! global $config; ! $stem = '<div id="stem" class="section">'; ! // <h3>'.get_string('stackAuthor_stem', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'" href="http://stack.bham.ac.uk/wiki/index.php/Stem"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></h3>'; + $stem .= '<div id="authoringVersionID">v.'.$this->item->getQuestionId().'</div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Question_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a> </span> <span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) *************** *** 188,192 **** //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_stem', 'stack','').'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code></span><span class="formw"> '.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 190,199 ---- //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_questionStem', 'stack','') ! .'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code>' ! .'<p />Preview<input onclick="$(\'#stemPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span>'; ! $stem .= '<span class="formw" onkeyup="authorPreview(\'questionStem\',\'#stemPreview\')">'.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="stemPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'questionStem\',\'#stemPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; *************** *** 197,201 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').'</span><span class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) --- 204,211 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/CASText#Worked_solution"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a>'; ! $stem .= '<p />Preview<input onclick="$(\'#workedSolutionPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span></span><span class="formw" onkeyup="authorPreview(\'workedSolution\',\'#workedSolutionPreview\')" class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="workedSolutionPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'workedSolution\',\'#workedSolutionPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) *************** *** 204,208 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' </span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 214,218 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/Question_note"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; *************** *** 213,217 **** ! $stem .= '<div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $stem .= '<div class="clearer"> </div><br /> </div>'; --- 223,228 ---- ! //$stem .= '<div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; ! $stem .= '<div class="clearer"> </div><br /> </div>'; *************** *** 228,232 **** { global $config; ! $form = '<div class="section"><h3><a onclick="swapper(prtContainer, \'prtIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" />'.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; --- 239,249 ---- { global $config; ! $form = '<div id="prts" class="section"> ! <h3><a onclick="$(\'#prtContainer\').slideToggle();swapper(prtContainer, \'prtIcon\');"> ! <img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" /> '. ! get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a> ! <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Potential_response_trees"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; *************** *** 245,253 **** } - $PRTs = $this->item->getPRTs(); if($PRTs != NULL) { - foreach($PRTs as $name => $PRT) { --- 262,268 ---- *************** *** 272,276 **** $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; --- 287,291 ---- $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Feedback_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a><br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; *************** *** 299,303 **** } ! $form .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $form .= '</div></div>'; // id=PRT, class=section --- 314,318 ---- } ! //$form .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $form .= '</div></div>'; // id=PRT, class=section *************** *** 325,331 **** { global $config; ! $xhtml = '<div class="section"><h3><a onclick="swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; ! $xhtml .= '<div id="qpContainer">'; $qpNames = array_keys($this->item->questionPart); --- 340,348 ---- { global $config; ! $xhtml = '<div id="parts" class="section"><h3><a onclick="$(\'#partContainer\').slideToggle();swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; ! $xhtml .= '<div id="partContainer">'; $qpNames = array_keys($this->item->questionPart); *************** *** 335,340 **** $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr> ! <td class="tableTitle">'.get_string('stackAuthor_studentAnsKey', 'stack','').'</td>'; foreach($qpNames as $name) --- 352,359 ---- $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr><td class="IElabel"> </td> ! <td colspan="'.$noQPs.'">'.get_string('stackAuthor_studentAnsKey', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Students.27s_Answer_Key"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td></tr><tr><td class="IElabel"> </td>'; foreach($qpNames as $name) *************** *** 342,346 **** $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= "</tr><tr><td>".get_string('stackAuthor_inputType', 'stack','')."</td>"; //inputtypes --- 361,367 ---- $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_inputType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Input_Type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //inputtypes *************** *** 354,358 **** } ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_teachersAns', 'stack','').'</td>'; //teachers answer foreach($qpNames as $name) --- 375,381 ---- } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_teachersAns', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Teacher.27s_Answer"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //teachers answer foreach($qpNames as $name) *************** *** 366,370 **** //box size ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_boxsize', 'stack','').'</td>'; foreach($qpNames as $name) { --- 389,395 ---- //box size ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_boxsize', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Box_Size"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) { *************** *** 374,378 **** } //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_strictsyntax', 'stack','').'</td>'; foreach($qpNames as $name) --- 399,405 ---- } //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_strictsyntax', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Strict_Syntax"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 385,389 **** //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_insertStars', 'stack','').'</td>'; foreach($qpNames as $name) --- 412,418 ---- //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_insertStars', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Insert_Stars"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 397,401 **** //syntax hint ! $xhtml .= '</tr><td>'.get_string('stackAuthor_syntaxHint', 'stack','').'</td>'; foreach($qpNames as $name) --- 426,432 ---- //syntax hint ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_syntaxHint', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Syntax_Hint"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 408,412 **** //forbidden words, comma separated. ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbiddenWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 439,445 ---- //forbidden words, comma separated. ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbiddenWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbidden_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 430,434 **** //allowed words, same as forbidden words ! $xhtml .= '</tr><td>'.get_string('stackAuthor_allowedWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 463,469 ---- //allowed words, same as forbidden words ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_allowedWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Allowed_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 452,456 **** //forbid floats ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbidFloats', 'stack','').'</td>'; foreach($qpNames as $name) --- 487,493 ---- //forbid floats ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbidFloats', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbid_Floats"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 463,467 **** //Require in lowest terms ! $xhtml .= '</tr><td>'.get_string('stackAuthor_LowestTerms', 'stack','').'</td>'; foreach($qpNames as $name) --- 500,506 ---- //Require in lowest terms ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_LowestTerms', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Require_lowest_terms"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 474,478 **** //SameType ! $xhtml .= '</tr><td>'.get_string('stackAuthor_sameType', 'stack','').'</td>'; foreach($qpNames as $name) --- 513,519 ---- //SameType ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_sameType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Check_Students_answer.27s_type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 487,493 **** } //finally add in any input type options ! $xhtml .= '</tr><td>'.get_string('stackAuthor_inputTypeOpt', 'stack').'</td>'; foreach($qpNames as $name) --- 528,568 ---- } + //StudentVerify + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_studentVerify', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Student_must_verify"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-studentVerify'; + $studentVerify = $this->item->questionPart[$name]->getStudentVerify(); + if($studentVerify !== NULL) + { + $widget = $studentVerify->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + + //HideFeedback + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_hideFeedback', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Hide_feedback"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-hideFeedback'; + $hideFeedback = $this->item->questionPart[$name]->getHideFeedback(); + if($hideFeedback !== NULL) + { + $widget = $hideFeedback->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + //finally add in any input type options ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_inputTypeOpt', 'stack').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 507,511 **** $xhtml .= '</tr></tbody></table>'; ! $xhtml .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $xhtml .= '<div class="clearer"> </div></div></div>'; } --- 582,586 ---- $xhtml .= '</tr></tbody></table>'; ! //$xhtml .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $xhtml .= '<div class="clearer"> </div></div></div>'; } *************** *** 561,567 **** { global $config; ! $meta = '<div class="section"><h3><a onclick="swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a></h3>'; //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; ! $meta .= '<div id="meta">'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_publish','stack','').' </span><span class="formw">'.$this->item->published->editWidget('questionPublished', 45).'</span></div>'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_qstatus','stack','').' </span><span class="formw">'.$this->item->questionStatus->editWidget('questionStatus', 45).'</span></div>'; --- 636,645 ---- { global $config; ! $meta = '<div id="meta" class="section"><h3><a onclick="$(\'#metaContainer\').slideToggle();swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Metadata"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; ! //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; ! $meta .= '<div id="metaContainer">'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_publish','stack','').' </span><span class="formw">'.$this->item->published->editWidget('questionPublished', 45).'</span></div>'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_qstatus','stack','').' </span><span class="formw">'.$this->item->questionStatus->editWidget('questionStatus', 45).'</span></div>'; *************** *** 589,595 **** { global $config; ! $opt = '<div class="section"><h3><a onclick="swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; ! $opt .= '<div id="options">'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_questionLevelSimp','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('Simplify', 45).'</span></div>'; //$opt .= '<div class="row"><span class="label">Insert Stars: </span><span class="formw">'.$this->item->itemOptions->getWidget('InsertStars', 45).'</span></div>'; --- 667,675 ---- { global $config; ! $opt = '<div id="options" class="section"><h3><a onclick="$(\'#optionContainer\').slideToggle();swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Options"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; ! $opt .= '<div id="optionContainer">'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_questionLevelSimp','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('Simplify', 45).'</span></div>'; //$opt .= '<div class="row"><span class="label">Insert Stars: </span><span class="formw">'.$this->item->itemOptions->getWidget('InsertStars', 45).'</span></div>'; *************** *** 601,604 **** --- 681,685 ---- $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackPartially','stack','').'</span><span class="formw">'.$this->item->itemOptions->getWidget('FeedbackGenericPCorrect', 45).'</span></div>'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackIncorrect','stack','').'</span><span class="formw">'.$this->item->itemOptions->getWidget('FeedbackGenericIncorrect', 45).'</span></div>'; + $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_OptWorkedSol','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('OptWorkedSol', 45).'</span></div>'; $opt .= '<h4>'.get_string('stackAuthor_output', 'stack', '').'</h4>'; *************** *** 614,619 **** { global $config; ! $tests = '<div class="section"><h3><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="testsIcon" />'.get_string('stackAuthor_questionTests', 'stack','').'</a></h3>'; ! $tests .= '<div id="tests">'; if(!empty($this->item->q... [truncated message content] |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:29
|
Update of /cvsroot/stack/stack-dev/lib/XML In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/XML Modified Files: Tag: question_reporting ImportStackTwoItem.php ImportStackOneItem.php ExportStackTwoBatch.php ExportStackTwoItem.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: ExportStackTwoBatch.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ExportStackTwoBatch.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** ExportStackTwoBatch.php 27 Aug 2009 16:23:00 -0000 1.5 --- ExportStackTwoBatch.php 22 Nov 2010 23:05:51 -0000 1.5.2.1 *************** *** 82,90 **** $path = $config->get('tmp'); ! if($filename == NULL) ! { ! $title = get_string('stackExport_xmlFilename', 'stack', ''); ! } ! $title = $title.'.xml'; $this->title = $title; --- 82,87 ---- $path = $config->get('tmp'); ! $title = get_string('stackExport_xmlFilename', 'stack', ''); ! $title = $title.date('_Y_m_d_H-i-s',time()).'.xml'; $this->title = $title; Index: ImportStackTwoItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ImportStackTwoItem.php,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** ImportStackTwoItem.php 16 Oct 2009 10:28:43 -0000 1.23 --- ImportStackTwoItem.php 22 Nov 2010 23:05:50 -0000 1.23.2.1 *************** *** 93,97 **** public function importQuestion($filename=NULL, $itemOptions=NULL, $validate=true) { - //echo $filename; if($filename != NULL) { --- 93,96 ---- Index: ImportStackOneItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ImportStackOneItem.php,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** ImportStackOneItem.php 27 Aug 2009 16:23:00 -0000 1.25 --- ImportStackOneItem.php 22 Nov 2010 23:05:51 -0000 1.25.2.1 *************** *** 109,113 **** if($valid == true) { - //echo 'Correct'; $this->setDesc(); $this->setVars(); --- 109,112 ---- Index: ExportStackTwoItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/XML/ExportStackTwoItem.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** ExportStackTwoItem.php 27 Aug 2009 16:23:00 -0000 1.11 --- ExportStackTwoItem.php 22 Nov 2010 23:05:51 -0000 1.11.2.1 *************** *** 208,212 **** { $node = $this->dom->createElement($title); ! $nodeText = $this->dom->createTextNode($text); $node->appendChild($nodeText); return $node; --- 208,212 ---- { $node = $this->dom->createElement($title); ! $nodeText = $this->dom->createTextNode(utf8_encode($text)); $node->appendChild($nodeText); return $node; |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:28
|
Update of /cvsroot/stack/stack-dev/lib/ui/inputTypes In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/ui/inputTypes Modified Files: Tag: question_reporting TextArea.php TrueFalseIT.php DropDownList.php StringIT.php AlgebraIT.php CreatingNewInteractionElements.txt ListIT.php Matrix.php SingleCharIT.php InputTypeController.php AnswerInputType.php Added Files: Tag: question_reporting Slider.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: SingleCharIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/SingleCharIT.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** SingleCharIT.php 27 Aug 2009 16:23:00 -0000 1.5 --- SingleCharIT.php 22 Nov 2010 23:05:49 -0000 1.5.2.1 *************** *** 104,108 **** return $box; } ! } --- 104,110 ---- return $box; } ! public static function getOptionsUsed() { ! return array('teacherAns', 'forbid', 'sameType', 'studentVerify', 'hideFeedback'); ! } } Index: AnswerInputType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/AnswerInputType.php,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** AnswerInputType.php 27 Aug 2009 16:23:00 -0000 1.10 --- AnswerInputType.php 22 Nov 2010 23:05:49 -0000 1.10.2.1 *************** *** 137,141 **** /** ! * Transforms the students input into a casstring if needed. From most returns same as went in. * * @param array|string $in --- 137,141 ---- /** ! * Transforms the student's input into a casstring if needed. From most returns same as went in. * * @param array|string $in *************** *** 160,163 **** --- 160,176 ---- } + /** + * Default is to assume all options used. Subclasses can overide with more restrictive sets. + */ + public static function getOptionsUsed() { + return array('teacherAns', 'boxSize','informalSyntax','insertStars', 'syntaxHint', 'forbid','allow','floats','lowest','sameType','studentVerify', 'hideFeedback'); + } + + /** + * Default is to specify no defaults. Subclasses can overide with some. + */ + public static function getOptionDefaults() { + return NULL; + } } Index: DropDownList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/DropDownList.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** DropDownList.php 27 Aug 2009 16:23:00 -0000 1.6 --- DropDownList.php 22 Nov 2010 23:05:49 -0000 1.6.2.1 *************** *** 118,124 **** else { ! $values = $this->parameters['ddl_values']->getSelection(); ! $values = trim($values); ! $exploded = explode(',', $values); if(!empty($values)) --- 118,125 ---- else { ! $values = $this->parameters['ddl_values']->getSelection(); ! $values = trim($values); ! $su = new stringUtil('['.$values.']'); ! $exploded = $su->listToArray(false); if(!empty($values)) *************** *** 156,160 **** } ! } ?> \ No newline at end of file --- 157,167 ---- } ! public static function getOptionsUsed() { ! return array('teacherAns', 'studentVerify', 'hideFeedback'); ! } + public static function getOptionDefaults() { + return array('studentVerify'=>'false', 'hideFeedback'=>'true'); + } + } ?> \ No newline at end of file Index: TextArea.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/TextArea.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** TextArea.php 27 Aug 2009 16:23:00 -0000 1.2 --- TextArea.php 22 Nov 2010 23:05:49 -0000 1.2.2.1 *************** *** 113,117 **** $rows = $this->modinput_tokenizer(substr($this->default, 1, -1)); // array("[a,b]","[c,d]"); ! $norows = count($rows)+4; $dispval = ''; $cols = $this->boxWidth; --- 113,117 ---- $rows = $this->modinput_tokenizer(substr($this->default, 1, -1)); // array("[a,b]","[c,d]"); ! $norows = count($rows)+3; $dispval = ''; $cols = $this->boxWidth; *************** *** 126,130 **** /** ! * Converts the inputs passed in into a textares into a Maxima list * * @param string|array $in --- 126,130 ---- /** ! * Converts the inputs passed in into a textareas into a Maxima list * * @param string|array $in *************** *** 134,137 **** --- 134,141 ---- public function transform($in) { + if(''==trim($in)) { + return(''); + } + $vals = explode("\n",$in); $out = '['; *************** *** 231,235 **** --- 235,254 ---- } + /** + * Returns an array in the form of the $_POST data, used for the question tests. + * + * @param string $value + * @access public + * @return array + */ + public function getTestPostData($value) + { + $post_data=substr($value,1,strlen($value)-2); + return array($this->name=>$post_data); + } + public static function getOptionDefaults() { + return array('boxSize'=>25, 'studentVerify'=>'true', 'hideFeedback'=>'false'); + } } ?> \ No newline at end of file --- NEW FILE: Slider.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Benjamin Holmes (ma...@be...) * * @package stackInputType */ global $config; require_once 'AnswerInputType.php'; // A jQuery UI slider, see http://jqueryui.com/demos/slider class Slider extends AnswerInputType { // Attributes //protected $min; //protected $max; //protected $step; public function __construct($name, $width = null, $default = null, $maxLength = null, $height = null, $param = null) { //if (!isset($width)) $width = '200'; $this->name = $name; $this->boxWidth = $width; if($param == NULL) { $this->parameters['slider_min'] = new Meta('required', '0'); $this->parameters['slider_max'] = new Meta('required', '100'); $this->parameters['slider_step'] = new Meta('required', '1'); } else $this->parameters = $param; // parent::__construct($name, $width); //$this->min = $param['min']; //$this->max = $param['max']; //$this->step = $param['step']; parent::__construct($name, $width, $default, $maxLength, $height, $param); } public function getXHTML() { $url = $GLOBALS['config']->get('weburl'); // include jQuery and jQuery UI scripts $slider = '<link rel="stylesheet" type="text/css" href="' . $url . '/other/jqueryCSS/jquery.ui.css" /> <script type="text/javascript" src="' . $url . '/other/jquery.js"></script> <script type="text/javascript" src="' . $url . '/other/jquery.ui.js"></script>'; $slider .= '<div id="' . $this->name . '_slider" style="width: ' . $this->boxWidth . 'px;"></div> <div id="' . $this->name . '_value">'.$this->default.'</div> <input id="' . $this->name . '" name="' . $this->name . '" type="hidden" value="'.$this->default.'" />'; $slider .= '<script type="text/javascript"> $(document).ready(function() { $("#' . $this->name . '_slider").slider({' . (is_numeric($this->default) ? "value: {$this->default}," : '') . (isset($this->parameters['slider_min']) ? "min: {$this->parameters['slider_min']}," : '') . (isset($this->parameters['slider_max']) ? "max: {$this->parameters['slider_max']}," : '') . (isset($this->parameters['slider_step']) ? "step: {$this->parameters['slider_step']}," : '') . ' slide: function(event, ui) { $("#' . $this->name . '").val(ui.value) $("#' . $this->name . '_value").text(ui.value); } }); }); </script>'; return $slider; } /** * Modifies the default parameters of this Input type based on the authors inputs * If authors input is null, returns the defaults. * * @access public * @param array $param * @return array */ public function getDefaultParam($param=NULL) { if(!empty($param['slider_min'])) { $this->parameters['slider_min']->setSelection($param['slider_min']); } if(!empty($param['slider_max'])) { $this->parameters['slider_max']->setSelection($param['slider_max']); } return $this->parameters; } public static function getOptionsUsed() { return array('teacherAns', 'boxSize', 'studentVerify', 'hideFeedback'); } public static function getOptionDefaults() { return array('boxSize'=>'200', 'studentVerify'=>'false', 'hideFeedback'=>'true'); } } ?> Index: Matrix.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/Matrix.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** Matrix.php 27 Aug 2009 16:23:00 -0000 1.6 --- Matrix.php 22 Nov 2010 23:05:49 -0000 1.6.2.1 *************** *** 20,24 **** require_once 'AnswerInputType.php'; require_once('AnswerInputTypeInterface.php'); ! //require_once($root.'/lib/items/Meta.php'); /** * Generates a grid for input of Matricies. --- 20,24 ---- require_once 'AnswerInputType.php'; require_once('AnswerInputTypeInterface.php'); ! require_once($root.'/lib/stringUtil.php'); /** * Generates a grid for input of Matricies. *************** *** 157,163 **** for($j=0; $j < $width; $j++) { ! $name = $this->name.'-'.$i.'-'.$j; $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $xhtml .= '<td><input type="text" name="'.$name.'" value="'.$default.'" size="'.$this->boxWidth.'" onfocus="this.value=\'\'" ></td>'; } if($i == 0) --- 157,163 ---- for($j=0; $j < $width; $j++) { ! $name = $this->name.'|'.$i.'|'.$j; $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $xhtml .= '<td><input type="text" name="'.$name.'" value="'.$default.'" size="'.$this->boxWidth.'" ></td>'; } if($i == 0) *************** *** 215,219 **** /*echo '<hr>Defaults:<pre>'; var_dump($this->defaults); ! echo '</pre>';*/ } } --- 215,220 ---- /*echo '<hr>Defaults:<pre>'; var_dump($this->defaults); ! echo '</pre>'; ! */ } } *************** *** 404,433 **** public function getTestPostData($value) { - $post_data = array(); - - $cs = 'matrix_size('.$this->parameters['teacherAns'].')'; - $matrixSize = new CasString($cs); ! $mct = new MultiCasText(array('size' => $matrixSize)); ! $mct->casValidate('t'); - $size = $mct->getRawValues('size'); ! $dimensions = explode(',',$size[$cs]); ! $height = trim($dimensions[0], '[]'); ! $width = trim($dimensions[1], '[]'); ! for($i=0; $i < $height; $i++) { ! for($j=0; $j < $width; $j++) { ! $name = $this->name.'-'.$i.'-'.$j; ! $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $post_data[$name] = $default; ! } } ! return $post_data; } ! } ?> \ No newline at end of file --- 405,432 ---- public function getTestPostData($value) { ! $this -> setDefault($value); ! $post_data = array(); ! $height = count($this->defaults); ! if ($height>0) { ! $width = count($this->defaults[1]); ! for($i=0; $i < $height; $i++) { ! for($j=0; $j < $width; $j++) { ! $name = $this->name.'|'.$i.'|'.$j; ! $default = empty($this->defaults) ? '' : $this->defaults[$i][$j]; ! $post_data[$name] = $default; ! } ! } } ! return $post_data; } ! public static function getOptionsUsed() { ! return array('teacherAns', 'informalSyntax', 'insertStars', 'syntaxHint', 'forbid', 'allow', 'floats', 'lowest', 'sameType', 'studentVerify', 'hideFeedback'); ! } } ?> \ No newline at end of file Index: StringIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/StringIT.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** StringIT.php 27 Aug 2009 16:23:00 -0000 1.6 --- StringIT.php 22 Nov 2010 23:05:49 -0000 1.6.2.1 *************** *** 113,116 **** --- 113,123 ---- } + public static function getOptionsUsed() { + return array('teacherAns', 'forbid', 'allow', 'floats', 'lowest', 'sameType', 'studentVerify', 'hideFeedback'); + } + + public static function getOptionDefaults() { + return array('boxSize'=>20, 'studentVerify'=>'false', 'hideFeedback'=>'true'); + } } Index: AlgebraIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/AlgebraIT.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** AlgebraIT.php 27 Aug 2009 16:23:00 -0000 1.7 --- AlgebraIT.php 22 Nov 2010 23:05:49 -0000 1.7.2.1 *************** *** 117,120 **** --- 117,138 ---- return $box; } + + public static function getOptionsUsed() { + return parent::getOptionsUsed(); + } + + + /** + * Returns the default options. + * Only need to specify where they differ from QuestionPart defaults, so does not contain all used options (see setOptionsUsed()) + * String keys MUST match QuestionPart variable names. + * + * @param array $param + * @access public + * @return Array(String) + */ + public static function getOptionDefaults() { + return array('boxSize'=>'20'); + } } ?> \ No newline at end of file Index: InputTypeController.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/InputTypeController.php,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** InputTypeController.php 27 Aug 2009 16:23:00 -0000 1.12 --- InputTypeController.php 22 Nov 2010 23:05:49 -0000 1.12.2.1 *************** *** 34,37 **** --- 34,38 ---- require_once $root.'/lib/ui/inputTypes/ListIT.php'; require_once $root.'/lib/ui/inputTypes/TextArea.php'; + require_once $root.'/lib/ui/inputTypes/Slider.php'; class InputTypeController *************** *** 44,48 **** * @access private */ ! private $avaliableTypes; /** --- 45,49 ---- * @access private */ ! private $availableTypes; /** *************** *** 110,125 **** $this->answerBox = new TextArea($name, $width, $default, $maxLength, $height, $param); break; } } //set list of avaliable input types, in a format that can be translated ! $this->avaliableTypes['Algebraic Input'] = get_string('stackInputType_Algebraic', 'stack', ''); ! $this->avaliableTypes['True/False'] = get_string('stackInputType_truefalse', 'stack', ''); ! $this->avaliableTypes['Single Character'] = get_string('stackInputType_singlechar', 'stack', ''); ! $this->avaliableTypes['DropDownList'] = get_string('stackInputType_dropdownlist', 'stack', ''); ! $this->avaliableTypes['Matrix'] = get_string('stackInputType_matrix', 'stack', ''); ! $this->avaliableTypes['List'] = get_string('stackInputType_list', 'stack', ''); ! $this->avaliableTypes['Textarea'] = get_string('stackInputType_Textarea', 'stack', ''); // We currently don't allow strings to be passed to the CAS, so remove this type. ! //$this->avaliableTypes['String'] = get_string('stackInputType_String', 'stack', ''); // Currently there are too many bugs with DragMath - so don't offer it! //$this->avaliableTypes['Dragmath with input box'] = get_string('stackInputType_dragmathInputBox', 'stack', ''); --- 111,131 ---- $this->answerBox = new TextArea($name, $width, $default, $maxLength, $height, $param); break; + + case 'Slider': + $this->answerBox = new Slider($name, $width, $default, $maxLength, $height, $param); + break; } } //set list of avaliable input types, in a format that can be translated ! $this->availableTypes['Algebraic Input'] = get_string('stackInputType_Algebraic', 'stack', ''); ! $this->availableTypes['True/False'] = get_string('stackInputType_truefalse', 'stack', ''); ! $this->availableTypes['Single Character'] = get_string('stackInputType_singlechar', 'stack', ''); ! $this->availableTypes['DropDownList'] = get_string('stackInputType_dropdownlist', 'stack', ''); ! $this->availableTypes['Matrix'] = get_string('stackInputType_matrix', 'stack', ''); ! $this->availableTypes['List'] = get_string('stackInputType_list', 'stack', ''); ! $this->availableTypes['Textarea'] = get_string('stackInputType_Textarea', 'stack', ''); ! $this->availableTypes['Slider'] = get_string('stackInputType_slider', 'stack', ''); // We currently don't allow strings to be passed to the CAS, so remove this type. ! //$this->availableTypes['String'] = get_string('stackInputType_String', 'stack', ''); // Currently there are too many bugs with DragMath - so don't offer it! //$this->avaliableTypes['Dragmath with input box'] = get_string('stackInputType_dragmathInputBox', 'stack', ''); *************** *** 166,170 **** //display a drop down list $widget = '<select name="'.$prefix.'">'; ! foreach($this->avaliableTypes as $key => $val) { //if indexed array of values, use val for both display and return --- 172,176 ---- //display a drop down list $widget = '<select name="'.$prefix.'">'; ! foreach($this->availableTypes as $key => $val) { //if indexed array of values, use val for both display and return *************** *** 222,226 **** return $this->answerBox->transform($in); } - } ?> \ No newline at end of file --- 228,280 ---- return $this->answerBox->transform($in); } + public function getTestPostData($in) + { + return $this->answerBox->getTestPostData($in); + } + + /** + * Return array of arrays for each IT to be used by authoring interface. + */ + public static function getOptionsUsed() + { + // HTML option values mapping to array of options to be shown + $used['Algebraic Input'] = AlgebraIT::getOptionsUsed(); + //$used['DragMathAppletOnly'] = DragMathAppletOnly::getOptionsUsed(); + //$used['DragMathInputBox'] = DragMathInputBox::getOptionsUsed(); + $used['Single Character'] = SingleCharIT::getOptionsUsed(); + //$used['StringIT'] = StringIT::getOptionsUsed(); + $used['True/False'] = TrueFalseIT::getOptionsUsed(); + $used['DropDownList'] = DropDownList::getOptionsUsed(); + $used['Matrix'] = Matrix::getOptionsUsed(); + $used['List'] = ListIT::getOptionsUsed(); + $used['Textarea'] = TextArea::getOptionsUsed(); + $used['Slider'] = Slider::getOptionsUsed(); + + foreach($used as $type => $value) { + $used[$type][] = 'inputType'; // obviously required for all + } + + return $used; + } + + /** + * Return array of arrays for each IT to be used by authoring interface. + */ + public static function getOptionDefaults() { + $defaults['Algebraic Input'] = AlgebraIT::getOptionDefaults(); + //$defaults['DragMathAppletOnly'] = DragMathAppletOnly::getOptionDefaults(); + //$defaults['DragMathInputBox'] = DragMathInputBox::getOptionDefaults(); + $defaults['Single Character'] = SingleCharIT::getOptionDefaults(); + //$defaults['StringIT'] = StringIT::getOptionDefaults(); + $defaults['True/False'] = TrueFalseIT::getOptionDefaults(); + $defaults['DropDownList'] = DropDownList::getOptionDefaults(); + $defaults['Matrix'] = Matrix::getOptionDefaults(); + $defaults['List'] = ListIT::getOptionDefaults(); + $defaults['Textarea'] = TextArea::getOptionDefaults(); + $defaults['Slider'] = Slider::getOptionDefaults(); + + return $defaults; + } + } ?> \ No newline at end of file Index: ListIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/ListIT.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ListIT.php 27 Aug 2009 16:23:00 -0000 1.4 --- ListIT.php 22 Nov 2010 23:05:49 -0000 1.4.2.1 *************** *** 22,25 **** --- 22,26 ---- require_once($root.'/lib/items/QTTuple.php'); require_once($root.'/lib/items/QTList.php'); + require_once($root.'/lib/stringUtil.php'); /** * A general input type for producing lists of answers for the student to pick from. *************** *** 97,101 **** if($param == NULL) { ! $param['list_input_type'] = new Meta('optional', 'radio', array('radio' => 'radio buttons', 'dropdown'=>'drop down list' )); for($i=3; $i > 0; $i--) --- 98,102 ---- if($param == NULL) { ! $param['list_input_type'] = new Meta('optional', 'radio', array('radio' => 'radio buttons', 'dropdown'=>'drop down list', 'checkbox'=>'check boxes')); for($i=3; $i > 0; $i--) *************** *** 229,241 **** $result = $this->parameters['list_values']->purgeEmpty(); $no = $this->parameters['list_no_display']->getSelection(); $range = $this->parameters['list_values']->size(); - $range = $range -1; //range should start at 0, not 1 - $no--; //adding in the teachers answer, so need one fewer ! $randomSet = $this->randomSelection($this->parameters['seed'], $no, ($range)); //insert the teacher's answer into a random position - srand($this->parameters['seed']); $tPos = rand(0, $no); --- 230,243 ---- $result = $this->parameters['list_values']->purgeEmpty(); + // The number of distractors the teacher wants to show. $no = $this->parameters['list_no_display']->getSelection(); + $no--; //adding in the teachers answer, so need one fewer from the selection + // The number of distractors entered by the teacher. $range = $this->parameters['list_values']->size(); ! // Generate random positions for the distractors ! $randomSet = $this->randomSelection($this->parameters['seed'], $no, $range); //insert the teacher's answer into a random position srand($this->parameters['seed']); $tPos = rand(0, $no); *************** *** 244,248 **** $result = $this->parameters['list_values']->CASProcess('t'); ! $teachers = $this->parameters['list_correct_ans']->casProcess('t'); if($result !== true) --- 246,259 ---- $result = $this->parameters['list_values']->CASProcess('t'); ! $teachers = $this->parameters['list_correct_ans']->CASProcess('t'); ! ! /* Remove random positioning - useful for testing */ ! /* ! $randomSet=array(); ! for($i=$no-1; $i >= -1; $i--) ! { ! $randomSet[$i]=$i; ! } ! */ if($result !== true) *************** *** 255,283 **** $displayVals[-1] = $this->parameters['list_correct_ans']->getDisplayValue(); if($this->parameters['list_input_type']->getSelection() == 'radio') { if(($this->default == NULL)) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="" checked />'.$ns_s.'<br />'; foreach($randomSet as $id) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display'].'<br />'; } } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="" />'.$ns_s.'<br />'; foreach($randomSet as $id) { if($this->default == $displayVals[$id]['list_label']) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" checked />'.$displayVals[$id]['list_display'].'<br />'; } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display'].'<br />'; } } } } ! else { $xhtml .= '<select name="'.$this->name.'">'; --- 266,295 ---- $displayVals[-1] = $this->parameters['list_correct_ans']->getDisplayValue(); + $xhtml .= "\n"; if($this->parameters['list_input_type']->getSelection() == 'radio') { if(($this->default == NULL)) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="" checked />'.$ns_s."<br />\n"; foreach($randomSet as $id) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="" />'.$ns_s."<br />\n"; foreach($randomSet as $id) { if($this->default == $displayVals[$id]['list_label']) { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" checked />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } else { ! $xhtml .= '<input type="radio" name="'.$this->name.'" value="'.$displayVals[$id]['list_label'].'" />'.stripslashes($displayVals[$id]['list_display'])."<br />\n"; } } } } ! else if($this->parameters['list_input_type']->getSelection() == 'dropdown') { $xhtml .= '<select name="'.$this->name.'">'; *************** *** 305,308 **** --- 317,355 ---- $xhtml .= '</select>'; } + else if($this->parameters['list_input_type']->getSelection() == 'checkbox') + { + $i=0; + + // Split up a list into an array, so we can tick checkboxes. + $ans = trim($this->default); + if (NULL!== $ans and ''!==trim(ans)) { + $su = new stringUtil($ans); + $ans_array = $su->listToArray(false); + } + + if(($this->default == NULL)) + { + // Don't need "not selected" in checkbox type. + //$xhtml .= '<input type="checkbox" name="'.$this->name.'|'.$i++.'" value="" checked />'.$ns_s."<br />\n"; + foreach($randomSet as $id) + { + $xhtml .= '<input type="checkbox" name="'.$this->name.'|'.$i++.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display']."<br />\n"; + } + } else { + // Don't need "not selected" in checkbox type. + //$xhtml .= '<input type="checkbox" name="'.$this->name.'|'.$i++.'" value="" />'.$ns_s."<br />\n"; + foreach($randomSet as $id) + { + if(in_array($displayVals[$id]['list_label'],$ans_array)) + { + $xhtml .= '<input type="checkbox" name="'.$this->name.'|'.$i++.'" value="'.$displayVals[$id]['list_label'].'" checked />'.$displayVals[$id]['list_display']."<br />\n"; + } + else + { + $xhtml .= '<input type="checkbox" name="'.$this->name.'|'.$i++.'" value="'.$displayVals[$id]['list_label'].'" />'.$displayVals[$id]['list_display']."<br />\n"; + } + } + } + } } } *************** *** 310,315 **** } /** ! * Produces a psuedo random set of numbers the seed. Each number will be in the set only once. * Returns NULL if requested set size > max range * --- 357,416 ---- } + + /** + * Converts the array of inputs passed in into a maxima matrix string + * + * @param string|array $in + * @return string + * @access public + */ + public function transform($in) + { + + // Only checkboxes will send in an array. These need to be turned into a list. + if (is_array($in)) { + $out = ''; + foreach($in as $ans) { + $out .= ','.$ans; + } + $in = '['.substr($out,1).']'; + } + + return $in; + } + + /** + * Returns an array in the form of the $_POST data, used for the question tests. + * + * @param string $value + * @access public + * @return array + */ + public function getTestPostData($value) + { + + if($this->parameters['list_input_type']->getSelection() == 'radio') { + $post_data= array($this->name=>$value); + } else if($this->parameters['list_input_type']->getSelection() == 'dropdown') { + $post_data = array($this->name=>$value); + } else if($this->parameters['list_input_type']->getSelection() == 'checkbox') { + + $su = new stringUtil($value); + $ans_array = $su->listToArray(false); + + $post_data = array(); + foreach ($ans_array as $key=>$val) + { + $post_data[$this->name.'-'.$key] = $val; + } + } + + return $post_data; + } + + /** ! * Produces a psuedo random set of numbers from the seed. ! * Each number will be in the set only once. * Returns NULL if requested set size > max range * *************** *** 328,331 **** --- 429,434 ---- else { + // Range should start at zero, so subtract one. + $range--; srand($seed); $return = array(); *************** *** 344,347 **** --- 447,454 ---- } } + + public static function getOptionsUsed() { + return array('teacherAns', 'studentVerify', 'hideFeedback'); + } } ?> \ No newline at end of file Index: CreatingNewInteractionElements.txt =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/CreatingNewInteractionElements.txt,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** CreatingNewInteractionElements.txt 2 Jul 2009 10:46:41 -0000 1.1 --- CreatingNewInteractionElements.txt 22 Nov 2010 23:05:49 -0000 1.1.4.1 *************** *** 8,9 **** --- 8,12 ---- If a new interaction element fails to work through Moodle, look here. + + Where an interaction element needs to create more than one form + element, look at the Matrix type. Index: TrueFalseIT.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/inputTypes/TrueFalseIT.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** TrueFalseIT.php 27 Aug 2009 16:23:00 -0000 1.9 --- TrueFalseIT.php 22 Nov 2010 23:05:49 -0000 1.9.2.1 *************** *** 124,127 **** --- 124,153 ---- } + + /** + * Returns an array of all options that are relevant to this type (overiding ALL options) + * Used to determine which options to show in authoring, for example. + * String keys MUST match QuestionPart variable names. + * + * @access public + * @return Array(String) + */ + public static function getOptionsUsed() + { + return array('teacherAns', 'studentVerify', 'hideFeedback'); + } + + /** + * Returns the default options. + * Only need to specify where they differ from QuestionPart defaults, so does not contain all used options (see setUsedoptions()) + * String keys MUST match QuestionPart variable names. + * + * @param array $param + * @access public + * @return Array(StackOption) + */ + public static function getOptionDefaults() { + return array('studentVerify'=>'false', 'hideFeedback'=>'true'); + } } |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:27
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/stack Modified Files: Tag: question_reporting styles.php block_stack.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: block_stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/stack/block_stack.php,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** block_stack.php 23 Jun 2009 16:18:28 -0000 1.8 --- block_stack.php 22 Nov 2010 23:05:47 -0000 1.8.4.1 *************** *** 67,70 **** --- 67,76 ---- $this->content->icons[] = '<img src="'.$root.'/pix/i/switch.gif" class="icon" alt="Edit Question Options" />'; } + /* + if (has_capability('moodle/question:viewmine', $context)) { + $this->content->items[] = '<a href="'.$root.'/question/type/opaque/stack/soapPage.php?page=diagnostic">'.get_string('diagnostic', 'block_stack').'</a>'; + $this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />'; + } + */ } else *************** *** 86,88 **** } ! ?> --- 92,94 ---- } ! ?> \ No newline at end of file Index: styles.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/stack/styles.php,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** styles.php 23 Jun 2009 16:18:28 -0000 1.2 --- styles.php 22 Nov 2010 23:05:47 -0000 1.2.4.1 *************** *** 2,4 **** --- 2,13 ---- .submitbtns { display: none; + } + + /* Ensures that elements generated by jsMath don't overlap and + thus disable buttons whilst enabling embedded input fields. + Workaround from http://www.math.union.edu/~dpvc/jsMath/bugs.html + STACK bug #2890734 */ + input { + z-index: 2; + position: relative; } \ No newline at end of file |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:26
|
Update of /cvsroot/stack/stack-dev/install In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/install Modified Files: Tag: question_reporting installFunctions.php installTranslator.php installStyles.css p2.php p3.php answer_test_testsuite.php adodbinit.php healthcheck.php p4.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: installTranslator.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/installTranslator.php,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** installTranslator.php 5 Apr 2007 14:02:29 -0000 1.1 --- installTranslator.php 22 Nov 2010 23:05:47 -0000 1.1.12.1 *************** *** 1,14 **** <?php ! /* ! Usual translator is no good for us, as config.php not been wrote yet. Instead pull language straight from session. */ ! session_start(); ! ! function get_string($identifier, $module='', $a=NULL) { ! //global $config; //return '['. $identifier .']'; --- 1,14 ---- <?php ! /* ! Usual translator is no good for us, as config.php not been wrote yet. Instead pull language straight from session. */ ! if(session_id() == '') session_start(); ! ! function get_string($identifier, $module='', $a=NULL) { ! //global $config; //return '['. $identifier .']'; *************** *** 20,24 **** // Get the current language if(!empty($_SESSION['Slang'])) ! { $lang = $_SESSION['Slang']; } --- 20,24 ---- // Get the current language if(!empty($_SESSION['Slang'])) ! { $lang = $_SESSION['Slang']; } *************** *** 27,32 **** $lang = 'en'; } ! ! /*if (is_array($options)) { if (array_key_exists('Language',$options)) { --- 27,32 ---- $lang = 'en'; } ! ! /*if (is_array($options)) { if (array_key_exists('Language',$options)) { Index: p3.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/p3.php,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -C2 -d -r1.24 -r1.24.2.1 *** p3.php 1 Sep 2009 08:45:50 -0000 1.24 --- p3.php 22 Nov 2010 23:05:47 -0000 1.24.2.1 *************** *** 17,33 **** */ //check we have the required settings to be here, else bounce to start ! session_start(); ! $configFile = '../config.php'; ! if(file_exists($configFile)) ! { ! require($configFile); ! $config = new stackConfig(); ! global $config; ! $root = $config->get('docroot'); ! // Ensure admin is logged in. ! require $root.'/lib/ui/AdminInterface.php'; ! } --- 17,33 ---- */ //check we have the required settings to be here, else bounce to start ! if(session_id() == '') session_start(); ! $configFile = '../config.php'; ! if(file_exists($configFile)) ! { ! require($configFile); ! $config = new stackConfig(); ! global $config; ! $root = $config->get('docroot'); ! // Ensure admin is logged in. ! require $root.'/lib/ui/AdminInterface.php'; ! } *************** *** 104,108 **** require_once($_SESSION['Sdocroot'].'/maxima/initMaxima.php'); ! $errorMessgage = ''; //form has been sent, check all complete foreach($_SESSION as $label => $val) --- 104,108 ---- require_once($_SESSION['Sdocroot'].'/maxima/initMaxima.php'); ! $errorMessage = ''; //form has been sent, check all complete foreach($_SESSION as $label => $val) *************** *** 215,219 **** <div class="content"> <?php ! if ($errorMessage != '') echo '<div class="box"> <p>'.$errorMessage.'</p> --- 215,219 ---- <div class="content"> <?php ! if (!empty($errorMessage)) echo '<div class="box"> <p>'.$errorMessage.'</p> *************** *** 265,269 **** <?php ! $maximaVersions = array('5.19.2','5.18.1','5.17.0','5.16.3','5.15.0','5.13.0','5.12.0','5.11.0'); foreach($maximaVersions as $mVer) { --- 265,269 ---- <?php ! $maximaVersions = array('5.22.1','5.21.1','5.20.1','5.19.2','5.18.1','5.17.0','5.16.3','5.15.0'); foreach($maximaVersions as $mVer) { *************** *** 284,290 **** <div class="row"> <span class="label">Platform:</span><span class="formw"> <input type="radio" name="platform" value="win" <?php if($_SESSION['Splatform'] == 'win'){echo 'checked';} ?> onclick="containerHeight.hide();" /> <?php echo get_string('stackInstall_win','stack'); ?><br /> ! <input type="radio" name="platform" value="unix" <?php if($_SESSION['Splatform'] == 'unix'){echo 'checked';} ?> onclick="containerHeight.hide();" /> <?php echo get_string('stackInstall_unix','stack'); ?><br /> ! <input type="radio" name="platform" value="server" <?php if($_SESSION['Splatform'] == 'server'){echo 'checked';} ?> onclick="containerHeight.toggle();" /> <?php echo get_string('stackInstall_serverMode','stack'); ?><br /> </span> </div> --- 284,291 ---- <div class="row"> <span class="label">Platform:</span><span class="formw"> + <?php if(!isset($_SESSION['Splatform'])) $_SESSION['Splatform'] = 'win'; ?> <input type="radio" name="platform" value="win" <?php if($_SESSION['Splatform'] == 'win'){echo 'checked';} ?> onclick="containerHeight.hide();" /> <?php echo get_string('stackInstall_win','stack'); ?><br /> ! <input type="radio" name="platform" value="unix" <?php if($_SESSION['Splatform'] == 'unix'){echo 'checked';} ?> onclick="containerHeight.hide();" /> <?php echo get_string('stackInstall_unix','stack'); ?><br /> ! <input type="radio" name="platform" value="server" <?php if($_SESSION['Splatform'] == 'server'){echo 'checked';} ?> onclick="containerHeight.toggle();" /> <?php echo get_string('stackInstall_serverMode','stack'); ?><br /> </span> </div> *************** *** 363,371 **** <?php echo get_string('stackInstall_externalProgInfo','stack'); ?> </div> ! <div class="box"> ! <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_submit','stack'); ?></span><span class="formw"><input type="submit" value="<?php echo get_string('stackInstall_submit','stack'); ?>" /></span> ! </div> ! </div> <input type="hidden" name="sent" value="sent" /> --- 364,368 ---- <?php echo get_string('stackInstall_externalProgInfo','stack'); ?> </div> ! <span class="formw"><span class="formw"><input type="submit" value="<?php echo get_string('stackInstall_contButton','stack'); ?>" /></span> <input type="hidden" name="sent" value="sent" /> Index: installFunctions.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/installFunctions.php,v retrieving revision 1.35 retrieving revision 1.35.2.1 diff -C2 -d -r1.35 -r1.35.2.1 *** installFunctions.php 1 Sep 2009 08:45:50 -0000 1.35 --- installFunctions.php 22 Nov 2010 23:05:47 -0000 1.35.2.1 *************** *** 28,32 **** * @return bool true if write succeeded. */ ! session_start(); function createTmpDir($root, $tmp) --- 28,32 ---- * @return bool true if write succeeded. */ ! if(session_id() == '') session_start(); function createTmpDir($root, $tmp) *************** *** 146,150 **** $config .= ' ! $this->configArray["version"] = "STACK 2.0 beta"; $this->configArray["platform"] = '."'".$_SESSION['Splatform']."'".'; //server os / server mode $this->configArray["host"] = '."'".$_SESSION['Shost']."'".'; //server hostname --- 146,150 ---- $config .= ' ! $this->configArray["version"] = "STACK 2.2"; $this->configArray["platform"] = '."'".$_SESSION['Splatform']."'".'; //server os / server mode $this->configArray["host"] = '."'".$_SESSION['Shost']."'".'; //server hostname *************** *** 199,214 **** switch($this->casArray["version"]) { - case "5.11.0": - $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.11.0.bat"; - break; - - case "5.12.0": - $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.12.0.bat"; - break; - - case "5.13.0": - $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.13.0.bat"; - break; - case "5.15.0": $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.15.0.bat"; --- 199,202 ---- *************** *** 230,233 **** --- 218,233 ---- $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.19.2.bat"; break; + + case "5.20.1": + $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.20.1.bat"; + break; + + case "5.21.1": + $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.20.1.bat"; + break; + + case "5.21.2": + $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.20.1.bat"; + break; } *************** *** 279,283 **** } } ! ?>'; $config = trim($config); return $config; --- 279,283 ---- } } ! '; // deliberately omitting PHP close tag to avoid trailing whitespace issues $config = trim($config); return $config; *************** *** 285,291 **** /** ! * Checks the config.php wrote to disk is valid. * - * Checks last characters are ?> * @return bool */ --- 285,290 ---- /** ! * Checks the config.php wrote to disk is valid and secure. * * @return bool */ *************** *** 295,309 **** if($conf == false){ return false; ! }else{ ! if(substr($conf, -2) != '?>'){ ! return false; ! } ! else{ ! return true; ! } } } /** * Called at end of installation process, writes out the a server specific WSDL file required for Opaque server to function * --- 294,322 ---- if($conf == false){ return false; ! } else { ! return true; } } /** + * Checks various potential security loopholes. + * + * @return bool + */ + function checkSecurity(){ + + $issues = ''; + + if(file_exists('../config.php~')) { + $issues .= '<li>Your configuration settings are public as <tt>config.php~</tt>. You should remove this file.'; + } + if(!empty($issues)) { + $issues = '<ul>'.$issues.'</ul>'; + } + + return $issues; + } + + /** * Called at end of installation process, writes out the a server specific WSDL file required for Opaque server to function * *************** *** 500,504 **** $send .= "Referer: $r\r\n"; }else{ ! if ($_SERVER['HTTP_REFERER']){ $send .= "Referer: {$_SERVER['HTTP_REFERER']}\r\n"; } --- 513,517 ---- $send .= "Referer: $r\r\n"; }else{ ! if (isset($_SERVER['HTTP_REFERER'])){ $send .= "Referer: {$_SERVER['HTTP_REFERER']}\r\n"; } *************** *** 529,534 **** } fputs($open, $send); while (!feof($open)) { ! $return .= fgets($open, 4096); } fclose($open); --- 542,548 ---- } fputs($open, $send); + $return = ''; while (!feof($open)) { ! $return .= fgets($open, 4096); } fclose($open); Index: p2.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/p2.php,v retrieving revision 1.23 retrieving revision 1.23.4.1 diff -C2 -d -r1.23 -r1.23.4.1 *** p2.php 26 Jun 2009 18:08:21 -0000 1.23 --- p2.php 22 Nov 2010 23:05:47 -0000 1.23.4.1 *************** *** 19,24 **** if(!isset($_POST['submitted'])) { ! session_start(); ! $configFile = '../config.php'; if(file_exists($configFile)) --- 19,24 ---- if(!isset($_POST['submitted'])) { ! if(session_id() == '') session_start(); ! $configFile = '../config.php'; if(file_exists($configFile)) *************** *** 28,43 **** global $config; $root = $config->get('docroot'); ! // Ensure admin is logged in. require $root.'/lib/ui/AdminInterface.php'; } ! $_SESSION['Senv'] = $_POST['env']; ! if ($_SESSION['Senv'] != 'ok') { header('Location: index.php'); } ! $server = 'localhost'; $db = 'stack'; --- 28,43 ---- global $config; $root = $config->get('docroot'); ! // Ensure admin is logged in. require $root.'/lib/ui/AdminInterface.php'; } ! $_SESSION['Senv'] = $_POST['env']; ! if ($_SESSION['Senv'] != 'ok') { header('Location: index.php'); } ! $server = 'localhost'; $db = 'stack'; *************** *** 49,53 **** $moodlepassword = ''; $moodleprefix = 'mdl_'; ! } --- 49,53 ---- $moodlepassword = ''; $moodleprefix = 'mdl_'; ! } *************** *** 55,65 **** { //attempt to load variables from the session ! session_start(); ! $server = $_SESSION['Sdbserver']; $db = $_SESSION['Sdb']; $username = $_SESSION['Sdbusername']; $password = $_SESSION['Sdbpassword']; $driver = $_SESSION['Sdriver']; ! $moodleserver = $_SESSION['SmoodleDBhost']; $moodleusername = $_SESSION['SmoodleDBuser']; --- 55,65 ---- { //attempt to load variables from the session ! //session_start(); ! $server = $_SESSION['Sdbserver']; $db = $_SESSION['Sdb']; $username = $_SESSION['Sdbusername']; $password = $_SESSION['Sdbpassword']; $driver = $_SESSION['Sdriver']; ! $moodleserver = $_SESSION['SmoodleDBhost']; $moodleusername = $_SESSION['SmoodleDBuser']; *************** *** 84,88 **** $password = addslashes($_POST['password']); $driver = addslashes($_POST['driver']); ! $moodleserver = addslashes($_POST['moodleserver']); $moodledb = addslashes($_POST['moodledb']); --- 84,88 ---- $password = addslashes($_POST['password']); $driver = addslashes($_POST['driver']); ! $moodleserver = addslashes($_POST['moodleserver']); $moodledb = addslashes($_POST['moodledb']); *************** *** 91,100 **** $moodleprefix = addslashes($_POST['moodleprefix']); $moodleDriver = addslashes($_POST['moodleDriver']); ! //check can access db with supplied details //@$link = mysql_connect($server, $username, $password); require_once('adodbinit.php'); $link = testConnection($server, $username, $password, $db, $driver); ! if (!$link) { --- 91,100 ---- $moodleprefix = addslashes($_POST['moodleprefix']); $moodleDriver = addslashes($_POST['moodleDriver']); ! //check can access db with supplied details //@$link = mysql_connect($server, $username, $password); require_once('adodbinit.php'); $link = testConnection($server, $username, $password, $db, $driver); ! if (!$link) { *************** *** 108,112 **** else { ! //add to session session_start(); --- 108,112 ---- else { ! //add to session session_start(); *************** *** 118,122 **** $result = buildTables($server, $username, $password, $db, $driver); ! if($result != true) { --- 118,122 ---- $result = buildTables($server, $username, $password, $db, $driver); ! if($result != true) { *************** *** 145,153 **** //try to connect to moodle database. //@$link = mysql_connect($moodleserver, $moodleusername, $moodlepassword); ! //@$selectedDB = mysql_select_db($moodledb, $link); ! $moodleConn = testConnection($moodleserver, $moodleusername, $moodlepassword, $moodledb, $moodleDriver); ! if ($moodleConn == false) { --- 145,153 ---- //try to connect to moodle database. //@$link = mysql_connect($moodleserver, $moodleusername, $moodlepassword); ! //@$selectedDB = mysql_select_db($moodledb, $link); ! $moodleConn = testConnection($moodleserver, $moodleusername, $moodlepassword, $moodledb, $moodleDriver); ! if ($moodleConn == false) { *************** *** 177,184 **** $_SESSION['SmoodleDriver'] = $moodleDriver; $_SESSION['SmoodleSetup'] = 'true'; ! header('Location: p3.php'); } ! } else --- 177,184 ---- $_SESSION['SmoodleDriver'] = $moodleDriver; $_SESSION['SmoodleSetup'] = 'true'; ! header('Location: p3.php'); } ! } else *************** *** 187,196 **** header('Location: p3.php'); } ! ! } } } ! } --- 187,196 ---- header('Location: p3.php'); } ! ! } } } ! } Index: answer_test_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/answer_test_testsuite.php,v retrieving revision 1.40 retrieving revision 1.40.2.1 diff -C2 -d -r1.40 -r1.40.2.1 *** answer_test_testsuite.php 15 Oct 2009 15:28:04 -0000 1.40 --- answer_test_testsuite.php 22 Nov 2010 23:05:47 -0000 1.40.2.1 *************** *** 45,49 **** // AlgEquiv Answer tests. ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','x^2-2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','integerp(3)','true',1,'','Predicates'); $testsuite[] = stack_testsuite_construct('AlgEquiv','integerp(3.1)','true',0,'',''); --- 45,50 ---- // AlgEquiv Answer tests. ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1/0','1',0,'',''); ! $testsuite[] = stack_testsuite_construct('AlgEquiv','1','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','integerp(3)','true',1,'','Predicates'); $testsuite[] = stack_testsuite_construct('AlgEquiv','integerp(3.1)','true',0,'',''); *************** *** 62,65 **** --- 63,69 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','abs(x)','sqrt(x^2)',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x-1','(x^2-1)/(x+1)',1,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','a^b*a^c','a^(b+c)',1,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','(4*sqrt(3)*%i+4)^(1/5)','6^(1/5)*cos(%pi/15)-6^(1/5)*%i*sin(%pi/15)',0,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)^2','x^2-2*x+1',1,'','Polynomials and rational function'); $testsuite[] = stack_testsuite_construct('AlgEquiv','(x-1)*(x^2+x+1)','x^3-1',1,'',''); *************** *** 70,75 **** --- 74,81 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(x)^2-1','cos(2*x)',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','exp(%i*%pi)','-1',1,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','2*cos(2*x)+x+1','-sin(x)^2+3*cos(x)^2+x',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','(2*sec(2*t)^2-2)/2','-(sin(4*t)^2-2*sin(4*t)+cos(4*t)^2-1)*(sin(4*t)^2+2*sin(4*t)+cos(4*t)^2-1)/(sin(4*t)^2+cos(4*t)^2+2*cos(4*t)+1)^2',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','log(a^2*b)','2*log(a)+log(b)',1,'','Logarithms'); + $testsuite[] = stack_testsuite_construct('AlgEquiv','lg(10^x)','x',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','x','[1,2,3]',0,'','Lists'); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2]','[1,2,3]',0,'',''); *************** *** 77,80 **** --- 83,87 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,x>2]','[1,2<x]',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','[1,2,[2-x<0,{1,2,2,2,1,3}]]','[1,2,[2-x<0,{1,2}]]',0,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','x','{1,2,3}',0,'','Sets'); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2}','{1,2,3}',0,'',''); *************** *** 82,85 **** --- 89,93 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,2,4}','{1,2,3}',0,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','{1,x>4}','{4<x,1}',1,'',''); + $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); $testsuite[] = stack_testsuite_construct('AlgEquiv','matrix([1,2],[2,3])','matrix([1,2,3],[2,3,3])',0,'',''); *************** *** 127,134 **** --- 135,144 ---- $testsuite[] = stack_testsuite_construct('AlgEquiv','n/n!','1/(n-1)!',1,'',''); $testsuite[] = stack_testsuite_construct('AlgEquiv','2/%i*ln(sqrt((1+z)/2)+%i*sqrt((1-z)/2))','-%i*ln(z+i*sqrt(1-z^2))',1,'','These currently fail'); + $testsuite[] = stack_testsuite_construct('AlgEquiv','-%i/sqrt(x)','sqrt(-1/x)',1,'',''); // SubstEquiv Answer tests. $testsuite[] = stack_testsuite_construct('SubstEquiv','1/0','x^2-2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('SubstEquiv','x^2+1','x^2+1',1,'',''); + $testsuite[] = stack_testsuite_construct('SubstEquiv','x^2+1','x^3+1',0,'',''); $testsuite[] = stack_testsuite_construct('SubstEquiv','X^2+1','x^2+1',1,'',''); $testsuite[] = stack_testsuite_construct('SubstEquiv','x^2+y','a^2+b',1,'',''); *************** *** 139,148 **** $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/0','0',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+2*x','x*2+1',1,'','Simple polynomials'); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+x','2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+x+x','2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(x+y)+z','z+x+y',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/2','3/6',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+x+x','2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','y=x','x=y',0,'','Equality is not included as commutative....'); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x+1','y=2*x+1',0,'','Equations'); --- 149,177 ---- $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/0','0',0,'',''); + $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','0','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+2*x','x*2+1',1,'','Simple polynomials'); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+x','2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1+x+x','2*x+1',0,'',''); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(x+y)+z','z+x+y',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x*x','x^2',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(1-x)^2','(x-1)^2',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','-1+2','2-1',1,'','Unary minus'); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','-1*2+3*4','3*4-1*2',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(-1*2)+3*4','3*4+(-1*2)',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x*(-y)','-x*y',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x*(-y)','-(x*y)',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(-x)*(-x)','x*x',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(-x)*(-x)','x^2',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/2','3/6',0,'','Rational expressions'); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/(1+2*x)','1/(2*x+1)',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','2/(4+2*x)','1/(x+2)',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(a*b)/c','a*(b/c)',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(-x)/y','-(x/y)',1,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x/(-y)','-(x/y)',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','-1/(1-x)','1/(x-1)',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','1/2*1/x','1/(2*x)',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','%i','e^(pi/2)',0,'','Complex numbers'); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','(4*sqrt(3)*%i+4)^(1/5)','rectform((4*sqrt(3)*%i+4)^(1/5))',0,'',''); ! $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','y=x','x=y',0,'','Equality is not included as commutative....'); $testsuite[] = stack_testsuite_construct('Equal_Com_Ass','x+1','y=2*x+1',0,'','Equations'); *************** *** 177,180 **** --- 206,211 ---- + $testsuite[] = stack_testsuite_construct('SameType','1/0','1',0,'',''); + $testsuite[] = stack_testsuite_construct('SameType','1','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('SameType','4^(-1/2)','1/2',1,'','Numbers'); $testsuite[] = stack_testsuite_construct('SameType','x','[1,2,3]',0,'','Lists'); *************** *** 201,209 **** $testsuite[] = stack_testsuite_construct('Expanded','2*(x-1)','0',0,'',''); $testsuite[] = stack_testsuite_construct('Expanded','(x-1)*(x+1)','0',0,'',''); $testsuite[] = stack_testsuite_construct('Expanded','cos(2*x)','0',1,'',''); // Factored form ! $testsuite[] = stack_testsuite_construct('FacForm','1/0','x^2-2*x+1',0,'',''); ! $testsuite[] = stack_testsuite_construct('FacForm','1/0','x^2-2*x+1',0,'x',''); $testsuite[] = stack_testsuite_construct('FacForm','2','2',1,'x','Trivial cases'); $testsuite[] = stack_testsuite_construct('FacForm','1/3','1/3',1,'x',''); --- 232,244 ---- $testsuite[] = stack_testsuite_construct('Expanded','2*(x-1)','0',0,'',''); $testsuite[] = stack_testsuite_construct('Expanded','(x-1)*(x+1)','0',0,'',''); + $testsuite[] = stack_testsuite_construct('Expanded','(x-a)*(x-b)','0',0,'',''); + $testsuite[] = stack_testsuite_construct('Expanded','x^2-(a+b)*x+a*b','0',0,'',''); + $testsuite[] = stack_testsuite_construct('Expanded','x^2-a*x-b*x+a*b','0',1,'',''); $testsuite[] = stack_testsuite_construct('Expanded','cos(2*x)','0',1,'',''); // Factored form ! $testsuite[] = stack_testsuite_construct('FacForm','1/0','0',0,'x',''); ! $testsuite[] = stack_testsuite_construct('FacForm','0','1/0',0,'x',''); ! $testsuite[] = stack_testsuite_construct('FacForm','0','0',0,'1/0',''); $testsuite[] = stack_testsuite_construct('FacForm','2','2',1,'x','Trivial cases'); $testsuite[] = stack_testsuite_construct('FacForm','1/3','1/3',1,'x',''); *************** *** 245,248 **** --- 280,287 ---- $testsuite[] = stack_testsuite_construct('FacForm','(x-1)*(x+(1+sqrt(3)*%i)/2)*(x+(1-sqrt(3)*%i)/2)','x^3-1',1,'x',''); + + $testsuite[] = stack_testsuite_construct('CompSquare','1/0','0',0,'',''); + $testsuite[] = stack_testsuite_construct('CompSquare','1/0','0',0,'x',''); + $testsuite[] = stack_testsuite_construct('CompSquare','0','1/0',0,'x',''); $testsuite[] = stack_testsuite_construct('CompSquare','sin(x-1)+a-1','(x-1)^2+1',0,'x',''); $testsuite[] = stack_testsuite_construct('CompSquare','x^2-1','(x-1)*(x+1)',1,'x','Trivial cases'); *************** *** 262,266 **** //Single Fraction Test ! //$testsuite[] = stack_testsuite_construct('SingleFrac','1/0','1/n',0,'','Basic tests'); $testsuite[] = stack_testsuite_construct('SingleFrac','x=3','2',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','3','3',1,'',''); --- 301,306 ---- //Single Fraction Test ! $testsuite[] = stack_testsuite_construct('SingleFrac','1/0','1/n',0,'',''); ! $testsuite[] = stack_testsuite_construct('SingleFrac','0','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','x=3','2',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','3','3',1,'',''); *************** *** 270,274 **** $testsuite[] = stack_testsuite_construct('SingleFrac','a+1/2','(2*a+1)/2',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','1/n +2/(n+1)','(3*n+1)/(n*(n+1))',0,'',''); ! $testsuite[] = stack_testsuite_construct('SingleFrac','2*(1/n)','2/n',1,'','2 Correct answers for the same question'); $testsuite[] = stack_testsuite_construct('SingleFrac','2/n','2/n',1,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','2/(n+1)','1/(n+1)',0,'','Simple Mistakes'); --- 310,314 ---- $testsuite[] = stack_testsuite_construct('SingleFrac','a+1/2','(2*a+1)/2',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','1/n +2/(n+1)','(3*n+1)/(n*(n+1))',0,'',''); ! $testsuite[] = stack_testsuite_construct('SingleFrac','2*(1/n)','2/n',0,'','2 subtly different answers for the same question'); $testsuite[] = stack_testsuite_construct('SingleFrac','2/n','2/n',1,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','2/(n+1)','1/(n+1)',0,'','Simple Mistakes'); *************** *** 276,280 **** --- 316,327 ---- $testsuite[] = stack_testsuite_construct('SingleFrac','(2*n)/(n*(n+2))','(2*n)/(n*(n+3))',0,'',''); $testsuite[] = stack_testsuite_construct('SingleFrac','(x-1)/(x^2-1)','1/(x+1)',1,'',''); + $testsuite[] = stack_testsuite_construct('SingleFrac','(1/2)/(3/4)','2/3',0,'','Fractions within fractions'); + $testsuite[] = stack_testsuite_construct('SingleFrac','(x-2)/4/(2/x^2)','(x-2)*x^2/8',0,'',''); + $testsuite[] = stack_testsuite_construct('SingleFrac','1/(1-1/x)','x/(x-1)',0,'',''); + $testsuite[] = stack_testsuite_construct('PartFrac','1/0','3*x^2',0,'',''); + $testsuite[] = stack_testsuite_construct('PartFrac','1/0','3*x^2',0,'x',''); + $testsuite[] = stack_testsuite_construct('PartFrac','0','0',0,'1/0',''); + $testsuite[] = stack_testsuite_construct('PartFrac','0','1/0',0,'x',''); $testsuite[] = stack_testsuite_construct('PartFrac','1/m','1/n',0,'n','Basic tests'); $testsuite[] = stack_testsuite_construct('PartFrac','1/n','1/n',0,'n',''); *************** *** 292,295 **** --- 339,343 ---- $testsuite[] = stack_testsuite_construct('PartFrac','n/(2*n-1)-(n+1)/(2*n+1)','1/(4*n-2)-1/(4*n+2)',0,'n',''); $testsuite[] = stack_testsuite_construct('PartFrac','10/(x+3) - 2/(x+2) + x -2','(x^3 + 3*x^2 + 4*x +2)/((x+2)*(x+3))',1,'x','Correct Answer, Numerator > Denominator'); + $testsuite[] = stack_testsuite_construct('PartFrac','2*x+1/(x+1)+1/(x-1)','2*x^3/(x^2-1)',1,'x',''); $testsuite[] = stack_testsuite_construct('PartFrac','1/(n*(n-1))','1/(n*(n-1))',0,'n','Simple mistakes'); $testsuite[] = stack_testsuite_construct('PartFrac','1/(n-1)-1/n^2','1/((n+1)*n)',0,'n',''); *************** *** 309,319 **** $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'',''); $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Diff','3*x^2','3*x^2',1,'x',''); $testsuite[] = stack_testsuite_construct('Diff','3*X^2','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+1','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+c','3*x^2',0,'x',''); - $testsuite[] = stack_testsuite_construct('Diff','','3*x^2',0,'','Additional tests'); - $testsuite[] = stack_testsuite_construct('Diff','x^4/4+c','',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','y=x^4/4','x^4/4',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4','y=x^4/4',0,'x',''); --- 357,368 ---- $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'',''); $testsuite[] = stack_testsuite_construct('Diff','1/0','3*x^2',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Diff','0','1/0',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Diff','0','0',0,'1/0',''); ! $testsuite[] = stack_testsuite_construct('Diff','x^4/4+c','',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Diff','3*x^2','3*x^2',1,'x','Basic tests'); $testsuite[] = stack_testsuite_construct('Diff','3*X^2','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+1','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4+c','3*x^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','y=x^4/4','x^4/4',0,'x',''); $testsuite[] = stack_testsuite_construct('Diff','x^4/4','y=x^4/4',0,'x',''); *************** *** 326,331 **** // Integration test ! $testsuite[] = stack_testsuite_construct('Int','1/0','x^2-2*x+1',0,'',''); ! $testsuite[] = stack_testsuite_construct('Int','x^3/3','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3+1','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3+c','x^3/3',1,'x',''); --- 375,383 ---- // Integration test ! $testsuite[] = stack_testsuite_construct('Int','1/0','1',0,'',''); ! $testsuite[] = stack_testsuite_construct('Int','1/0','1',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Int','1','1/0',0,'x',''); ! $testsuite[] = stack_testsuite_construct('Int','0','0',0,'1/0',''); ! $testsuite[] = stack_testsuite_construct('Int','x^3/3','x^3/3',0,'x','Basic tests'); $testsuite[] = stack_testsuite_construct('Int','x^3/3+1','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','x^3/3+c','x^3/3',1,'x',''); *************** *** 336,340 **** --- 388,396 ---- $testsuite[] = stack_testsuite_construct('Int','X^3/3+c','x^3/3',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','sin(2*x)','x^3/3',0,'x',''); + $testsuite[] = stack_testsuite_construct('Int','x^2/2-2*x+2+c','(x-2)^2/2',1,'x',''); $testsuite[] = stack_testsuite_construct('Int','(t-1)^5/5+c','(t-1)^5/5',1,'t',''); + $testsuite[] = stack_testsuite_construct('Int','x^3/3+c','x^3/3+c',1,'x','The teacher adds a constant'); + $testsuite[] = stack_testsuite_construct('Int','x^2/2-2*x+2+c','(x-2)^2/2+k',1,'x',''); + $testsuite[] = stack_testsuite_construct('Int','exp(x)+c','exp(x)',1,'x','Special case'); $testsuite[] = stack_testsuite_construct('Int','2*x','x^3/3',0,'x','Student differentiates by mistake'); $testsuite[] = stack_testsuite_construct('Int','2*x+c','x^3/3',0,'x',''); *************** *** 356,359 **** --- 412,417 ---- $testsuite[] = stack_testsuite_construct('Int','ln(k*abs(x))','ln(k*abs(x))',1,'x',''); $testsuite[] = stack_testsuite_construct('Int','ln(x)+ln(a)','ln(k*abs(x+a))',0,'x','Other logs'); + $testsuite[] = stack_testsuite_construct('Int','log(x)^2-2*log(c)*log(x)+k','ln(c/x)^2',0,'x',''); + $testsuite[] = stack_testsuite_construct('Int','log(x)^2-2*log(c)*log(x)+k','ln(abs(c/x))^2',0,'x',''); $testsuite[] = stack_testsuite_construct('Int','2*sin(x)*cos(x)','sin(2*x)+c',0,'x','Trig'); $testsuite[] = stack_testsuite_construct('Int','2*sin(x)*cos(x)+k','sin(2*x)+c',1,'x',''); *************** *** 365,375 **** $testsuite[] = stack_testsuite_construct('Int','(tan(2*t)-2*t)/2+c','-(t*sin(4*t)^2-sin(4*t)+t*cos(4*t)^2+2*t*cos(4*t)+t)/(sin(4*t)^2+cos(4*t)^2+2*cos(4*t)+1)',1,'t',''); $testsuite[] = stack_testsuite_construct('Int','tan(x)-x+c','tan(x)-x',1,'x',''); - $testsuite[] = stack_testsuite_construct('Int','1/0','x^2-2*x+1',0,'x','Variable mismatch tests'); - $testsuite[] = stack_testsuite_construct('Int','1/0','x^2-2*x+1',1,'y',''); - $testsuite[] = stack_testsuite_construct('Int','x^3/3+1','x^3/3',0,'y',''); - $testsuite[] = stack_testsuite_construct('Int','x^3/3','y^3/3',0,'y',''); - $testsuite[] = stack_testsuite_construct('Int','y^3/3','x^3/3',0,'y',''); - $testsuite[] = stack_testsuite_construct('GT','1','1',0,'',''); $testsuite[] = stack_testsuite_construct('GT','2','1',1,'',''); --- 423,429 ---- $testsuite[] = stack_testsuite_construct('Int','(tan(2*t)-2*t)/2+c','-(t*sin(4*t)^2-sin(4*t)+t*cos(4*t)^2+2*t*cos(4*t)+t)/(sin(4*t)^2+cos(4*t)^2+2*cos(4*t)+1)',1,'t',''); $testsuite[] = stack_testsuite_construct('Int','tan(x)-x+c','tan(x)-x',1,'x',''); + $testsuite[] = stack_testsuite_construct('GT','1/0','1',0,'',''); + $testsuite[] = stack_testsuite_construct('GT','1','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('GT','1','1',0,'',''); $testsuite[] = stack_testsuite_construct('GT','2','1',1,'',''); *************** *** 379,382 **** --- 433,438 ---- + $testsuite[] = stack_testsuite_construct('GTE','1/0','1',0,'',''); + $testsuite[] = stack_testsuite_construct('GTE','1','1/0',0,'',''); $testsuite[] = stack_testsuite_construct('GTE','1','1',1,'',''); $testsuite[] = stack_testsuite_construct('GTE','2','1',1,'',''); *************** *** 386,389 **** --- 442,448 ---- + $testsuite[] = stack_testsuite_construct('NumRelative','1/0','0',0,'','Basic tests'); + $testsuite[] = stack_testsuite_construct('NumRelative','0','1/0',0,'',''); + $testsuite[] = stack_testsuite_construct('NumRelative','0','0',0,'1/0',''); $testsuite[] = stack_testsuite_construct('NumRelative','1.1','1',0,'','No option, so 5%'); $testsuite[] = stack_testsuite_construct('NumRelative','1.05','1',1,'',''); *************** *** 399,402 **** --- 458,486 ---- $testsuite[] = stack_testsuite_construct('NumAbsolute','3.14','pi',0,'0.001',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1/0','3',0,'0','Basic tests'); + $testsuite[] = stack_testsuite_construct('NumSigFigs','0','1/0',0,'0',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','0','0',0,'1/0',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1','3',0,'pi',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1','3',0,'[3,x]',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1','3',0,'[1,2,3]',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1','3',0,'',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1.234','4',0,'1','Option is a number'); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.141','3.1415927',0,'3',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.141','3.1415927',0,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.142','3.1415927',1,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.142','pi',1,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','pi','pi',0,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3141','3.1415927',0,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','0.00123','0.001234567',1,'3',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','0.001235','0.001234567',1,'4',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','0.150','0.14951',1,'3',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','1000','999',1,'2',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','-100','-149',1,'1',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','-0.05','-0.0499',1,'1',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.142','3.1415927',1,'[4,3]','Mixed options'); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.143','3.1415927',1,'[4,3]',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.150','3.1415927',0,'[4,3]',''); + $testsuite[] = stack_testsuite_construct('NumSigFigs','3.1416','3.1415927',0,'[4,3]',''); + $testsuite[] = stack_testsuite_construct('String','Hello','hello',0,'',''); *************** *** 412,437 **** $testsuite[] = stack_testsuite_construct('RegExp','cxcxcz','3.1415927',0,'[0-9]*\.[0-9]*',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','1/0','x^2-2*x+1',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','X','x',0,'','Case sensitivity'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','0.5','1/2',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','0.33','1/3',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2/4','1/2',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','-1/3','-1/3',1,'','Negative numbers'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','1/-3','-1/3',1,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','-2/4','-1/2',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2/-4','-1/2',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','x+1/3','x+1/3',1,'','Polynomials'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','x+2/6','x+1/3',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','cos(x)','cos(-x)',1,'','Trig functions'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','[1,2]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','[1,2,4]','[1,2,3]',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','{1,2}','{1,2,3}',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','{1,2,4}','{1,2,3}',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','matrix([1,2],[2,3])','matrix([1,2],[2,3])',1,'','Matrices'); - $testsuite[] = stack_testsuite_construct('LowestTerms','x=1','x=1',1,'',''); - $testsuite[] = stack_testsuite_construct('LowestTerms','1=x','x=1',1,'',''); - $testsuite[] = stack_testsuite_construct('LowestTerms','1','x>1',0,'','Inequalities'); - $testsuite[] = stack_testsuite_construct('LowestTerms','x>1','x>1',1,'',''); /* ********************************************************** */ --- 496,525 ---- $testsuite[] = stack_testsuite_construct('RegExp','cxcxcz','3.1415927',0,'[0-9]*\.[0-9]*',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','1/0','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','0.5','0',1,'','Mix of floats and rational numbers'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','0.33','0',1,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2/4','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','-1/3','0',1,'','Negative numbers'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','1/-3','0',1,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','-2/4','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2/-4','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','x+1/3','0',1,'','Polynomials'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','x+2/6','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2*x/4+2/6','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','2/4*x+2/6','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','cos(x)','0',1,'','Trig functions'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','cos(3/6*x)','0',0,'',''); ! $testsuite[] = stack_testsuite_construct('LowestTerms','matrix([1,2/4],[2,3])','0',0,'','Matrices'); ! ! $testsuite[] = stack_testsuite_construct('LowestTerms','x=1/2','0',1,'','Equations'); ! $testsuite[] = stack_testsuite_construct('LowestTerms','3/9=x','0',0,'',''); ! ! ! /* Create an array with all available tests on it */ ! foreach ($testsuite as $ts) { ! $AvailableTests[$ts['AnswerTest']]=true; ! } ! $AvailableTests = array_keys($AvailableTests); /* ********************************************************** */ *************** *** 441,444 **** --- 529,534 ---- + + // Now perform the tests, and display the results. *************** *** 448,451 **** --- 538,556 ---- } + if (array_key_exists('ALL',$_GET)) { + $AnsTest = 'ALL'; + } + + // Normally turned off on production servers. + if ('ALL'==$AnsTest) {die();} + //$AnsTest='ALL'; + + + /* Tests in Windows. + C: + cd \xampp\htdocs\stack-dev\install\ + \xampp\php\php.exe answer_test_testsuite.php > c:\tmp\test.html + */ + /* Output the text for a batch file test. */ /* *************** *** 459,463 **** */ ! echo '<div class="content"> <div class="box">'; --- 564,568 ---- */ ! echo ' <div class="box">'; *************** *** 467,506 **** echo ' </div>'; ! echo '<h2>'.get_string('stackInstall_testsuite_choose','stack','')."</h2>\n"; ! echo "<form name=\"ChooseAnsTest\" action=\"\" method=\"POST\">\n"; ! $prefs = new maximaPreferences(); ! $anst = new AnsTestController($AnsTest,0,0,$prefs); ! echo $anst->ansTestWidget("AnsTest",$AnsTest); ! echo '<input type="submit" value="Submit" />'; ! echo "</form>"; ! if ('' == $AnsTest OR 'default' == $AnsTest) { ! die(); } - $a = $AnsTest; - echo '<hr /><h1>'.get_string('stackInstall_testsuite_for','stack',$a)."</h2>\n"; ! echo $stackAnswerTest[$AnsTest]['doc']; ! $all_passed = TRUE; ! echo "<p><table border='1' cellpadding='2'>\n\n"; ! // (4) Sort out and display the output ! echo "<tr bgcolor='#DDDDDD'>\n <th> pass? </th> ! <th> SAns </th> ! <th> TAns </th> ! <th> Opt </th> ! <th> Errors </th> ! <th> RawMark </th> ! <th> Expected </th> ! <th> FeedBack </th> ! <th> AnswerNote </th>\n</tr>\n"; ! foreach ($testsuite as $ts) { // (0) Check this is the required AnswerTest. --- 572,627 ---- echo ' </div>'; ! if ('ALL'!==$AnsTest) { ! echo '<h2>'.get_string('stackInstall_testsuite_choose','stack','')."</h2>\n"; ! echo "<form name=\"ChooseAnsTest\" action=\"\" method=\"POST\">\n"; ! $prefs = new maximaPreferences(); ! $anst = new AnsTestController($AnsTest,0,0,$prefs); ! echo $anst->ansTestWidget("AnsTest",$AnsTest); ! echo '<input type="submit" value="Submit" />'; ! echo "</form>"; ! } ! if ('' == $AnsTest OR 'default' == $AnsTest) { ! die(); ! } ! // Decide how many answer tests to choose! ! if ('ALL'===$AnsTest) { ! $TestList = $AvailableTests; ! //$TestList = array('String','StringSloppy'); ! foreach($TestList as $AnsTest) { ! echo '<a href="#'.$AnsTest.'">'.$AnsTest.'</a><br />'; ! } ! echo '<hr />'; ! } else { ! $TestList = array($AnsTest); ! echo '<hr />'; } ! // Loop over the required tests ! foreach($TestList as $AnsTest) { ! $a = $AnsTest; ! echo '<h1><a name="'.$a.'">'.get_string('stackInstall_testsuite_for','stack',$a)."</a></h2>\n"; ! $all_passed = TRUE; + echo "<p><table border='1' cellpadding='2' width='100%'>\n\n"; + // (4) Sort out and display the output + echo "<tr bgcolor='#DDDDDD'>\n <th> pass? </th> + <th> SAns </th> + <th> TAns </th> + <th> Opt </th> + <th> Err </th> + <th> M </th> + <th> Ex </th> + <th> FeedBack </th> + <th> AnswerNote </th>\n</tr>\n"; ! ! foreach ($testsuite as $ts) { // (0) Check this is the required AnswerTest. *************** *** 508,511 **** --- 629,634 ---- if ($ts['AnswerTest'] == $AnsTest) { + //$maxima_str .= 'AT'.$ts['AnswerTest'].'('.$ts['SAns'].',['.$ts['TAns'].','.$ts['AnsTestOpt']."]);\n"; + $err = ''; *************** *** 534,541 **** } - if ('false' === $valid) { - $errors .= ' <font color="red">[invalid]</font>'; - } - if (''===$rawmark) { $rawmark='<font color="red">[ ]</font>'; --- 657,660 ---- *************** *** 559,564 **** echo "<tr>\n"; echo " <td> $outcome </td>\n"; ! echo " <td nowrap=\"nowrap\">".htmlspecialchars($ts['SAns'])." </td>\n "; ! echo " <td nowrap=\"nowrap\">".htmlspecialchars($ts['TAns'])." </td>\n "; echo " <td> {$ts['AnsTestOpt']} </td>\n "; echo " <td> $errors </td>\n "; --- 678,683 ---- echo "<tr>\n"; echo " <td> $outcome </td>\n"; ! echo " <td>".htmlspecialchars($ts['SAns'])." </td>\n "; ! echo " <td>".htmlspecialchars($ts['TAns'])." </td>\n "; echo " <td> {$ts['AnsTestOpt']} </td>\n "; echo " <td> $errors </td>\n "; *************** *** 585,592 **** echo "<hr />\n"; ?> - </div> <pre> --- 704,713 ---- echo "<hr />\n"; + //echo "<pre>".$maxima_str."</pre>"; + + } ?> <pre> Index: p4.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/p4.php,v retrieving revision 1.7 retrieving revision 1.7.12.1 diff -C2 -d -r1.7 -r1.7.12.1 *** p4.php 12 Dec 2007 14:37:41 -0000 1.7 --- p4.php 22 Nov 2010 23:05:47 -0000 1.7.12.1 *************** *** 37,45 **** } ! if(isset($_POST['sent'])) { - //check all complete - $errorMessage = ''; - if ($_POST['adminname'] == '') { --- 37,43 ---- } ! $errorMessage = ''; ! if(isset($_POST['sent'])) //check all complete { if ($_POST['adminname'] == '') { *************** *** 110,117 **** <form action="p4.php" method="POST"> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_firstName','stack'); ?></span><span class="formw"><input type="text" name="adminname" size="40" value="<?php echo $_SESSION['Sadminname']; ?>" /></span> </div> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_surname','stack'); ?></span><span class="formw"><input type="text" name="adminsurname" size="40" value="<?php echo $_SESSION['Sadminsurname']; ?>" /></span> </div> <br /> --- 108,115 ---- <form action="p4.php" method="POST"> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_firstName','stack'); ?></span><span class="formw"><input type="text" name="adminname" size="40" value="<?php echo isset($_SESSION['Sadminname'])? $_SESSION['Sadminname']:''; ?>" /></span> </div> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_surname','stack'); ?></span><span class="formw"><input type="text" name="adminsurname" size="40" value="<?php echo isset($_SESSION['Sadminsurname'])?$_SESSION['Sadminsurname']:''; ?>" /></span> </div> <br /> *************** *** 122,132 **** <span class="label"><?php echo get_string('stackInstall_password2','stack'); ?></span><span class="formw"><input type="password" name="pword2" size="40" /></span> </div> ! ! <?php if($_SESSION['SmoodleSetup'] == 'true') { echo '<br /> <div class="row"> ! <span class="label">Your Moodle Username</span><span class="formw">'; $result = moodleUsers($_SESSION['SmoodleDBhost'],$_SESSION['SmoodleDBuser'],$_SESSION['SmoodleDBpassword'],$_SESSION['SmoodleDB'],$_SESSION['SmoodleDriver'], $_SESSION['SmoodlePrefix']); echo $result; --- 120,130 ---- <span class="label"><?php echo get_string('stackInstall_password2','stack'); ?></span><span class="formw"><input type="password" name="pword2" size="40" /></span> </div> ! ! <?php if($_SESSION['SmoodleSetup'] == 'true') { echo '<br /> <div class="row"> ! <span class="label">'.get_string('stackInstall_yourMoodleUsername','stack').'</span><span class="formw">'; $result = moodleUsers($_SESSION['SmoodleDBhost'],$_SESSION['SmoodleDBuser'],$_SESSION['SmoodleDBpassword'],$_SESSION['SmoodleDB'],$_SESSION['SmoodleDriver'], $_SESSION['SmoodlePrefix']); echo $result; *************** *** 139,150 **** } ?> ! <br /> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_email','stack'); ?></span><span class="formw"><input type="text" name="adminemail" size="40" value="<?php echo $_SESSION['Sadminemail']; ?>" /></span> </div> <div class="row"> <span class="label"><?php echo get_string('stackInstall_smtp','stack'); ?></span><span class="formw"><input type="text" name="smtp" size="40" value="<?php ! if ($_SESSION['Ssmtp'] != '') { echo $_SESSION['Ssmtp']; } else { --- 137,148 ---- } ?> ! <br /> <div class="row"> ! <span class="label"><?php echo get_string('stackInstall_email','stack'); ?></span><span class="formw"><input type="text" name="adminemail" size="40" value="<?php echo isset($_SESSION['Sadminemail'])?$_SESSION['Sadminemail']:''; ?>" /></span> </div> <div class="row"> <span class="label"><?php echo get_string('stackInstall_smtp','stack'); ?></span><span class="formw"><input type="text" name="smtp" size="40" value="<?php ! if (isset($_SESSION['Ssmtp'])) { echo $_SESSION['Ssmtp']; } else { *************** *** 162,166 **** <div class="row"> <input type="hidden" name="sent" value="sent" /> ! <span class="label"></span><span class="formw"><input type="submit" value="Submit" /></span> </div> </form> --- 160,164 ---- <div class="row"> <input type="hidden" name="sent" value="sent" /> ! <span class="label"><input type="submit" value="Submit" /></span> </div> </form> Index: adodbinit.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/adodbinit.php,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** adodbinit.php 24 Aug 2009 10:20:49 -0000 1.8 --- adodbinit.php 22 Nov 2010 23:05:47 -0000 1.8.2.1 *************** *** 31,36 **** require_once("../other/adodb5/adodb.inc.php"); ! define("NUM_TABLES", 10); ! define("EXPECTED_TABLE_NAMES", "'attempt_meta_PRT', 'attempt_meta_answer', 'display_cache', 'display_cache_sequence', 'keywords', 'opaque_sessions', 'question_keyword', 'question_attempts', 'response_trees', 'stackquestion'");; /** --- 31,36 ---- require_once("../other/adodb5/adodb.inc.php"); ! define("NUM_TABLES", 11); ! define("EXPECTED_TABLE_NAMES", "'attempt_meta_PRT', 'attempt_meta_answer', 'display_cache', 'display_cache_sequence', 'keywords', 'opaque_sessions', 'question_keyword', 'question_attempts', 'response_trees', 'stackquestion', 'question_lines'"); /** *************** *** 182,185 **** --- 182,186 ---- questionKeywords X, questionUserLastEdited I(11) UNSIGNED DEFAULT NULL, + line I(11) UNSIGNED, questionPublisher X, questionFormat X, *************** *** 206,209 **** --- 207,222 ---- } + // Table structure for table `question_lines` + $fields= + 'id I(11) UNSIGNED NOTNULL AUTO PRIMARY, + latestVersion I(11) UNSIGNED, + modified T NOTNULL DEFTIMESTAMP ON UPDATE '.$db->sysTimeStamp; + + $sqlarray = $dict->CreateTableSQL("question_lines", $fields, ""); + if(!$dict->ExecuteSQLArray($sqlarray)) + { + $toReturn = $dict->ErrorMsg().'<br /><br />'; + } + // Structure for `display_cache` table $fields= *************** *** 265,269 **** } ! $conn = &NewADOConnection($driver); $result = $conn->PConnect($server, $username, $password, $database); --- 278,282 ---- } ! $conn = NewADOConnection($driver); $result = $conn->PConnect($server, $username, $password, $database); *************** *** 309,313 **** function testConnection($server, $username, $password, $database, $driver) { ! $conn = &NewADOConnection($driver); $result = @$conn->NConnect($server, $username, $password, $database); if($result == false) --- 322,326 ---- function testConnection($server, $username, $password, $database, $driver) { ! $conn = NewADOConnection($driver); $result = @$conn->NConnect($server, $username, $password, $database); if($result == false) *************** *** 334,338 **** { //echo "$driver $server $username $password $database $driver"; ! $conn = &NewADOConnection($driver); $result = @$conn->NConnect($server, $username, $password, $database); if($result == false) --- 347,351 ---- { //echo "$driver $server $username $password $database $driver"; ! $conn = NewADOConnection($driver); $result = @$conn->NConnect($server, $username, $password, $database); if($result == false) *************** *** 348,352 **** if(!empty($users)) { ! $xhtml .= '<select name="moodleUser">'; $xhtml .= '<option value="2">Default</option>'; foreach($users as $user) --- 361,365 ---- if(!empty($users)) { ! $xhtml = '<select name="moodleUser">'; $xhtml .= '<option value="2">Default</option>'; foreach($users as $user) Index: healthcheck.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/healthcheck.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** healthcheck.php 25 Sep 2009 11:29:59 -0000 1.11 --- healthcheck.php 22 Nov 2010 23:05:47 -0000 1.11.2.1 *************** *** 63,67 **** $maximaOptions = new maximaPreferences(); ! $seed = mktime(); --- 63,67 ---- $maximaOptions = new maximaPreferences(); ! $seed = time(); // encouraged over calling mktime() *************** *** 98,102 **** $display = 'LaTeX'; ! $displayTestString = '\[ \sum_{n=1}^\infty \left( \frac{1}{n^2}\right) = \frac{\pi^2}{6}. \]'; require_once $root.'/lib/ui/frontend.php'; --- 98,102 ---- $display = 'LaTeX'; ! $displayTestString = '\[ \sum_{n=1}^\infty \left( \frac{1}{n^2}\right) = \frac{\pi^2}{6}. \]'; require_once $root.'/lib/ui/frontend.php'; *************** *** 150,159 **** <?php // Check the configuration of JSMath if it has been set - $jsmathroot = trim($config->get('jsmath')); - if ('' != $jsmathroot) { echo '<div class="box"><h3>'.get_string('stackInstall_jsmathcheck','stack','').'</h3>'; ! $f = 1; $c = 1;//1 for header, 2 for body, 3 for both $r = NULL; --- 150,166 ---- <?php // Check the configuration of JSMath if it has been set + // incremental checks to avoid confusing contradictory failures + + $jsmathroot = trim($config->get('jsmath')); + + if ('' != $jsmathroot) { echo '<div class="box"><h3>'.get_string('stackInstall_jsmathcheck','stack','').'</h3>'; + // firstly, is it on the same server? + if(false !== strpos($jsmathroot, $_SERVER['HTTP_HOST'])) { + echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathsamehost', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" width="16" height="16" alt="'.get_string('stackIcon_success_alt','stack').'" /></p>'; ! // secondly, can load file be found? ! $f = 1; $c = 1;//1 for header, 2 for body, 3 for both $r = NULL; *************** *** 169,182 **** } else { echo '<p><span class="valid">'.get_string('stackInstall_success', 'stack','').'</span> '.get_string('stackInstall_jsmathok', 'stack','').' <img src="'.$wroot.'/pix/'.get_string('stackIcon_success','stack').'" widt... [truncated message content] |
Update of /cvsroot/stack/stack-dev/lib/items In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/items Modified Files: Tag: question_reporting StackOption.php Meta.php PotentialResponseTree.php ItemOption.php QuestionType.php InstantiatedItem.php ItemState.php QTList.php ItemTests.php CasTextType.php Item.php StudentAns.php RawKeyVal.php CasString.php InteractionElement.php QuestionPart.php PotentialResponse.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: StudentAns.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/StudentAns.php,v retrieving revision 1.42 retrieving revision 1.42.2.1 diff -C2 -d -r1.42 -r1.42.2.1 *** StudentAns.php 27 Aug 2009 16:23:00 -0000 1.42 --- StudentAns.php 22 Nov 2010 23:05:45 -0000 1.42.2.1 *************** *** 60,63 **** --- 60,64 ---- //first parse out the students variables $sAns = $this->parser($posted); + if($sAns != NULL) { *************** *** 117,121 **** if($ans == '') { - //echo 'here'; $this->studentAnswers[$label]->setRawAns($ans); $this->studentAnswers[$label]->setStatus(NULL); --- 118,121 ---- *************** *** 127,131 **** //if answer has changed, but not blank $prev = $this->studentAnswers[$label]->getRawAns(); ! if($ans != $prev) { $this->studentAnswers[$label]->setRawAns($ans); --- 127,131 ---- //if answer has changed, but not blank $prev = $this->studentAnswers[$label]->getRawAns(); ! if($ans !== $prev) { $this->studentAnswers[$label]->setRawAns($ans); *************** *** 220,225 **** foreach($this->studentAnswers as $label => $sAns) { - // echo "<hr>Checking $label<br>"; - //override items standard itemOptions with those specified in the question part related to this questionpart. if($questionPart !== NULL && array_key_exists($label, $questionPart)) --- 220,223 ---- *************** *** 246,250 **** $castext = '@'.$rawString.'@'; - // for some reason is returning text not the boolean values required. if($itemOptions->getSelected('InformalSyntax') == 'false') --- 244,247 ---- *************** *** 280,283 **** --- 277,281 ---- if(($valid === true) && ($questionPart !== NULL)) { + //from the question part associated with the student answer, check the student has not entered a forbidden keyword. if(array_key_exists($label, $questionPart)) *************** *** 320,334 **** } } - - // check for passed-through qmchar - if(false !== strpos('qmchar', $sym)) $valid = $sym.' contains question marks.'; - } - } } //check against implicitly forbidden words (IE the question variables and tans) - if(($valid === true) && (!empty($implictForbid))) { --- 318,326 ---- *************** *** 359,362 **** --- 351,360 ---- } + // Check for ?s in an answer, passed-through Maxima as "qmchar". These are not permitted + $qm_pos = strpos($sAns->getRawAns(),'?'); + if (false !== $qm_pos) { + $valid = $valid.get_string('stackCas_qmchar', 'stack', ''); + } + if($valid === true) { *************** *** 397,401 **** { //we only want answers that have passed the syntax checks ! if($sAns->getStatus() == 'valid') { $casText .= '@'; --- 395,399 ---- { //we only want answers that have passed the syntax checks ! if($sAns->getStatus() == 'valid' || $sAns->getStatus() == 'score') { $casText .= '@'; *************** *** 405,409 **** } - /*commands are send with insert stars on and strict syntax off, the least strict settings * this is to allow us to send all students answers through at the same time to the cas --- 403,406 ---- *************** *** 413,417 **** $ct = new casText($casText, 's', false, true); //need itemOptions settings - //add in float checking & type checking $i = 0; --- 410,413 ---- *************** *** 421,426 **** //echo $sAns->getRawAns(); //echo $sAns->getStatus(); ! //echo "<pre>";print_r($questionPart[$label]);echo "</pre>"; ! if($sAns->getStatus() == 'valid') { //create a castext string, for checking float status --- 417,422 ---- //echo $sAns->getRawAns(); //echo $sAns->getStatus(); ! //echo "<pre>";print_r($questionPart[$label]);echo "</pre>"; ! if($sAns->getStatus() == 'valid' || $sAns->getStatus() == 'score') { //create a castext string, for checking float status *************** *** 446,454 **** if($sameType == 'false') { ! $casCommands["caschat$i"] = 'stack_validate_typeless('.$starredAnswer.','.$ForbidFloats.','.$LowestTerms.')'; } else { ! $casCommands["caschat$i"] = 'stack_validate('.$starredAnswer.','.$ForbidFloats.','.$LowestTerms.','.$TAns.')'; } $validLabels[] = $label; --- 442,450 ---- if($sameType == 'false') { ! $casCommands["caschat$i"] = 'stack_validate_typeless(['.$starredAnswer.'],'.$ForbidFloats.','.$LowestTerms.')'; } else { ! $casCommands["caschat$i"] = 'stack_validate(['.$starredAnswer.'],'.$ForbidFloats.','.$LowestTerms.','.$TAns.')'; } $validLabels[] = $label; *************** *** 463,467 **** elseif ($casCommands === NULL) { ! //no cas commands to extract, valid = true, in a manor of thinking. } else --- 459,463 ---- elseif ($casCommands === NULL) { ! //no cas commands to extract, valid = true, in a manner of thinking. } else *************** *** 469,473 **** $displayFormat = $itemOptions->getSelected('Display'); ! //Student answers should not be simplyfied for display. $itemOptions->setSelected('Simplify','false'); --- 465,469 ---- $displayFormat = $itemOptions->getSelected('Display'); ! //Student answers should not be simplified for display. $itemOptions->setSelected('Simplify','false'); *************** *** 481,485 **** //echo "<pre>";print_r($displayResults);echo "</pre>"; - $i = 0; foreach($validLabels as $vLabel) --- 477,480 ---- *************** *** 555,558 **** --- 550,566 ---- } + /** + * Where an IE status can be fastracked from valid to score, do it. + */ + public function scoreIfValid($questionPart = NULL) { + if(!empty($this->studentAnswers)) { + foreach($this->studentAnswers as $label => $sAns) { + if($sAns->getStatus() == 'valid' && $questionPart[$label]->getStudentVerify()->getSelected() == 'false') { + $sAns->setStatus('score'); + } + } + } + } + /** * If casString not set will return null. Index: InteractionElement.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/InteractionElement.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** InteractionElement.php 27 Aug 2009 16:23:00 -0000 1.9 --- InteractionElement.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 106,110 **** */ public function getLabel() ! { return $this->label; } --- 106,110 ---- */ public function getLabel() ! { return $this->label; } *************** *** 117,121 **** */ public function getRawAns() ! { //strip $, ;, or : from answer $str = new stringUtil($this->rawAns); --- 117,121 ---- */ public function getRawAns() ! { //strip $, ;, or : from answer $str = new stringUtil($this->rawAns); *************** *** 130,134 **** */ public function getStatus() ! { return $this->status; } --- 130,134 ---- */ public function getStatus() ! { return $this->status; } *************** *** 141,145 **** */ public function getCasAns() ! { return $this->casValue; } --- 141,145 ---- */ public function getCasAns() ! { return $this->casValue; } *************** *** 152,156 **** */ public function getDisplayValue() ! { return $this->displayValue; } --- 152,156 ---- */ public function getDisplayValue() ! { return $this->displayValue; } *************** *** 164,168 **** */ public function setStatus($changedStatus) ! { $nullStatus = array(NULL,'new','solutionSeen'); //changes that are valid if status is Null now $newStatus = array(NULL,'new','valid','invalid'); --- 164,168 ---- */ public function setStatus($changedStatus) ! { $nullStatus = array(NULL,'new','solutionSeen'); //changes that are valid if status is Null now $newStatus = array(NULL,'new','valid','invalid'); *************** *** 241,245 **** */ public function setCasAns($ans) ! { $this->casValue = $ans; } --- 241,245 ---- */ public function setCasAns($ans) ! { $this->casValue = $ans; } *************** *** 253,257 **** */ public function setRawAns($ans) ! { $this->rawAns = $ans; } --- 253,257 ---- */ public function setRawAns($ans) ! { $this->rawAns = $ans; } *************** *** 265,269 **** */ public function setDisplayValue($disp) ! { $this->displayValue = $disp; } --- 265,269 ---- */ public function setDisplayValue($disp) ! { $this->displayValue = $disp; } *************** *** 277,281 **** */ public function getFeedback() ! { return $this->feedback; } --- 277,281 ---- */ public function getFeedback() ! { return $this->feedback; } *************** *** 289,293 **** */ public function setFeedback($feedback) ! { $this->feedback = $feedback; } --- 289,293 ---- */ public function setFeedback($feedback) ! { $this->feedback = $feedback; } Index: QuestionPart.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/QuestionPart.php,v retrieving revision 1.32 retrieving revision 1.32.2.1 diff -C2 -d -r1.32 -r1.32.2.1 *** QuestionPart.php 27 Aug 2009 16:23:00 -0000 1.32 --- QuestionPart.php 22 Nov 2010 23:05:45 -0000 1.32.2.1 *************** *** 129,133 **** private $insertStars; - /** * Whether to enable type checking on students answer or not. --- 129,132 ---- *************** *** 138,141 **** --- 137,155 ---- private $sameType; + /** + * Whether student answer needs to be visually verified by student + * + * @var boolean + * @access private + */ + private $studentVerify; + + /** + * Whether student receives feedback for this question part + * + * @var boolean + * @access private + */ + private $hideFeedback; /** *************** *** 145,148 **** --- 159,163 ---- * @access private */ + private $inputTypeParam; *************** *** 180,185 **** $this->insertStars = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); $this->sameType = new StackOption('list', 'true', array('true' => get_string('stackOption_checkType','stack',''), 'false' => get_string('stackOption_doNotCheckType','stack',''))); ! //set the default input type paramters for the selected input type $this->loadITDefaults(); } --- 195,202 ---- $this->insertStars = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); $this->sameType = new StackOption('list', 'true', array('true' => get_string('stackOption_checkType','stack',''), 'false' => get_string('stackOption_doNotCheckType','stack',''))); + $this->studentVerify = new StackOption('list','true',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + $this->hideFeedback = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); ! //set the default input type parameters for the selected input type $this->loadITDefaults(); } *************** *** 374,378 **** { $this->inputType->setSelection($inputType); ! } /** --- 391,395 ---- { $this->inputType->setSelection($inputType); ! } /** *************** *** 617,620 **** --- 634,680 ---- } + /** + * Returns the stackoption for controlling whether to check students needs to verify their valid answer + * @access public + * @return stackOption studentVerify + */ + public function getStudentVerify() { + return $this->studentVerify; + } + + /** + * Sets the studentVerify value + * @access public + * @param string new value + * @return void + */ + public function setStudentVerify($val) { + if($this->studentVerify !== NULL) + { + $this->studentVerify->setSelected($val); + } + } + + /* Returns the stackoption for controlling whether to check students needs to verify their valid answer + * @access public + * @return stackOption studentVerify + */ + public function getHideFeedback() { + return $this->hideFeedback; + } + + /** + * Sets the studentVerify value + * @access public + * @param string new value + * @return void + */ + public function setHideFeedback($val) { + if($this->hideFeedback !== NULL) + { + $this->hideFeedback->setSelected($val); + } + } + /** * Sets the sameType value *************** *** 654,658 **** /** ! * set the default input type paramters for the selected input type * * @param array $parameters The set values, if any. --- 714,718 ---- /** ! * set the default input type options and parameters for the selected input type * * @param array $parameters The set values, if any. *************** *** 661,670 **** public function loadITDefaults($parameters=NULL) { ! $inputType = $this->inputType->getSelection(); $iType = new InputTypeController($inputType); $this->inputTypeParam = $iType->getDefaultParam($parameters); } - /** * Updates the Input Type parameters with the passed in values from an associative array. --- 721,729 ---- public function loadITDefaults($parameters=NULL) { ! $inputType = $this->inputType->getSelection(); $iType = new InputTypeController($inputType); $this->inputTypeParam = $iType->getDefaultParam($parameters); } /** * Updates the Input Type parameters with the passed in values from an associative array. *************** *** 685,692 **** if(array_key_exists($label, $this->inputTypeParam)) { - /*echo '<pre>'; - var_dump($this->inputTypeParam); - echo '</pre>';*/ - $this->inputTypeParam[$label]->setSelection($value); } --- 744,747 ---- *************** *** 799,802 **** --- 854,885 ---- } + public function equals($other) { + return $this->allowedWords == $other->allowedWords + && $this->boxSize == $other->boxSize + && $this->forbiddenWords == $other->forbiddenWords + && $this->forbidFloats == $other->forbidFloats + && $this->formalSyntax == $other->formalSyntax + && $this->inputType == $other->inputType + && $this->inputTypeParam == $other->inputTypeParam + && $this->insertStars == $other->insertStars + && $this->lowestTerms == $other->lowestTerms + && $this->qpName == $other->qpName + && $this->sameType == $other->sameType + && $this->studentAnsKey == $other->studentAnsKey + && $this->syntaxHint == $other->syntaxHint + && $this->teacherAns == $other->teacherAns + && $this->studentVerify == $other->studentVerify + && $this->hideFeedback == $other->hideFeedback; + } + + /** + * Ensure this Question Part has all latest options. For legacy Items. + * @param none + * @return none + */ + public function ensureCompleteOptions() { + if(!isset($this->studentVerify)) $this->studentVerify = new StackOption('list','true',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + if(!isset($this->hideFeedback)) $this->hideFeedback = new StackOption('list','false',array('true' => get_string('stack_True', 'stack', ''), 'false' => get_string('stack_False', 'stack', ''))); + } } Index: QuestionType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/QuestionType.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** QuestionType.php 27 Aug 2009 16:23:00 -0000 1.11 --- QuestionType.php 22 Nov 2010 23:05:44 -0000 1.11.2.1 *************** *** 75,79 **** /** ! * The questionType type, may be keyval,castext,caschat, or meta. Fixed at the class level. * Used so each questiontype subclass can identify its own type. * --- 75,79 ---- /** ! * The questionType type, may be keyval,castext, caschat or meta. Fixed at the class level. * Used so each questiontype subclass can identify its own type. * *************** *** 87,94 **** * @access protected */ ! protected $errorLog; /** ! * Whether this questiontype forbids floats (ofcourse pointless in the meta class. * @var bool * @access protected --- 87,94 ---- * @access protected */ ! protected static $errorLog; /** ! * Whether this questiontype forbids floats (of course pointless in the meta class). * @var bool * @access protected *************** *** 97,101 **** /** ! * Where this questionType should be simplyfied when sent to the cas or not. * * @access protected --- 97,101 ---- /** ! * Where this questionType should be simplified when sent to the cas or not. * * @access protected *************** *** 125,129 **** $this->metaType = $metatype; $this->xmlType = $xmlType; ! $this->errorLog = new error(); } --- 125,130 ---- $this->metaType = $metatype; $this->xmlType = $xmlType; ! //$this->errorLog = new error(); ! if(self::$errorLog == null) self::$errorLog = new error(); } *************** *** 210,214 **** $toReturn = false; $msg = $this->required.' is an invalid option for a required field. Must be either optional, required or system.'; ! $this->errorLog->addError($msg); } --- 211,215 ---- $toReturn = false; $msg = $this->required.' is an invalid option for a required field. Must be either optional, required or system.'; ! self::$errorLog->addError($msg); } *************** *** 220,224 **** $msg = $this->xmlType.' is an invalid XML type'; ! $this->errorLog->addError($msg); } return $toReturn; --- 221,225 ---- $msg = $this->xmlType.' is an invalid XML type'; ! self::$errorLog->addError($msg); } return $toReturn; *************** *** 245,249 **** //var_dump($this->errorLog); ! return $this->errorLog->toString(); } --- 246,250 ---- //var_dump($this->errorLog); ! return self::$errorLog->toString();//$this->errorLog->toString(); } *************** *** 262,266 **** { //display a simple text box ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->default.'"'; } else --- 263,267 ---- { //display a simple text box ! $widget = '<input type="text" name="'.$name.'" id="'.$name.'" size="'.$size.'" value="'.$this->default.'"'; } else *************** *** 334,340 **** return $node->textContent; } - - - } --- 335,338 ---- Index: ItemTests.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/ItemTests.php,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** ItemTests.php 27 Aug 2009 16:23:00 -0000 1.3 --- ItemTests.php 22 Nov 2010 23:05:44 -0000 1.3.2.1 *************** *** 218,222 **** --- 218,231 ---- } + public function equals($other) { + if(!empty($this->tests)) { + if(empty($other->tests)) return false; + foreach($this->tests as $key => $val) { + if($val != $other->tests[$key]) return false; + } + } else if(!empty($other->tests)) return false; + return true; + } } Index: PotentialResponse.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/PotentialResponse.php,v retrieving revision 1.48 retrieving revision 1.48.4.1 diff -C2 -d -r1.48 -r1.48.4.1 *** PotentialResponse.php 27 Jun 2009 08:51:41 -0000 1.48 --- PotentialResponse.php 22 Nov 2010 23:05:45 -0000 1.48.4.1 *************** *** 583,586 **** --- 583,608 ---- /** + * Returns the quiet setting. + * + * @access public + * @return string + */ + public function getQuiet() + { + return $this->quiet; + } + + /** + * Returns the teacher note. + * + * @access public + * @return string + */ + public function getTeacherNote() + { + return $this->teacherNote; + } + + /** * Returns the answertest used in this PR. * *************** *** 665,669 **** $form = '<div class="PR">'; $form .= "<strong>".get_string('stack_num','stack','')." $id</strong><br />"; - $form .= '<span style="float: right">'.get_string('stackQuestion_PR_remove','stack','').'<input type="checkbox" name="'.$prefix.'-remove" value="true"></span> '; $form .= get_string('stackQuestion_PR_SAns2','stack','').': <input type="text" size="10" name="'.$prefix.'-sans" value="'.$this->sAns.'" /> '; //sans $form .= get_string('stackQuestion_PR_TAns2','stack','').': <input type="text" size="10" name="'.$prefix.'-tans" value="'.$this->tAns.'" /> '; //tans --- 687,690 ---- *************** *** 704,721 **** } ! ! //True Array ! $form .= '<div class="PRTTrue"><strong>'.get_string('stack_true','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-trueModMark">'; - $modOpts = array('=','+','-','=AT'); foreach($modOpts as $mod) { ! if($mod == $this->trueArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected>$mod</option>"; } else --- 725,743 ---- } + $modOpts = array('=','+','-','=AT'); ! // False PR box output first for rendering reasons ! $form .= "<div>";// container for true/false boxes ! //if false ! $form .= '<div class="PRTFalse"><strong>'.get_string('stack_false','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-falseModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->falseArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected='selected'>$mod</option>"; } else *************** *** 727,740 **** $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-trueMark" value="'.$this->trueArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-truePenalty" value="'.$this->trueArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-trueNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRTrue) { ! $form .= "<option value=\"$ppr\" selected>$ppr</option>"; } else --- 749,762 ---- $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-falseMark" value="'.$this->falseArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-falsePenalty" value="'.$this->falseArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-falseNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRFalse) { ! $form .= "<option value=\"$ppr\" selected='selected'>$ppr</option>"; } else *************** *** 745,779 **** $form .= '</select>'; $form .= '<br /><br />'; ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-trueFeedback" >'.$this->trueArray['feedback'].'</textarea>'; //feedback ! //$form .= 'Feedback: '.$this->trueArray['feedback']->editWidget("$prefix-trueFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->trueArray['AnsNote']; ! if ('' === $the_an) { ! $the_an = substr($prefix,14).'-T '; } ! $form .= get_string('ShowAt_AnswerNote','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-trueAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! ! if(!empty($validationErrors['truefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['truefeedback'].'</p>'; } - $form .= '</div>'; ! ! //if false ! $form .= '<div class="PRTFalse"><strong>'.get_string('stack_false','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-falseModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->falseArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected='selected'>$mod</option>"; } else --- 767,800 ---- $form .= '</select>'; $form .= '<br /><br />'; ! ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-falseFeedback" >'.$this->falseArray['feedback'].'</textarea>'; ! //$form .= 'Feedback: '.$this->falseArray['feedback']->editWidget("$prefix-falseFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->falseArray['AnsNote']; ! if ('' == $the_an) { ! // knock off "PR-PotResTree_" ! $the_an = substr($prefix,14).'-F '; } + $form .= '<br />'.get_string('ShowAt_AnswerNote','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-falseAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! if(!empty($validationErrors['falsefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['falsefeedback'].'</p>'; } $form .= '</div>'; ! //True Array ! $form .= '<div class="PRTTrue"><strong>'.get_string('stack_true','stack','').'</strong><br />'; //rawmarkmod dropdown box ! $form .= get_string('stackQuestion_PR_RawMarkMod2','stack','').': <select name="'.$prefix.'-trueModMark">'; foreach($modOpts as $mod) { ! if($mod == $this->trueArray['rawModMark']) { ! $form .= "<option value=\"$mod\" selected>$mod</option>"; } else *************** *** 785,798 **** $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-falseMark" value="'.$this->falseArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-falsePenalty" value="'.$this->falseArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-falseNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRFalse) { ! $form .= "<option value=\"$ppr\" selected='selected'>$ppr</option>"; } else --- 806,819 ---- $form .= '</select> '; ! $form .= get_string('Mark','stack','').': <input type="text" size="2" name="'.$prefix.'-trueMark" value="'.$this->trueArray['rawmark'].'" /> '; //mark ! $form .= get_string('ShowAt_Penalty','stack','').': <input type="text" size="2" name="'.$prefix.'-truePenalty" value="'.$this->trueArray['penalty'].'" /> '; //penalty ! $form .= get_string('stackQuestion_PR_nextPR','stack','').' <select name="'.$prefix.'-trueNextPR">'; foreach($potentialPRs as $ppr) { ! if($ppr == $this->nextPRTrue) { ! $form .= "<option value=\"$ppr\" selected>$ppr</option>"; } else *************** *** 803,827 **** $form .= '</select>'; $form .= '<br /><br />'; ! ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-falseFeedback" >'.$this->falseArray['feedback'].'</textarea>'; ! //$form .= 'Feedback: '.$this->falseArray['feedback']->editWidget("$prefix-falseFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->falseArray['AnsNote']; ! if ('' == $the_an) { ! // knock off "PR-PotResTree_" ! $the_an = substr($prefix,14).'-F '; } - $form .= get_string('ShowAt_AnswerNote','stack','').': <textarea cols="45" rows="1" name="'.$prefix.'-falseAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! if(!empty($validationErrors['falsefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['falsefeedback'].'</p>'; } $form .= '</div>'; $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_teachersNote','stack','').' <br></span><span class="formw"><textarea cols="65" rows="1" name="'.$prefix.'-teacherNotes">'.$this->teacherNote.'</textarea></span></div>'; ! $form .= '<div class="clearer"> </div>'; $form .= '</div>'; --- 824,850 ---- $form .= '</select>'; $form .= '<br /><br />'; ! $form .= get_string('ShowAt_FeedBack','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-trueFeedback" >'.$this->trueArray['feedback'].'</textarea>'; //feedback ! //$form .= 'Feedback: '.$this->trueArray['feedback']->editWidget("$prefix-trueFeedback", 45, 1); // CJS 10/10/2008 // If the AnswerNote is empty, we should add something useful. ! $the_an = $this->trueArray['AnsNote']; ! if ('' === $the_an) { ! $the_an = substr($prefix,14).'-T '; } ! $form .= '<br />'.get_string('ShowAt_AnswerNote','stack','').': <textarea cols="40" rows="1" name="'.$prefix.'-trueAnsNote" >'.$the_an.'</textarea>'; //Ansnote ! ! if(!empty($validationErrors['truefeedback'])) { ! $form .= '<p class="error">'.get_string('ShowAt_FeedBack','stack','').': '.$validationErrors['truefeedback'].'</p>'; } + $form .= '</div>'; + $form .= '</div>'; // close true/false container $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_teachersNote','stack','').' <br></span><span class="formw"><textarea cols="65" rows="1" name="'.$prefix.'-teacherNotes">'.$this->teacherNote.'</textarea></span></div>'; ! //$form .= '<div class="clearer"> </div>'; ! $form .= '<span style="float: right">'.get_string('stackQuestion_PR_remove','stack','').'<input type="checkbox" name="'.$prefix.'-remove" value="true"></span> '; $form .= '</div>'; Index: Meta.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/Meta.php,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** Meta.php 27 Aug 2009 16:23:00 -0000 1.18 --- Meta.php 22 Nov 2010 23:05:44 -0000 1.18.2.1 *************** *** 58,62 **** //set selected to default initially $this->selection = $default; ! $this->errorLog = new error(); } --- 58,62 ---- //set selected to default initially $this->selection = $default; ! // done in parent (and statically) $this->errorLog = new error(); } *************** *** 288,292 **** } } - ?> \ No newline at end of file --- 288,294 ---- } + public function equals($other) { + return $this->forbidFloats == $other->forbidFloats; + } } ?> \ No newline at end of file Index: QTList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/QTList.php,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** QTList.php 27 Aug 2009 16:23:00 -0000 1.3 --- QTList.php 22 Nov 2010 23:05:44 -0000 1.3.2.1 *************** *** 460,464 **** break; } ! echo 'selected: '.$selected.'<Br />'; if(trim($selected) == '') { --- 460,464 ---- break; } ! echo 'selected: '.$selected.'<br />'; if(trim($selected) == '') { Index: PotentialResponseTree.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/PotentialResponseTree.php,v retrieving revision 1.71 retrieving revision 1.71.4.1 diff -C2 -d -r1.71 -r1.71.4.1 *** PotentialResponseTree.php 27 Jun 2009 08:51:41 -0000 1.71 --- PotentialResponseTree.php 22 Nov 2010 23:05:44 -0000 1.71.4.1 *************** *** 289,302 **** $preCalcValues = $this->prtPreCalc($preCalcValues, $maximaPreferences, $seed); - //requirements have been met, traverse the tree. - $nextPR = 0; //always start at PR 0 - //find the PR with the lowest id to start with. - $PRkeys = array_keys($this->PResponses); - sort($PRkeys); - $nextPR = $PRkeys[0]; - - //var_dump($this->PResponses); - //echo '<br><br>'; while($nextPR != -1) { --- 289,304 ---- $preCalcValues = $this->prtPreCalc($preCalcValues, $maximaPreferences, $seed); + // Do we have errors from the above? + if (-1==$preCalcValues) { + $nextPR=-1; + } else { + //requirements have been met, traverse the tree. + $nextPR = 0; //always start at PR 0 + //find the PR with the lowest id to start with. + $PRkeys = array_keys($this->PResponses); + sort($PRkeys); + $nextPR = $PRkeys[0]; + } while($nextPR != -1) { *************** *** 1045,1049 **** /** ! * Sends the student & teachers answers from each PR to the cas * @param array $precalc * @return array --- 1047,1051 ---- /** ! * Sends the student & teacher's answers from each PR to the CAS * @param array $precalc * @return array *************** *** 1140,1148 **** if($mconn->displayErrorString() !== NULL) { ! echo '<div class="error">'; ! echo '<p>'.'The Potential response tree caused the following problems:'.'</p>';; ! echo $mconn->displayErrorString(); ! echo '</div>'; ! die(); } else --- 1142,1155 ---- if($mconn->displayErrorString() !== NULL) { ! $err = '<div class="error">'; ! $err .= '<p>'.get_string('PR_ERROR','STACK').'</p>';; ! $err .= $mconn->displayErrorString(); ! $err .= '</div>'; ! $this->ansNote .='|PR_ERROR|'; ! $this->feedback .= $err; ! $this->penalty =0; ! $this->mark =0; ! //die(); ! return -1; } else *************** *** 1386,1389 **** --- 1393,1450 ---- return $node; } + + public function equals($other) { + // test PResponses first + if(!empty($this->PResponses)) + { + if(empty($other->PResponses) + || sizeof($this->PResponses) != sizeof($other->PResponses)) { + return false; + } + + if($this->penalty != $other->penalty) return false; + + foreach($this->PResponses as $name => $pr) + { + $opr = $other->PResponses[$name]; + if(empty($opr)) return false; + if($pr->getAnsTest() != $opr->getAnsTest() + || $pr->getTAns() != $opr->getTAns() + || $pr->getSAns() != $opr->getSAns() + || $pr->getTrueAN() != $opr->getTrueAN() + || $pr->getFalseAN() != $opr->getFalseAN() + || $pr->getTestOp() != $opr->getTestOp() + || $pr->getQuiet() != $opr->getQuiet() + || $pr->getTeacherNote() != $opr->getTeacherNote() + ) return false; + + // compare trueArray and falseArray + foreach($pr->ifTrue() as $key => $val) { + $array = $opr->ifTrue(); + if($array[$key] != $val) return false; + } + + foreach($pr->ifFalse() as $key => $val) { + $array = $opr->ifFalse(); + if($array[$key] != $val) return false; + } + } + + return true; + } + + return $this->ansNote == $other->ansNote + && $this->ansRequirements == $other->ansRequirements + && $this->ansTestError == $other->ansTestError + && $this->autoSimplify == $other->autoSimplify + && $this->description == $other->description + && $this->feedback == $other->feedback + && $this->feedbackVariables == $other->feedbackVariables + && $this->genericFeedback == $other->genericFeedback + && $this->mark == $other->mark + && $this->penalty == $other->penalty + && $this->PRTName == $other->PRTName + && $this->questionValue == $other->questionValue; + } } Index: CasString.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/CasString.php,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -d -r1.16 -r1.16.2.1 *** CasString.php 27 Aug 2009 16:23:00 -0000 1.16 --- CasString.php 22 Nov 2010 23:05:45 -0000 1.16.2.1 *************** *** 257,261 **** { $cs = trim($this->casString); ! $validString = '@ev(stack_validate_typeless('.$cs.', '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; return $validString; } --- 257,261 ---- { $cs = trim($this->casString); ! $validString = '@ev(stack_validate_typeless(['.$cs.'], '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; return $validString; } Index: StackOption.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/StackOption.php,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** StackOption.php 27 Aug 2009 16:23:00 -0000 1.12 --- StackOption.php 22 Nov 2010 23:05:44 -0000 1.12.2.1 *************** *** 18,22 **** /** ! * A option for a question. Some options are kept seperate from the item itself * as these may be changed at a quiz or higher level * --- 18,22 ---- /** ! * An option for a question. Some options are kept separate from the item itself * as these may be changed at a quiz or higher level * *************** *** 69,74 **** * @var error * @access private ! */ ! private $errorLog; /** --- 69,76 ---- * @var error * @access private ! */ ! private static $errorLog; ! ! //private $logger; /** *************** *** 89,94 **** $this->casType = $casType; $this->selected = $default; ! $this->errorLog = new error(); ! } --- 91,96 ---- $this->casType = $casType; $this->selected = $default; ! //$this->errorLog = new error(); ! if(self::$errorLog == null) self::$errorLog = new error(); } *************** *** 177,181 **** { $msg = 'Invalid StackOption type: '.$this->type; ! $this->errorLog->addError($msg); $toReturn = false; } --- 179,183 ---- { $msg = 'Invalid StackOption type: '.$this->type; ! self::$errorLog->addError($msg); $toReturn = false; } *************** *** 184,188 **** { $msg = 'Undefined casKey for casType: '.$this->casType; ! $this->errorLog->addError($msg); $toReturn = false; } --- 186,190 ---- { $msg = 'Undefined casKey for casType: '.$this->casType; ! self::$errorLog->addError($msg); $toReturn = false; } *************** *** 192,196 **** $msg = 'Undefined casType for casKey: '.$this->casKey; //echo $msg; ! $this->errorLog->addError($msg); $toReturn = false; } --- 194,198 ---- $msg = 'Undefined casType for casKey: '.$this->casKey; //echo $msg; ! self::$errorLogaddError($msg); $toReturn = false; } *************** *** 207,211 **** public function getErrors() { ! return $this->errorLog->toString(); } --- 209,213 ---- public function getErrors() { ! return self::$errorLog->toString(); } *************** *** 223,227 **** if(empty($this->values)) { ! //display a text imput box $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->selected.'"/>'; } --- 225,229 ---- if(empty($this->values)) { ! //display a text input box $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->selected.'"/>'; } *************** *** 334,337 **** } } - ?> \ No newline at end of file --- 336,338 ---- Index: InstantiatedItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/InstantiatedItem.php,v retrieving revision 1.81 retrieving revision 1.81.2.1 diff -C2 -d -r1.81 -r1.81.2.1 *** InstantiatedItem.php 28 Aug 2009 10:09:23 -0000 1.81 --- InstantiatedItem.php 22 Nov 2010 23:05:44 -0000 1.81.2.1 *************** *** 332,336 **** if(!empty($this->PRTrees)) { - $this->updatePreCalc($sAns); //update precalculated values --- 332,335 ---- *************** *** 352,355 **** --- 351,355 ---- if(!empty($prtRequirements)) { + foreach($PRT->getRequirements() as $ansKey) { *************** *** 363,366 **** --- 363,369 ---- $changed = true; } + elseif(isset($previously[$ansKey]) && isset($currently[$ansKey]) && $previously[$ansKey] !== $currently[$ansKey]) { + $changed = true; + } } } Index: RawKeyVal.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/RawKeyVal.php,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -C2 -d -r1.28 -r1.28.2.1 *** RawKeyVal.php 27 Aug 2009 16:23:00 -0000 1.28 --- RawKeyVal.php 22 Nov 2010 23:05:45 -0000 1.28.2.1 *************** *** 79,83 **** public function __construct($rawstring, $required = 'optional', $default = NULL, $values = NULL, $metatag = NULL, $metatype = NULL, $xmlType = NULL) { ! //generic $this->required = $required; --- 79,83 ---- public function __construct($rawstring, $required = 'optional', $default = NULL, $values = NULL, $metatag = NULL, $metatype = NULL, $xmlType = NULL) { ! // can we not just invoke the parent contructor for the below? //generic $this->required = $required; *************** *** 87,91 **** $this->metaType = $metatype; $this->xmlType = $xmlType; ! $this->errorLog = new error(); //rawKeyVal specific --- 87,91 ---- $this->metaType = $metatype; $this->xmlType = $xmlType; ! if(self::$errorLog == null) self::$errorLog = new error(); //rawKeyVal specific *************** *** 518,522 **** { $kv = trim($pair->getMaximaPair()); ! $castext .= '@ev(stack_validate_typeless('.$kv.', '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; } return $castext; --- 518,522 ---- { $kv = trim($pair->getMaximaPair()); ! $castext .= '@ev(stack_validate_typeless(['.$kv.'], '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; } return $castext; *************** *** 640,644 **** public function contains_rand() { ! if (false===strpos($this->raw,'rand(')) return false; else --- 640,646 ---- public function contains_rand() { ! if (false===strpos($this->raw,'rand(') && ! false===strpos($this->raw,'rand_with_step(') && ! false===strpos($this->raw,'rand_with_prohib(')) return false; else *************** *** 646,650 **** --- 648,661 ---- } + public function equals($other) { + if(count($other->keyVals) != count($this->keyVals)) return false; + + foreach($this->keyVals as $v) { + // look for keyVal with same key and value in other + } + } + } + ?> \ No newline at end of file Index: CasTextType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/CasTextType.php,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** CasTextType.php 20 Oct 2009 10:15:28 -0000 1.25 --- CasTextType.php 22 Nov 2010 23:05:44 -0000 1.25.2.1 *************** *** 261,265 **** { //display text input ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.$this->casText.'"/>'; } else --- 261,265 ---- { //display text input ! $widget = '<input type="text" name="'.$name.'" size="'.$size.'" value="'.stripslashes(htmlspecialchars($this->casText)).'"/>'; } else *************** *** 403,407 **** { $cmd = trim($cmd); ! $castext .= '@ev(stack_validate_typeless('.$cmd.', '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; } return $castext; --- 403,407 ---- { $cmd = trim($cmd); ! $castext .= '@ev(stack_validate_typeless(['.$cmd.'], '.$forbidFloats.', '.$lowestTerms.'), simp: '.$simplify.')@'; } return $castext; *************** *** 426,430 **** $selection = $dom->createElement("castext"); ! $selectionText = $dom->createTextNode($this->casText); $selection->appendChild($selectionText); --- 426,430 ---- $selection = $dom->createElement("castext"); ! $selectionText = $dom->createTextNode(utf8_encode($this->casText)); $selection->appendChild($selectionText); Index: ItemOption.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/ItemOption.php,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** ItemOption.php 27 Aug 2009 16:23:00 -0000 1.19 --- ItemOption.php 22 Nov 2010 23:05:44 -0000 1.19.2.1 *************** *** 76,80 **** $this->addOption('Display','list','LaTeX',array('LaTeX','MathML'),'OPT_OUTPUT','string'); $this->addOption('MultiplicationSign','list','dot',array('(none)' => get_string('stackOption_none', 'stack', ''),'dot'=> get_string('stackOption_dot', 'stack', ''),'cross'=> get_string('stackOption_cross', 'stack', '')),'make_multsgn','fun'); ! $this->addOption('ComplexNo','list','i',array('i','j'),'make_complexJ','fun'); $this->addOption('Floats','list','true',array('true' => get_string('stack_True','stack',''),'false' => get_string('stack_False', 'stack','')),'OPT_NoFloats','ex'); $this->addOption('SqrtSign','list','true',array('true' => get_string('stack_True','stack',''),'false' => get_string('stack_False', 'stack','')),'sqrtdispflag','ex'); --- 76,80 ---- $this->addOption('Display','list','LaTeX',array('LaTeX','MathML'),'OPT_OUTPUT','string'); $this->addOption('MultiplicationSign','list','dot',array('(none)' => get_string('stackOption_none', 'stack', ''),'dot'=> get_string('stackOption_dot', 'stack', ''),'cross'=> get_string('stackOption_cross', 'stack', '')),'make_multsgn','fun'); ! $this->addOption('ComplexNo','list','i',array('i','j','symi','symj'),'make_complexJ','fun'); $this->addOption('Floats','list','true',array('true' => get_string('stack_True','stack',''),'false' => get_string('stack_False', 'stack','')),'OPT_NoFloats','ex'); $this->addOption('SqrtSign','list','true',array('true' => get_string('stack_True','stack',''),'false' => get_string('stack_False', 'stack','')),'sqrtdispflag','ex'); *************** *** 97,100 **** --- 97,101 ---- $this->addOption('FeedbackGenericIncorrect','html',get_string('stackOptions_FeedBackGenericIncorrect_def','stack',''),''); $this->addOption('FeedbackGenericPCorrect','html',get_string('stackOptions_FeedBackGenericPCorrect_def','stack',''),''); + $this->addOption('OptWorkedSol','list','true',array('true' => get_string('stack_True','stack',''),'false' => get_string('stack_False', 'stack','')),'',''); } *************** *** 430,434 **** return $node; } - } ?> \ No newline at end of file --- 431,469 ---- return $node; } + /* Copies values from passed ItemOption to this. + * Useful where default options are an extension of stored ones. + * i.e. for updating old question instances. + */ + public function copyFrom($src) { + if(!empty($src->options)) + { + foreach($src->options as $optName => $option) + { + // check src option even exists in this + if(array_key_exists($optName, $this->options)) { + + $selected = $src->options[$optName]->getSelected(); + + // copy value over, involves checks. + $this->options[$optName]->setSelected($src->options[$optName]->getSelected()); + + } else { + $this->errorLog->addError('Attempted to copy selection of '.$optName.' which does not exist in current item.'); + } + } + } + } + + public function equals($other) { + if(empty($this->options) != empty($other->options)) return false; + if(!empty($this->options)) + { + foreach($this->options as $optName => $option) { + if($other->options[$optName]->getSelected() != $option->getSelected()) return false; + } + } + return true; + } + } ?> \ No newline at end of file Index: Item.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/Item.php,v retrieving revision 1.61 retrieving revision 1.61.2.1 diff -C2 -d -r1.61 -r1.61.2.1 *** Item.php 27 Aug 2009 16:23:00 -0000 1.61 --- Item.php 22 Nov 2010 23:05:44 -0000 1.61.2.1 *************** *** 40,44 **** * -holds potential response trees * -Used for editing & displaying questions ! * -Superclass of instatiated item. Instatiated item is the class which creates * a question for display, and answering by the student. * --- 40,44 ---- * -holds potential response trees * -Used for editing & displaying questions ! * -Superclass of instantiated item. Instantiated item is the class which creates * a question for display, and answering by the student. * *************** *** 53,56 **** --- 53,63 ---- protected $qID; + // Attributes + /** + * @var String + * @access protected + */ + protected $line; + /** * @var Array *************** *** 331,334 **** --- 338,342 ---- $this->questionStatus = $questionVariables['questionStatus']; $this->published = $questionVariables['published']; + $this->line = $questionVariables['line']; } else *************** *** 339,342 **** --- 347,356 ---- } + // handle legacy items + if(NULL !== $this->questionPart) { + foreach($this->questionPart as $qp) { + $qp->ensureCompleteOptions(); + } + } //load in the keywords from the database *************** *** 361,365 **** //$db->connect(); ! //because of how PHP does database connections $db and $kwDB's connections are essencially combinded into one connection. if($itemOpt == NULL) { --- 375,379 ---- //$db->connect(); ! //because of how PHP does database connections $db and $kwDB's connections are essentially combined into one connection. if($itemOpt == NULL) { *************** *** 371,385 **** die(); } ! $this->itemOptions = $db->base64_unserialize($serialised); // CJS 6/1/9. Not needed in the long term. New option added. if (NULL === $this->itemOptions->getOption('Feedback')) { $this->itemOptions->addOption('Feedback','list','TGS',array('TGS' => get_string('stackOption_Feedback_TGS', 'stack', ''),'TG'=> get_string('stackOption_Feedback_TG', 'stack', ''),'GS'=> get_string('stackOption_Feedback_GS', 'stack', ''),'G'=> get_string('stackOption_Feedback_G', 'stack', ''),'S'=> get_string('stackOption_Feedback_S', 'stack', ''),'none'=> get_string('stackOption_Feedback_none', 'stack', ''))); } ! } else { ! $this->itemOptions = $itemOpt; } --- 385,407 ---- die(); } ! /* ! * Approach is to overwrite default options rather than just ! * clone them. Allows us to extend options without fear. ! */ ! $this->itemOptions = new ItemOption(); // future-proofing ! $this->itemOptions->copyFrom($db->base64_unserialize($serialised)); + /* + * SPH 18/2/10. Covered by overwriting approach above. // CJS 6/1/9. Not needed in the long term. New option added. if (NULL === $this->itemOptions->getOption('Feedback')) { $this->itemOptions->addOption('Feedback','list','TGS',array('TGS' => get_string('stackOption_Feedback_TGS', 'stack', ''),'TG'=> get_string('stackOption_Feedback_TG', 'stack', ''),'GS'=> get_string('stackOption_Feedback_GS', 'stack', ''),'G'=> get_string('stackOption_Feedback_G', 'stack', ''),'S'=> get_string('stackOption_Feedback_S', 'stack', ''),'none'=> get_string('stackOption_Feedback_none', 'stack', ''))); } ! **/ } else { ! $this->itemOptions = new ItemOption(); // see 'future-proofing' above ! $this->itemOptions->copyFrom($itemOpt); } *************** *** 418,421 **** --- 440,444 ---- global $config; $this->qID = NULL; //not yet been assigned, once stored gets a question ID + //$this->version = 0; // set according to version scheme $this->PRTrees = array(); *************** *** 522,526 **** /** ! * Stores the question in the the database, if $asnew is set to true, adds as a new question. * * @param bool $asNew --- 545,549 ---- /** ! * Stores the question revision in the the database, if $asNew is set to true, adds as a new question line. * * @param bool $asNew *************** *** 530,546 **** public function store($asNew = false) { ! if($a... [truncated message content] |
Update of /cvsroot/stack/stack-dev/lib/answertests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/answertests Modified Files: Tag: question_reporting EqualComAss.php CasEqual.php FacForm.php ATRegExp.php SAExpanded.php LowestTerms.php Creating new answer tests.txt SubstEquiv.php GreaterThan.php AnsTestController.php AlgEquiv.php Diff.php CompSquare.php GreaterThanEqual.php Expanded.php PartFrac.php SameType.php template_cas_answertest.php Int.php SingleFrac.php Added Files: Tag: question_reporting NumSigFigs.php EquationAT.php MultiEquiv.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: SameType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/SameType.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** SameType.php 27 Aug 2009 16:23:00 -0000 1.9 --- SameType.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 61,65 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 61,64 ---- Index: ATRegExp.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/ATRegExp.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** ATRegExp.php 27 Aug 2009 16:23:00 -0000 1.7 --- ATRegExp.php 22 Nov 2010 23:05:45 -0000 1.7.2.1 *************** *** 52,57 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing regular expression in Cas Option field'); ! $this->ATError = 'Missing regular expression in Cas Option field'; return NULL; } --- 52,60 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing regular expression in CAS Option field'); ! $this->ATError = 'Missing regular expression in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION_REGEX'; ! $this->ATMark = 0; return NULL; } Index: Expanded.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/Expanded.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Expanded.php 27 Aug 2009 16:23:00 -0000 1.2 --- Expanded.php 22 Nov 2010 23:05:45 -0000 1.2.2.1 *************** *** 61,65 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 61,64 ---- Index: AlgEquiv.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/AlgEquiv.php,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** AlgEquiv.php 27 Aug 2009 16:23:00 -0000 1.12 --- AlgEquiv.php 22 Nov 2010 23:05:45 -0000 1.12.2.1 *************** *** 64,68 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 64,67 ---- Index: FacForm.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/FacForm.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** FacForm.php 27 Aug 2009 16:23:00 -0000 1.11 --- FacForm.php 22 Nov 2010 23:05:45 -0000 1.11.2.1 *************** *** 60,66 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing required variable in CAS Option field'); ! $this->ATError = 'Missing required variable in CAS Option field'; ! return NULL; } else --- 60,69 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing variable in CAS Option field'); ! $this->ATError = 'Missing variable in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION'; ! $this->ATMark = 0; ! return NULL; } else *************** *** 85,89 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 88,91 ---- Index: LowestTerms.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/LowestTerms.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** LowestTerms.php 27 Aug 2009 16:23:00 -0000 1.2 --- LowestTerms.php 22 Nov 2010 23:05:45 -0000 1.2.2.1 *************** *** 67,71 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 67,70 ---- Index: GreaterThan.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/GreaterThan.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** GreaterThan.php 27 Aug 2009 16:23:00 -0000 1.9 --- GreaterThan.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 62,66 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 62,65 ---- Index: SingleFrac.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/SingleFrac.php,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** SingleFrac.php 11 Sep 2009 10:14:13 -0000 1.4 --- SingleFrac.php 22 Nov 2010 23:05:45 -0000 1.4.2.1 *************** *** 62,70 **** $ta = $this->tAnsKey; $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$ta, self::casFunction); $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 62,70 ---- $ta = $this->tAnsKey; + $this->maximaPreferences->updateOption('Simplify', 'false'); $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$ta, self::casFunction); $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; Index: EqualComAss.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/EqualComAss.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** EqualComAss.php 27 Aug 2009 16:23:00 -0000 1.9 --- EqualComAss.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 62,66 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 62,65 ---- Index: CompSquare.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/CompSquare.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** CompSquare.php 11 Sep 2009 13:35:49 -0000 1.1 --- CompSquare.php 22 Nov 2010 23:05:45 -0000 1.1.2.1 *************** *** 60,65 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing required variable in CAS Option field'); ! $this->ATError = 'Missing required variable in CAS Option field'; return NULL; } --- 60,68 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing variable in CAS Option field'); ! $this->ATError = 'Missing variable in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION'; ! $this->ATMark = 0; return NULL; } *************** *** 85,89 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 88,91 ---- Index: GreaterThanEqual.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/GreaterThanEqual.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** GreaterThanEqual.php 27 Aug 2009 16:23:00 -0000 1.9 --- GreaterThanEqual.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 61,65 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 61,64 ---- Index: template_cas_answertest.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/template_cas_answertest.php,v retrieving revision 1.2 retrieving revision 1.2.14.1 diff -C2 -d -r1.2 -r1.2.14.1 *** template_cas_answertest.php 27 Sep 2007 10:40:04 -0000 1.2 --- template_cas_answertest.php 22 Nov 2010 23:05:45 -0000 1.2.14.1 *************** *** 26,32 **** * Description of the answertest.. * ! * @author ! * @version ! * @copyright */ class template_cas_answertest extends AnsTest { --- 26,32 ---- * Description of the answertest.. * ! * @author ! * @version ! * @copyright */ class template_cas_answertest extends AnsTest { *************** *** 34,38 **** // Associations // Operations ! /** * constant --- 34,38 ---- // Associations // Operations ! /** * constant *************** *** 41,60 **** const casFunction = 'ATTest'; /** ! * ! * ! * @param string $sAnsKey ! * @param string $tAnsKey ! * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { ! parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); } /** * The actual answertest code, for most answertests using the cas this will suffice ! * ! * @return bool * @access public */ --- 41,60 ---- const casFunction = 'ATTest'; /** ! * ! * ! * @param string $sAnsKey ! * @param string $tAnsKey ! * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { ! parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); } /** * The actual answertest code, for most answertests using the cas this will suffice ! * ! * @return bool * @access public */ *************** *** 63,73 **** $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$this->tAnsKey, self::casFunction); //the call to the cas ! $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; ! if($this->ATMark == '1') { --- 63,72 ---- $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$this->tAnsKey, self::casFunction); //the call to the cas ! $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; ! if($this->ATMark == '1') { Index: Diff.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/Diff.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** Diff.php 27 Aug 2009 16:23:00 -0000 1.11 --- Diff.php 22 Nov 2010 23:05:45 -0000 1.11.2.1 *************** *** 59,64 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing required variable in Cas Option field'); ! $this->ATError = 'Missing required variable in Cas Option field'; return NULL; } --- 59,67 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing variable in CAS Option field'); ! $this->ATError = 'Missing variable in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION'; ! $this->ATMark = 0; return NULL; } *************** *** 83,87 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 86,89 ---- --- NEW FILE: NumSigFigs.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Chris Sangwin (C.J...@bh...) * * @package stackAnswertest */ global $config; require_once $config->get('docroot').'/lib/items/CasString.php'; require_once 'AnsTest.php'; /** * This is test checks to see if the difference between the teacher's answer (ta) and student's answer (sa) is within a tolerance of the answer. The default tolerance is 0.05, but this can be changed with the answer test option. Literally this test is passed if abs(sa-ta) <= tol and false otherwise. */ class NumSigFigs extends AnsTest { // Attributes // Associations // Operations /** * constant * The name of the cas function this answer test uses. */ const casFunction = 'ATNumSigFigs'; /** * * @param string $sAnsKey * @param string $tAnsKey * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); } /** * * * @return bool * @access public */ public function doAnsTest() { $atOpt = $this->ATOption; // Set a default option if (''==trim($atOpt)) { $atOpt='3'; } $ta = "[$this->tAnsKey,$atOpt]"; $this->maximaPreferences->updateOption('Simplify', 'true'); $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$ta, self::casFunction); $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; if($this->ATMark == '1') { return true; } else { return false; } } } ?> Index: CasEqual.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/CasEqual.php,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** CasEqual.php 27 Aug 2009 16:23:00 -0000 1.10 --- CasEqual.php 22 Nov 2010 23:05:45 -0000 1.10.2.1 *************** *** 63,67 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 63,66 ---- Index: Creating new answer tests.txt =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/Creating new answer tests.txt,v retrieving revision 1.6 retrieving revision 1.6.14.1 diff -C2 -d -r1.6 -r1.6.14.1 *** Creating new answer tests.txt 4 Feb 2008 11:48:25 -0000 1.6 --- Creating new answer tests.txt 22 Nov 2010 23:05:45 -0000 1.6.14.1 *************** *** 87,91 **** This sample answertest will return true if the students answer is a floating point number. ! In the doAnsTest method, begin by editing the casCommands array to contain all the commands you require. Each individual cas command should be a seperate array entry. After the code to send the castext to the CAS change how you wish to derive a true/false answer. --- 87,91 ---- This sample answertest will return true if the students answer is a floating point number. ! In the doAnsTest method, begin by editing the casCommands array to contain all the commands you require. Each individual cas command should be a separate array entry. After the code to send the castext to the CAS change how you wish to derive a true/false answer. --- NEW FILE: MultiEquiv.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Jonathan Hart (j.p...@bh...) * * @package stackAnswertest */ global $config; require_once $config->get('docroot').'/lib/items/CasString.php'; require_once $config->get('docroot').'/lib/CAS/maximaConnector.php'; require_once 'AnsTest.php'; /** * detailed description * * @author * @version * @copyright */ class MultiEquiv extends AnsTest { // Attributes // Associations // Operations /** * constant * The name of the cas function this answer test uses. */ const casFunction = 'ATMultiEquiv'; /** * * * @param string $sAnsKey * @param string $tAnsKey * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); } /** * * * @return bool * @access public */ public function doAnsTest() { $this->maximaPreferences->updateOption('Simplify', 'false'); $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$this->tAnsKey, self::casFunction); $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; if($this->ATMark == '1') { //echo '<strong>Returning true</strong>'; return true; } else { //echo '<strong>Returning false</strong>'; return false; } } } ?> Index: SAExpanded.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/SAExpanded.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** SAExpanded.php 27 Aug 2009 16:23:00 -0000 1.9 --- SAExpanded.php 22 Nov 2010 23:05:45 -0000 1.9.2.1 *************** *** 61,65 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 61,64 ---- Index: AnsTestController.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/AnsTestController.php,v retrieving revision 1.31 retrieving revision 1.31.2.1 diff -C2 -d -r1.31 -r1.31.2.1 *** AnsTestController.php 11 Sep 2009 13:35:49 -0000 1.31 --- AnsTestController.php 22 Nov 2010 23:05:45 -0000 1.31.2.1 *************** *** 73,76 **** --- 73,77 ---- 'NumAbsolute'=>get_string('stackOptions_AnsTest_values_Num_tol_absolute','stack',''), 'NumRelative'=>get_string('stackOptions_AnsTest_values_Num_tol_relative','stack',''), + 'NumSigFigs'=>get_string('stackOptions_AnsTest_values_Num_sig_figs','stack',''), 'LowestTerms'=>get_string('stackOptions_AnsTest_values_Num_LowestTerms','stack',''), 'Diff'=>get_string('stackOptions_AnsTest_values_Diff','stack',''), *************** *** 179,182 **** --- 180,188 ---- break; + case 'NumSigFigs': + require_once 'NumSigFigs.php'; + $this->AT = new NumSigFigs($sAns, $tAns, $maximaPreferences, $AnsTestOption); + break; + case 'LowestTerms': require_once 'LowestTerms.php'; *************** *** 184,187 **** --- 190,205 ---- break; + // The following two are only used in the module ODE and should not be available for questions. + // CJS, 30/10/9 + + case 'MultiEquiv': + require_once 'MultiEquiv.php'; + $this->AT = new MultiEquiv($sAns, $tAns, $maximaPreferences, $AnsTestOption); + break; + case 'EquationAT': + require_once 'EquationAT.php'; + $this->AT = new EquationAT($sAns, $tAns, $maximaPreferences, $AnsTestOption); + break; + } --- NEW FILE: EquationAT.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Jonathan Hart (j.p...@bh...) * * @package stackAnswertest */ global $config; require_once $config->get('docroot').'/lib/items/CasString.php'; require_once 'AnsTest.php'; /** * detailed description * * @author * @version * @copyright */ class EquationAT extends AnsTest { // Attributes // Associations // Operations /** * constant * The name of the cas function this answer test uses. */ const casFunction = 'ATEquations'; /** * * * @param string $sAnsKey * @param string $tAnsKey * @param CasString $casOption * @access public */ public function __construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption = NULL) { parent::__construct($sAnsKey, $tAnsKey, $maximaPreferencs, $casOption); $this->CASProcessTestOps = true; } /** * * * @return bool * @access public */ public function doAnsTest() { if($this->ATOption == NULL) { $this->errorLog->addError('Missing variable in CAS Option field'); $this->ATError = 'Missing variable in CAS Option field'; $this->ATFeedback = ' stack_trans("TEST_FAILED");'; $this->ATAnsNote = 'STACKERROR_OPTION'; $this->ATMark = 0; return NULL; } else { $ATOptionCasString = new CasString($this->ATOption); $valid = $ATOptionCasString->validate(); if(!$valid) { $this->errorLog->addError("Answer test option $this->ATOption failed validation: ".$ATOptionCasString->getErrors()); return NULL; } else { //$this->errorLog = validate_casstring($atest_ops); $atOpt = $this->ATOption; $ta = "[$this->tAnsKey,$atOpt,false]"; $mconn = new maximaConnector($this->maximaPreferences); $result = $mconn->sendAnsTest($this->sAnsKey,$ta, self::casFunction); $this->ATMark = $result['rawmark']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; $this->ATError = $result['error']; if($this->ATMark == '1') { return true; } else { return false; } } } } } ?> Index: SubstEquiv.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/SubstEquiv.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** SubstEquiv.php 27 Aug 2009 16:23:00 -0000 1.2 --- SubstEquiv.php 22 Nov 2010 23:05:45 -0000 1.2.2.1 *************** *** 64,68 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 64,67 ---- Index: Int.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/Int.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** Int.php 27 Aug 2009 16:23:00 -0000 1.11 --- Int.php 22 Nov 2010 23:05:45 -0000 1.11.2.1 *************** *** 61,66 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing required variable in Cas Option field'); ! $this->ATError = 'Missing required variable in Cas Option field'; return NULL; } --- 61,69 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing variable in CAS Option field'); ! $this->ATError = 'Missing variable in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION'; ! $this->ATMark = 0; return NULL; } *************** *** 85,89 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 88,91 ---- Index: PartFrac.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/answertests/PartFrac.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** PartFrac.php 27 Aug 2009 16:23:00 -0000 1.11 --- PartFrac.php 22 Nov 2010 23:05:45 -0000 1.11.2.1 *************** *** 60,65 **** if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing required variable in Cas Option field'); ! $this->ATError = 'Missing required variable in Cas Option field'; return NULL; } --- 60,68 ---- if($this->ATOption == NULL) { ! $this->errorLog->addError('Missing variable in CAS Option field'); ! $this->ATError = 'Missing variable in CAS Option field'; ! $this->ATFeedback = ' stack_trans("TEST_FAILED");'; ! $this->ATAnsNote = 'STACKERROR_OPTION'; ! $this->ATMark = 0; return NULL; } *************** *** 85,89 **** $this->ATMark = $result['rawmark']; - $this->ATValid = $result['valid']; $this->ATAnsNote = $result['answernote']; $this->ATFeedback = $result['feedback']; --- 88,91 ---- |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:24
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/maxima Modified Files: Tag: question_reporting maximafun.php initMaxima.php complexi.lisp stackmaxima.mac stacktex.lisp unittests.mac complexj.lisp noun_arith.mac Added Files: Tag: question_reporting stackmaxima_5.20.1.bat Removed Files: Tag: question_reporting stackmaxima_5.13.0.bat stackmaxima_5.11.0.bat stackmaxima_5.15.0.bat stackmaxima_5.12.0.bat Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -C2 -d -r1.65 -r1.65.2.1 *** stackmaxima.mac 15 Oct 2009 15:28:18 -0000 1.65 --- stackmaxima.mac 22 Nov 2010 23:05:44 -0000 1.65.2.1 *************** *** 3,7 **** /* ********************************** */ ! stack_reset(ex):= block( kill(allbut [functions]), kill(trigsimp), --- 3,7 ---- /* ********************************** */ ! stack_reset(rand_seed):= block( kill(allbut [functions]), [...1753 lines suppressed...] --- 1871,1878 ---- /* If ok, we perform the test */ if cont then ret:ATEquationfun(SA,SB,var,AT), ! ret:StackReturnOb(string(ret[2]),ret[3],ret[4]), return(ret) )$ /* Description : forme echelonne par lignes d'une matrice rectangulaire *************** *** 2034,2037 **** /* Stack expects some output */ ! print("[ Stack-Maxima started V2.0 dev ]"); --- 1956,1959 ---- /* Stack expects some output */ ! print("[ Stack-Maxima started V2.0 ]"); --- stackmaxima_5.11.0.bat DELETED --- --- NEW FILE: stackmaxima_5.20.1.bat --- @echo off set arg0=%0 set arg1=%1 set arg2=%2 set arg3=%3 set arg4=%4 set arg5=%5 set arg6=%6 set arg7=%7 set arg8=%8 set arg9=%9 rem Uncomment the line below and set required value to MAXIMA_LANG_SUBDIR rem to get localized describe in command line Maxima rem set MAXIMA_LANG_SUBDIR=es set lisp=gcl set version=5.20.1 set prefix=C:/maxima set maxima_prefix=C:\PROGRA~1\MAXIMA~1.1 set package=maxima set verbose=false set mingw_gccver=3.3.1 set path=%maxima_prefix%\bin;%maxima_prefix%\lib\gcc-lib\mingw32\3.3.1;%path% if "%USERPROFILE%" == "" goto win9x if "%MAXIMA_USERDIR%" == "" set MAXIMA_USERDIR=%USERPROFILE%\maxima if "%MAXIMA_TEMPDIR%" == "" set MAXIMA_TEMPDIR=%USERPROFILE% goto startparseargs :win9x if "%MAXIMA_USERDIR%" == "" set MAXIMA_USERDIR=%maxima_prefix%\user if "%MAXIMA_TEMPDIR%" == "" set MAXIMA_TEMPDIR=%maxima_prefix% :startparseargs if x%1 == x-l goto foundlisp if x%1 == x--lisp goto foundlisp if x%1 == x-u goto foundversion if x%1 == x--use-version goto foundversion if x%1 == x-v goto foundverbose if x%1 == x--verbose goto foundverbose :continueparseargs shift if not x%1 == x goto startparseargs goto endparseargs :foundlisp set lisp=%2 shift goto continueparseargs :foundversion set version=%2 shift goto continueparseargs :foundverbose set verbose=true goto continueparseargs :endparseargs if "%MAXIMA_LAYOUT_AUTOTOOLS%" == "" goto defaultlayout set layout_autotools=true goto endlayout :defaultlayout set layout_autotools=true :endlayout if "%MAXIMA_PREFIX%" == "" goto defaultvars if "%layout_autotools%" == "true" goto maxim_autotools set maxima_imagesdir=%MAXIMA_PREFIX%\src goto endsetupvars :maxim_autotools set maxima_imagesdir=%MAXIMA_PREFIX%\lib\%package%\%version% goto endsetupvars :defaultvars if "%layout_autotools%" == "true" goto defmaxim_autotools set maxima_imagesdir=%prefix%\src goto endsetupvars :defmaxim_autotools set maxima_imagesdir=%prefix%\lib\%package%\%version% goto endsetupvars :endsetupvars set maxima_image_base=%maxima_imagesdir%\binary-%lisp%\maxima if "%verbose%" == "true" @echo on if "%lisp%" == "gcl" goto dogcl if "%lisp%" == "clisp" goto doclisp if "%lisp%" == "ecl" goto doecl @echo Maxima error: lisp %lisp% not known. goto end :dogcl %maxima_imagesdir%\binary-gcl\maxima.exe -eval "(cl-user::run)" -f -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :doclisp if "%layout_autotools%" == "true" goto clisp_autotools clisp -q -M %maxima_image_base%.mem "" -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :clisp_autotools %maxima_imagesdir%\binary-clisp\lisp.exe -q -M %maxima_image_base%.mem "" -- %arg1% %arg2% %arg3% %arg4% %arg5% %arg6% %arg7% %arg8% %arg9% goto end :doecl ecl -load %maxima_image_base%.fas -eval "(user::run)" -- "%arg1%" "%arg2%" "%arg3%" "%arg4%" "%arg5%" "%arg6%" "%arg7%" "%arg8%" "%arg9%" goto end :end --- stackmaxima_5.15.0.bat DELETED --- Index: maximafun.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/maximafun.php,v retrieving revision 1.6 retrieving revision 1.6.12.1 diff -C2 -d -r1.6 -r1.6.12.1 *** maximafun.php 3 Oct 2007 12:24:17 -0000 1.6 --- maximafun.php 22 Nov 2010 23:05:44 -0000 1.6.12.1 *************** *** 19,22 **** --- 19,25 ---- $maxima_cmd['%enumer']['use'] = 't'; + $maxima_cmd['%f']['urls'][] = 'maxima_16.html#IDX636'; + $maxima_cmd['%f']['use'] = 't'; + $maxima_cmd['%gamma']['urls'][] = 'maxima_31.html#IDX1065'; $maxima_cmd['%gamma']['use'] = 's'; *************** *** 46,49 **** [...13412 lines suppressed...] ! $maxima_cmd['zlabel']['urls'][] = 'maxima_48.html#IDX1868'; ! $maxima_cmd['zlabel']['use'] = ''; ! ! $maxima_cmd['zlange']['urls'][] = 'maxima_58.html#IDX2297'; ! $maxima_cmd['zlange']['use'] = ''; ! ! $maxima_cmd['zrange']['urls'][] = 'maxima_48.html#IDX1855'; $maxima_cmd['zrange']['use'] = ''; ! $maxima_cmd['ztics']['urls'][] = 'maxima_48.html#IDX1873'; $maxima_cmd['ztics']['use'] = ''; + $maxima_cmd['ztics_axis']['urls'][] = 'maxima_48.html#IDX1884'; + $maxima_cmd['ztics_axis']['use'] = ''; + + $maxima_cmd['ztics_rotate']['urls'][] = 'maxima_48.html#IDX1879'; + $maxima_cmd['ztics_rotate']['use'] = ''; ?> \ No newline at end of file Index: complexj.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/complexj.lisp,v retrieving revision 1.1 retrieving revision 1.1.12.1 diff -C2 -d -r1.1 -r1.1.12.1 *** complexj.lisp 23 Mar 2007 10:51:43 -0000 1.1 --- complexj.lisp 22 Nov 2010 23:05:44 -0000 1.1.12.1 *************** *** 6,10 **** ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "j" texword) (defprop $%i "<mi>j</mi> " mathmlword) --- 6,10 ---- ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "\\mathrm{j}" texword) (defprop $%i "<mi>j</mi> " mathmlword) Index: complexi.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/complexi.lisp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** complexi.lisp 23 Jun 2009 14:39:36 -0000 1.2 --- complexi.lisp 22 Nov 2010 23:05:44 -0000 1.2.4.1 *************** *** 6,10 **** ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "i" texword) (defprop $%i "<mi>i</mi> " mathmlword) --- 6,10 ---- ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ! (defprop $%i "\\mathrm{i}" texword) (defprop $%i "<mi>i</mi> " mathmlword) Index: noun_arith.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/noun_arith.mac,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** noun_arith.mac 19 Nov 2008 15:37:03 -0000 1.3 --- noun_arith.mac 22 Nov 2010 23:05:44 -0000 1.3.10.1 *************** *** 8,11 **** --- 8,12 ---- Chris Sangwin 21 Oct 2005. + Chris Sangwin 7 Nov 2009, with help from JHD. */ *************** *** 37,40 **** --- 38,42 ---- infix("noun/",122,123); infix("noun^",140,139); + prefix("UNARY_RECIP",100); /* (2) */ *************** *** 65,69 **** ex:subst(STACK_DIV_OP,"noun/",ex), ex:subst("^","noun^",ex), ! ev(ex))$ --- 67,73 ---- ex:subst(STACK_DIV_OP,"noun/",ex), ex:subst("^","noun^",ex), ! define(UNARY_RECIP a, a^(-1)), ! ex:ev(ex,UNARY_MINUS=-1), ! remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ *************** *** 78,82 **** define(a noun/ b, a/b), define(a noun^ b, a^b), ! define(n- a, -1*a), ex:ev(ex,nouns), remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ --- 82,86 ---- define(a noun/ b, a/b), define(a noun^ b, a^b), ! define(noun- a, -1*a), ex:ev(ex,nouns), remfunction("noun+","noun*","noun/","noun^","noun-"),ex)$ *************** *** 87,92 **** ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst("noun-","-",ex), ! ex:subst("noun/",STACK_DIV_OP,ex), ex:subst("noun^","^",ex), ev(ex))$ --- 91,96 ---- ex:subst("noun+","+",ex), ex:subst("noun*","*",ex), ! ex:subst(lambda([ex],UNARY_MINUS noun* ex),"-",ex), /* Unary minus really communtes with multipication*/ ! ex:subst(lambda([ex1,ex2], ex1 noun* (UNARY_RECIP ex2)),STACK_DIV_OP,ex), /* Turn 1/x into x^(-1), in a special form */ ex:subst("noun^","^",ex), ev(ex))$ *************** *** 119,131 **** /* An answer test in the context of commutative+associative addition and multiplication.*/ ATEqual_com_ass(sa,sb) := ! block([RawMark,FeedBack,AnswerNote,ret], RawMark:0, FeedBack:"", AnswerNote:"", /* We need to check things are of the same type */ ret:ATSameTypefun(sa,sb), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass:",ret[3]), return(StackReturnOb(string(false),string(ret[2]),ret[3],ret[4])) ), ret:block([simp:true,ret],ATAlgEquivfun(sa,sb)), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass: (not AlgEquiv) ",ret[3]), return(StackReturnOb(string(ret[1]),string(ret[2]),ret[3],"")) ), /* Now actually apply this test */ if equals_commute_associate(sa,sb) then --- 123,139 ---- /* An answer test in the context of commutative+associative addition and multiplication.*/ ATEqual_com_ass(sa,sb) := ! block([RawMark,FeedBack,AnswerNote,ret,SAA,SBB], RawMark:0, FeedBack:"", AnswerNote:"", + SAA:errcatch(ev(sa,simp,fullratsimp,nouns)), + if (is(SAA=[STACKERROR]) or is(SAA=[])) then return(StackReturnOb("0","ATEqual_com_ass_STACKERROR_SAns","")), + SBB:errcatch(ev(sb,simp,fullratsimp,nouns)), + if (is(SBB=[STACKERROR]) or is(SBB=[])) then return(StackReturnOb("0","ATEqual_com_ass_STACKERROR_TAns","")), /* We need to check things are of the same type */ ret:ATSameTypefun(sa,sb), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass:",ret[3]), return(StackReturnOb(string(ret[2]),ret[3],ret[4])) ), ret:block([simp:true,ret],ATAlgEquivfun(sa,sb)), if ret[2]=0 then ! (ret[3]:concat("ATEqual_com_ass: (not AlgEquiv) ",ret[3]), return(StackReturnOb(string(ret[2]),ret[3],"")) ), /* Now actually apply this test */ if equals_commute_associate(sa,sb) then *************** *** 133,137 **** else (RawMark:0, AnswerNote:"AlgEquiv, but not equal"), ! return(StackReturnOb("true",string(RawMark),AnswerNote,FeedBack)) )$ --- 141,145 ---- else (RawMark:0, AnswerNote:"AlgEquiv, but not equal"), ! return(StackReturnOb(string(RawMark),AnswerNote,FeedBack)) )$ *************** *** 161,162 **** --- 169,179 ---- + /* Things to consider: 7/11/9 + + (1) What about pushing -1 thorugh /, + eg x*(-y) vs -(x*y) + + (2) What about even powers? + e.g. (1-x)^2 vs (x-1)^2 + + */ --- stackmaxima_5.12.0.bat DELETED --- Index: initMaxima.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/initMaxima.php,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** initMaxima.php 23 Jun 2009 14:39:36 -0000 1.5 --- initMaxima.php 22 Nov 2010 23:05:44 -0000 1.5.4.1 *************** *** 172,175 **** --- 172,182 ---- // Exceptions: Maxima variable names which are allowed to be variable names as part of STACK. + // Enable students to use any Greek letters as part of an answer. + + $greek = array(alpha,nu,beta,xi,gamma,omicron,delta,pi,epsilon,rho,zeta,sigma,eta,tau,theta,upsilon,iota,phi,kappa,chi,lambda,psi,mu,omega); + foreach ($greek as $gl) { + $gl = strtoupper($gl); + $sA .= ", '$gl' "; + } --- stackmaxima_5.13.0.bat DELETED --- Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stacktex.lisp,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** stacktex.lisp 23 Jun 2009 14:39:36 -0000 1.4 --- stacktex.lisp 22 Nov 2010 23:05:44 -0000 1.4.4.1 *************** *** 1,13 **** ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 21 Jan 2009. ! ;; Useful files: ! ;; \Maxima-5.9.0\share\maxima\5.9.0\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.9.0\share\maxima\5.9.0\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second --- 1,13 ---- ;; Customize Maxima's TEX() function. To give better control to the output. ! ;; Chris Sangwin 27 Sept 2010. ! ;; Useful files: ! ;; \Maxima-5.21.1\share\maxima\5.21.1\share\utils\mactex-utilities.lisp ! ;; \Maxima-5.21.1\share\maxima\5.21.1\src\mactex.lisp ;; Additional mactex utilities taken from the distributed file ;; mactex-utilities.lisp ! ;; Based on code by Richard J. Fateman, copyright 1987. ! ;; Fateman's code was ported to Common Lisp by William ! ;; Schelter. ;; If you want LaTeX style quotients, first load mactex and second *************** *** 39,46 **** (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) --- 39,46 ---- (defun tex-matrix (x l r) ;; matrix looks like ((mmatrix)((mlist) a b) ...) ! (append l `("\\left[\\begin{array}{") (tex-matrix-col-count x "c") ; Replace every column with a "c" `("} ") ! ; Below is the bit we need - forms the array (mapcan #'(lambda(y) (tex-list (cdr y) nil (list " \\\\ ") " & ")) (cdr x)) '("\\end{array}\\right]") r) *************** *** 62,68 **** (defun tex-prefix-unaryminus (x l r) ! (tex (cadr x) (append l (texsym (caar x))) r 'mparen 'mparen)) ! (defprop &? ("?") texsym) --- 62,70 ---- (defun tex-prefix-unaryminus (x l r) ! (tex (cadr x) (append l (texsym (caar x))) r (caar x) rop)) ! ! ! ;; Display question marks correctly (defprop &? ("?") texsym) *************** *** 133,134 **** --- 135,153 ---- ;(%laplace "{\\cal L}") )) ;; etc + + ;; Remove un-needed {}s from string output + ;; Chris Sangwin, 28/10/2009 + + (defun tex-string (x) + (cond ((equal x "") "") + ((eql (elt x 0) #\\) x) + (t (concatenate 'string "\\mbox{" x "}")))) + + + ;; Sort out display on inequalitis + ;; Chris Sangwin, 21/9/2010 + + (defprop mlessp (" < ") texsym) + (defprop mgreaterp (" > ") texsym) + + Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** unittests.mac 25 Sep 2009 17:22:37 -0000 1.11 --- unittests.mac 22 Nov 2010 23:05:44 -0000 1.11.2.1 *************** *** 18,21 **** --- 18,23 ---- )$ + UT('all_listp(real_numberp,[1,e^(%i*%pi),1+sqrt(2),sin(1)]),true)$ + UT('any_listp(real_numberp,[%i,1+%i,x+3,1+sqrt(-3)]),false)$ UT('expandp( (x-1)*(x+1)),false)$ *************** *** 23,26 **** --- 25,31 ---- UT('expandp( 2*x-1),true)$ UT('expandp( x-1),true)$ + UT('expandp( (p-1)*(p+1)),false)$ + UT('expandp( 2*(p-1)),false)$ + UT('expandp( 6*p+3*y),true)$ UT('factorp( x),true)$ *************** *** 158,160 **** --- 163,203 ---- UT('subst_equiv(x^2+y+v+u+w,a^2+b+y+v+w),[u=b,x=a]); + UT('exdowncase(X^2+X+1),x^2+x+1); + UT('exdowncase(X-x),0); /* Watch out for this case when using in anger! */ + UT('exdowncase(%pi),%pi); + + UT('stack_assignmentp(x=1),true); + UT('stack_assignmentp(x=sqrt(2)),true); + UT('stack_assignmentp(3=1),false); + UT('stack_assignmentp(d=v*t),false); + UT('stack_assignmentp(1=x),false); + + UT('stack_op(1),""); + UT('stack_op(x),""); + UT('stack_op(%pi),""); + UT('stack_op(3+z),"+"); + UT('stack_op(3*z),"*"); + UT('stack_op(3^z),"^"); + UT('stack_op(3/z),STACK_DIV_OP); + UT('stack_op(sin(3*z)),"sin"); + UT('stack_op((-1)/(x^2+1)),"/"); + UT('stack_op(1-x),"+"); + UT('stack_op(x-1),"+"); + UT('stack_op("-"(x-1)),"+"); + UT('stack_op("-"(1/(x^2+1))),STACK_DIV_OP); + UT('stack_op("-"(2*x)),"*"); + + UT('StackDISP(a/b,""),"\\frac{a}{b}"); + UT('StackDISP(-27,""),"-27"); + UT('StackDISP(-(x-1),""),"-\\left(x-1\\right)"); + UT('StackDISP(-sin(x^2),""),"-\\sin \\left( x^2 \\right)"); + UT('StackDISP(asin(x),""),"\\sin^{-1} \\left( x \\right)"); + UT('StackDISP(log(x),""),"\\ln \\left( x \\right)"); + + UT('strip_int_const(x+k,x),x); + UT('strip_int_const(x+1+k,x),x+1); + UT('strip_int_const((x-1)^2+k^2,x),(x-1)^2); + UT('strip_int_const((t-1)^4/4+c,x),(t-1)^4/4); + + |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:24
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/opaque Modified Files: Tag: question_reporting questiontype.php Added Files: Tag: question_reporting styles.css Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: styles.css --- /** Fonts --------------------------------------- */ h1.section{ font-family: Lucida Sans, serif; text-align: center; } /** Spans --------------------------------------- */ span.correct{ color: green; } span.partially{ color: orange; } span.incorrect{ color: red; background-color: transparent; } div.displayedEq{ text-align: center; padding: 0.2em; } /** Generic classes -------------------------------- */ img{ border:0; margin-left: 0.1em; margin-right: 0.1em; } .warning{ color: orange; } .icon{ float:right; margin-top: -35px; margin-bottom: -60px; padding: 1.0em; /*background: yellow;*/ } .SyntaxExample1{ border: 1px dotted #333; padding: 0.2em; color: blue; background-color: #eee; font-family: monospace; font-size: 120%; font-weight: bold; } .SyntaxExample2{ color: blue; font-family: monospace; font-size: 100%; font-weight: bold; } /* No dashed box, for inclusion inside other error message boxes*/ .errorMsg{ color: #ff0000; } .error{ color: #ff0000; } p.error{ } .feedback{ } .solutionButton{ } .removeButton{ float:right; } .tableTitle{ font-weight: bold; } .centre{ text-align: center; } .quote{ font-style: italic; text-align: center; width: 80%; } .small{ font-size: 80%; } .relatedBox{ border: 1px dotted #333; padding: 0.2em; margin-left: 1em; margin-right: 1em; } .stackbutton{ margin-left: 0em; margin-right: 1.5em; } .logs{ font-family: monospace; } /** Structural DIVs ----------------------------------------------*/ div.error{ min-width: 30em; color: red; font-weight: bold; font-size: 90%; background-color: #fff; border: 1px dashed #c12926; text-align: left; padding: 0.2em; margin: 1em; } div.clearer{ clear: both; display: inline-block; } /*secondary information to the student, */ /* request feedback, resubmit etc. Netural feedback */ div.secondaryFeedback{ border: 1px solid #e1e1e1; background-color: #eee; padding: 0.2em; margin-bottom: 0.2em; width: 80%; margin-left: auto; margin-right: auto; margin-top: 0.2em; } h3.secondaryFeedback{ font-weight: normal; border-bottom: 1px solid #ccc; } /*feedback to student */ div.InteractionElementFeedback{ background-color: #FFFF99; border: 1px solid #EEEE66; margin-left: auto; margin-right: auto; padding: 0.2em; width: 80%; margin-top: 0.2em; margin-bottom: 0.2em; } /*Make the paragraph have only a single line break between paragraphs*/ p.studentFeedback{ margin: 0em; } /*PRT feedback */ div.PRTFeedback{ border: 1px solid #ccf; background-color: #ddf; width: 80%; margin-left: auto; margin-right: auto; margin-bottom: 0.2em; padding-left: 0.2em; padding-right: 0.2em; padding-bottom: 0.2em; /*Top has enough padding with the <h3>tag */ } h3.PRTFeedback{ font-weight: normal; border-bottom: 1px solid #bbf; } .PRTScore{ float: right; } /*Authoring layout */ div.requirements{ border: 1px solid #000; padding: 0.4em; background-color: #fff; } div.section { border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; margin-left: 140px; } h3.section{ font-weight: normal; border-bottom: 1px solid #aaa; } div.section80{ border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; width: 80%; margin-right: auto; margin-left: auto; } h3.section80{ font-weight: normal; border-bottom: 1px solid #aaa; } div.PRT{ /*border: 1px solid #222;*/ padding: 1.0em; margin: 1em; background-color: #ddd; } div.PR{ border: 1px solid #000; background-color: #fff; margin-top: 1em; margin-bottom: 0.5em; padding: 1em; } div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; margin-top: 1em; background-color: #efe; } div.PRTFalse{ border: 1px dotted #FFA19E; padding: 0.25em; margin-top: 1em; background-color: #fee; } .interactionElementsTable, .deploymentTable { margin-right: auto; margin-left: auto; text-align: left; width: 95%; background-color: #fff; } div.row { clear: both; padding-top: 0.1em; padding-bottom: 0.1em; min-height: 2em; height: 1%; } div.row span.error { min-width: 30em; color: red; font-weight: bold; font-size: 90%; background-color: #fee; border: 1px dashed #c12926; float: left; text-align: left; padding: 0.2em; } div.row span.label { float: left; width: 250px; text-align: right; padding: 0.25em; } div.row span.formw { float: left; text-align: left; padding: 0.2em; /*width: 300px;*/ } div.row span.full{ float: left; text-align: left; padding: 0.2em; } div.authorMath { background-color:#FFFFFF; border:1px dashed; clear:left; float:none; padding:0.2em; width:505px; display: none; } div#authoringControls { background-color:#EEEEEE; border:1px solid #E1E1E1; padding:5px; position:fixed; width:120px; left:20px; } div#authoringControls input { width: 110px; margin: 1px 5px; } /* Tables --------------------------------------------------------------*/ .tableHeader{ font-weight: bold; background-color: #ddd; } tr.light{ } tr.dark{ background-color: #eee; } .reportTable{ text-align: left; width: 100%; } .reportsStatsTable{ text-align: left; width: 60%; } .optionEditor{ background-color: white; } .matrixTable td { border: 0px solid black; } tr.odd { background-color: #eee; } tr.even { background-color: #fff; } td { vertical-align: top; } /* Lists ------------------------------------------------------------------*/ .horizontal li{ display: inline; list-style-type: none; margin-right: 2em; } /* Searching -------------------------------------------------------------*/ .over80pc{ background-color: #CCFF99; } .over60pc{ background-color: #FFFF99; } .over30pc{ background-color: #FFCC99; } .lower30pc{ background-color: #FF9999; } /* Moodle -------------------------------------------------------------------*/ /*Turn off moodle grading*/ div.grading{ display: none; } /* hide review all questions on one page */ div.controls a{ display: none; } Index: questiontype.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/questiontype.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** questiontype.php 23 Sep 2009 13:20:05 -0000 1.9 --- questiontype.php 22 Nov 2010 23:05:44 -0000 1.9.2.1 *************** *** 73,80 **** $contributions = array('<link rel="stylesheet" type="text/css" href="' . $this->plugin_baseurl() . '/styles.css" />'); ! /* TODO: remove this nasty hardwired hack */ ! $contributions[] = "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://stack.bham.ac.uk/stack-dev/styles.css\" />"; ! $contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/inputTypes/dragmath/dragmath.php\"></script>"; ! $contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/helpPopup.js\"></script>"; return $contributions; --- 73,79 ---- $contributions = array('<link rel="stylesheet" type="text/css" href="' . $this->plugin_baseurl() . '/styles.css" />'); ! /* TOFIX: references to the STACK base below */ ! //$contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/inputTypes/dragmath/dragmath.php\"></script>"; ! //$contributions[] = "<script type=\"text/javascript\" src=\"http://stack.bham.ac.uk/stack-dev/lib/ui/helpPopup.js\"></script>"; return $contributions; *************** *** 226,229 **** --- 225,231 ---- } + function print_question_grading_details(&$question, &$state, $cmoptions, $options) { + // No output in STACK, thanks. + } } |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:03
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack_diagnostic In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/stack_diagnostic Added Files: Tag: question_reporting styles.php block_stack_diagnostic.php config_global.html readme.txt Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: block_stack_diagnostic.php --- <?php class block_stack_diagnostic extends block_list { function init() { $this->title = get_string('title', 'block_stack_diagnostic'); $this->version = 2007090500; } function get_content() { global $CFG; $root = $CFG->wwwroot; if ($this->content !== NULL) { return $this->content; } $this->content = new stdClass; $this->content->items = array(); $this->content->icons = array(); $this->content->footer = ''; //check STACK question type has been added. $filename = $CFG->dirroot.'/question/type/opaque/stack/'; if (!empty($this->instance->pageid)) { $context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid); } if (empty($context)) { $context = get_context_instance(CONTEXT_SYSTEM); } global $SESSION; $SESSION->stackContext = $context; if(file_exists($filename)) { //$this->content->items[] = print_r($context,1); //$this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />'; ///* if (has_capability('mod/quiz:attempt', $context)) { $this->content->items[] = 'can attempt quiz '; $this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />'; } // if (has_capability('mod/quiz:viewreports', $context)) { $this->content->items[] = 'can view <a href="'.$root.'/question/type/opaque/stack/soapPage.php?page=diagnostic">'.get_string('reports', 'block_stack_diagnostic').'</a>'; $this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />'; //$this->content->items[] = ; // } //*/ } else { $this->content->items[] = get_string('stack_not_installed', 'block_stack'); $this->content->icons[] = '<img src="'.$root.'/blocks/stack/images/warning.png" class="icon" alt="Warning" />'; } return $this->content; } function has_config() { return true; } /*function instance_allow_config() { return true; }*/ } ?> --- NEW FILE: readme.txt --- STACK Block A simple block which allows displays links to access STACK server functions. (http://stack.bham.ac.uk) Users are only shown links to parts they have access rights to. Install ------- To install, copy the stack folder into <moodle directory>/blocks/ Log into moodle and go to the admin page eg. www.yourmoodlesite.com/admin Select a course and turn editing on. You can add then add the STACK Block to that course. Icons ----- Icons from Moodle and http://www.famfamfam.com/lab/icons/silk/ Version History --------------- 1.0 First Release (5th Sept 2007) Jonathan Hart, j.p...@bh... --- NEW FILE: styles.php --- /* We provide our own quiz buttons, one of which triggers a hidden button. */ .submitbtns { display: none; } /* Ensures that elements generated by jsMath don't overlap and thus disable buttons whilst enabling embedded input fields. Workaround from http://www.math.union.edu/~dpvc/jsMath/bugs.html STACK bug #2890734 */ input { z-index: 2; position: relative; } --- NEW FILE: config_global.html --- <h3><?php echo get_string('settings', 'block_stack_diagnostic'); ?></h3> <p><?php echo get_string('noSettings', 'block_stack_diagnostic'); ?></p> <p> <?php $url = '../question/type/opaque/engines.php'; echo get_string('opaqueSettings', 'block_stack_diagnostic', $url); ?> .</p> |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/server In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/server Modified Files: Tag: question_reporting maximaXMLTranslator.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: maximaXMLTranslator.php =================================================================== RCS file: /cvsroot/stack/stack-dev/server/maximaXMLTranslator.php,v retrieving revision 1.8 retrieving revision 1.8.12.1 diff -C2 -d -r1.8 -r1.8.12.1 *** maximaXMLTranslator.php 27 Sep 2007 11:24:18 -0000 1.8 --- maximaXMLTranslator.php 22 Nov 2010 23:05:53 -0000 1.8.12.1 *************** *** 30,38 **** private $xmlIn; //xml coming in ! private $message; //simplexml parser object private $cmdType; //answer test or caschat? private $seed; //timestamp seed ! private $csNames; private $csVars; --- 30,38 ---- private $xmlIn; //xml coming in ! private $message; //simplexml parser object private $cmdType; //answer test or caschat? private $seed; //timestamp seed ! private $csNames; private $csVars; *************** *** 46,52 **** { $this->xmlIn = $xml; ! echo 'XML in: '.$xml; ! try { --- 46,52 ---- { $this->xmlIn = $xml; ! echo 'XML in: '.$xml; ! try { *************** *** 56,71 **** echo 'XML parser failed: '.$e; } ! $this->security = $this->message->security; $this->cmdType = $this->message->cmdtype; $this->seed = $this->message->seed; //$this->seed = time(); ! $this->csNames = ''; $this->csVars = ''; $this->csCmds = ''; ! ! } ! function securityCheck() { --- 56,71 ---- echo 'XML parser failed: '.$e; } ! $this->security = $this->message->security; $this->cmdType = $this->message->cmdtype; $this->seed = $this->message->seed; //$this->seed = time(); ! $this->csNames = ''; $this->csVars = ''; $this->csCmds = ''; ! ! } ! function securityCheck() { *************** *** 74,78 **** $checkArray[] = $this->message->anstest->student; $checkArray[] = $this->message->anstest->teacher; ! return $this->securityCheckCommands($checkArray); } --- 74,78 ---- $checkArray[] = $this->message->anstest->student; $checkArray[] = $this->message->anstest->teacher; ! return $this->securityCheckCommands($checkArray); } *************** *** 84,91 **** } return $this->securityCheckCommands($checkArray); ! } } ! ! /** * Gets just the keywords used in the raw cas string. Gives unique keywords only --- 84,91 ---- } return $this->securityCheckCommands($checkArray); ! } } ! ! /** * Gets just the keywords used in the raw cas string. Gives unique keywords only *************** *** 99,126 **** if(count($checkArray) > 0) { ! foreach($checkArray as $cmd) { $pat = "|[\?_A-Za-z0-9]+|"; preg_match_all($pat,$cmd,$out,PREG_PATTERN_ORDER); ! // Filter out some of these matches. ! ! foreach($out[0] as $key) { // Do we have only numbers, or only 2 characters? // These strings are fine. preg_match("|[0-9]+|",$key,$justnum); ! ! if (empty($justnum) and strlen($key)>2) { //echo "Keyword found: $key <br />"; $upKey = strtoupper($key); ! array_push($strin_keywords, $upKey); ! } } } ! $this->keywords = array_unique($strin_keywords); //var_dump($strin_keywords); if (count($this->keywords) > 0) --- 99,126 ---- if(count($checkArray) > 0) { ! foreach($checkArray as $cmd) { $pat = "|[\?_A-Za-z0-9]+|"; preg_match_all($pat,$cmd,$out,PREG_PATTERN_ORDER); ! // Filter out some of these matches. ! ! foreach($out[0] as $key) { // Do we have only numbers, or only 2 characters? // These strings are fine. preg_match("|[0-9]+|",$key,$justnum); ! ! if (empty($justnum) and strlen($key)>2) { //echo "Keyword found: $key <br />"; $upKey = strtoupper($key); ! array_push($strin_keywords, $upKey); ! } } } ! $this->keywords = array_unique($strin_keywords); //var_dump($strin_keywords); if (count($this->keywords) > 0) *************** *** 138,142 **** } } ! /** * Check security of commands --- 138,142 ---- } } ! /** * Check security of commands *************** *** 148,152 **** $toReturn = true; $problem = ''; ! global $stack_cas; $globalForbid[] = $stack_cas['globalForbid']; --- 148,152 ---- $toReturn = true; $problem = ''; ! global $stack_cas; $globalForbid[] = $stack_cas['globalForbid']; *************** *** 154,158 **** $studentAllow = $stack_cas['studentAllow']; ! if($this->getCommandKeywords($checkArray) === true) { --- 154,158 ---- $studentAllow = $stack_cas['studentAllow']; ! if($this->getCommandKeywords($checkArray) === true) { *************** *** 160,164 **** foreach($this->keywords as $key) { ! if($this->in_array_caseless($key, $globalForbid)) { --- 160,164 ---- foreach($this->keywords as $key) { ! if($this->in_array_caseless($key, $globalForbid)) { *************** *** 183,187 **** //echo "$key is not in teacher forbid.<br>"; } ! } else --- 183,187 ---- //echo "$key is not in teacher forbid.<br>"; } ! } else *************** *** 192,196 **** $toReturn = false; $problem .= "Unknown function: $key"; ! } else --- 192,196 ---- $toReturn = false; $problem .= "Unknown function: $key"; ! } else *************** *** 202,206 **** }//foreach //echo $problem; ! if(!$toReturn) { --- 202,206 ---- }//foreach //echo $problem; ! if(!$toReturn) { *************** *** 215,220 **** return $toReturn; } ! ! function in_array_caseless($search, &$array) { $search = strtolower($search); --- 215,220 ---- return $toReturn; } ! ! function in_array_caseless($search, &$array) { $search = strtolower($search); *************** *** 231,235 **** } } ! function buildMaximaString() { --- 231,235 ---- } } ! function buildMaximaString() { *************** *** 244,265 **** echo 'Creating cas chat'.$this->cmdType; return $this->buildCaschatString(); ! } } ! function buildCaschatString() { ! //sort out maxima commands $i = 0; foreach($this->message->commands->caschat as $cmd) { ! $this->cmd = str_replace('?', 'qmchar', $cmd); // replace any ?'s that slipped through $this->csNames .= ", $cmd->label"; $this->csCmds .= ", print(\"$i=[ error= [\"), cte(\"$cmd->label\",errcatch($cmd->label:$cmd->cmd)) "; $i++; ! } ! $cs ='cab:block([ RANDOM_SEED'; $cs .= $this->csNames; --- 244,265 ---- echo 'Creating cas chat'.$this->cmdType; return $this->buildCaschatString(); ! } } ! function buildCaschatString() { ! //sort out maxima commands $i = 0; foreach($this->message->commands->caschat as $cmd) { ! $this->cmd = str_replace('?', 'qmchar', $cmd); // replace any ?'s that slipped through $this->csNames .= ", $cmd->label"; $this->csCmds .= ", print(\"$i=[ error= [\"), cte(\"$cmd->label\",errcatch($cmd->label:$cmd->cmd)) "; $i++; ! } ! $cs ='cab:block([ RANDOM_SEED'; $cs .= $this->csNames; *************** *** 269,276 **** $cs .= $this->csCmds; $cs .= ", print(\"] ]\") , return(true) ); \n "; ! return $cs; } ! function buildAnsTest() { --- 269,276 ---- $cs .= $this->csCmds; $cs .= ", print(\"] ]\") , return(true) ); \n "; ! return $cs; } ! function buildAnsTest() { *************** *** 278,293 **** $exp2 = $this->message->anstest->teacher; $ansTest = $this->message->anstest->anstesttype; ! ! $cs = "cab:block([ ans1983,str{$this->csNames}] {$this->csVars}, "; ! $cs .= " print(\"[ Timestamp = [ $this->seed ], Ans= [ error = [\"), cte(\"ans1983\",errcatch(ans1983:$exp1)),"; ! $cs .= " print(\" AnswerTestError = [ \"), str:$ansTest(ans1983,$exp2), print(\" ], \"), print(str), return(true)); \n"; ! return $cs; } ! function buildVariables() { ! foreach($this->message->maximavar->mstring as $string) { --- 278,294 ---- $exp2 = $this->message->anstest->teacher; $ansTest = $this->message->anstest->anstesttype; ! ! $cs = "cab:block([ STACK_SA,STACK_TA,str{$this->csNames}] {$this->csVars}, "; ! $cs .= " print(\"[ Timestamp = [ $this->seed ], Ans= [ error = [\"), STACK_SA:cte(\"STACK_SA\",errcatch($exp1)),"; ! $cs .= " print(\" TAAns= [ error = [\"), STACK_TA:cte(\"STACK_TA\",errcatch(STACK_TA:$exp2)),"; ! $cs .= " print(\" AnswerTestError = [ \"), str:$ansTest(STACK_SA,STACK_TA), print(\" ], \"), print(str), return(true)); \n"; ! return $cs; } ! function buildVariables() { ! foreach($this->message->maximavar->mstring as $string) { *************** *** 295,299 **** $this->csVars .= ', '.$string->key.':"'.$string->value.'"'; } ! foreach($this->message->maximavar->mexp as $exp) { --- 296,300 ---- $this->csVars .= ', '.$string->key.':"'.$string->value.'"'; } ! foreach($this->message->maximavar->mexp as $exp) { *************** *** 301,310 **** $this->csVars .= ', '.$exp->key.':'.$exp->value; } ! foreach($this->message->maximavar->mfunc as $func) { $this->csVars .= ', '.$func->key.'('.$func->value.')'; } ! } --- 302,311 ---- $this->csVars .= ', '.$exp->key.':'.$exp->value; } ! foreach($this->message->maximavar->mfunc as $func) { $this->csVars .= ', '.$func->key.'('.$func->value.')'; } ! } |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766 Modified Files: Tag: question_reporting styles.css index.php testsuite.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: styles.css =================================================================== RCS file: /cvsroot/stack/stack-dev/styles.css,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -C2 -d -r1.38 -r1.38.2.1 *** styles.css 22 Oct 2009 09:41:20 -0000 1.38 --- styles.css 22 Nov 2010 23:05:53 -0000 1.38.2.1 *************** *** 19,22 **** --- 19,23 ---- span.incorrect{ color: red; + background-color: transparent; } *************** *** 26,34 **** } ! /** Generic classes -------------------------------- */ img{ border:0; --- 27,50 ---- } ! .moreTags { ! display:none; ! } /** Generic classes -------------------------------- */ + body, table, td, th, li { + font-family:Arial,Verdana,Helvetica,sans-serif; + padding: 5px; + } + + a { + text-decoration: none; + } + + a:hover { + text-decoration: underline; + } + img{ border:0; *************** *** 216,224 **** } ! div.section{ border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; } h3.section{ --- 232,241 ---- } ! div.section { border: 1px solid #e1e1e1; background-color: #eee; padding: 0.4em; margin-bottom: 0.5em; + margin-left: 180px; } h3.section{ *************** *** 256,271 **** } div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; - margin-top: 1em; background-color: #efe; } div.PRTFalse{ border: 1px dotted #FFA19E; - padding: 0.25em; - margin-top: 1em; background-color: #fee; } --- 273,293 ---- } + div.PRTTrue, div.PRTFalse { + width: 48%; + padding: 0.25em; + margin-top: 1em; + } + div.PRTTrue{ border: 1px solid #DDFFBA; padding: 0.25em; background-color: #efe; + float:left; } div.PRTFalse{ border: 1px dotted #FFA19E; background-color: #fee; + float:right; } *************** *** 275,279 **** text-align: left; width: 95%; ! background-color: #fff; } --- 297,312 ---- text-align: left; width: 95%; ! border: 0; ! } ! ! .interactionElementsTable td, .interactionElementsTable th { ! border-color: #000000; ! border-width: 0 0 0 1px; ! padding: 3px; ! } ! ! .IElabel { ! border:0 none; ! text-align: right; } *************** *** 301,305 **** float: left; width: 250px; ! text-align: left; padding: 0.25em; } --- 334,338 ---- float: left; width: 250px; ! text-align: right; padding: 0.25em; } *************** *** 318,322 **** --- 351,385 ---- } + div.authorMath { + background-color:#FFFFFF; + border:1px dashed; + clear:left; + float:none; + padding:0.2em; + width:505px; + display: none; + } + div#authoringVersionID { + float:right; + font-size:small; + } + + div#authoringControls { + background-color:#EEEEEE; + border:1px solid #E1E1E1; + padding:5px; + position:fixed; + width:160px; + } + + div#authoringControls input { + width: 100px; + margin: 1px 5px; + } + + div#authoringControls ul { + + } *************** *** 336,339 **** --- 399,411 ---- } + #questionListTable { + border-collapse: collapse; + border-spacing: 0; + } + + #questionListTable th { + background-image: url('pix/gradient.jpg') + } + .reportTable{ text-align: left; *************** *** 362,365 **** --- 434,441 ---- } + td { + vertical-align: top; + } + /* Lists ------------------------------------------------------------------*/ Index: testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-dev/testsuite.php,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** testsuite.php 20 Jul 2009 10:23:37 -0000 1.5 --- testsuite.php 22 Nov 2010 23:05:53 -0000 1.5.4.1 *************** *** 39,43 **** <div class="section80"> ! <p><?php echo get_string('stackTestsuite_installedVersion','stack').$config->get("version"); ?></p> <h3 class="section80"><?php echo get_string('stackTestsuite_subtitle','stack'); ?></h3> --- 39,45 ---- <div class="section80"> ! <p><?php ! ! echo get_string('stackTestsuite_installedVersion','stack').$config->get("version").' (Maxima '.$config->getCas('version').', '.$config->get('platform').')'; ?></p> <h3 class="section80"><?php echo get_string('stackTestsuite_subtitle','stack'); ?></h3> Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-dev/index.php,v retrieving revision 1.38 retrieving revision 1.38.2.1 diff -C2 -d -r1.38 -r1.38.2.1 *** index.php 20 Oct 2009 15:12:45 -0000 1.38 --- index.php 22 Nov 2010 23:05:53 -0000 1.38.2.1 *************** *** 57,169 **** } } ! ! switch($_POST['Submit']) ! { ! case get_string('stackQuestionList_delete','stack'): //delete ! if(!empty($selected)) ! { ! $msg .= '<h3 class="section">'.get_string('FE_confirmDelete','stack').'</h3>'; ! $msg .= '<p>'.get_string('FE_deleteMsg','stack',count($selected)).'</p>'; ! $msg .= '<p><form action="index.php" method="POST"> ! <input type="Submit" name="Submit" value="'.get_string('FE_yesDelete','stack').'" /> ! <input type="Submit" name="Submit" value="'.get_string('FE_noCancel','stack').'" />'; ! foreach($selected as $qid) ! { ! $msg .= '<input type="hidden" name="'.$qid.'" value="selected" />'; ! } ! $msg .= '</form></p>'; ! } ! break; ! case get_string('FE_yesDelete','stack'): ! foreach($selected as $name) ! { ! $db->removeItem($name); ! } ! $msg = '<p>'.get_string('FE_qDeleted','stack').'</p>'; ! break; ! case get_string('stackQuestionList_export','stack'): //export ! if(!empty($selected)) ! { ! foreach($selected as $name) ! { ! $export[] = $name; ! } ! $batch = new ExportStackTwoBatch($export); ! $result = $batch->exportItems(); ! } ! break; ! case get_string('stackQuestionList_validate','stack'): //validate ! if(!empty($selected)) ! { ! $execTime = ini_get('max_execution_time'); ! $start = time(); ! $toValidate = count($selected); ! $validated = 0; ! $failedValidation = 0; ! $i = 0; ! while((time() - $start) < ($execTime - 10) && ($i < $toValidate)) // leaving 10 seconds to spare to display list of questions ! { ! $item = new Item(NULL, $selected[$i]); ! if($item->valid == false) ! { ! $item->validateQuestion(); ! $item->store(); ! if($item->valid == false) ! { ! $failedValidation++; ! } ! //$validated++; ! } ! $validated++; ! $i++; ! } ! //echo 'Elapsed: '.(time() - $start).'<br />'; ! //echo $validated.' of '.$toValidate.' questions validated.<br />'; ! } ! break; ! case get_string('stackQuestionList_updateStatus','stack'): //update status ! if(!empty($selected)) ! { ! foreach($selected as $id) ! { ! //the question status is stored in the item object and a db field - so we can't just update the db. ! $item = new Item(NULL, $id); ! $item->published->setSelection($_POST['publishedStatus']); ! $item->store(); ! } ! } ! break; ! case get_string('stackQuestionList_Deploy','stack'): //Deploy each of the selected. ! if(!empty($selected)) ! { ! foreach($selected as $id) ! { ! $deployment = new Deployment($id); ! if ($deployment->isSingleton()) { ! if($deployment->autoDeployed) { // single version, not deployed ! $msg .= get_string('FE_deployQuestion_auto', 'stack').' '.$id.'<br />'; ! } else { ! $msg .= $id.': '.get_string('FE_deployQuestion_norand', 'stack').'<br />'; ! } ! } else { ! $post = array('add'=>$_POST['nodeploy']); ! $deployment->processOperations($post); ! $msg .= $id.': '. get_string('FE_deployQuestion_adding', 'stack', $_POST['nodeploy']).'<br />'; ! } ! } ! } ! break; } } --- 57,170 ---- } } ! if(isset($_POST['Submit'])) { ! switch($_POST['Submit']) ! { ! case get_string('stackQuestionList_delete','stack'): //delete ! if(!empty($selected)) ! { ! $msg .= '<h3 class="section">'.get_string('FE_confirmDelete','stack').'</h3>'; ! $msg .= '<p>'.get_string('FE_deleteMsg','stack',count($selected)).'</p>'; ! $msg .= '<p><form action="index.php" method="POST"> ! <input type="Submit" name="Submit" value="'.get_string('FE_yesDelete','stack').'" /> ! <input type="Submit" name="Submit" value="'.get_string('FE_noCancel','stack').'" />'; ! foreach($selected as $qid) ! { ! $msg .= '<input type="hidden" name="'.$qid.'" value="selected" />'; ! } ! $msg .= '</form></p>'; ! } ! break; ! case get_string('FE_yesDelete','stack'): ! foreach($selected as $name) ! { ! $db->removeLineContainingItem($name); ! } ! $msg = '<p>'.get_string('FE_qDeleted','stack').'</p>'; ! break; ! case get_string('stackQuestionList_export','stack'): //export ! if(!empty($selected)) ! { ! foreach($selected as $name) ! { ! $export[] = $name; ! } ! $batch = new ExportStackTwoBatch($export); ! $result = $batch->exportItems(); ! } ! break; ! case get_string('stackQuestionList_validate','stack'): //validate ! if(!empty($selected)) ! { ! $execTime = ini_get('max_execution_time'); ! $start = time(); ! $toValidate = count($selected); ! $validated = 0; ! $failedValidation = 0; ! $i = 0; ! while((time() - $start) < ($execTime - 10) && ($i < $toValidate)) // leaving 10 seconds to spare to display list of questions ! { ! $item = new Item(NULL, $selected[$i]); ! if($item->valid == false) ! { ! $item->validateQuestion(); ! $item->store(); ! if($item->valid == false) ! { ! $failedValidation++; ! } ! //$validated++; ! } ! $validated++; ! $i++; ! } ! //echo 'Elapsed: '.(time() - $start).'<br />'; ! //echo $validated.' of '.$toValidate.' questions validated.<br />'; ! } ! break; ! case get_string('stackQuestionList_updateStatus','stack'): //update status ! if(!empty($selected)) ! { ! foreach($selected as $id) ! { ! //the question status is stored in the item object and a db field - so we can't just update the db. ! $item = new Item(NULL, $id); ! $item->published->setSelection($_POST['publishedStatus']); ! $item->store(); ! } ! } ! break; ! case get_string('stackQuestionList_Deploy','stack'): //Deploy each of the selected. ! if(!empty($selected)) ! { ! foreach($selected as $id) ! { ! $deployment = new Deployment($id); ! if ($deployment->isSingleton()) { ! if($deployment->autoDeployed) { // single version, not deployed ! $msg .= get_string('FE_deployQuestion_auto', 'stack').' '.$id.'<br />'; ! } else { ! $msg .= $id.': '.get_string('FE_deployQuestion_norand', 'stack').'<br />'; ! } ! } else { ! $post = array('add'=>$_POST['nodeploy']); ! $deployment->processOperations($post); ! $msg .= $id.': '. get_string('FE_deployQuestion_adding', 'stack', $_POST['nodeploy']).'<br />'; ! } ! } ! } ! break; ! } } } *************** *** 180,198 **** <body> ! <div class="section80"> ! <h3 class="section">Administrate STACK</h3> ! <ul class="horizontal"> ! <li><a href="lib/ui/authorTest.php"><?php echo get_string('FE_index_New','stack','') ?></a></li> ! <li><a href="lib/ui/questionImporter.php"><?php echo get_string('FE_index_Import','stack','') ?></a></li> ! <li><a href="chat.php"><?php echo get_string('FE_index_Chat','stack','') ?></a></li> ! <li><a href="lib/ui/search.php"><?php echo get_string('FE_index_search','stack','') ?></a></li> ! <li><a href="lib/ui/report.php"><?php echo get_string('FE_index_Reports','stack','') ?></a></li> ! <li><a href="lib/ui/OptionsEdit.php"><?php echo get_string('FE_index_Options','stack','') ?></a></li> ! <li><a href="http://stack.bham.ac.uk/wiki/"><?php echo get_string('FE_index_Docs','stack','') ?></a></li> ! <li><a href="testsuite.php"><?php echo get_string('FE_index_Test','stack','') ?></a></li> ! <li><a href="<?php echo $hintroot;?>"><?php echo get_string('FE_index_Hints','stack','') ?></a></li> ! <li><a href="index.php?action=logout"><?php echo get_string('FE_index_Logout','stack','') ?></a></li> ! </ul> ! </div> <?php --- 181,194 ---- <body> ! <a href="lib/ui/authorTest.php"><?php echo get_string('FE_index_New','stack','') ?></a> | ! <a href="lib/ui/questionImporter.php"><?php echo get_string('FE_index_Import','stack','') ?></a> | ! <a href="chat.php"><?php echo get_string('FE_index_Chat','stack','') ?></a> | ! <a href="lib/ui/search.php"><?php echo get_string('FE_index_search','stack','') ?></a> | ! <a href="lib/ui/report.php"><?php echo get_string('FE_index_Reports','stack','') ?></a> | ! <a href="lib/ui/OptionsEdit.php"><?php echo get_string('FE_index_Options','stack','') ?></a> | ! <a href="http://stack.bham.ac.uk/wiki/"><?php echo get_string('FE_index_Docs','stack','') ?></a> | ! <a href="testsuite.php"><?php echo get_string('FE_index_Test','stack','') ?></a> | ! <a href="<?php echo $hintroot;?>"><?php echo get_string('FE_index_Hints','stack','') ?></a> | ! <a href="index.php?action=logout"><?php echo get_string('FE_index_Logout','stack','') ?></a> <?php *************** *** 209,213 **** $question_bank_filter = stack_questionbank_filter_get(); ! if($result != NULL) { if($result == false) --- 205,209 ---- $question_bank_filter = stack_questionbank_filter_get(); ! if(isset($result)) { if($result == false) *************** *** 242,263 **** <?php echo '<h3>'.get_string('stackQuestion_filterQuestions','stack','').'</h3>'; ! echo '<p>'.get_string('stackQuestion_filterSearch','stack','').'</p>'; $db = new StackDBItem(); $db->connect(); ! $filter=array('order1'=>'','order2'=>'','order2'=>''); ! if (array_key_exists('bank_filter',$_POST)) { ! $filter['order1']=$_POST['bank_filter']['order1']; ! $filter['order2']=$_POST['bank_filter']['order2']; ! $filter['order3']=$_POST['bank_filter']['order3']; ! } ! $questions = $db->getListOfQuestions(NULL,true,$filter); ! $no_question = 0; if(!empty($questions)) { ! echo "\n<form name='questionsform' action='index.php' method='POST'>\n"; /************************************************************************************/ --- 238,266 ---- <?php echo '<h3>'.get_string('stackQuestion_filterQuestions','stack','').'</h3>'; ! //echo '<p>'.get_string('stackQuestion_filterSearch','stack','').'</p>'; $db = new StackDBItem(); $db->connect(); + // get question list ! $filter=array('order1'=>'','order2'=>'','order2'=>''); ! if (array_key_exists('bank_filter',$_POST)) { ! $filter['order1']=$_POST['bank_filter']['order1']; ! $filter['order2']=$_POST['bank_filter']['order2']; ! $filter['order3']=$_POST['bank_filter']['order3']; ! } ! ! $questions = $db->getListOfQuestions(NULL,true,$filter); ! ! // link all keywords ! $kwdb = new StackDBKeywords(); ! $kwdb->connect(); ! // need to sort alphnumerically whilst still respecting case (for now) ! $all_keywords = $kwdb->getAllKeywords(true); if(!empty($questions)) { ! /************************************************************************************/ *************** *** 269,323 **** /************************************************************************************/ ! echo '<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="0">'; stack_questionBank_filter_tablehead($question_bank_filter); ! echo '<tr><td></td>'; ! $fields = array('ID','Name','Description','Valid', 'Status', 'Published','DateLastEdited','NoDeployed'); foreach($fields as $key) { $val = get_string('stackQuestion_question'.$key,'stack',''); echo "<th scope='column'>$val</th>"; } ! echo '<td> </td><td> </td><td> </td></tr>'; for($i=0; $i < count($questions); $i++) { ! if (stack_questionBank_filter_display_question($question_bank_filter,$questions[$i])) { ! echo '<tr> ! <td><input type="checkbox" name="'.$questions[$i]['id'].'" value="selected" /></td> ! <td>'.$questions[$i]['id'].'</td> ! <td>'.$questions[$i]['questionName'].'</td> ! <td>'.$questions[$i]['questionDescription'].'</td> ! <td>'.$questions[$i]['valid'].'</td> ! <td>'.$questions[$i]['status'].'</td> ! <td>'.get_string('stackMetaData_published'.$questions[$i]['published'], 'stack').'</td> ! <td>'.$questions[$i]['questionDateLastEdited'].'</td> <td>'.$questions[$i]['nodeployed'].'</td>'; if($questions[$i]['valid'] == 1) { ! echo '<td><a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkTry','stack').'</a></td>'; } else { ! echo '<td>'.get_string('stackQuestion_filterLinkTry', 'stack').'</td>'; } - echo '<td><a href="lib/ui/authorTest.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkEdit','stack').'</a></td>'; - echo '<td><a href="lib/ui/questionDeploy.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkDeploy','stack').'</a></td>'; - - echo '<td><a href="lib/ui/questionExporter.php?id='.$questions[$i]['id'].'">'.get_string('stackQuestion_filterLinkXML','stack').'</a></td>'; ! echo '</tr>'; ! $no_questions +=1; } } echo "\n</table>\n\n"; ! echo '(# = '.$no_questions.') <input type="radio" name="selectall" onclick="selectAll(this.form,0);" />'.get_string('stackSelectAll','stack').'<input type="radio" name="selectall" onclick="selectAll(this.form,1);" />'.get_string('stackInvertSelection','stack'); echo '<h4>'.get_string('stackQuestion_filterWithSelected','stack','').'</h4>'; $trans_sub = get_string('stackQuestion_filterExportToXML','stack'); --- 272,372 ---- /************************************************************************************/ ! echo "\n<form name='questionsform' action='index.php' method='POST'>\n"; + echo '<table>'; stack_questionBank_filter_tablehead($question_bank_filter); + echo '</table>'; ! echo '<table id="questionListTable">'; ! echo '<tr><th></th>'; ! $fields = array('Header','Valid', 'Status', 'Published','DateLastEdited','NoDeployed'); foreach($fields as $key) { $val = get_string('stackQuestion_question'.$key,'stack',''); echo "<th scope='column'>$val</th>"; } + echo '<th nowrap>'.get_string('stackQuestion_questionActions','stack','').'</th>'; + echo '<td></td></tr>'; ! $kwdb = new StackDBKeywords(); ! $kwdb->connect(); + $no_displayed=0; for($i=0; $i < count($questions); $i++) { ! $keywords = $kwdb->getQuestionsKeywords($questions[$i]['id']); ! if (stack_questionBank_filter_display_question($question_bank_filter,$questions[$i],$keywords)) { ! $no_displayed++; ! ! if($i % 2 == 0) echo '<tr class="even">'; ! else echo '<tr class="odd">'; ! echo '<td><input type="checkbox" name="'.$questions[$i]['id'].'" value="selected" /></td> ! <td><b>'.$questions[$i]['questionName'].'</b> (v.'.$questions[$i]['id'].'): </b>'.$questions[$i]['questionDescription']; ! ! if(!empty($keywords)) { ! echo '<br /><small>'; ! asort($keywords); ! $firstKeyword = true; ! foreach($keywords as $keyword) { ! if(!$firstKeyword) { ! echo ', '; ! } else $firstKeyword = false; ! $kwLink = "<a href='?tagged=$keyword'>".$keyword."</a>"; ! echo $kwLink; ! } ! echo '</small>'; ! } ! echo '</td><td style="text-align: center">'; ! if($questions[$i]['valid'] == 1) ! { ! echo '<img alt="1" src="pix/correct.png" />'; ! } ! else ! { ! echo '<img alt="0" src="pix/incorrect.png" />'; ! } ! echo '</td><td>'.$questions[$i]['status'].'</td>'; ! ! $val = $questions[$i]['published']; ! $aval = get_string('stackMetaData_published'.$questions[$i]['published'], 'stack'); ! echo '<td><img src="'.$config->get('webroot').'/pix/'.$val.'.png" alt="'.$aval.'" /></td>'; ! ! echo '<td>'.$questions[$i]['questionDateLastEdited'].'</td> <td>'.$questions[$i]['nodeployed'].'</td>'; + echo '<td nowrap>'; + echo '<a href="lib/ui/authorTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/pencil.png" title="'.get_string('stackIcon_edit','stack').'" alt="'.get_string('stackIcon_edit','stack').'" />'; if($questions[$i]['valid'] == 1) { ! echo '<a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/eye.png" title="'.get_string('stackIcon_try','stack').'" alt="'.get_string('stackIcon_try','stack').'" /></a> '; } else { ! echo '<a href="lib/ui/questionTest.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/eye.png" title="'.get_string('stackIcon_try','stack').'" alt="'.get_string('stackIcon_try','stack').'" /></a> '; ! //echo get_string('stackQuestion_filterLinkTry', 'stack'); ! } ! if($questions[$i]['valid'] == 1) ! { ! echo ' <a href="lib/ui/questionDeploy.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/arrow_out.png" title="'.get_string('stackIcon_deploy','stack').'" alt="'.get_string('stackIcon_deploy','stack').'" /></a>'; ! } ! else ! { ! echo ' <img src="'.$config->get('webroot').'/pix/transparent16x16.gif" />'; ! //echo get_string('stackQuestion_filterLinkDeploy','stack'); } ! echo ' <a href="lib/ui/questionExporter.php?id='.$questions[$i]['id'].'"><img src="'.$config->get('webroot').'/pix/disk.png" title="'.get_string('stackIcon_xml','stack').'" alt="'.get_string('stackIcon_xml','stack').'" /></a>'; ! echo '</td></tr>'; } } echo "\n</table>\n\n"; ! ! echo '<br />'.$no_displayed.' ('.count($questions).') '.get_string('FE_index_question(s)', 'stack').'. '; ! ! echo ' <input type="radio" name="selectall" onclick="selectAll(this.form,0);" />'.get_string('stackSelectAll','stack').'<input type="radio" name="selectall" onclick="selectAll(this.form,1);" />'.get_string('stackInvertSelection','stack'); echo '<h4>'.get_string('stackQuestion_filterWithSelected','stack','').'</h4>'; $trans_sub = get_string('stackQuestion_filterExportToXML','stack'); *************** *** 334,337 **** --- 383,394 ---- echo '<input type="submit" name="Submit" value="'.get_string('stackQuestionList_Deploy','stack').'" class="stackbutton" /></span>'; echo "\n</form>\n"; + + echo '<table>'; + echo '<tr><th></th><th>'.get_string('stackQuestion_questionActions','stack','').'</th><th width="20"></th><th></th><th>'.get_string('stackQuestion_questionPublished','stack','').'</th></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/pencil.png" alt="'.get_string('stackQuestion_filterLinkEdit','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkEdit', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Unpublished.png" alt="'.get_string('stackMetaData_publishedUnpublished', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedUnpublished', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/eye.png" alt="'.get_string('stackIcon_try','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkTry', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Published.png" alt="'.get_string('stackMetaData_publishedPublished', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedPublished', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/arrow_out.png" alt="'.get_string('stackQuestion_filterLinkDeploy','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkDeploy', 'stack').'</td><td></td><td><img src="'.$config->get('webroot').'/pix/Private.png" alt="'.get_string('stackMetaData_publishedPrivate', 'stack').'" /></td> <td>'.get_string('stackMetaData_publishedPrivate', 'stack').'</td></tr>'; + echo '<tr><td><img src="'.$config->get('webroot').'/pix/disk.png" alt="'.get_string('stackQuestion_filterLinkXML','stack').'" /></td> <td>'.get_string('stackQuestion_filterLinkXML', 'stack').'</td></tr>'; + echo '</table>'; } else |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/lib/blocks In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/blocks Added Files: Tag: question_reporting BlockInterface.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: BlockInterface.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * * @author Matti Harjula * */ require_once("../ui/BlockHandler.php"); /** * Block class "interface". All blocks must implement this "interface". All blocks * must also be stored in /lib/blocks/active/ and named as *Block and placed in * files named *Block.php */ abstract class BlockInterface { /** * Returns the possible identifiers of "pseudo-blocks" that should be * ignored by the parser when inside this type of an block. * * This is used to define substructure for blocks using the same block-syntax * as with real blocks. The main example is the if-else-if: * {% if something %} * {% else %} <= That is not a start tag for an else-block it is just * internal structure of the if block and the parser should * ignore it. Naturally, should it exist somewhere where it is * not a direct child of an if-block it must be considered as * a syntax error. * {% end if %} * * Returns an empty array or false if no identifiers are needed. * * @return array of strings e.g. array("else") for the if-else-if block */ abstract public function getSubBlockIdentifiers(); /** * Returns the identifier of this block. If this is a "for"-block we return * "for". * * @return string */ abstract public function getBlockIdentifier(); /** * Processes the blocks contents. Then returns the processed contents. * * @param string $blockContent * @param array $blockVars Maxima strings of the evaluated variables * @param object $casTextHandler can be used to evaluate the content of this * block if needed. May be needed when block needs to act on the * real contents of the block. For example when the contents of this * block are used as the source code for something it may be necessary * evaluate possible if and for blocks beforehand. * * * * @return string the processed string that replaces the original content * of this block */ abstract public function processBlock($blockContent,$blockVars,$casTextHandler); } ?> |
Update of /cvsroot/stack/stack-dev/other/jqplot In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/other/jqplot Added Files: Tag: question_reporting optionsTutorial.txt gpl-2.0.txt excanvas.min.js jquery.jqplot.js usage.txt changes.txt jquery.jqplot.min.js README.txt excanvas.js MIT-LICENSE.txt jquery.jqplot.css jqPlotCssStyling.txt jquery.jqplot.min.css jqPlotOptions.txt copyright.txt jquery-1.3.2.min.js Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: jquery.jqplot.css --- /*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/ .jqplot-target { position: relative; color: #666666; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 1em; /* height: 300px; width: 400px;*/ } /*rules applied to all axes*/ .jqplot-axis { font-size: 0.75em; } .jqplot-xaxis { margin-top: 10px; } .jqplot-x2axis { margin-bottom: 10px; } .jqplot-yaxis { margin-right: 10px; } .jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, .jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis { margin-left: 10px; margin-right: 10px; } /*rules applied to all axis tick divs*/ .jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick { position: absolute; } .jqplot-xaxis-tick { top: 0px; /* initial position untill tick is drawn in proper place */ left: 15px; /* padding-top: 10px;*/ vertical-align: top; } .jqplot-x2axis-tick { bottom: 0px; /* initial position untill tick is drawn in proper place */ left: 15px; /* padding-bottom: 10px;*/ vertical-align: bottom; } .jqplot-yaxis-tick { right: 0px; /* initial position untill tick is drawn in proper place */ top: 15px; /* padding-right: 10px;*/ text-align: right; } .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick { left: 0px; /* initial position untill tick is drawn in proper place */ top: 15px; /* padding-left: 10px;*/ /* padding-right: 15px;*/ text-align: left; } .jqplot-xaxis-label { margin-top: 10px; font-size: 11pt; position: absolute; } .jqplot-x2axis-label { margin-bottom: 10px; font-size: 11pt; position: absolute; } .jqplot-yaxis-label { margin-right: 10px; /* text-align: center;*/ font-size: 11pt; position: absolute; } .jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, .jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, .jqplot-y8axis-label, .jqplot-y9axis-label { /* text-align: center;*/ font-size: 11pt; position: absolute; } table.jqplot-table-legend, table.jqplot-cursor-legend { background-color: rgba(255,255,255,0.6); border: 1px solid #cccccc; position: absolute; font-size: 0.75em; } td.jqplot-table-legend { vertical-align:middle; } td.jqplot-table-legend > div { border:1px solid #cccccc; padding:0.2em; } div.jqplot-table-legend-swatch { width:0px; height:0px; border-top-width: 0.35em; border-bottom-width: 0.35em; border-left-width: 0.6em; border-right-width: 0.6em; border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-style: solid; } .jqplot-title { top: 0px; left: 0px; padding-bottom: 0.5em; font-size: 1.2em; } table.jqplot-cursor-tooltip { border: 1px solid #cccccc; font-size: 0.75em; } .jqplot-cursor-tooltip { border: 1px solid #cccccc; font-size: 0.75em; white-space: nowrap; background: rgba(208,208,208,0.5); padding: 1px; } .jqplot-highlighter-tooltip { border: 1px solid #cccccc; font-size: 0.75em; white-space: nowrap; background: rgba(208,208,208,0.5); padding: 1px; } .jqplot-point-label { font-size: 0.75em; } td.jqplot-cursor-legend-swatch { vertical-align:middle; text-align:center; } div.jqplot-cursor-legend-swatch { width:1.2em; height:0.7em; } --- NEW FILE: jqPlotCssStyling.txt --- Title: jqPlot CSS Customization Much of the styling of jqPlot is done by css. The jqPlot css file is, unremarkably, jquery.jqplot.css and resides in the same directory as jqPlot itself. There exist some styling related javascript properties on the plot objects themselves (like fontStyle, fontSize, etc.). These can be set with the options object at plot creation. Generally, setting these options is *NOT* the preferred way to customize the look of the plot. Use the css file instead. *These options are deprecated and may disappear*. The exceptions are certain background and color options which control attributes of something renderered on a canvas. This would be line color, grid background, etc. These must be set by the options object. For a list of available options, see <jqPlot Options>. Objects in the plot that can be customized by css are given a css class like ".jqplot-*". For example, the plot title will have a ".jqplot-title" class, the axes ".jqplot-axis", etc. Currently assigned classes in jqPlot are as follows: .jqplot-target - Styles for the plot target div. These will be cascaded down to all plot elements according to css rules. .jqplot-axis - Styles for all axes .jqplot-xaxis - Styles applied to the primary x axis only. .jqplot-yaxis - Styles applied to the primary y axis only. .jqplot-x2axis, .jqplot-x3axis, ... - Styles applied to the 2nd, 3rd, etc. x axis only. .jqplot-y2axis, .jqplot-y3axis, ... - Styles applied to the 2nd, 3rd, etc.y axis only. .jqplot-axis-tick - Styles applied to all axis ticks .jqplot-xaxis-tick - Styles applied to primary x axis ticks only. .jqplot-x2axis-tick - Styles applied to secondary x axis ticks only. .jqplot-yaxis-tick - Styles applied to primary y axis ticks only. .jqplot-y2axis-tick - Styles applied to secondary y axis ticks only. table.jqplot-table-legend - Styles applied to the legend box table. .jqplot-title - Styles applied to the title. .jqplot-cursor-tooltip - Styles applied to the cursor tooltip .jqplot-highlighter-tooltip - Styles applied to the highlighter tooltip. div.jqplot-table-legend-swatch - the div element used for the colored swatch on the legend. Note that axes will be assigned 2 classes like: class=".jqplot-axis .jqplot-xaxis". --- NEW FILE: excanvas.min.js --- if(!document.createElement("canvas").getContext){(function(){var Y=Math;var q=Y.round;var o=Y.sin;var B=Y.cos;var H=Y.abs;var N=Y.sqrt;var d=10;var f=d/2;function A(){return this.context_||(this.context_=new D(this))}var v=Array.prototype.slice;function g(j,m,p){var i=v.call(arguments,2);return function(){return j.apply(m,i.concat(v.call(arguments)))}}function ad(i){return String(i).replace(/&/g,"&").replace(/"/g,""")}function R(j){if(!j.namespaces.g_vml_){j.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!j.namespaces.g_o_){j.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))}},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j<m.length;j++){this.initElement(m[j])}},initElement:function(j){if(!j.getContext){j.getContext=A;R(j.ownerDocument);j.innerHTML="";j.attachEvent("onpropertychange",z);j.attachEvent("onresize",V);var i=j.attributes;if(i.width&&i.width.specified){j.style.width=i.width.nodeValue+"px"}else{j.width=j.clientWidth}if(i.height&&i.height.specified){j.style.height=i.height.nodeValue+"px"}else{j.height=j.clientHeight}}return j}};function z(j){var i=j.srcElement;switch(j.propertyName){case"width":i.getContext().clearRect();i.style.width=i.attributes.width.nodeValue+"px";i.firstChild.style.width=i.clientWidth+"px";break;case"height":i.getContext().clearRect();i.style.height=i.attributes.height.nodeValue+"px";i.firstChild.style.height=i.clientHeight+"px";break}}function V(j){var i=j.srcElement;if(i.firstChild){i.firstChild.style.width=i.clientWidth+"px";i.firstChild.style.height=i.clientHeight+"px"}}e.init();var n=[];for(var ac=0;ac<16;ac++){for(var ab=0;ab<16;ab++){n[ac*16+ab]=ac.toString(16)+ab.toString(16)}}function C(){return[[1,0,0],[0,1,0],[0,0,1]]}function J(p,m){var j=C();for(var i=0;i<3;i++){for(var af=0;af<3;af++){var Z=0;for(var ae=0;ae<3;ae++){Z+=p[i][ae]*m[ae][af]}j[i][af]=Z}}return j}function x(j,i){i.fillStyle=j.fillStyle;i.lineCap=j.lineCap;i.lineJoin=j.lineJoin;i.lineWidth=j.lineWidth;i.miterLimit=j.miterLimit;i.shadowBlur=j.shadowBlur;i.shadowColor=j.shadowColor;i.shadowOffsetX=j.shadowOffsetX;i.shadowOffsetY=j.shadowOffsetY;i.strokeStyle=j.strokeStyle;i.globalAlpha=j.globalAlpha;i.font=j.font;i.textAlign=j.textAlign;i.textBaseline=j.textBaseline;i.arcScaleX_=j.arcScaleX_;i.arcScaleY_=j.arcScaleY_;i.lineScale_=j.lineScale_}var b={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"};function M(j){var p=j.indexOf("(",3);var i=j.indexOf(")",p+1);var m=j.substring(p+1,i).split(",");if(m.length==4&&j.substr(3,1)=="a"){alpha=Number(m[3])}else{m[3]=1}return m}function c(i){return parseFloat(i)/100}function u(j,m,i){return Math.min(i,Math.max(m,j))}function I(af){var m,j,i;h=parseFloat(af[0])/360%360;if(h<0){h++}s=u(c(af[1]),0,1);l=u(c(af[2]),0,1);if(s==0){m=j=i=l}else{var Z=l<0.5?l*(1+s):l+s-l*s;var ae=2*l-Z;m=a(ae,Z,h+1/3);j=a(ae,Z,h);i=a(ae,Z,h-1/3)}return"#"+n[Math.floor(m*255)]+n[Math.floor(j*255)]+n[Math.floor(i*255)]}function a(j,i,m){if(m<0){m++}if(m>1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}function F(j){var ae,Z=1;j=String(j);if(j.charAt(0)=="#"){ae=j}else{if(/^rgb/.test(j)){var p=M(j);var ae="#",af;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){af=Math.floor(c(p[m])*255)}else{af=Number(p[m])}ae+=n[u(af,0,255)]}Z=p[3]}else{if(/^hsl/.test(j)){var p=M(j);ae=I(p);Z=p[3]}else{ae=b[j]||j}}}return{color:ae,alpha:Z}}var r={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||r.style,variant:m.fontVariant||r.variant,weight:m.fontWeight||r.weight,size:m.fontSize||r.size,family:m.fontFamily||r.family}}function w(m,j){var i={};for(var af in m){i[af]=m[af]}var ae=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ae*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ae/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=ae*(4/3)*Z}else{i.size=ae}}}}}i.size*=0.981;return i}function aa(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}function S(i){switch(i){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function D(j){this.m_=C();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=j;var i=j.ownerDocument.createElement("div");i.style.width=j.clientWidth+"px";i.style.height=j.clientHeight+"px";i.style.overflow="hidden";i.style.position="absolute";j.appendChild(i);this.element_=i;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var t=D.prototype;t.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};t.beginPath=function(){this.currentPath_=[]};t.moveTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.lineTo=function(j,i){var m=this.getCoords_(j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};t.bezierCurveTo=function(m,j,ai,ah,ag,ae){var i=this.getCoords_(ag,ae);var af=this.getCoords_(m,j);var Z=this.getCoords_(ai,ah);K(this,af,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}t.quadraticCurveTo=function(ag,m,j,i){var af=this.getCoords_(ag,m);var ae=this.getCoords_(j,i);var ah={x:this.currentX_+2/3*(af.x-this.currentX_),y:this.currentY_+2/3*(af.y-this.currentY_)};var Z={x:ah.x+(ae.x-this.currentX_)/3,y:ah.y+(ae.y-this.currentY_)/3};K(this,ah,Z,ae)};t.arc=function(aj,ah,ai,ae,j,m){ai*=d;var an=m?"at":"wa";var ak=aj+B(ae)*ai-f;var am=ah+o(ae)*ai-f;var i=aj+B(j)*ai-f;var al=ah+o(j)*ai-f;if(ak==i&&!m){ak+=0.125}var Z=this.getCoords_(aj,ah);var ag=this.getCoords_(ak,am);var af=this.getCoords_(i,al);this.currentPath_.push({type:an,x:Z.x,y:Z.y,radius:ai,xStart:ag.x,yStart:ag.y,xEnd:af.x,yEnd:af.y})};t.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};t.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};t.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};t.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};t.createRadialGradient=function(p,ae,m,j,Z,i){var af=new U("gradientradial");af.x0_=p;af.y0_=ae;af.r0_=m;af.x1_=j;af.y1_=Z;af.r1_=i;return af};t.drawImage=function(ao,m){var ah,af,aj,aw,am,ak,aq,ay;var ai=ao.runtimeStyle.width;var an=ao.runtimeStyle.height;ao.runtimeStyle.width="auto";ao.runtimeStyle.height="auto";var ag=ao.width;var au=ao.height;ao.runtimeStyle.width=ai;ao.runtimeStyle.height=an;if(arguments.length==3){ah=arguments[1];af=arguments[2];am=ak=0;aq=aj=ag;ay=aw=au}else{if(arguments.length==5){ah=arguments[1];af=arguments[2];aj=arguments[3];aw=arguments[4];am=ak=0;aq=ag;ay=au}else{if(arguments.length==9){am=arguments[1];ak=arguments[2];aq=arguments[3];ay=arguments[4];ah=arguments[5];af=arguments[6];aj=arguments[7];aw=arguments[8]}else{throw Error("Invalid number of arguments")}}}var ax=this.getCoords_(ah,af);var p=aq/2;var j=ay/2;var av=[];var i=10;var ae=10;av.push(" <g_vml_:group",' coordsize="',d*i,",",d*ae,'"',' coordorigin="0,0"',' style="width:',i,"px;height:",ae,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var Z=[];Z.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",q(ax.x/d),",","Dy=",q(ax.y/d),"");var at=ax;var ar=this.getCoords_(ah+aj,af);var ap=this.getCoords_(ah,af+aw);var al=this.getCoords_(ah+aj,af+aw);at.x=Y.max(at.x,ar.x,ap.x,al.x);at.y=Y.max(at.y,ar.y,ap.y,al.y);av.push("padding:0 ",q(at.x/d),"px ",q(at.y/d),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",Z.join(""),", sizingmethod='clip');")}else{av.push("top:",q(ax.y/d),"px;left:",q(ax.x/d),"px;")}av.push(' ">','<g_vml_:image src="',ao.src,'"',' style="width:',d*aj,"px;"," height:",d*aw,'px"',' cropleft="',am/ag,'"',' croptop="',ak/au,'"',' cropright="',(ag-am-aq)/ag,'"',' cropbottom="',(au-ak-ay)/au,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",av.join(""))};t.stroke=function(aj){var ah=[];var Z=false;var m=10;var ak=10;ah.push("<g_vml_:shape",' filled="',!!aj,'"',' style="position:absolute;width:',m,"px;height:",ak,'px;"',' coordorigin="0,0"',' coordsize="',d*m,",",d*ak,'"',' stroked="',!aj,'"',' path="');var al=false;var ae={x:null,y:null};var ai={x:null,y:null};for(var af=0;af<this.currentPath_.length;af++){var j=this.currentPath_[af];var ag;switch(j.type){case"moveTo":ag=j;ah.push(" m ",q(j.x),",",q(j.y));break;case"lineTo":ah.push(" l ",q(j.x),",",q(j.y));break;case"close":ah.push(" x ");j=null;break;case"bezierCurveTo":ah.push(" c ",q(j.cp1x),",",q(j.cp1y),",",q(j.cp2x),",",q(j.cp2y),",",q(j.x),",",q(j.y));break;case"at":case"wa":ah.push(" ",j.type," ",q(j.x-this.arcScaleX_*j.radius),",",q(j.y-this.arcScaleY_*j.radius)," ",q(j.x+this.arcScaleX_*j.radius),",",q(j.y+this.arcScaleY_*j.radius)," ",q(j.xStart),",",q(j.yStart)," ",q(j.xEnd),",",q(j.yEnd));break}if(j){if(ae.x==null||j.x<ae.x){ae.x=j.x}if(ai.x==null||j.x>ai.x){ai.x=j.x}if(ae.y==null||j.y<ae.y){ae.y=j.y}if(ai.y==null||j.y>ai.y){ai.y=j.y}}}ah.push(' ">');if(!aj){y(this,ah)}else{G(this,ah,ae,ai)}ah.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",ah.join(""))};function y(m,ae){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ae.push("<g_vml_:stroke",' opacity="',Z,'"',' joinstyle="',m.lineJoin,'"',' miterlimit="',m.miterLimit,'"',' endcap="',S(m.lineCap),'"',' weight="',i,'px"',' color="',p,'" />')}function G(ao,ag,aI,ap){var ah=ao.fillStyle;var az=ao.arcScaleX_;var ay=ao.arcScaleY_;var j=ap.x-aI.x;var p=ap.y-aI.y;if(ah instanceof U){var al=0;var aD={x:0,y:0};var av=0;var ak=1;if(ah.type_=="gradient"){var aj=ah.x0_/az;var m=ah.y0_/ay;var ai=ah.x1_/az;var aK=ah.y1_/ay;var aH=ao.getCoords_(aj,m);var aG=ao.getCoords_(ai,aK);var ae=aG.x-aH.x;var Z=aG.y-aH.y;al=Math.atan2(ae,Z)*180/Math.PI;if(al<0){al+=360}if(al<0.000001){al=0}}else{var aH=ao.getCoords_(ah.x0_,ah.y0_);aD={x:(aH.x-aI.x)/j,y:(aH.y-aI.y)/p};j/=az*d;p/=ay*d;var aB=Y.max(j,p);av=2*ah.r0_/aB;ak=2*ah.r1_/aB-av}var at=ah.colors_;at.sort(function(aL,i){return aL.offset-i.offset});var an=at.length;var ar=at[0].color;var aq=at[an-1].color;var ax=at[0].alpha*ao.globalAlpha;var aw=at[an-1].alpha*ao.globalAlpha;var aC=[];for(var aF=0;aF<an;aF++){var am=at[aF];aC.push(am.offset*ak+av+" "+am.color)}ag.push('<g_vml_:fill type="',ah.type_,'"',' method="none" focus="100%"',' color="',ar,'"',' color2="',aq,'"',' colors="',aC.join(","),'"',' opacity="',aw,'"',' g_o_:opacity2="',ax,'"',' angle="',al,'"',' focusposition="',aD.x,",",aD.y,'" />')}else{if(ah instanceof T){if(j&&p){var af=-aI.x;var aA=-aI.y;ag.push("<g_vml_:fill",' position="',af/j*az*az,",",aA/p*ay*ay,'"',' type="tile"',' src="',ah.src_,'" />')}}else{var aJ=F(ao.fillStyle);var au=aJ.color;var aE=aJ.alpha*ao.globalAlpha;ag.push('<g_vml_:fill color="',au,'" opacity="',aE,'" />')}}}t.fill=function(){this.stroke(true)};t.closePath=function(){this.currentPath_.push({type:"close"})};t.getCoords_=function(p,j){var i=this.m_;return{x:d*(p*i[0][0]+j*i[1][0]+i[2][0])-f,y:d*(p*i[0][1]+j*i[1][1]+i[2][1])-f}};t.save=function(){var i={};x(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(C(),this.m_)};t.restore=function(){if(this.aStack_.length){x(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function k(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function X(j,i,p){if(!k(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}t.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];X(this,J(i,this.m_),false)};t.rotate=function(j){var p=B(j);var m=o(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];X(this,J(i,this.m_),false)};t.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];X(this,J(i,this.m_),true)};t.transform=function(Z,p,af,ae,j,i){var m=[[Z,p,0],[af,ae,0],[j,i,1]];X(this,J(m,this.m_),true)};t.setTransform=function(ae,Z,ag,af,p,j){var i=[[ae,Z,0],[ag,af,0],[p,j,1]];X(this,i,true)};t.drawText_=function(ak,ai,ah,an,ag){var am=this.m_,aq=1000,j=0,ap=aq,af={x:0,y:0},ae=[];var i=w(E(this.font),this.element_);var p=aa(i);var ar=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=ar.direction=="ltr"?"right":"left";break;case"start":Z=ar.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":af.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":af.y=-i.size/2.25;break}switch(Z){case"right":j=aq;ap=0.05;break;case"center":j=ap=aq/2;break}var ao=this.getCoords_(ai+af.x,ah+af.y);ae.push('<g_vml_:line from="',-j,' 0" to="',ap,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!ag,'" stroked="',!!ag,'" style="position:absolute;width:1px;height:1px;">');if(ag){y(this,ae)}else{G(this,ae,{x:-j,y:0},{x:ap,y:i.size})}var al=am[0][0].toFixed(3)+","+am[1][0].toFixed(3)+","+am[0][1].toFixed(3)+","+am[1][1].toFixed(3)+",0,0";var aj=q(ao.x/d)+","+q(ao.y/d);ae.push('<g_vml_:skew on="t" matrix="',al,'" ',' offset="',aj,'" origin="',j,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',ad(ak),'" style="v-text-align:',Z,";font:",ad(p),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",ae.join(""))};t.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};t.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};t.measureText=function(m){if(!this.textMeasureEl_){var i='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};t.clip=function(){};t.arcTo=function(){};t.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var W=P.prototype=new Error;W.INDEX_SIZE_ERR=1;W.DOMSTRING_SIZE_ERR=2;W.HIERARCHY_REQUEST_ERR=3;W.WRONG_DOCUMENT_ERR=4;W.INVALID_CHARACTER_ERR=5;W.NO_DATA_ALLOWED_ERR=6;W.NO_MODIFICATION_ALLOWED_ERR=7;W.NOT_FOUND_ERR=8;W.NOT_SUPPORTED_ERR=9;W.INUSE_ATTRIBUTE_ERR=10;W.INVALID_STATE_ERR=11;W.SYNTAX_ERR=12;W.INVALID_MODIFICATION_ERR=13;W.NAMESPACE_ERR=14;W.INVALID_ACCESS_ERR=15;W.VALIDATION_ERR=16;W.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P})()}; --- NEW FILE: jquery.jqplot.min.css --- .jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em;}.jqplot-axis{font-size:.75em;}.jqplot-xaxis{margin-top:10px;}.jqplot-x2axis{margin-bottom:10px;}.jqplot-yaxis{margin-right:10px;}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis{margin-left:10px;margin-right:10px;}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{position:absolute;}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top;}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom;}.jqplot-yaxis-tick{right:0;top:15px;text-align:right;}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left;}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute;}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute;}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute;}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;position:absolute;}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em;}td.jqplot-table-legend{vertical-align:middle;}td.jqplot-table-legend>div{border:1px solid #ccc;padding:.2em;}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:.35em;border-bottom-width:.35em;border-left-width:.6em;border-right-width:.6em;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid;}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em;}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-highlighter-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-point-label{font-size:.75em;}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center;}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em;} --- NEW FILE: jqPlotOptions.txt --- Title: jqPlot Options **This document is out of date. While the options described here should still be relavent and valid, it has not been updated for many new options. Sorry for this inconvenience.** This document describes the options available to jqPlot. These are set with the third argument to the $.jqplot('target', data, options) function. Options are using the following convention: {{{ property: default, // notes }}} This document is not complete! Not all options are shown! Also, Options marked with ** in the notes are post 0.7.1 additions. They will be available in the next release. Further information about the options can be found in the online API documentation. For details on how the options relate to the API documentation, see the <Options Tutorial> in the optionsTutorial.txt file. {{{ options = { seriesColors: [ "#4bb2c5", "#c5b47f", "#EAA228", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc"], // colors that will // be assigned to the series. If there are more series than colors, colors // will wrap around and start at the beginning again. stackSeries: false, // if true, will create a stack plot. // Currently supported by line and bar graphs. title: '', // Title for the plot. Can also be specified as an object like: title: { text: '', // title for the plot, show: true, }, axesDefaults: { show: false, // wether or not to renderer the axis. Determined automatically. min: null, // minimum numerical value of the axis. Determined automatically. max: null, // maximum numverical value of the axis. Determined automatically. pad: 1.2, // a factor multiplied by the data range on the axis to give the // axis range so that data points don't fall on the edges of the axis. ticks: [], // a 1D [val1, val2, ...], or 2D [[val, label], [val, label], ...] // array of ticks to use. Computed automatically. numberTicks: undefined, renderer: $.jqplot.LinearAxisRenderer, // renderer to use to draw the axis, rendererOptions: {}, // options to pass to the renderer. LinearAxisRenderer // has no options, tickOptions: { mark: 'outside', // Where to put the tick mark on the axis // 'outside', 'inside' or 'cross', showMark: true, showGridline: true, // wether to draw a gridline (across the whole grid) at this tick, markSize: 4, // length the tick will extend beyond the grid in pixels. For // 'cross', length will be added above and below the grid boundary, show: true, // wether to show the tick (mark and label), showLabel: true, // wether to show the text label at the tick, formatString: '', // format string to use with the axis tick formatter } showTicks: true, // wether or not to show the tick labels, showTickMarks: true, // wether or not to show the tick marks }, axes: { xaxis: { // same options as axesDefaults }, yaxis: { // same options as axesDefaults }, x2axis: { // same options as axesDefaults }, y2axis: { // same options as axesDefaults } }, seriesDefaults: { show: true, // wether to render the series. xaxis: 'xaxis', // either 'xaxis' or 'x2axis'. yaxis: 'yaxis', // either 'yaxis' or 'y2axis'. label: '', // label to use in the legend for this line. color: '', // CSS color spec to use for the line. Determined automatically. lineWidth: 2.5, // Width of the line in pixels. shadow: true, // show shadow or not. shadowAngle: 45, // angle (degrees) of the shadow, clockwise from x axis. shadowOffset: 1.25, // offset from the line of the shadow. shadowDepth: 3, // Number of strokes to make when drawing shadow. Each // stroke offset by shadowOffset from the last. shadowAlpha: 0.1, // Opacity of the shadow. showLine: true, // whether to render the line segments or not. showMarker: true, // render the data point markers or not. fill: false, // fill under the line, fillAndStroke: false, // **stroke a line at top of fill area. fillColor: undefined, // **custom fill color for filled lines (default is line color). fillAlpha: undefined, // **custom alpha to apply to fillColor. renderer: $.jqplot.LineRenderer], // renderer used to draw the series. rendererOptions: {}, // options passed to the renderer. LineRenderer has no options. markerRenderer: $.jqplot.MarkerRenderer, // renderer to use to draw the data // point markers. markerOptions: { show: true, // wether to show data point markers. style: 'filledCircle', // circle, diamond, square, filledCircle. // filledDiamond or filledSquare. lineWidth: 2, // width of the stroke drawing the marker. size: 9, // size (diameter, edge length, etc.) of the marker. color: '#666666' // color of marker, set to color of line by default. shadow: true, // wether to draw shadow on marker or not. shadowAngle: 45, // angle of the shadow. Clockwise from x axis. shadowOffset: 1, // offset from the line of the shadow, shadowDepth: 3, // Number of strokes to make when drawing shadow. Each stroke // offset by shadowOffset from the last. shadowAlpha: 0.07 // Opacity of the shadow } }, series:[ {Each series has same options as seriesDefaults}, {You can override each series individually here} ], legend: { show: false, location: 'ne', // compass direction, nw, n, ne, e, se, s, sw, w. xoffset: 12, // pixel offset of the legend box from the x (or x2) axis. yoffset: 12, // pixel offset of the legend box from the y (or y2) axis. }, grid: { drawGridLines: true, // wether to draw lines across the grid or not. gridLineColor: '#cccccc' // **Color of the grid lines. background: '#fffdf6', // CSS color spec for background color of grid. borderColor: '#999999', // CSS color spec for border around grid. borderWidth: 2.0, // pixel width of border around grid. shadow: true, // draw a shadow for grid. shadowAngle: 45, // angle of the shadow. Clockwise from x axis. shadowOffset: 1.5, // offset from the line of the shadow. shadowWidth: 3, // width of the stroke for the shadow. shadowDepth: 3, // Number of strokes to make when drawing shadow. // Each stroke offset by shadowOffset from the last. shadowAlpha: 0.07 // Opacity of the shadow renderer: $.jqplot.CanvasGridRenderer, // renderer to use to draw the grid. rendererOptions: {} // options to pass to the renderer. Note, the default // CanvasGridRenderer takes no additional options. }, // Plugin and renderer options. // BarRenderer. // With BarRenderer, you can specify additional options in the rendererOptions object // on the series or on the seriesDefaults object. Note, some options are respecified // (like shadowDepth) to override lineRenderer defaults from which BarRenderer inherits. seriesDefaults: { rendererOptions: { barPadding: 8, // number of pixels between adjacent bars in the same // group (same category or bin). barMargin: 10, // number of pixels between adjacent groups of bars. barDirection: 'vertical', // vertical or horizontal. barWidth: null, // width of the bars. null to calculate automatically. shadowOffset: 2, // offset from the bar edge to stroke the shadow. shadowDepth: 5, // nuber of strokes to make for the shadow. shadowAlpha: 0.8, // transparency of the shadow. } }, // Cursor // Options are passed to the cursor plugin through the "cursor" object at the top // level of the options object. cursor: { style: 'crosshair', // A CSS spec for the cursor type to change the // cursor to when over plot. show: true, showTooltip: true, // show a tooltip showing cursor position. followMouse: false, // wether tooltip should follow the mouse or be stationary. tooltipLocation: 'se', // location of the tooltip either relative to the mouse // (followMouse=true) or relative to the plot. One of // the compass directions, n, ne, e, se, etc. tooltipOffset: 6, // pixel offset of the tooltip from the mouse or the axes. showTooltipGridPosition: false, // show the grid pixel coordinates of the mouse // in the tooltip. showTooltipUnitPosition: true, // show the coordinates in data units of the mouse // in the tooltip. tooltipFormatString: '%.4P', // sprintf style format string for tooltip values. useAxesFormatters: true, // wether to use the same formatter and formatStrings // as used by the axes, or to use the formatString // specified on the cursor with sprintf. tooltipAxesGroups: [], // show only specified axes groups in tooltip. Would specify like: // [['xaxis', 'yaxis'], ['xaxis', 'y2axis']]. By default, all axes // combinations with for the series in the plot are shown. }, // Dragable // Dragable options are specified with the "dragable" object at the top level // of the options object. dragable: { color: undefined, // custom color to use for the dragged point and dragged line // section. default will use a transparent variant of the line color. constrainTo: 'none', // Constrain dragging motion to an axis: 'x', 'y', or 'none'. }, // Highlighter // Highlighter options are specified with the "highlighter" object at the top level // of the options object. highlighter: { lineWidthAdjust: 2.5, // pixels to add to the size line stroking the data point marker // when showing highlight. Only affects non filled data point markers. sizeAdjust: 5, // pixels to add to the size of filled markers when drawing highlight. showTooltip: true, // show a tooltip with data point values. tooltipLocation: 'nw', // location of tooltip: n, ne, e, se, s, sw, w, nw. fadeTooltip: true, // use fade effect to show/hide tooltip. tooltipFadeSpeed: "fast"// slow, def, fast, or a number of milliseconds. tooltipOffset: 2, // pixel offset of tooltip from the highlight. tooltipAxes: 'both', // which axis values to display in the tooltip, x, y or both. tooltipSeparator: ', ' // separator between values in the tooltip. useAxesFormatters: true // use the same format string and formatters as used in the axes to // display values in the tooltip. tooltipFormatString: '%.5P' // sprintf format string for the tooltip. only used if // useAxesFormatters is false. Will use sprintf formatter with // this string, not the axes formatters. }, // LogAxisRenderer // LogAxisRenderer add 2 options to the axes object. These options are specified directly on // the axes or axesDefaults object. axesDefaults: { base: 10, // the logarithmic base. tickDistribution: 'even', // 'even' or 'power'. 'even' will produce with even visiual (pixel) // spacing on the axis. 'power' will produce ticks spaced by // increasing powers of the log base. }, // PieRenderer // PieRenderer accepts options from the rendererOptions object of the series or seriesDefaults object. seriesDefaults: { rendererOptions: { diameter: undefined, // diameter of pie, auto computed by default. padding: 20, // padding between pie and neighboring legend or plot margin. sliceMargin: 0, // gap between slices. fill: true, // render solid (filled) slices. shadowOffset: 2, // offset of the shadow from the chart. shadowDepth: 5, // Number of strokes to make when drawing shadow. Each stroke // offset by shadowOffset from the last. shadowAlpha: 0.07 // Opacity of the shadow } }, // Trendline // Trendline takes options on the trendline object of the series or seriesDefaults object. seriesDefaults: { trendline: { show: true, // show the trend line color: '#666666', // CSS color spec for the trend line. label: '', // label for the trend line. type: 'linear', // 'linear', 'exponential' or 'exp' shadow: true, // show the trend line shadow. lineWidth: 1.5, // width of the trend line. shadowAngle: 45, // angle of the shadow. Clockwise from x axis. shadowOffset: 1.5, // offset from the line of the shadow. shadowDepth: 3, // Number of strokes to make when drawing shadow. // Each stroke offset by shadowOffset from the last. shadowAlpha: 0.07 // Opacity of the shadow } } } }}} --- NEW FILE: gpl-2.0.txt --- Title: GPL Version 2 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. --- NEW FILE: jquery-1.3.2.min.js --- /* * jQuery JavaScript Library v1.3.2 * http://jquery.com/ * * Copyright (c) 2009 John Resig * Dual licensed under the MIT and GPL licenses. * http://docs.jquery.com/License * * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) * Revision: 6246 */ (function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocumen... [truncated message content] |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/lang/en/doc In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lang/en/doc Modified Files: Tag: question_reporting maxima_functions.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: maxima_functions.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/doc/maxima_functions.php,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -C2 -d -r1.2 -r1.2.12.1 *** maxima_functions.php 2 Apr 2008 22:50:28 -0000 1.2 --- maxima_functions.php 22 Nov 2010 23:05:54 -0000 1.2.12.1 *************** *** 18,24 **** <p>This is a complete and alphabetical list of Maxima functions taken from the distributed documentation, ! together with the extent to which they are supported by STACK. This list is taken from Maxima 5.13.0 on 19 September 2007, and so may well be incomplete.</p> ! <p>The reasons why a function may have been excluded from STACK are listed below. <ul> <li>File operations</li> --- 18,24 ---- <p>This is a complete and alphabetical list of Maxima functions taken from the distributed documentation, ! together with the extent to which they are supported by STACK. This list is taken from Maxima 5.21.1 on 1 June 2010, and so may well be incomplete.</p> ! <p>The reasons why a function may have been excluded from STACK are listed below. <ul> <li>File operations</li> *************** *** 49,61 **** if (array_key_exists('use',$vals)) { - // This next if is entirely for formatting reasons. - // Long command or variable names clutter the display if unused. - if (strlen($fun) < 20 or 's' == $vals['use'] or 't' == $vals['use']) { echo "\n<tr>\n"; echo " <td>"; foreach ($vals['urls'] as $url) { ! echo " <a href='{$MaximaDocs}{$url}'>$fun</a> "; } echo "</td>\n"; --- 49,64 ---- if (array_key_exists('use',$vals)) { echo "\n<tr>\n"; echo " <td>"; + $i=0; foreach ($vals['urls'] as $url) { ! $i+=1; ! if ($i==1) { ! echo " <a href='{$MaximaDocs}{$url}'>$fun</pre></a> "; ! } else { ! echo " <a href='{$MaximaDocs}{$url}'>[$i]</pre></a> "; ! } } echo "</td>\n"; *************** *** 69,72 **** --- 72,77 ---- } else if ('never' == $vals['use']) { echo " <td> <font color='gray'>(Forbidden)</font> </td>\n "; + } else if ('NEW' == $vals['use']) { + echo " <td> <font color='red'>NEW</font> </td>\n "; } else echo " <td nowrap='nowrap'>Not supported</td>\n"; *************** *** 91,103 **** echo "</tr>"; } ! ! } } ?> - <hr> - <a href="index.html">STACK documentation home page</a> </body> --- 96,106 ---- echo "</tr>"; } ! } + echo "</table>"; ?> <hr> </body> |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/install/update In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/install/update Modified Files: Tag: question_reporting Updater.php index.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: Updater.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/update/Updater.php,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** Updater.php 27 Aug 2009 16:22:48 -0000 1.6 --- Updater.php 22 Nov 2010 23:05:53 -0000 1.6.2.1 *************** *** 21,25 **** require_once($root.'/lib/database/StackDBBackup.php'); ! define(STACK_CURRENT, 'STACK 2.0 alpha 2'); //The latest version of STACK. class Updater{ --- 21,25 ---- require_once($root.'/lib/database/StackDBBackup.php'); ! define(STACK_CURRENT, 'STACK 2.2'); //The latest version of STACK. class Updater{ *************** *** 63,68 **** unset($update); ! case 'STACK 2.0 alpha 2': ! //nothing yet } --- 63,73 ---- unset($update); ! // bit of a jump!? ! ! case 'STACK 2.0 beta': ! require_once('updates/TwoPointTwo.php'); //load the code to update STACK to 2.2 ! $update = new TwoPointTwo($this->errorLog); ! $update->performUpdate(); ! unset($update); } Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/update/index.php,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** index.php 14 Nov 2008 19:05:59 -0000 1.4 --- index.php 22 Nov 2010 23:05:53 -0000 1.4.10.1 *************** *** 17,21 **** */ session_start(); ! define(STACK_CURRENT, 'STACK 2.0 beta'); //The latest version of STACK. $configFile = '../../config.php'; if(!file_exists($configFile)) --- 17,21 ---- */ session_start(); ! define(STACK_CURRENT, 'STACK 2.2'); //The latest version of STACK. $configFile = '../../config.php'; if(!file_exists($configFile)) |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/sample_questions/diagnostictests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/sample_questions/diagnostictests Added Files: Tag: question_reporting DiagnosticTests.xml FormulaSheet.tex ReadMe.txt Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: ReadMe.txt --- Stimulating Techniques in Entry-level Mathematics with the STACK CAA system In April 2010 the National HE STEM Programme (http://www.stemprogramme.com) funded a mini-project stimulating Techniques in Entry-level Mathematics (STEM) with the STACK computer aided assessment (CAA) system}. The aims of this project are to take existing diagnostic tests in core mathematics and develop similar automatic tests for the STACK computer aided assessment system. The outcome of these tests will be a user profile which links outcomes to existing online learning materials. See http://web.mat.bham.ac.uk/C.J.Sangwin/projects/2010STEM/ The questions in this folder are the results of this project. These questions files are released under Creative Commons Attribution-Share Alike. http://creativecommons.org/licenses/by-sa/2.0/uk/ --- NEW FILE: FormulaSheet.tex --- \documentclass{article} \usepackage{amsmath,amssymb,latexsym,a4wide,times} \usepackage{epsfig} \usepackage{graphicx} \parindent=0pt \parskip=2mm \columnsep=1cm \newcommand{\R}{{\mathbb R}} \newcommand{\N}{{\mathbb N}} \newcommand{\Z}{{\mathbb Z}} \newcommand{\Q}{{\mathbb Q}} \newcommand{\C}{{\mathbb C}} \renewcommand{\d}{\mathrm{d}} \pagestyle{empty} \begin{document} \begin{center} {\Large\bf Facts and formulae} \end{center} Indices: \[ a^ma^n = a^{m+n},\quad \frac{a^m}{a^n} = a^{m-n},\quad (a^m)^n = a^{mn}\] \[ a^0 = 1,\quad a^{-m} = \frac{1}{a^m},\quad a^{\frac{1}{n}} = \sqrt[n]{a},\quad a^{\frac{m}{n}} = \left(\sqrt[n]{a}\right)^m.\] Logarithms: for any $b>0$, $b \neq 1$: $\log_b(a) = c$, means $a = b^c$. \[\log_b(a) + \log_b(b) = \log_b(ab),\quad \log_b(a) - \log_b(b) = \log_b\left(\frac{a}{b}\right),\quad n\log_b(a) = \log_b\left(a^n\right)\] \[\log_b(1) = 0,\quad \log_b(b) = 1,\quad \log_a(x) = \frac{\log_b(x)}{\log_b(a)}\] Natural logarithms use base $e\approx 2.718$, and are denoted $\log_e$ or alternatively $\ln$. Standard Trigonometric Values \[ \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}} \] Standard Trigonometric Identities \[\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}\] Hyperbolic Functions \[\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}}\] 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}\] Inverse Hyperbolic Functions \[\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)\] \[\tanh^{-1}(x) = \frac{1}{2}\ln\left({1+x\over 1-x}\right) \quad \mbox{ for } -1< x < 1\] Calculus rules The Product Rule: \[\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}}.\] The Quotient Rule: \[\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}. \] The Chain Rule \[\frac{df(g(x))}{dx} = \frac{dg(x)}{dx}\cdot\frac{df(u)}{du}.\] Integration by Substitution: \[\int f(u){{\rm d}u\over {\rm d}x}{\rm d}x=\int f(u){\rm d}u \quad\hbox{and}\quad \int_a^bf(u){{\rm d}u\over {\rm d}x}\,{\rm d}x = \int_{u(a)}^{u(b)}f(u){\rm d}u.\] Integration by Parts: \[\int_a^b u{{\rm d}v\over {\rm d}x}{\rm d}x=\left[uv\right]_a^b- \int_a^b{{\rm d}u\over {\rm d}x}v\,{\rm d}x.\] \begin{center} \begin{tabular}{ll} $f(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) = \frac{\sin(x)}{\cos(x)}$ & $\sec^2(x)$ \\ $\mbox{cosec}(x)=\frac{1}{\sin(x)}$ & $-\mbox{cosec}(x)\cot(x)$ \\ $\sec(x)=\frac{1}{\cos(x)}$ & $\sec(x)\tan(x)$ \\ $\cot(x)=\frac{\cos(x)}{\sin(x)}$ & $-\mbox{cosec}^2(x)$ \\ $\cosh(x)$ & $\sinh(x)$ \\ $\sinh(x)$ & $\cosh(x)$ \\ $\tanh(x)$ & $\mbox{sech}^2(x)$ \\ $\mbox{sech}(x)$ & $-\mbox{sech}sech(x)\tanh(x)$ \\ $\mbox{cosech}(x)$ & $-\mbox{cosech}(x)\coth(x)$ \\ $coth(x)$ & $-\mbox{cosech}^2(x)$ \\ \end{tabular} \end{center} \[\frac{d}{dx}\left(\sin^{-1}(x)\right) = \frac{1}{\sqrt{1-x^2}},\quad \frac{d}{dx}\left(\cos^{-1}(x)\right) = \frac{-1}{\sqrt{1-x^2}},\quad \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}},\quad \frac{d}{dx}\left(\sinh^{-1}(x)\right) = \frac{1}{\sqrt{x^2+1}},\quad \frac{d}{dx}\left(\tanh^{-1}(x)\right) = \frac{1}{1-x^2}\] \begin{center} \begin{tabular}{lll} $f(x)$ & $\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$ & $-\frac{\pi}{2} < x < \frac{\pi}{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} \end{center} \vfill {\scriptsize C J Sangwin, \verb$C.J...@bh...$, \today. This formula sheet is released under Creative Commons Attribution-Share Alike.\\ \includegraphics[width=1.5cm]{88x31.png}} \end{document} --- NEW FILE: DiagnosticTests.xml --- <?xml version="1.0" encoding="UTF-8"?> <mathQuiz version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><assessmentItem version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:lom="http://www.imsglobal.org/xsd/imsmd_v1p2"><questionCasValues><questionStem type="CasText"><castext>Expand \(\left(@apbx@\right)^5\). #ans1# <IEfeedback>ans1</IEfeedback> <PRTfeedback>Result</PRTfeedback> <p>How confident are you (as a %)? #con1# <IEfeedback>con1</IEfeedback></p> </castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionStem><questionVariables type="RawKeyVal"><rawKeyVals>a = 2*rand(6)-5; b_magnitude = rand(4)+2; dummy1 = block(while a = b_magnitude do b_magnitude: rand(4)+2,return(b_magnitude)); b_sign = 2*rand(2)-1; b = b_magnitude * b_sign; bx = b*x; bx2 = bx^2; bx3 = bx2*bx; bx4 = bx3*bx; bx5 = bx4*bx; apbx = a+bx; a5 = a^5; b5 = b^5; five_a4_b = 5*a^4*b; five_a_b4 = 5*a*b^4; ten_a2_b3 = 10*a^2*b^3; ten_a3_b2 = 10*a^3*b^2; expansion = a^5+5*a^4*b*x+10*a^3*b^2*x^2+10*a^2*b^3*x^3+5*a*b^4*x^4+b^5*x^5</rawKeyVals><forbidFloats>false</forbidFloats><simplify>true</simplify></questionVariables><workedSolution type="CasText"><castext>For \(n\) a positive integer then by the binomial theorem \[ \left(a + b\right)^n = a^n + \frac{n!}{\left(n-1\right)!\cdot 1!}a^{n-1}\cdot b + \ldots+\frac{n!}{\left(n-r\right)!\cdot r!}a^{n-r}\cdot b^r + \ldots + b^n\mbox{.} \] In this case \(a=@a@\), \(b=@b@\) and \(n=5\); therefore \[\begin{array}{rcl}\displaystyle \left(@apbx@\right)^5 = @a@^5 + 5\cdot @a@^4 \cdot @b@ \cdot x + [...1545 lines suppressed...] \[ x=\frac{@dg1@ - @bg2@}{@ad@ - @bc@} = \frac{@xnum@}{@xden@} = @x_value@ \] and then substituting \(x=@x_value@\) in the former equation we see \[y = \frac{@dg1@ - @ad@ \times @x@}{@bd@} = \frac{@ynum@}{@bd@} = @y_value@\mbox{.}\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></workedSolution><questionNote type="CasText"><castext>\[\begin{array}{rcl}\displaystyle @lhs1@&\displaystyle =&\displaystyle @g1@\mbox{,}\\ @lhs2@&\displaystyle =&\displaystyle @g2@\mbox{,}\\ \displaystyle x & \displaystyle = & \displaystyle @x_value@\mbox{,}\\ \displaystyle y & \displaystyle = & \displaystyle @y_value@\mbox{.} \end{array}\]</castext><forbidFloats>false</forbidFloats><simplify>true</simplify></questionNote></questionCasValues><questionparts><questionpart><name>ans1</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>20</boxsize><teachersAns type="CasString"><casString>x_value</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/><forbiddenWords><Forbid>*</Forbid><Forbid> /</Forbid><Forbid> +</Forbid></forbiddenWords></questionpart><questionpart><name>ans2</name><inputType type="Meta"><selection>Algebraic Input</selection><default>Algebraic Input</default><values/></inputType><boxsize>20</boxsize><teachersAns type="CasString"><casString>y_value</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>ans2</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/><forbiddenWords><Forbid>*</Forbid><Forbid> /</Forbid><Forbid> +</Forbid></forbiddenWords></questionpart><questionpart><name>con1</name><inputType type="Meta"><selection>Slider</selection><default>Algebraic Input</default><values/></inputType><boxsize>200</boxsize><teachersAns type="CasString"><casString>0</casString><forbidFloats>false</forbidFloats><simplify>true</simplify></teachersAns><studentAnsKey>con1</studentAnsKey><syntax type="Meta"><selection></selection><default></default><values/></syntax><stackoption><name>formalSyntax</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>forbidFloats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>insertStars</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption><stackoption><name>sameType</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>true</selected></stackoption><stackoption><name>lowestTerms</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_LowestTerms</casKey><casType>ex</casType><selected>true</selected></stackoption><inputTypesParameters/></questionpart></questionparts><PotentialResponseTrees><PotentialResponseTree><prtname>PotResTree_combined_values</prtname><questionValue>1</questionValue><autoSimplify>true</autoSimplify><feedbackVariables>ansg1 = a*ans1+b*ans2; ansg2 = c*ans1+d*ans2; xy_answer = [ans1,ans2]</feedbackVariables><description type="Meta"><selection></selection><default></default><values/></description><PotentialResponses><PR id="0"><answerTest>AlgEquiv</answerTest><teachersAns>xy_values</teachersAns><studentAns>xy_answer</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>1</rawMark><feedback><p>You can check your answer by substituting for \(x\) and \(y\) and confirming that the equations balance.</p></feedback><ansnote>EQN-SIM-TRUE</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback>Substituting \(x=@ans1@\) and \(y=@ans2@\) \begin{eqnarray*} @lhs1@&=&@ansg1@\mbox{,}\\ @lhs2@&=&@ansg2@\mbox{,} \end{eqnarray*} but substituting in the unique correct values for \(x\) and \(y\) the above equations should evaluate to @g1@ and @g2@ respectively.</feedback><ansnote>EQN-SIM-FALSE-0</ansnote><nextPR>1</nextPR></false><teacherNote></teacherNote></PR><PR id="1"><answerTest>AlgEquiv</answerTest><teachersAns>xy_rhserror</teachersAns><studentAns>xy_answer</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>When you multiply an equation by a constant, remember to multiply both sides, the right hand-side as well as the left hand-side.</p></feedback><ansnote>UNMULTIPLIED_RHS</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>EQN-SIM-FALSE-1</ansnote><nextPR>2</nextPR></false><teacherNote></teacherNote></PR><PR id="2"><answerTest>AlgEquiv</answerTest><teachersAns>xy_signerror</teachersAns><studentAns>xy_answer</studentAns><testoptions></testoptions><quietAnsTest></quietAnsTest><true><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback><p>It may be that you added the two equations when you should have subtracted one from the other.</p></feedback><ansnote>SIGN_ERROR</ansnote><nextPR>-1</nextPR></true><false><rawModMark>=</rawModMark><rawMark>0</rawMark><feedback></feedback><ansnote>EQN-SIM-FALSE-2 </ansnote><nextPR>-1</nextPR></false><teacherNote></teacherNote></PR></PotentialResponses></PotentialResponseTree></PotentialResponseTrees><MetaData><dc:Publisher stackname="lastUserEditor" type="Meta"><selection></selection><default></default><values/></dc:Publisher><dc:language stackname="language" type="Meta"><selection>en</selection><default>en</default><values><value key="en">en</value><value key="fr">fr</value><value key="nl">nl</value><value key="es">es</value><value key="unspecified">Unspecified</value></values></dc:language><dc:title stackname="questionName" type="Meta"><selection>Diasgnostic_EQN-SIM_2</selection><default></default><values/></dc:title><dc:description stackname="questionDescription" type="Meta"><selection>Two simultaneous linear equations</selection><default></default><values/></dc:description><dc:publisher stackname="questionPublisher" type="Meta"><selection>http://130.88.73.28/stack-1-0/</selection><default>http://matsrv6.bham.ac.uk/stem</default><values/></dc:publisher><dc:format stackname="questionFormat" type="Meta"><selection>text/xml; charset="utf-8"</selection><default>text/xml; charset="utf-8"</default><values><value key="0">application</value><value key="1">audio</value><value key="2">image</value><value key="3">message</value><value key="4">model</value><value key="5">text</value><value key="6">video</value><value key="7">multipart</value></values></dc:format><lom:context stackname="questionLearningContext" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="PrimaryEducation">Primary Education</value><value key="SecondaryEducation">Secondary Education</value><value key="HigherEducation">Higher Education</value><value key="UniversityFirstCycle">University First Cycle</value><value key="UniversitySecondCycle">University Second Cycle</value><value key="UniversityPostGrade">University Post Grade</value><value key="TechnicalSchoolFirstCycle">Technical School First Cycle</value><value key="TechnicalSchoolSecondCycle">Technical School Second Cycle</value><value key="ProfessionalFormation">Professional Formation</value><value key="ContinuousFormation">Continuous Formation</value><value key="VocationalTraining">Vocational Training</value><value key="unspecified">Unspecified</value></values></lom:context><lom:difficulty stackname="questionDifficulty" type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="VeryEasy">Very Easy</value><value key="Easy">Easy</value><value key="Medium">Medium</value><value key="Difficult">Difficult</value><value key="VeryDifficult">Very Difficult</value><value key="unspecified">Unspecified</value></values></lom:difficulty><questionCompetency type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Think">Think</value><value key="Argue">Argue</value><value key="Solve">Solve</value><value key="Represent">Represent</value><value key="Language">Language</value><value key="Communicate">Communicate</value><value key="Tools">Tools</value><value key="unspecified">Unspecified</value></values></questionCompetency><questionCompentencyLevel type="Meta"><selection>unspecified</selection><default>unspecified</default><values><value key="Elementary">Elementary</value><value key="SimpleConceptual">Simple conceptual</value><value key="Multi-step">Multi-step</value><value key="Complex">Complex</value><value key="unspecified">Unspecified</value></values></questionCompentencyLevel><lom:typicallearningtime stackname="questionTimeAllocated" type="Meta"><selection>00:00:00</selection><default>00:00:00</default><values/></lom:typicallearningtime><dc:rights stackname="questionRights" type="Meta"><selection>http://www.gnu.org/copyleft/gpl.html</selection><default>http://www.gnu.org/copyleft/gpl.html</default><values/></dc:rights><questionExerciseType type="Meta"><selection>AlgebraicExpression</selection><default>AlgebraicExpression</default><values><value key="AlgebraicExpression">Algebraic Expression</value><value key="MCQSingleAnswer">MCQ Single Answer</value><value key="MCQMultpleAnswer">MCQ Multiple Answer</value><value key="FillInBlank">Fill in blank</value><value key="Unspecified">Unspecified</value></values></questionExerciseType><dc:date stackname="questionDateLastEdited" type="Meta"><selection>2010-09-01 12:08:29</selection><default>2010-08-18 16:52:13</default><values/></dc:date><lom:status stackname="questionStatus" type="Meta"><selection>Draft</selection><default>Draft</default><values><value key="Draft">Draft</value><value key="Deployed">Deployed</value><value key="Buggy">Buggy</value></values></lom:status><published type="Meta"><selection>Published</selection><default>Unpublished</default><values><value key="Unpublished">Unpublished</value><value key="Published">Published</value><value key="Private">Private</value></values></published><lom:keyword stackname="keywords" type="Meta"><selection>Manchester, A48A, foundation, diagnostic, EQN-SIM</selection><default>Manchester, A48A, foundation, diagnostic, EQN-SIM</default><values/></lom:keyword></MetaData><ItemOptions><stackoption><name>Display</name><type>list</type><default>LaTeX</default><values><value>LaTeX</value><value>MathML</value></values><casKey>OPT_OUTPUT</casKey><casType>string</casType><selected>LaTeX</selected></stackoption><stackoption><name>MultiplicationSign</name><type>list</type><default>dot</default><values><value>(none)</value><value>dot</value><value>cross</value></values><casKey>make_multsgn</casKey><casType>fun</casType><selected>dot</selected></stackoption><stackoption><name>ComplexNo</name><type>list</type><default>i</default><values><value>i</value><value>j</value><value>symi</value><value>symj</value></values><casKey>make_complexJ</casKey><casType>fun</casType><selected>i</selected></stackoption><stackoption><name>Floats</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>OPT_NoFloats</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>SqrtSign</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>sqrtdispflag</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>Simplify</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey>simp</casKey><casType>ex</casType><selected>true</selected></stackoption><stackoption><name>MarkModMethod</name><type>list</type><default>Penalty</default><values><value>Penalty</value><value>First Answer</value><value>Last Answer</value></values><casKey></casKey><casType></casType><selected>Penalty</selected></stackoption><stackoption><name>AssumePos</name><type>list</type><default>false</default><values><value>true</value><value>false</value></values><casKey>assume_pos</casKey><casType>ex</casType><selected>false</selected></stackoption><stackoption><name>TeacherEmail</name><type>string</type><default>s.h...@bh...</default><casKey></casKey><casType></casType><selected>Nie...@ma...</selected></stackoption><stackoption><name>Feedback</name><type>list</type><default>TGS</default><values><value>TGS</value><value>TG</value><value>GS</value><value>T</value><value>G</value><value>S</value><value>none</value></values><casKey></casKey><casType></casType><selected>G</selected></stackoption><stackoption><name>FeedbackGenericCorrect</name><type>html</type><default><span class='correct'>Correct answer, well done.</span></default><casKey></casKey><casType></casType><selected><span class='correct'>Correct answer, well done.</span></selected></stackoption><stackoption><name>FeedbackGenericIncorrect</name><type>html</type><default><span class='incorrect'>Incorrect answer.</span></default><casKey></casKey><casType></casType><selected><span class='incorrect'>Incorrect answer.</span></selected></stackoption><stackoption><name>FeedbackGenericPCorrect</name><type>html</type><default><span class='partially'>Your answer is partially correct.</span></default><casKey></casKey><casType></casType><selected><span class='partially'>Your answer is partially correct.</span></selected></stackoption><stackoption><name>OptWorkedSol</name><type>list</type><default>true</default><values><value>true</value><value>false</value></values><casKey></casKey><casType></casType><selected>false</selected></stackoption></ItemOptions><ItemTests><test><col><key>IE_ans1</key><value>x_value</value></col><col><key>IE_ans2</key><value>y_value</value></col><col><key>PRT_PotResTree_combined_values</key><value>EQN-SIM-TRUE</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>xrhserror</value></col><col><key>IE_ans2</key><value>yrhserror</value></col><col><key>PRT_PotResTree_combined_values</key><value>UNMULTIPLIED_RHS</value></col><col><key>IE_con1</key><value></value></col></test><test><col><key>IE_ans1</key><value>xsignerror</value></col><col><key>IE_ans2</key><value>ysignerror</value></col><col><key>PRT_PotResTree_combined_values</key><value>SIGN_ERROR</value></col><col><key>IE_con1</key><value></value></col></test></ItemTests></assessmentItem></mathQuiz> |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/reporting Modified Files: Tag: question_reporting ReportWidgets.php UserAttempts.php MarksAttempt.php StackReport.php Added Files: Tag: question_reporting json.php SkillsResources.php DiagnosticReport.php Removed Files: Tag: question_reporting dataController.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: SkillsResources.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Chris Sangwin (C.J...@bh...) * * @package stackReport */ class SkillsResources { private $stackurl; private $skills; private $skillTags; private $skillMajor; private $resources; private $resourceMap; public function __construct($url) { $this->stackurl = $url; $this->loadSkills(); $this->loadResources(); } private function loadSkills() { $skills = array(); $skills['LOG'] = 'Logic'; $skills['FOR'] = 'Using conventional forms of notation'; $skills['NUM'] = 'Number'; $skills['NUM-REL'] = 'Relative size'; $skills['NUM-RTP'] = 'Ratio / Proportion'; $skills['NUM-FRC'] = 'Fractions'; $skills['NUM-DEC'] = 'Decimals'; $skills['NUM-IND'] = 'Indices'; $skills['NUM-NEG'] = 'Negative Numbers'; $skills['ART'] = 'Arithmetic Operations'; $skills['ART-ADD'] = 'Addition'; $skills['ART-SUB'] = 'Subtraction'; $skills['ART-MUL'] = 'Multiplication'; $skills['ART-DIV'] = 'Division'; $skills['ART-RUL'] = 'Rules'; $skills['ALG'] = 'Algebra'; $skills['ALG-GNO'] = 'Generalised number'; $skills['ALG-VAR'] = 'Variable'; $skills['ALG-FEQ'] = 'Forming Equations'; $skills['ALG-TRN'] = 'Transposition'; $skills['ALG-UNC'] = 'Unclosed Forms'; $skills['ALG-GAT'] = 'Gathering of like terms'; $skills['ALG-SMP'] = 'Simplification'; $skills['ALG-EXB'] = 'Expand Brackets'; $skills['ALG-FAC'] = 'Factorisation'; $skills['ALG-RSD'] = 'Rationalisation of Surds'; $skills['ALG-BEX'] = 'Binomial Expansion'; $skills['ALG-SPF'] = 'Simple Partial Fractions'; $skills['ALG-RPF'] = 'Partial Fractions involving a repeated term'; $skills['ALG-QPF'] = 'Partial Fractions involving a quadratic term'; $skills['ALG-IPF'] = 'Improper Partial Fractions'; $skills['EST'] = 'Estimation'; $skills['EST-EST'] = 'Estimating'; $skills['EST-RND'] = 'Rounding'; $skills['EQN'] = 'Equations'; $skills['EQN-LIN'] = 'Solve Linear Equations'; $skills['EQN-SIM'] = 'Solve Simultaneous Equations'; $skills['EQN-QUD'] = 'Solve Quadratic Equations'; $skills['EQN-INQ'] = 'Solve Inequations'; $skills['WRP'] = 'Analysis of Word Problems'; $skills['FNC'] = 'Functions'; $skills['FNC-EVL'] = 'Evaluate a function'; $skills['FNC-CMP'] = 'Composite Functions'; $skills['FNC-INV'] = 'Inverse Functions'; $skills['FNC-MOD'] = 'Modulus Functions'; $skills['FNC-HYP'] = 'Hyperbolic Functions'; $skills['GEO'] = 'Geometry'; $skills['GEO-CRD'] = 'Coordinates'; $skills['GEO-DST'] = 'Distances'; $skills['GEO-GRD'] = 'Gradients'; $skills['GEO-EQL'] = 'Equations of lines'; $skills['GEO-ANM'] = 'Angular Measure'; $skills['GEO-TRG'] = 'Right-angle Trig'; $skills['GEO-TFN'] = 'Trigonometric Functions'; $skills['GEO-CRC'] = 'Circles'; $skills['GEO-TID'] = 'Trigonometric Identities'; $skills['GRP'] = 'Interpreting Graphs'; $skills['DIG'] = 'Analysis of Diagrams'; $skills['SEQ'] = 'Sequences and Series'; $skills['SEQ-TER'] = 'Terms in Series'; $skills['SEQ-ART'] = 'Arithmetic Series'; $skills['SEQ-ASM'] = 'Partial Sums of arithmetic Series'; $skills['SEQ-GEO'] = 'Geometric Series'; $skills['SEQ-SGM'] = 'Partial Sums of Geometric Series'; $skills['SEQ-SNF'] = 'Sum to Infinity of Geometric Series'; $skills['SEQ-BIS'] = 'Binomial Series'; $skills['LGE'] = 'Logarithms and Exponentials'; $skills['LGE-EXP'] = 'Exponential Function'; $skills['LGE-LWE'] = 'Laws of Exponentials'; $skills['LGE-LOG'] = 'The Logarithmic Function'; $skills['LGE-LLG'] = 'Laws of Logarithms'; $skills['DIF'] = 'Differentiation'; $skills['DIF-CON'] = 'Concept of Differentiation'; $skills['DIF-TAN'] = 'Gradient of Tangent'; $skills['DIF-MON'] = 'Derivative of monomial'; $skills['DIF-POL'] = 'Derivative of Polynomial'; $skills['DIF-MXN'] = 'Maxima and Minima'; $skills['DIF-EXP'] = 'Derivative of Exponential'; $skills['DIF-LOG'] = 'Derivative of Logarithm'; $skills['DIF-TAB'] = 'Table of Derivatives'; $skills['DIF-PRD'] = 'Product Rule'; $skills['DIF-QUT'] = 'Quotient Rule'; $skills['DIF-CHN'] = 'Chain Rule'; $skills['DIF-TRG'] = 'Derivatives of Trig Functions'; $skills['DIF-IMP'] = 'Implicit Differentiation'; $skills['DIF-PRM'] = 'Parametric Differentiation'; $skills['INT'] = 'Integration'; $skills['INT-CON'] = 'Concept and constant of integration'; $skills['INT-DEF'] = 'Definite Integrals'; $skills['INT-MON'] = 'Integrals of monomials'; $skills['INT-POL'] = 'Integrals of polynomials and sums'; $skills['INT-TRG'] = 'Integrals of trig functions'; $skills['INT-EXP'] = 'Integrals of exponential functions'; $skills['INT-XM1'] = 'Integrals of 1/x'; $skills['INT-AUC'] = 'Area under curve'; $skills['INT-ABC'] = 'Area between curves'; $skills['INT-PRT'] = 'Integration by parts'; $skills['INT-SUB'] = 'Integration by substitution'; $skills['INT-VSR'] = 'Volume of Solid of Revolution'; $skills['VEC'] = 'Vectors'; $skills['VEC-ADD'] = 'Vector Addition'; $skills['VEC-SUB'] = 'Vector Subtraction'; $skills['VEC-VXS'] = 'Vector Multiplied by Scalar'; $skills['VEC-PNT'] = 'Vector from point to point'; $skills['VEC-MAG'] = 'Magnitude of Vector'; $skills['VEC-UNT'] = 'Unit Vector'; $skills['VEC-EQL'] = 'Vector Equation of Line'; $skills['VEC-SCP'] = 'Scalar Product'; $skillTags = array_keys($skills); $skillMajor = array(); foreach ($skillTags as $skill) { if (strstr($skill, '-') !== false) { $skillMajor[]=$skill; } } $this->skills = $skills; $this->skillMajor = $skillMajor; $this->skillTags = $skillTags; } // end loadSkills() private function loadResources() { // title // url // skills (as comma separated list) // type, e.g. pdf, video, etc. // $resources[] = $this->constructResource('','','',''); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The Chain Rule','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_5.pdf','DIF-CHN','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The Chain Rule','','DIF-CHN','pdf'); $resources[] = $this->constructResource('Simultaneous equations','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-simult-2009-1.pdf','EQN-SIM','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Simultaneous equations','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_13.pdf','EQN-SIM','pdf'); $resources[] = $this->constructResource('Factoring simple expressions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-factorsimple-2009-1.pdf','ALG-FAC','pdf'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Factoring simple expressions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_5.pdf','ALG-FAC','pdf'); $resources[] = $this->constructResource('Decimals','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-decimals-2009-1.pdf','NUM-DEC','pdf'); $resources[] = $this->constructResource('Introduction to differentiation','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-introtodiff-2009-1.pdf','DIF-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Introduction to differentiation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_1.pdf','DIF-CON','PDF'); $resources[] = $this->constructResource('Expanding or removing brackets','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-expandbrack-2009-1.pdf','ALG-EXB','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The exponential constant e','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_4.pdf','LGE-EXP','PDF'); $resources[] = $this->constructResource('The exponential constant e','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-expconstant-2009-1.pdf','LGE-EXP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The logarithm function','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_7.pdf','LGE-LOG','PDF'); $resources[] = $this->constructResource('Factorising quadratics','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-factorisingquadratics-2009-1.pdf','ALG-FAC','PDF'); $resources[] = $this->constructResource('Fractions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-fractions-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Addition and subtraction of fractions','http://www.mathcentre.ac.uk/resources/leaflets/mathcentre/business/mc-bus-addsub-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Multiplication and division of fractions','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-mult-and-div-2009-1.pdf','NUM-FRC','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The hyperbolic functions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_5.pdf','FNC-HYP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: The hyperbolic identities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/3_6.pdf','FNC-HYP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration as summation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_12.pdf','INT-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration as the reverse of differentiation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_6.pdf','INT-CON','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration by parts','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_10.pdf','INT-PRT','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Integration by substitution','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_11.pdf','INT-SUB','PDF'); $resources[] = $this->constructResource('The equation of a straight line','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-slope-2009-1.pdf','GEO-EQL','PDF'); $resources[] = $this->constructResource('Logarithms','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-logarithms-2009-1.pdf','LGE-LOG','PDF'); $resources[] = $this->constructResource('The laws of logarithms','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-logs2-2009-1.pdf','LGE-LLG','PDF'); $resources[] = $this->constructResource('Sigma notation','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-sigma-2009-1.pdf','SEQ','PDF'); $resources[] = $this->constructResource('The modulus of a number','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/1_5.pdf','FNC-MOD','PDF'); $resources[] = $this->constructResource('Approaching Numeracy as an Adult','http://www.mathcentre.ac.uk/resources/uploaded/mccp-samuels-refno1.pdf','ART','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_23.pdf','ALG-RPF,ALG-QPF,ALG-SPF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_24.pdf','ALG-RPF,ALG-QPF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Partial Fractions 3','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_25.pdf','ALG-IPF','PDF'); $resources[] = $this->constructResource('Percentages','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-percentage-2009-1.pdf','NUM','PDF'); $resources[] = $this->constructResource('Indices or Powers','http://www.mathcentre.ac.uk/resources/Algebra%20leaflets/mc-indices1-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Negative and fractional powers','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-negfracpower-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Laws of indices','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-lawsindices-2009-1.pdf','NUM-IND','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Product and quotient rules','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_4.pdf','DIF-PRD,DIF-QUT','PDF'); $resources[] = $this->constructResource('Pythagoras theorem','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_5.pdf','GEO','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Degrees and radians','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_1.pdf','GEO-ANM','PDF'); $resources[] = $this->constructResource('Ratios','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-ratios-2009-1.pdf','NUM-RTP','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Addition and subtraction','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-ratios-2009-1.pdf','ART-ADD,ART-SUB','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Multiplication and division','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_9.pdf','ART-MUL,ART-DIV','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Evaluating definite integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_9.pdf','INT-DEF','PDF'); $resources[] = $this->constructResource('What is a function?','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-function-2009-1.pdf','FNC','PDF'); $resources[] = $this->constructResource('x-y plots','http://www.mathcentre.ac.uk/resources/mc-healthsciences/mc-xyplots-2009-1.pdf','FNC','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Inequalities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_16.pdf','EQN-INQ','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Graphical solution of inequalities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_18.pdf','EQN-INQ','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Quadratic equations 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_14.pdf','EQN-QUD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Quadratic equations 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_15.pdf','EQN-QUD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Rearranging formulas 1','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_10.pdf','ALG-TRN,EQN-LIN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Rearranging formulas 2','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_11.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: What is a surd?','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/2_27.pdf','ALG-RSD','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Scientific notation','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/1_3.pdf','FOR,NUM-DEC,NUM-IND','PDF'); $resources[] = $this->constructResource('Symbols','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-symbols-2009-1.pdf','FOR','PDF'); $resources[] = $this->constructResource('Rearranging formulas 1','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-formulas1-2009-1.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Rearranging formulas 2','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-formulas2-2009-1.pdf','ALG-TRN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Graphs of the trig functions','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_3.pdf','GEO-TFN','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Trigonometrical Identities','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/4_4.pdf','GEO-TID','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Evaluating definite integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_9.pdf','INT-DEF','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Linearity rules of integration','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_8.pdf','INT-POL','PDF'); $resources[] = $this->constructResource('Engineering Maths First Aid Kit. Quick Reference Leaflet: Table of Integrals','http://www.mathcentre.ac.uk/resources/Engineering%20maths%20first%20aid%20kit/latexsource%20and%20diagrams/8_7.pdf','INT','PDF'); $resources[] = $this->constructResource('Table of derivatives','http://www.mathcentre.ac.uk/resources/uploaded/mc-bus-tableofderiv-2009-1.pdf','DIF','PDF'); $resources[] = $this->constructResource('Teach Yourself Workbook: The Chain Rule','http://www.mathcentre.ac.uk/resources/uploaded/mc-ty-chain-2009-1.pdf','DIF-CHN','pdf'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Chain Rule','http://www.mathcentre.ac.uk/video/405','DIF-CHN','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Product Rule','http://www.mathcentre.ac.uk/video/404','DIF-PRD','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The Quotient Rule','http://www.mathcentre.ac.uk/video/403','DIF-QUT','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The standard functions','http://www.mathcentre.ac.uk/video/402','DIF','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The derivatives of further functions','http://www.mathcentre.ac.uk/video/409','DIF','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Parametric Differentiation','http://www.mathcentre.ac.uk/video/406','DIF-PRM','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Implicit Differentiation','http://www.mathcentre.ac.uk/video/408','DIF-IMP','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Equation of the tangent line','http://www.mathcentre.ac.uk/video/410','DIF-TAN','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The area under a curve','http://www.mathcentre.ac.uk/video/412','INT-AUC','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: The anti-derivative','http://www.mathcentre.ac.uk/video/413','INT-CON','video'); $resources[] = $this->constructResource('mathtutor: Video tutorial: Mathematical language','http://www.mathcentre.ac.uk/video/294','FOR','video'); $resourceMap = array(); foreach ($resources as $res) { foreach ($res['skill'] as $tskill) { $resourceMap[$tskill][] = array('title'=>$res['title'],'URL'=>$res['URL'],'type'=>$res['type']); } } $this->resources=$resources; $this->resourceMap=$resourceMap; } // end loadResources() private function constructResource($title,$URL,$skills,$type) { $res['title'] = $title; $res['URL'] = $URL; $skills=explode(',',$skills); foreach ($skills as $skill) { $res['skill'][] = trim(strtoupper($skill)); } $res['type'] = strtoupper($type); return $res; } private function typeToIcon($type) { if ('PDF'==$type) { $icon = 'page_white_acrobat.png'; } else if ('VIDEO'==$type) { $icon = 'page_white_camera.png'; } else { $icon = 'page_white_go.png'; } return $icon; } private function getDiagnosticQuestions($keyword) { $db = new StackDBADOdb(); $db -> connect(); // Ought to go via StackDBItem, really! $sql = "SELECT questionID, questionName FROM stackquestion, question_keyword, keywords, question_lines WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND (question_keyword.qid = stackquestion.questionID) AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_lines.latestVersion) ORDER BY stackquestion.questionID"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result[] = array($row[0],$row[1]); } return $result; } private function getDiagnosticStems($keyword) { $db = new StackDBADOdb(); $db -> connect(); // Ought to go via StackDBItem, really! $sql = "SELECT stackquestion.questionID, stackquestion.questionName, display_cache.xhtml FROM question_keyword, keywords, display_cache, display_cache_sequence, question_lines, stackquestion WHERE (keyword LIKE ".$db->dbSafeString($keyword)." ) AND (question_keyword.kwid = keywords.id) AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_keyword.qid) AND (stackquestion.questionID = question_lines.latestVersion) AND (stackquestion.questionID = display_cache.qID) AND (display_cache_sequence.nextNode = display_cache.id) AND (display_cache_sequence.event = 0)"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result[$row[0]] = array($row[1],$row[2]); } return $result; } private function getQuestionStem($qname) { $db = new StackDBADOdb(); $db -> connect(); $sql = "SELECT stackquestion.questionID,stackquestion.questionName, display_cache.xhtml FROM display_cache, display_cache_sequence, question_lines, stackquestion WHERE (stackquestion.questionName = ".$db->dbSafeString($qname).") AND (stackquestion.line = question_lines.id) AND (stackquestion.questionID = question_lines.latestVersion) AND (stackquestion.questionID = display_cache.qID) AND (display_cache_sequence.nextNode = display_cache.id) AND (display_cache_sequence.event = 0)"; $query = $db->query($sql); $result=array(); foreach($query as $row) { $result = array($row[0],$row[1],$row[2]); } return $result; } private function getSkillsResources($qid){ $kwdb = new StackDBKeywords(); $kwdb->connect(); $keywords = $kwdb->getQuestionsKeywords($qid); $skills = array(); if(!empty($keywords)) { asort($keywords); foreach($keywords as $keyword) { if (in_array($keyword,$this->skillTags)) { $skills[]=$keyword; } } } return $skills; } public function generateSkillsTable(){ $skillsTable="<ol><ol>\n"; foreach ($this->skills as $skill => $name) { $res_links=''; if (array_key_exists($skill,$this->resourceMap)) { foreach($this->resourceMap[$skill] as $res) { $rtitle = $res['title']; $rurl = $res['URL']; $icon = $this->typeToIcon($res['type']); $res_links .= '<a target="_blank" href="'.$rurl.'"><img border=0 alt="'.$rtitle.'" src="'.$icon.'" /></a>'; } } $questions = $this->getDiagnosticQuestions($skill); $qno = count($questions); $links = ''; if (0==$qno) { $col = '#FF3300'; } else { $col = '#000000'; foreach($questions as $question) { $qid = $question[0]; $qname = $question[1]; $links .= ' <a target="_blank" href="'.$this->stackurl.'/lib/ui/questionTest.php?id='.$qid.'"><img border=0 src="'.$this->stackurl.'/pix/eye.png" title="'.$qname.'" alt="'.$qname.'" /></a>'."\n "; } } if (strstr($skill, '-') !== false) { $skillsTable .= " <li><font color='$col'>$name ($skill)</font> $qno $res_links $links</li>\n"; } else { $skillsTable .= "</ol>\n <li><b><font color='$col'>$name ($skill)</font></b> $qno $res_links $links</li>\n<ol>\n"; } } $skillsTable.="</ol></ol>\n\n\n"; return $skillsTable; } public function generateQuiz($quizlist){ $questions = $this->getDiagnosticStems('diagnostic'); $kwdb = new StackDBKeywords(); $kwdb->connect(); $quiz=''; foreach ($questions as $qid => $question) { $quiz.= "<font size=+2><b>($qid) {$question[0]}</b>:</font> <font color=orange>"; $keywords = $kwdb->getQuestionsKeywords($qid); if(!empty($keywords)) { asort($keywords); $firstKeyword = true; foreach($keywords as $keyword) { if(!$firstKeyword) { $quiz.= ', '; } else $firstKeyword = false; $quiz.= $keyword; } } $quiz.= "</font>"; $quiz.= "<p>".$question[1]."</p>"; $quiz.= "<p><hr /></p>"; } return $quiz; } public function generateWikiPage() { $wiki=''; foreach ($this->skills as $skill => $name) { if (strstr($skill, '-') !== false) { $wiki.= "## $name ($skill)\n"; } else { $wiki.= "# $name ($skill)\n"; } } return $wiki; } public function generateLaTeX() { $tot = 0; $toplevelonly = TRUE; $LaTeX="\begin{enumerate}\n"; foreach ($this->skills as $skill => $name) { if (strstr($skill, '-') !== false) { $tot ++; $toplevelonly = TRUE; $LaTeX.= " \item $name ($skill)\n"; } else { if ($toplevelonly) { $tot ++; } $toplevelonly = FALSE; $LaTeX.= "\end{enumerate}\n \item $name ($skill)\n \begin{enumerate}\n"; } } $LaTeX.=" \end{enumerate}\n\end{enumerate}"; return $LaTeX.$tot; } public function generateTestedSkillsPage($test) { $skills_tested=array(); $skillsTable='<h2>Test questions</h2>'; $skillsTable.='<ol>'; foreach ($test as $qname){ $qid = getQuestionID($qname); $qskills = $this->getSkillsResources($qid); $link = ' <a target="_blank" href="'.$this->stackurl.'/lib/ui/questionTest.php?id='.$qid.'"><img border=0 src="'.$this->stackurl.'/pix/eye.png" title="'.$qname.'" alt="'.$qname.'" /></a>'."\n "; $sk = ''; if (empty($qskills)){ $sk = 'NONE! '; } else { foreach($qskills as $qskill){ $skills_tested[$qskill]++; $sk .= $qskill.' '; } } $skillsTable.= '<li>'.$qname.' ('.$qid.') '.$sk.' '.$link.' </li>'; } $skillsTable.='</ol>'; $skillsTable.='<h2>Skills tested</h2>'; $skillsTable.="<ol><ol>\n"; foreach ($this->skills as $skill => $name) { if (array_key_exists($skill,$skills_tested)) { $col = '#000000'; $qnum = $skills_tested[$skill]; } else { $col = '#FF3300'; $qnum = ''; } if (strstr($skill, '-') !== false) { $skillsTable .= " <li><font color='$col'>$name ($skill) $qnum </font></li>\n"; } else { $skillsTable .= "</ol>\n <li><b><font color='$col'>$name ($skill)</b> $qnum </font></li>\n<ol>\n"; } } $skillsTable.="</ol></ol>\n\n\n"; // Generate the text of the quiz. $quiz=''; foreach ($test as $qname){ $question = $this->getQuestionStem($qname); //$quiz.= "<h2><b>($question[0]) {$question[1]}</b>:</h2>"; $quiz.= "\n\n \item"; $qtp = strpos($question[2],'How'); $qt = substr($question[2],0,$qtp); $quiz.= "<p>".$qt."</p>"; $quiz.= "<p><hr /></p>"; } $skillsTable .= $quiz; return $skillsTable; } public function getSkills() { return $this->skills; } // return a (ranked?) list of resources for the passed skills public function getResourcesForSkills($skills) { $return = array(); foreach($skills as $skill) { if(!empty($this->resourceMap[$skill])) $return[] = $this->resourceMap[$skill]; } return $return; } } Index: MarksAttempt.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/MarksAttempt.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** MarksAttempt.php 27 Aug 2009 16:23:01 -0000 1.5 --- MarksAttempt.php 22 Nov 2010 23:05:52 -0000 1.5.2.1 *************** *** 17,197 **** */ ! /** ! * Class for holding and sorting marks from a report ! * ! * @author ! * @version ! * @copyright ! */ ! class MarksAttempt { ! // Attributes ! /** ! * ! * ! * @var int ! * @access private ! */ ! private $userID; ! ! /** ! * ! * ! * @var int ! * @access private ! */ ! private $questionID; ! ! /** ! * ! * ! * @var array ! * @access private ! */ ! private $attempt; ! ! private $noPartAttempts; ! ! private $noAttempts; ! ! // Associations ! // Operations ! /** ! * ! * ! * @param int $userID ! * @param $questionID ! * @access public ! */ ! public function __construct($userID, $questionID) ! { ! $this->userID = $userID; ! $this->questionID = $questionID; ! $this->noAttempts = 0; ! $this->noPartAttempts = 0; ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getAttempts() ! { ! return $this->attempt; ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getLastAttempt() ! { ! if(!empty($this->attempt)) ! { ! $attemptIds = array_keys($this->attempt); ! rsort($attemptIds); //reverse sort ! $id = $attemptIds[0]; ! $value = $this->attempt[$id]; ! return array($id => $value); ! } ! else ! { ! return NULL; ! } ! } ! ! public function lastAttemptNoParts() ! { ! $last = $this->getLastAttempt(); ! if($last != NULL) ! { ! foreach($last as $l) ! { ! $count = count($l); ! //echo 'COUNT: '.$count; ! return $count; ! } ! ! } ! else ! { ! return NULL; ! } ! ! } ! ! /** ! * ! * ! * @return array ! * @access public ! */ ! public function getFirstAttempt() ! { ! if(!empty($this->attempt)) ! { ! $attemptIds = array_keys($this->attempt); ! sort($attemptIds); ! $id = $attemptIds[0]; ! $value = $this->attempt[$id]; ! return array($id => $value); ! } ! else ! { ! return NULL; ! } ! } ! ! public function firstAttemptNoParts() ! { ! $first = $this->getFirstAttempt(); ! if($first != NULL) ! { ! foreach($first as $f) ! { ! $count = count($f); ! //echo 'COUNT: '.$count; ! return $count; ! } ! ! } ! else ! { ! return NULL; ! } ! ! } ! ! /** ! * ! * ! * @param int $attemptID ! * @param string $PRTName ! * @param float $rawmark ! * @param float $modmark ! * @return void ! * @access public ! */ ! public function addAttempt($attemptID, $PRTName, $rawmark, $modmark) ! { ! $this->attempt[$attemptID][$PRTName] = array('RawMark' => $rawmark, 'ModMark' => $modmark); ! $this->noPartAttempts++; ! } ! ! ! public function noPartAttempts() ! { ! return $this->noPartAttempts; ! } ! ! public function noAttempts() ! { ! return count($this->attempt); ! } ! ! } ?> \ No newline at end of file --- 17,199 ---- */ ! // It is believed that this entire file is legacy code. ! // ! // /** ! // * Class for holding and sorting marks from a report ! // * ! // * @author ! // * @version ! // * @copyright ! // */ ! // class MarksAttempt { ! // // Attributes ! // /** ! // * ! // * ! // * @var int ! // * @access private ! // */ ! // private $userID; ! // ! // /** ! // * ! // * ! // * @var int ! // * @access private ! // */ ! // private $questionID; ! // ! // /** ! // * ! // * ! // * @var array ! // * @access private ! // */ ! // private $attempt; ! // ! // private $noPartAttempts; ! // ! // private $noAttempts; ! // ! // // Associations ! // // Operations ! // /** ! // * ! // * ! // * @param int $userID ! // * @param $questionID ! // * @access public ! // */ ! // public function __construct($userID, $questionID) ! // { ! // $this->userID = $userID; ! // $this->questionID = $questionID; ! // $this->noAttempts = 0; ! // $this->noPartAttempts = 0; ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getAttempts() ! // { ! // return $this->attempt; ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getLastAttempt() ! // { ! // if(!empty($this->attempt)) ! // { ! // $attemptIds = array_keys($this->attempt); ! // rsort($attemptIds); //reverse sort ! // $id = $attemptIds[0]; ! // $value = $this->attempt[$id]; ! // return array($id => $value); ! // } ! // else ! // { ! // return NULL; ! // } ! // } ! // ! // public function lastAttemptNoParts() ! // { ! // $last = $this->getLastAttempt(); ! // if($last != NULL) ! // { ! // foreach($last as $l) ! // { ! // $count = count($l); ! // //echo 'COUNT: '.$count; ! // return $count; ! // } ! // ! // } ! // else ! // { ! // return NULL; ! // } ! // ! // } ! // ! // /** ! // * ! // * ! // * @return array ! // * @access public ! // */ ! // public function getFirstAttempt() ! // { ! // if(!empty($this->attempt)) ! // { ! // $attemptIds = array_keys($this->attempt); ! // sort($attemptIds); ! // $id = $attemptIds[0]; ! // $value = $this->attempt[$id]; ! // return array($id => $value); ! // } ! // else ! // { ! // return NULL; ! // } ! // } ! // ! // public function firstAttemptNoParts() ! // { ! // $first = $this->getFirstAttempt(); ! // if($first != NULL) ! // { ! // foreach($first as $f) ! // { ! // $count = count($f); ! // //echo 'COUNT: '.$count; ! // return $count; ! // } ! // ! // } ! // else ! // { ! // return NULL; ! // } ! // ! // } ! // ! // /** ! // * ! // * ! // * @param int $attemptID ! // * @param string $PRTName ! // * @param float $rawmark ! // * @param float $modmark ! // * @return void ! // * @access public ! // */ ! // public function addAttempt($attemptID, $PRTName, $rawmark, $modmark) ! // { ! // $this->attempt[$attemptID][$PRTName] = array('RawMark' => $rawmark, 'ModMark' => $modmark); ! // $this->noPartAttempts++; ! // } ! // ! // ! // public function noPartAttempts() ! // { ! // return $this->noPartAttempts; ! // } ! // ! // public function noAttempts() ! // { ! // return count($this->attempt); ! // } ! // ! // } ?> \ No newline at end of file --- NEW FILE: DiagnosticReport.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @author Simon Hammond (s.h...@bh...) * * @package stackReport */ global $config; $root = $config->get('docroot'); //require_once $root.'/lib/dateTime.php'; //require_once $root.'/lib/items/Meta.php'; require_once $root.'/lib/database/StackDBReporting.php'; require_once $root.'/lib/database/MoodleDB.php'; require_once $root.'/lib/database/StackDBAttemptPRTMeta.php'; //require_once 'QuestionFinder.php'; require_once $root . '/lib/Logger.php'; require_once $root.'/opaque/MoodleDisplayItem.php'; require_once $root . '/lib/reporting/SkillsResources.php'; class DiagnosticReport { /* TODO: * - Get distribution of scores and confidences for skills across all attempts * - Reference mapping of weak/unconfident outcomes to external resources * */ private $skill; private $resources; private $student; private $quiz; //private $answerNotes; public function __construct($student = NULL, $quiz = NULL) { $this->logger = new Logger('DiagnosticReport'); $this->student = $student; $this->quiz = $quiz; $reporting = new StackDBReporting(); //$this->answerNotes = $reporting->studentAnswerNotes($this->student, $this->quiz); $this->loadResources(); } /** * one-to-many or many-to-many mapping? Latter would be nice. * Could even rank them then, based on skills profile. * www.123.com will help you with [NUM] numbers */ private function loadResources() { $skillsResources = new SkillsResources(); $this->skill = $skillsResources->getSkills(); // then learning resource links $this->resources = array(); $this->resources[] = array("Sesame Street Learning About Numbers 4", "http://www.youtube.com/watch?v=Qxm6c7U8gxc", "NUM-ADD"); $this->resources[] = array("BBC - KS2 Bitesize: Maths - Fractions - activity", "http://www.bbc.co.uk/schools/ks2bitesize/maths/number/fractions/play.shtml", "NUM-FRC"); $this->resources[] = array("Wikipedia Numbers", "http://en.wikipedia.org/wiki/Number", "NUM-DEC, NUM-REL, NUM-NEG"); } public function resourcesFor($subskills) { $skillsResources = new SkillsResources(); //$this->logger->debug(print_r($skillsResources->getResourcesForSkills(array('EQN-SIM')), 1)); //$subskills = array('EQN-SIM'); $this->logger->debug("subskills:".print_r($subskills,1)); $resources = $skillsResources->getResourcesForSkills($subskills); return $resources; /* foreach($subskills as $subskill) { foreach($this->resources as $resource) { if(strpos($resource[2], $subskill) !== false) { $toReturn[] = $resource; } } } // sort by frequency return $toReturn;*/ } public function getString($key) { return isset($this->skill[$key]) ? $this->skill[$key] : "[$key]"; } public function display() { $reporting = new StackDBReporting(); $out = "";//"<p>This is a report based on your latest attempts for diagnostic questions.</p>"; // link to quiz-specific results $mdb = new MoodleDB(); $mdb->connect(); $attempts = $mdb->getQuizAttempts($this->student); $quizzes = array_keys($attempts); if($attempts) { // links to each and all quizzes $out .= "<b>Show quiz:</b> <a href='soapPage.php?page=diagnostic'>All</a>, "; foreach($quizzes as $quiz) { $out .= "<a href='soapPage.php?page=diagnostic&quiz=$quiz'>$quiz</a> (".count($attempts[$quiz])." attempts), "; } } if($this->quiz !== NULL) { // possibly restrict to a single quiz $a = $attempts[$this->quiz]; unset($attempts); $attempts[$this->quiz] = $a; } $quizzes = array_keys($attempts); // revise quizzes // going and getting those answer notes $answerNotes = $this->traverseAnswerNotes($attempts); //$answerNotes = array(end($answerNotes));// take last answer only //$out .= "<br>Collated answer notes: ".print_r($answerNotes, 1); // get array of skills mapping to array of subskills mapping to scores foreach($answerNotes as $note) { //$out .= "answernote:".print_r($answer,1); //preg_match("|diagnostic:(.*)|sxi", $note, $m); // indentifier now optional $m = preg_replace('|diagnostic:|sxi', '', $note); if(!empty($m)) { $changes = explode(',', $m);//$m[1]); //$this->logger->debug("CHANGES:".print_r($changes,1)); foreach($changes as $change) { // each skill mark $change = strtoupper($change); //$out .= $change.'<br/>'; /* // assuming format aaa-bbb=n if(preg_match("|^([a-z]{3})-([a-z]{3})[:=](-?\d+)|xi", $change, $m)) { $profile[$m[1]][$m[1].'-'.$m[2]] += $m[3]; } */ // assuming format aaa-bbb-[true|false] if(preg_match("/^([a-z]{3})-([a-z]{3})-(true|false)/xi", $change, $m)) { //$this->logger->debug("M:".print_r($m,1)); if($m[3] == 'TRUE') $value = 1; elseif($m[3] == 'FALSE') $value = -1; $profile[$m[1]][$m[1].'-'.$m[2]] += $value; } // assuming format aaa-[true|false] else if(preg_match("/^([a-z]{3})-(true|false)/xi", $change, $m)) { //$this->logger->debug("M:".print_r($m,1)); if($m[2] == 'TRUE') $value = 1; elseif($m[2] == 'FALSE') $value = -1; $profile[$m[1]][$m[1]] += $value; } } } } //$this->logger->debug("PROFILE:".print_r($profile,1)); // for each skill foreach($profile as $skill => $subskill) { $out .= "<div class='skillBox'>"; // container for graphs $out .= "<table><tr><td>"; // include report $out .= "<h1>".$this->getString($skill)."</h1>"; // include graph // get value bounds $max = max(0, max($subskill)); $min = min(0, min($subskill)); $labels = array(); foreach($subskill as $label => $value) { $labels[] = "'".$this->getString($label)."'"; } $out .= "<div id='chart-$skill' style='height:200px;width:300px; '></div> <script type='text/javascript'> line = [".implode(', ',$subskill)."]; conf = [4,3,1]; plot = $.jqplot('chart-$skill', [line, conf], { seriesDefaults:{ renderer:$.jqplot.BarRenderer, fill:true,fillToZero: true, showMarker: true, pointLabel:true}, legend:{show:true, location:'se'}, series:[ {label:'Feedback sum', renderer:$.jqplot.BarRenderer}, {label:'Confidence (dummy)', renderer:$.jqplot.BarRenderer} ], axes: { xaxis:{renderer:$.jqplot.CategoryAxisRenderer, ticks:[".implode(',',$labels)."]}, yaxis:{padMax:1.3, padMin:1.3, autoscale:true, numberTicks:1, showTicks:false, ticks:[-10, 0, 10]} } //,title: { text: '".$this->getString($skill)."' }, }) </script>"; $out .= "</td><td>"; // textual feedback $out .= "<h3>Raw Scores</h3>"; foreach($subskill as $label => $value) { $out .= $this->getString($label).': '.$value.'<br />'; } $out .= "<h3>Recommended Resources</h3>"; $recommendations = $this->resourcesFor(array_keys($subskill)); if(!empty($recommendations)) { //$out .= print_r($recommendations, 1); $out .= "<ul>"; foreach($recommendations[0] as $recommendation) { $out .= "<li><a href='".$recommendation['URL']."'>".$recommendation['title']."</a></li>"; } $out .= "</ul>"; } else { $out .= "<i>No resources to recommend.</i>"; } $out .= "</td></tr></table>"; $out .= "</div>";// close graph container } // Summary feedback and recommendations return $out; } /** * Returns an array of answer notes for specified map for attempts. * * @access public * @param array attempts map of quiz to attempts. * @return array list of answer notes */ public function traverseAnswerNotes($quizAttempts, $latestOnly = false) { // get ALL answernotes if there are no constraints // otherwise constrain by student // and quiz // or just quiz? $out = array(); $mdb = new MoodleDB(); $mdb->connect(); // will need some db objects... $cache = new StackDBCache(); $cache->connect(); $prtMetaDB = new StackDBAttemptPRTMeta(); $prtMetaDB->connect(); // Remember: this is initially a student-centric report card! $this->logger->debug("quizAttempts:".print_r($quizAttempts, 1)); // get all responses // for each quiz that has been attempted, get the response sequence that comprises that attempt foreach($quizAttempts as $quiz => $quizAttempt) { // for each quiz in scope, get attempts foreach($quizAttempt as $questionAttempts) { // for each quiz attempt // $attemptResponses = $mdb->getAttemptResponses($quizAttempt); // $this->logger->debug("attemptResponses:".print_r($attemptResponses, 1)); // $responses[$quizAttempt] = $attemptResponses['responses']; // $versionForAttempt[$quizAttempt] = $attemptResponses['version']; $questionResponses = $mdb->getQuestionAttemptResponses($questionAttempts); // } // } // parse responses for each attempt and use to traverse the cache, collating the answer notes - either last or all - question by question // attemptResponses would be better named questionResponses //$responses $this->logger->debug("questionResponses:".print_r($questionResponses, 1)); foreach($questionResponses as $question => $response) { // get initial state using randomseed and questionid preg_match('|__randomseed-(\d+)|',$response[0]['answer'], $match); $seed = $match[1]; $state = $cache->selectInitialState($seed, $response['version']); $this->logger->debug("init state: $state"); // iterate through sucessive cache states with parsed responses, collating answernotes $seqNumber = 1; while(isset($response[$seqNumber])) {// $state != NULL or isset($response[$seqNumber]) $this->logger->debug("one step beyond:".print_r($response[$seqNumber], 1)); $step = $response[$seqNumber++]; // decode the response into a post $encodedResponse = $step['answer']; $this->logger->debug('encodedResponse = '.$encodedResponse); $encodedArray = preg_split('/(?<!\\\\)\,/', $encodedResponse); // Split the responses on non-backslash-escaped commas. $post = array(); foreach($encodedArray as $e) { // $this->logger->debug("e = $e"); list($key, $value) = explode('-', $e, 2); $post[$key] = str_replace('\\\\,', ',', $value); } // temporarily insert event to map it $post['event'] = $step['event']; $this->logger->debug('moodle event'.$post['event']); $event = MoodleDisplayItem::mapStackEvent($post); $this->logger->debug("mapped post=".print_r($post,1)); unset($post['event']); unset($post['stackaction']); $transition = $cache->nextTransition($state, $post, $event); $oldstate = $state; $state = $cache->nextNode($transition); //if($state === NULL) $this->logger->critical("STATE IS NULL!"); $this->logger->debug("post: ".print_r($post,1)." with event: $event from state: $oldstate goes to state $state"); $details = $prtMetaDB->getAttemptDetails($state); // get the answer notes from potentially more than one PRT unset($notes);// = array(); foreach($details as $detail) { $notes[] = $detail['AnsNote']; $out[] = $detail['AnsNote']; } $this->logger->debug("notes=".print_r($notes, 1)); //$this->logger->debug("$notes=".print_r($notes, 1)); //$merge = array_merge($out, $notes); // assuming ALL results } $merge = array_merge($merge, $notes); $this->logger->debug("merge=".print_r($notes, 1)); } } }//*/ // return array of answernotes return $out; } } ?> --- dataController.php DELETED --- Index: ReportWidgets.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/ReportWidgets.php,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** ReportWidgets.php 29 Nov 2009 13:24:10 -0000 1.7.2.1 --- ReportWidgets.php 22 Nov 2010 23:05:52 -0000 1.7.2.2 *************** *** 17,113 **** */ ! /** ! * detailed description ! * ! * @author ! * @version ! * @copyright ! */ ! global $config; $root = $config->get('docroot'); require_once $root.'/lib/translator.php'; class ReportWidgets { ! /** ! * ! * ! * @access public */ ! public function __construct() ! { ! } ! /** ! * Returns xhtml for a selector of which attempts to display (all, scored, last...) ! * @access public ! * @return string ! */ ! public function displayAttemptsSelector($selected=NULL, $name='attemptType') ! { ! $options['all'] = get_string('stackReport_allAttempts','stack'); ! $options['last'] = get_string('stackReport_lastAttempt','stack'); ! $options['firstscored'] = get_string('stackReport_firstScoreAttempt','stack'); ! $options['first'] = get_string('stackReport_firstAttempt','stack'); ! return $this->optionSelector($options, $selected, $name); } ! /** ! * As above, but without 'first scored' ! * ! */ ! public function displayPRTAttemptSelector($selected=NULL, $name='attemptType') ! { ! $options['all'] = get_string('stackReport_allAttempts','stack'); ! $options['last'] = get_string('stackReport_lastAttempt','stack'); ! $options['first'] = get_string('stackReport_firstAttempt','stack'); ! return $this->optionSelector($options, $selected, $name); } ! public function displayStatusSelector($selected=NULL, $name='status') ! { ! $options['all'] = get_string('stackReport_all','stack'); ! $options['null'] = get_string('stackReport_null','stack'); ! $options['valid'] = get_string('stackReport_valid','stack'); ! $options['invalid'] = get_string('stackReport_invalid','stack'); ! $options['score'] = get_string('stackReport_score','stack'); ! $options['solutionSeen'] = get_string('stackReport_score','stack'); ! return $this->optionSelector($options, $selected, $name); ! } ! public function displayMarksSelector($selected=NULL, $name='marks') ! { ! $options['any'] = get_string('stackReport_all','stack'); ! $options['zero'] = get_string('stackReport_zeroMarks','stack'); ! $options['notZero'] = get_string('stackReport_notZeroMarks','stack'); ! $options['notFull'] = get_string('stackReport_notFullMarks','stack'); ! $options['full'] = get_string('stackReport_fullMarks','stack'); ! return $this->optionSelector($options, $selected, $name); } ! private function optionSelector($options, $selected, $name) ! { ! $xhtml .= '<select name="'.$name.'">'; ! foreach($options as $value => $text) ! { ! if($value == $selected) ! { ! $xhtml .= '<option value="'.$value.'" selected="selected">'.$text.'</option>'; ! } ! else ! { ! $xhtml .= '<option value="'.$value.'">'.$text.'</option>'; ! } ! } ! $xhtml .= '</select>'; ! return $xhtml; } } ?> \ No newline at end of file --- 17,149 ---- */ ! global $config; $root = $config->get('docroot'); + require_once $root.'/lib/error.php'; require_once $root.'/lib/translator.php'; + require_once $root.'/lib/database/StackDBReporting.php'; class ReportWidgets { ! ! private $errorlog; ! ! public function __construct() { ! $this->errorLog = new error(); ! } ! ! /** ! * Makes an html selector given an array of value : text pairs. */ ! private function selector($options, $name, $selected = null) { ! $sel .= "<select name=\"$name\">"; ! foreach ($options as $value => $text) { ! $sel .= "<option value=\"$value\"" ! . ($value == $selected ? ' selected="selected"' : '') // Makes the option selected if it's got the right value ! . ">$text</option>\n"; ! } ! $sel .= '</select>'; ! return $sel; } + + /** + * Makes an HTML select element with questions as options + */ + public function questionSelector ($selected = null) { + + $db = new StackDBReporting(); + $qs = $db->questionList(); ! if (!isset($qs)) { ! $options['error'] = 'Couldn\'t get questions'; ! } else { ! foreach ($qs as $q) { ! $options[$q[0]] = $q[0] . ' - ' . substr($q[1], 0, 40); // abreviate the name ! } ! } ! return $this->selector($options, 'questionSelector', $selected); } ! /** ! * Makes an HTML select element with questions as options ! */ ! public function studentSelector ($selected = null) { ! ! $db = new StackDBReporting(); ! $students = $db->studentList(); ! if (!isset($students)) { ! $options['error'] = 'Couldn\'t get students'; ! } else { ! foreach ($students as $s) { ! $options[$s[0]] = $s[0] . ' - ' . $s[2] . ' ' . $s[3]; // abreviate the name ! } ! } + return $this->selector($options, 'studentSelector', $selected); + } ! /** ! * Returns xhtml for a selector of which attempts to display (all, scored, last...) ! */ ! public function attemptsSelector ($selected = null) { ! ! $options['all'] = get_string('stackReport_allAttempts', 'stack'); ! $options['last'] = get_string('stackReport_lastAttempt', 'stack'); ! $options['firstScored'] = get_string('stackReport_firstScoreAttempt', 'stack'); ! $options['first'] = get_string('stackReport_firstAttempt', 'stack'); ! return $this->selector($options, 'attemptsSelector', $selected); } ! public function statusSelector($selected) { ! ! $options['all'] = get_string('stackReport_all','stack'); ! $options['null'] = get_string('stackReport_null','stack'); ! $options['valid'] = get_string('stackReport_valid','stack'); ! $options['invalid'] = get_string('stackReport_invalid','stack'); ! $options['score'] = get_string('stackReport_score','stack'); ! $options['solutionSeen'] = get_string('stackRepo... [truncated message content] |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:02
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lang/en Modified Files: Tag: question_reporting stack.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.135.2.2 retrieving revision 1.135.2.3 diff -C2 -d -r1.135.2.2 -r1.135.2.3 *** stack.php 3 Feb 2010 13:41:01 -0000 1.135.2.2 --- stack.php 22 Nov 2010 23:05:53 -0000 1.135.2.3 *************** *** 20,24 **** $string['WorkedSolution'] = 'Worked solution'; $string['NoSolution'] = '[No solution available]'; ! $string['YourAttemptsWere'] = 'Your attempts at this question were as follows.'; $string['Answer'] = 'Answer'; $string['NoAttemptsAtQ'] = 'You have made no attempts at this question.'; --- 20,25 ---- $string['WorkedSolution'] = 'Worked solution'; $string['NoSolution'] = '[No solution available]'; ! $string['YourAttemptsWere'] = 'Your attempts at this question were as follows'; ! $string['stack_show/hide_feedback'] = 'show/hide feedback'; $string['Answer'] = 'Answer'; $string['NoAttemptsAtQ'] = 'You have made no attempts at this question.'; *************** *** 32,35 **** --- 33,37 ---- $string['stackQuestion_questionVarsRaw'] = 'Question variables'; $string['stackQuestion_questionVars'] = '(Internal) Question variables'; + $string['stackQuestion_id.revision'] = 'id.revision'; $string['stackQuestion_questionStem'] = 'Question stem'; $string['stackQuestion_questionAns'] = "Teacher's answer"; *************** *** 46,50 **** $string['stackQuestion_questionName'] = 'Name'; ! $string['stackQuestion_questionKeywords'] = 'Keywords'; $string['stackQuestion_questionBody'] = 'Body'; $string['stackQuestion_questionUserLastEdited'] = 'User'; --- 48,54 ---- $string['stackQuestion_questionName'] = 'Name'; ! $string['stackQuestion_questionKeywordFilter'] = 'Keyword filter'; ! $string['stackQuestion_questionKeywordReset'] = '[reset]'; ! $string['stackQuestion_questionKeywordInvertFilter'] = 'Invert keywords'; $string['stackQuestion_questionBody'] = 'Body'; $string['stackQuestion_questionUserLastEdited'] = 'User'; *************** *** 64,74 **** $string['stackQuestion_questionRights'] = 'Rights statement'; $string['stackQuestion_questionValid'] = 'Valid'; $string['stackQuestion_questionStatus'] = 'Status'; $string['stackQuestion_questionDescription'] = 'Description'; ! $string['stackQuestion_questionDateLastEdited'] = 'Last edited on'; $string['stackQuestion_questionPublished'] = 'Privacy'; $string['stackQuestion_questionRelevance'] = 'Relevance'; ! $string['stackQuestion_questionNoDeployed'] = "# dep'd"; // Used in the question bank order select form to indicate no selection. --- 68,80 ---- $string['stackQuestion_questionRights'] = 'Rights statement'; + $string['stackQuestion_questionHeader'] = '<b>Name</b> (version): Description <small>keywords</small>'; $string['stackQuestion_questionValid'] = 'Valid'; $string['stackQuestion_questionStatus'] = 'Status'; $string['stackQuestion_questionDescription'] = 'Description'; ! $string['stackQuestion_questionDateLastEdited'] = 'Last edited'; $string['stackQuestion_questionPublished'] = 'Privacy'; $string['stackQuestion_questionRelevance'] = 'Relevance'; ! $string['stackQuestion_questionNoDeployed'] = "<abbr title='number deployed'>#</abbr>"; ! $string['stackQuestion_questionActions'] = "Actions"; // Used in the question bank order select form to indicate no selection. *************** *** 121,124 **** --- 127,131 ---- $string['stackOptions_FeedBackGenericPCorrect'] = 'Feedback: partially correct'; $string['stackOptions_FeedBackGenericPCorrect_def'] = "<span class='partially'>Your answer is partially correct.</span>"; + $string['stackOptions_OptWorkedSol'] = 'Worked solution on demand'; $string['stackOptions_QuizMode'] = 'Quiz mode'; $string['stackOptions_SubjectMode'] = 'Allow access to'; *************** *** 175,178 **** --- 182,186 ---- $string['stackOptions_AnsTest_values_Num_tol_relative'] = "Num_tol_relative"; $string['stackOptions_AnsTest_values_Num_tol_absolute'] = "Num_tol_absolute"; + $string['stackOptions_AnsTest_values_Num_sig_figs'] = "Num_sig_figs"; $string['stackOptions_AnsTest_values_Num_GT'] = "Num_GT"; $string['stackOptions_AnsTest_values_Num_GTE'] = "Num_GTE"; *************** *** 268,271 **** --- 276,280 ---- $string['AT_NOTIMPLEMENTED'] = 'This answer test has not been implemented.'; + $string['TEST_FAILED'] = 'The answer test failed to execute correctly: please altert your teacher.'; $string['ATAlgEquiv_SA_not_expression'] = 'Your answer should be an expression, not an equation, inequality, list, set or matrix. '; *************** *** 321,329 **** $string['ATSingleFrac_var'] = 'The variables in your answer are different to the those of the question, please check them. '; $string['ATSingleFrac_ret_exp'] = 'Your answer is not algebraically equivalent to the correct answer. You must have done something wrong. '; $string['ATCompSquare_true'] = ''; ! $string['ATCompSquare_wrong'] = ''; $string['ATCompSquare_not_AlgEquiv'] = 'Your answer appears to be in the correct form, but is not equivalent to the correct answer.'; ! $string['ATCompSquare_wrong_no_summands'] = 'The completed square is of the form \( a(\cdots\cdots)^2 + b\) where \(a\) and \(b\) do not depend on your variable. More than one of your summands appears to depend on the variable in your answer.'; --- 330,339 ---- $string['ATSingleFrac_var'] = 'The variables in your answer are different to the those of the question, please check them. '; $string['ATSingleFrac_ret_exp'] = 'Your answer is not algebraically equivalent to the correct answer. You must have done something wrong. '; + $string['ATSingleFrac_div'] = 'Your answer contains fractions within fractions. You need to clear these and write your answer as a single fraction.'; $string['ATCompSquare_true'] = ''; ! $string['ATCompSquare_false'] = ''; $string['ATCompSquare_not_AlgEquiv'] = 'Your answer appears to be in the correct form, but is not equivalent to the correct answer.'; ! $string['ATCompSquare_false_no_summands'] = 'The completed square is of the form \( a(\cdots\cdots)^2 + b\) where \(a\) and \(b\) do not depend on your variable. More than one of your summands appears to depend on the variable in your answer.'; *************** *** 339,342 **** --- 349,358 ---- $string['ATDiff_int'] = 'It looks like you have integrated instead!'; + $string['ATNumSigFigs_error_list'] = $string['ATFacForm_error_list']; + $string['ATNumSigFigs_NotDecimal'] = 'Your answer should be a decimal number, but is not! '; + $string['ATNumSigFigs_Inaccurate'] = 'The accuracy of your answer is not correct. Either you have rounded correctly, or you have rounded an intermediate answer which propagates an error.'; + $string['ATNumSigFigs_WrongDigits'] = 'Your answer contains the wrong number of significant digits. '; + + // index.php *************** *** 359,367 **** $string['FE_index_main'] = 'main menu'; $string['FE_index_Hints'] = 'Hints'; ! $string['FE_index_search'] = 'Search Questions'; $string['FE_peak_memory'] = 'Peak memory usage: '; $string['FE_publicCopied'] = 'Public question copied'; $string['FE_publicCopy'] = 'You may now '; ! $string['FE_publicCopy2'] = 'modify your personal copy'; $string['FE_publicCopy3'] = 'of the question.'; $string['FE_confirmDelete'] = 'Confirm Delete'; --- 375,384 ---- $string['FE_index_main'] = 'main menu'; $string['FE_index_Hints'] = 'Hints'; ! $string['FE_index_search'] = 'Search'; ! $string['FE_index_question(s)'] = 'question(s)'; $string['FE_peak_memory'] = 'Peak memory usage: '; $string['FE_publicCopied'] = 'Public question copied'; $string['FE_publicCopy'] = 'You may now '; ! $string['FE_publicCopy2'] = 'modify your personal copy'; $string['FE_publicCopy3'] = 'of the question.'; $string['FE_confirmDelete'] = 'Confirm Delete'; *************** *** 371,388 **** $string['FE_noCancel'] = 'No, Cancel'; $string['FE_testQuestion'] = 'Test Question'; ! $string['FE_deployQuestion'] = 'Deploy Question'; $string['FE_question'] = 'Question:'; $string['FE_deployQuestion_adding'] = 'Adding {$a} instances.'; ! $string['FE_deployQuestion_dropping'] = 'Dropping version '; $string['FE_deployQuestion_auto'] = 'Automatically deployed single question instance'; ! $string['FE_deployQuestion_singletonDeployed'] = 'Singleton question deployed (\'Drop\' will re-deploy).'; ! $string['FE_deployQuestion_versions'] = ' instances currently cached.'; ! $string['FE_deployQuestion_version'] = '1 instance currently cached.'; ! $string['FE_deployQuestion_newversions'] = 'new random instances.'; $string['FE_deployQuestion_noi'] = 'No instances added yet.'; $string['FE_deployQuestion_norand'] = 'There are no random instances of this question, and hence no need to deploy more than one version.'; ! $string['FE_deployQuestion_instancesOfQuestion']= 'Instances of question '; $string['FE_deployQuestion_primedResponses'] = 'Primed responses'; $string['FE_validate'] = '{$a[0]} of {$a[1]} questions validated.'; --- 388,418 ---- $string['FE_noCancel'] = 'No, Cancel'; $string['FE_testQuestion'] = 'Test Question'; ! $string['FE_deployVersion'] = 'Deploy Version'; $string['FE_question'] = 'Question:'; $string['FE_deployQuestion_adding'] = 'Adding {$a} instances.'; ! $string['FE_deployQuestion_attemptingDeploy'] = 'Attempting to deploy {$a} instances.'; ! $string['FE_deployQuestion_deployedInstances'] = 'Deployed {$a} new instances.'; ! $string['FE_deployQuestion_instancesOfQuestion']= 'Instances of question {$a}'; ! $string['FE_deployQuestion_droppedInstance'] = 'Dropped instance.'; $string['FE_deployQuestion_auto'] = 'Automatically deployed single question instance'; ! $string['FE_deployQuestion_singletonDeployed'] = 'Singleton question deployed (\'Undeploy\' will trigger redeploy).'; ! $string['FE_deployQuestion_xInstances'] = '{$a} instances '; ! $string['FE_deployQuestion_instanceDeployed'] = '1 instance deployed.'; ! $string['FE_deployQuestion_newRandomInstances'] = 'new random instances'; $string['FE_deployQuestion_noi'] = 'No instances added yet.'; $string['FE_deployQuestion_norand'] = 'There are no random instances of this question, and hence no need to deploy more than one version.'; ! $string['FE_deployQuestion_instancesOfVersion']= 'Instances of question version'; ! $string['FE_deployQuestion_autoprime'] = 'automatically prime'; $string['FE_deployQuestion_primedResponses'] = 'Primed responses'; + $string['FE_deployQuestion_ofVersionXdeployed'] = 'of version {$a} deployed.'; + $string['FE_deployQuestion_newerVersion'] = 'There is a newer version of this question available: <strong>version {$a}</strong>. To redeploy with this you will first need to undeploy the instances below. Students will continue to be able to answer those instances if they have already started.'; + $string['FE_deployQuestion_dropInstance'] = 'Dropped an instance ({$a}).'; + $string['FE_deployQuestion_undeployAll'] = 'Undeploy all'; + $string['FE_deployQuestion_confirmUndeployAll'] = 'Are you sure want to drop all deployed instances of this question version?'; + $string['FE_deployQuestion_oldVersionDeployed'] = 'An older version of this question has been deployed. Before you can deploy instances of this latest version you will need to undeploy all instances of the older version below. Students already using this version will be able to continue.'; + $string['FE_deployQuestion_newerVersionCannotDeploy'] = 'There is now a newer version of this question. This means you cannot deploy any more instances from the older version.'; + $string['FE_deployQuestion_undeployOldVersion'] = 'To deploy instances of the latest version you will need to undeploy all instances of this version. '; + $string['FE_deployQuestion_primedResponsesBlurb'] = 'Pregenerated from the question tests, they can include correct answers as well as common mistakes. The cache can be primed to include their straightforward submission to save the work at quiz time.'; $string['FE_validate'] = '{$a[0]} of {$a[1]} questions validated.'; *************** *** 441,444 **** --- 471,475 ---- $string['Mark'] = 'Mark'; $string['Submit'] = 'Submit'; + $string['blockTypeNotRecognised'] = '\'$a\' block type not recognised!'; //file IO *************** *** 473,476 **** --- 504,508 ---- $string['stackQuestion_PR_AddAPR'] = 'Add a Potential Response'; $string['stackQuestion_PR_requirements'] = 'This Potential Response Tree will become active when the student has answered:'; + $string['PR_ERROR'] = 'Please alert your teacher that the marking algorithm has failed to work because of the following problems:'; $string['stackCas_invalidCommand'] = 'CAS commands not valid'; *************** *** 489,492 **** --- 521,525 ---- $string['stackCas_apostrophe'] = 'Apostrophes are not permitted in responses: '; $string['stackCas_finalChar'] = '\'{$a[0]}\' is an invalid final character in {$a[1]}'; + $string['stackCas_qmchar'] = 'This answer contains a question mark, which is forbidden.'; //Authoring questions *************** *** 504,507 **** --- 537,541 ---- //buttons + $string['stackAuthor_qid'] = 'Question ID:'; $string['stackAuthor_button_update'] = 'Update'; $string['stackAuthor_button_addPRT'] = '+'; *************** *** 521,534 **** $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; $string['chat_button'] = 'chat'; //author editor text $string['stackAuthor_title'] = 'Author Question'; ! $string['stackAuthor_qid'] = 'Question ID:'; $string['stackAuthor_name'] = 'Name:'; $string['stackAuthor_description'] = 'Description:'; $string['stackAuthor_keywords'] = 'Keywords:'; $string['stackAuthor_qvariables'] = 'Question Variables:'; ! $string['stackAuthor_stem'] = 'Question Stem:'; ! $string['stackAuthor_stemInfo'] = '#ans# denotes student answers<br /> @castext@ for castext<br /><html></html> for html <br />$\latex$ for latex'; $string['stackAuthor_workedSolution'] = 'Worked Solution: '; $string['stackAuthor_qnote'] = 'Question Note:'; --- 555,572 ---- $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; $string['chat_button'] = 'chat'; + $string['stackQuiz_button_submit'] = 'Submit'; + $string['stackQuiz_button_finishQuiz'] = 'Finish quiz'; //author editor text + $string['stackAuthor_onlineGuide'] = 'Online Guide'; $string['stackAuthor_title'] = 'Author Question'; ! $string['stackAuthor_editingQuestion'] = 'Editing Question: '; ! $string['stackAuthor_stem'] = 'Stem'; $string['stackAuthor_name'] = 'Name:'; $string['stackAuthor_description'] = 'Description:'; $string['stackAuthor_keywords'] = 'Keywords:'; $string['stackAuthor_qvariables'] = 'Question Variables:'; ! $string['stackAuthor_questionStem'] = 'Question Stem:'; ! $string['stackAuthor_stemInfo'] = '#ans# denotes student answers<br /> @castext@ for castext<br /><html></html> for html <br />latex'; $string['stackAuthor_workedSolution'] = 'Worked Solution: '; $string['stackAuthor_qnote'] = 'Question Note:'; *************** *** 555,558 **** --- 593,598 ---- $string['stackAuthor_LowestTerms'] = 'Require lowest terms'; $string['stackAuthor_sameType'] = 'Check Students answer\'s type'; + $string['stackAuthor_studentVerify'] = 'Student must verify'; + $string['stackAuthor_hideFeedback'] = 'Hide feedback'; $string['stackAuthor_inputTypeOpt'] = 'Input Type Options'; $string['stackAuthor_noInputTypeOpt'] = 'No options'; *************** *** 561,565 **** ! $string['stackAuthor_metadata'] = 'Meta data'; $string['stackAuthor_qstatus'] = 'Question Status:'; $string['stackAuthor_lang'] = 'Language:'; --- 601,605 ---- ! $string['stackAuthor_metadata'] = 'Metadata'; $string['stackAuthor_qstatus'] = 'Question Status:'; $string['stackAuthor_lang'] = 'Language:'; *************** *** 583,589 **** $string['stackAuthor_feedbackIncorrect'] = 'Feedback Incorrect:'; $string['stackAuthor_output'] = 'Output'; $string['stackAuthor_multSign'] = 'Multiplication Sign:'; $string['stackAuthor_surd'] = 'Surd for Square Root:'; ! $string['stackAuthor_ComplexNo'] = 'sqrt(-1) = i (true) or j (false):'; $string['stackAuthor_empty_qstem'] = 'Please fill in the question stem.'; --- 623,630 ---- $string['stackAuthor_feedbackIncorrect'] = 'Feedback Incorrect:'; $string['stackAuthor_output'] = 'Output'; + $string['stackAuthor_OptWorkedSol'] = 'Worked solution on demand'; $string['stackAuthor_multSign'] = 'Multiplication Sign:'; $string['stackAuthor_surd'] = 'Surd for Square Root:'; ! $string['stackAuthor_ComplexNo'] = 'Meaning and display of sqrt(-1):'; $string['stackAuthor_empty_qstem'] = 'Please fill in the question stem.'; *************** *** 592,595 **** --- 633,637 ---- $string['stackAuthor_invalid_workedSolution'] = 'Worked Solution is invalid:'; $string['stackAuthor_invalid_questionNote'] = 'Question Note is invalid:'; + $string['stackAuthor_empty_questionNote'] = 'The Question Note cannot be empty when rand() appears in the question variables. Used to distinguish between different versions of the question.'; $string['stackAuthor_PRTAlreadyExists'] = 'A potential response tree already exists with the name'; $string['stackAuthor_teachersNote'] = 'Teachers Notes:'; *************** *** 603,617 **** //moodle additions to author interface ! $string['stackAuthor_moodleExport'] = 'Moodle Options'; ! $string['stackAuthor_addedMoodle'] = 'Added to Moodle'; $string['stackAuthor_moodleAddSucessful'] = 'Question added to Moodle successfully.'; ! $string['stackAuthor_moodleAddFailed'] = 'Failed to add question to Moodle.'; ! $string['stackAuthor_moodleEngIdFail'] = 'Engine ID missing, could not add to Moodle.'; $string['stackAuthor_moodleUpdateFail'] = 'Failed to update Moodle'; ! $string['stackAuthor_moodleQBFail'] = 'Could not update this question in Moodle\'s question bank.'; ! $string['stackAuthor_moodleSave1st'] = 'The question must be saved before it can be added to Moodle\'s question bank.'; ! $string['stackAuthor_inMoodle'] = 'This question is already in Moodle\'s question bank. Saving the question in STACK will automatically update Moodle.'; ! $string['stackAuthor_moodleSelectCat'] = 'You may add this question to one of Moodle\'s question banks. Select the required category.'; ! $string['stackAuthor_category'] = 'Category:'; $string['stackMoodle_passkeyInvalid'] = 'Invalid passkey for this server.'; --- 645,661 ---- //moodle additions to author interface ! $string['stackAuthor_moodleExport'] = 'Moodle Options'; ! $string['stackAuthor_addToMoodle'] = 'Add to Moodle'; ! $string['stackAuthor_addedMoodle'] = 'Added to Moodle'; $string['stackAuthor_moodleAddSucessful'] = 'Question added to Moodle successfully.'; ! $string['stackAuthor_moodleAddFailed'] = 'Failed to add question to Moodle.'; ! $string['stackAuthor_moodleEngIdFail'] = 'Engine ID missing, could not add to Moodle.'; $string['stackAuthor_moodleUpdateFail'] = 'Failed to update Moodle'; ! $string['stackAuthor_moodleQBFail'] = 'Could not update this question in Moodle\'s question bank.'; ! $string['stackAuthor_moodleSave1st'] = 'The question must be saved before it can be added to Moodle\'s question bank.'; ! $string['stackAuthor_inMoodle'] = 'This question is already in Moodle\'s question bank. Saving the question in STACK will automatically update Moodle.'; ! $string['stackAuthor_moodleSelectCat'] = 'You may add this question to one of Moodle\'s question banks. Select the required category.'; ! $string['stackAuthor_category'] = 'Category:'; ! $string['stackAuthor_savedVersions'] = 'Saved versions'; $string['stackMoodle_passkeyInvalid'] = 'Invalid passkey for this server.'; *************** *** 681,684 **** --- 725,729 ---- $string['Illegal_floats'] = 'Your answer contains floating point numbers, that are not allowed in this question. You need to type in numbers as fractions. For example, you should type 1/3 not 0.3333, which is after all only an approximation to one third.'; $string['DivisionZero'] = 'Your answer results in a division by zero, eg 1/0, which makes no mathematical sense.'; + $string['CommaError'] = 'Your answer contains commas which are not part of a list, set or matrix. <ul><li>If you meant to type in a list, please use <tt>{$a[0]}</tt>,</li><li>If you meant to type in a set, please use <tt>{$a[1]}</tt>.</li></ul>'; //question display strings *************** *** 690,696 **** $string['stackQuestionDisplay_couldnotDisplayWorkedS'] = 'There has been a problem displaying the worked solution:'; $string['stackQuestionDisplay_viewSolution'] = 'View Solution'; ! $string['stackQuestionDisplay_yourLastAnswer'] = 'Your last answer was interpreted as:'; ! $string['stackQuestionDisplay_yourAnswer'] = 'Your answer was:'; ! $string['stackQuestionDisplay_teachersAnswer'] = 'Teachers Answer:'; $string['stackQuestionDisplay_workedSolution'] = ''; $string['stackQuestionDisplay_requestWS'] = 'Request Worked Solution'; --- 735,741 ---- $string['stackQuestionDisplay_couldnotDisplayWorkedS'] = 'There has been a problem displaying the worked solution:'; $string['stackQuestionDisplay_viewSolution'] = 'View Solution'; ! $string['stackQuestionDisplay_yourLastAnswer'] = 'Your last answer was interpreted as: '; ! $string['stackQuestionDisplay_yourAnswer'] = 'Your answer was: '; ! $string['stackQuestionDisplay_teachersAnswer'] = 'Teachers Answer: '; $string['stackQuestionDisplay_workedSolution'] = ''; $string['stackQuestionDisplay_requestWS'] = 'Request Worked Solution'; *************** *** 698,702 **** $string['stackQuestionDisplay_workedSolutionDenied'] = 'You have changed one or more of your answers, because of this the worked solution will not be displayed.'; $string['stackQuestionDisplay_assessmentItem'] = 'Assessment Item'; ! $string['stackQuestionDisplay_resubmit'] = 'Your responses have been accepted and validated. Please review you responses and re-submit to fully evaluate your answers.'; $string['stackQuestionDisplay_PRTunevaluated'] = 'Please continue to work. Feedback will be provided here in due course.'; $string['stackQuestionDisplay_nomarks'] = 'Thank you. There are no marks available.'; --- 743,747 ---- $string['stackQuestionDisplay_workedSolutionDenied'] = 'You have changed one or more of your answers, because of this the worked solution will not be displayed.'; $string['stackQuestionDisplay_assessmentItem'] = 'Assessment Item'; ! $string['stackQuestionDisplay_resubmit'] = 'Your responses have been accepted and validated. Please review your responses and re-submit to fully evaluate your answers.'; $string['stackQuestionDisplay_PRTunevaluated'] = 'Please continue to work. Feedback will be provided here in due course.'; $string['stackQuestionDisplay_nomarks'] = 'Thank you. There are no marks available.'; *************** *** 734,738 **** $string['stackIcon_success'] = 'correct.png'; $string['stackIcon_success_alt'] = 'Success'; ! //Authoring errors --- 779,786 ---- $string['stackIcon_success'] = 'correct.png'; $string['stackIcon_success_alt'] = 'Success'; ! $string['stackIcon_edit'] = 'Edit'; ! $string['stackIcon_try'] = 'Try'; ! $string['stackIcon_deploy'] = 'Deploy'; ! $string['stackIcon_xml'] = 'XML'; //Authoring errors *************** *** 868,871 **** --- 916,920 ---- $string['stackInstall_password'] = 'Password'; $string['stackInstall_password2'] = 'Re-enter Password'; + $string['stackInstall_yourMoodleUsername'] = 'Your Moodle Username'; $string['stackInstall_email'] = 'Email Address (Optional)'; $string['stackInstall_smtp'] = 'SMTP Server <br />(Required for sending emails)'; *************** *** 873,884 **** //p5.php ! $string['stackInstall_configWriteFailed'] = 'Could not write config.php file. Please copy & paste the configuration below into a file named config.php in the directory {$a} then click continue.'; $string['stackInstall_configWriteSucceed'] = 'Configuration file has been written. Ready to test the CAS.'; //p6.php $string['stackInstall_installComplete'] = 'Installation Complete'; ! $string['stackInstall_installdone'] = 'STACK has been installed. The final step test STACKs connections to the CAS and external applications. This process may take a few seconds to complete.'; $string['stackInstall_webservice'] = 'External web applications such as Moodle can access STACK through the following URL. <br />Replace <tt>localhost</tt> with explicit <tt>127.0.0.1</tt>.'; ! $string['stackInstall_passkey'] = 'Your PassKey for this server is: <tt class=\"passkey\">{$a}</tt> you will need this when linking STACK with a VLE such as Moodle.'; $string['stackInstall_wsdlfail'] = 'Could not write WSDL configuration file.'; $string['stackInstall_wsdlload'] = 'Confirm the WSDL is available.'; --- 922,933 ---- //p5.php ! $string['stackInstall_configWriteFailed'] = 'Could not write <tt>config.php</tt> file. Please copy & paste the configuration below into a file named <tt>config.php</tt> in the directory <tt>{$a}</tt> then click continue.'; $string['stackInstall_configWriteSucceed'] = 'Configuration file has been written. Ready to test the CAS.'; //p6.php $string['stackInstall_installComplete'] = 'Installation Complete'; ! $string['stackInstall_installdone'] = 'STACK has been installed. The final step test STACK\'s connections to the CAS and external applications. This process may take a few seconds to complete.<p>Please register online at <pre>http://www.stack.bham.ac.uk</pre>for updates, news, and to participate in any online discussion.</p>'; $string['stackInstall_webservice'] = 'External web applications such as Moodle can access STACK through the following URL. <br />Replace <tt>localhost</tt> with explicit <tt>127.0.0.1</tt>.'; ! $string['stackInstall_passkey'] = 'Your PassKey for this server is: <tt class=\"passkey\">{$a}</tt> you will need this when linking STACK with a VLE such as Moodle. In Moodle, go to <pre>/moodle/question/type/opaque/engines.php</pre> to add engines.'; $string['stackInstall_wsdlfail'] = 'Could not write WSDL configuration file.'; $string['stackInstall_wsdlload'] = 'Confirm the WSDL is available.'; *************** *** 945,948 **** --- 994,998 ---- $string['stackHealth_connectedbackup'] = 'STACK uses this as a backup connection method, should all Maxima proxies fail.'; $string['stackHealth_connFail'] = 'Could not start an instance of Maxima.'; + $string['stackHealth_usingCommand'] = 'Using CAS command: '; $string['stackHealth_mainConnFail'] = 'It is not possible to use or edit STACK questions without a working connection to Maxima.'; $string['stackHealth_tempSuccess'] = 'Can write to temp directory'; *************** *** 953,967 **** $string['stackHealth_dirtest'] = 'Testing writable directories'; $string['stackHealth_noProblems'] = 'No problems found.'; $string['stackInstall_confHeader'] = 'Checking config.php'; $string['stackInstall_confvalid'] = 'Your config.php file is valid.'; ! $string['stackInstall_confEndSpaces'] = 'There should be no characters or spaces after "?>" in the config.php file. STACK may not work correctly unless you remove them.'; ! $string['stackInstall_failopenconfig'] = 'Could not open config.php'; ! $string['stackInstall_retryconfig'] = 'Click the back button to retry creating config.php'; $string['stackInstall_testsuite_title'] = 'A test suite for STACK Answer tests'; ! $string['stackInstall_testsuite_intro'] = 'This page allows you to test that the STACK answer tests are functioning correctly. Note that only answer tests can be checked through the web interface. Other Maxima commands need to be checked from the command line: see unittests.mac.'; $string['stackInstall_testsuite_choose'] = 'Please choose an answer test.'; $string['stackInstall_testsuite_pass'] = 'All tests passed!'; --- 1003,1021 ---- $string['stackHealth_dirtest'] = 'Testing writable directories'; $string['stackHealth_noProblems'] = 'No problems found.'; + $string['stackInstall_securityHeader'] = 'Security checks'; + $string['stackHealth_securityPass'] = 'No security issues found.'; + $string['stackHealth_securityFail'] = 'The following security issues below were found.'; $string['stackInstall_confHeader'] = 'Checking config.php'; $string['stackInstall_confvalid'] = 'Your config.php file is valid.'; ! $string['stackInstall_confPublic'] = '. STACK may not work correctly unless you remove them.'; ! $string['stackInstall_securityPublicConfig'] = 'Your configuration settings are public as config.php~. You should remove this file.'; + $string['stackInstall_failopenconfig'] = 'Could not open <tt>config.php</tt>'; + $string['stackInstall_retryconfig'] = 'Click the back button to retry creating config.php'; $string['stackInstall_testsuite_title'] = 'A test suite for STACK Answer tests'; ! $string['stackInstall_testsuite_intro'] = 'This page allows you to test that the STACK answer tests are functioning correctly. Note that only answer tests can be checked through the web interface. Other Maxima commands need to be checked from the command line: see unittests.mac.<br />Documentation for the answer tests is available on the <a href=\"http://stack.bham.ac.uk/wiki/index.php/Answer_tests\">wiki</a>.'; $string['stackInstall_testsuite_choose'] = 'Please choose an answer test.'; $string['stackInstall_testsuite_pass'] = 'All tests passed!'; *************** *** 1069,1072 **** --- 1123,1127 ---- $string['stackInputType_list'] = 'List'; $string['stackInputType_Textarea'] = 'Text area'; + $string['stackInputType_slider'] = 'Slider'; //Options editor *************** *** 1105,1109 **** $string['stackOption_Feedback_S'] = 'Score only (no text)'; $string['stackOption_Feedback_none'] = 'No feedback'; ! $string['stackOption_Feedback_none_feedback'] = 'Thank you. There is no specific feedback associated with this question.'; --- 1160,1164 ---- $string['stackOption_Feedback_S'] = 'Score only (no text)'; $string['stackOption_Feedback_none'] = 'No feedback'; ! $string['stackOption_Feedback_none_feedback'] = 'Thank you. Your answer has been accepted.'; *************** *** 1112,1117 **** $string['stackMoodle_questionNotDeployed'] = 'This question currently has no instances deployed.'; ! //Reporting strings $string['stackReport_allAttempts'] = 'All Attempts'; $string['stackReport_lastAttempt'] = 'Last Attempt'; --- 1167,1227 ---- $string['stackMoodle_questionNotDeployed'] = 'This question currently has no instances deployed.'; + // Deployment strings + $string['stackDeploy_button_update'] = 'Update'; // MUST match qtype_opaque + $string['FE_deployQuestion_moveTo'] = 'Move to'; ! // Reporting Strings ! ! // New strings ! $string['stackReport_questions'] = 'Questions'; ! $string['stackReport_students'] = 'Students'; ! $string['stackReport_last100AttemptsScores'] = 'The scores of the last 100 attempts'; ! $string['stackReport_attemptsGraph'] = 'Attempts graph'; ! $string['stackReport_attemptsTable'] = 'Attempts table'; ! $string['stackReport_potentialResponseTrees'] = 'Potential Response Trees'; ! $string['stackReport_attemptsHistory'] = 'History of attempts'; ! $string['stackReport_workedSolution'] = 'Worked Solution'; ! ! // Reporting strings for javascript ! $string['stackReport_js_attemptInfoString'] = 'Student #[student] tried question #[question] on [date] and scored [score]'; ! $string['stackReport_js_prtName'] = 'PRT Name'; ! $string['stackReport_js_answerNote'] = 'Answer Note'; ! $string['stackReport_js_score'] = 'Score'; ! $string['stackReport_js_totalAttempts'] = 'Total Attempts'; ! $string['stackReport_js_percentage'] = 'Percentage'; ! $string['stackReport_js_tooltipHint'] = 'Move your mouse over a point on the graph to see more information about the attempt.'; ! $string['stackReport_js_questions'] = 'Questions'; ! $string['stackReport_js_questionsAttemptedBy'] = 'Questions which [name] attempted'; ! $string['stackReport_js_students'] = 'Students'; ! $string['stackReport_js_studentsWhoAttempted'] = 'Students who attempted question #[question]'; ! $string['stackReport_js_loading'] = 'Loading'; ! $string['stackReport_js_questionNotes'] = 'Question Notes'; ! $string['stackReport_js_noAttempts'] = 'No Attempts'; ! $string['stackReport_js_noPRTs'] = 'This question has no potential response trees.'; ! $string['stackReport_js_questionAttempts'] = 'Attempts over time for question #[id]'; ! $string['stackReport_js_questionGraph'] = 'Graph of scores obtained on question #[id]'; ! $string['stackReport_js_studentAttempts'] = 'Attempts over time for student #[id]'; ! $string['stackReport_js_studentGraph'] = 'Graph of scores obtained by [name]'; ! $string['stackReport_js_tryQuestion'] = 'Try the question'; ! $string['stackReport_js_errorRetrieving'] = 'There was an error retrieving this data'; ! $string['stackReport_js_noWorkedSolution'] = 'There is no worked solution'; ! $string['stackReport_js_tryQuestionInInterface'] = 'Try this question in the test question interface'; ! $string['stackReport_js_dataAboutAttempt'] = 'Data about student [studentID]\'s attempts at question [questionID]'; // note backslash escapes apostrophe ! ! // Reporting strings for datatables ! $string['stackReport_js_dataTable_loading'] = 'Loading'; ! $string['stackReport_js_dataTable_first'] = 'First'; ! $string['stackReport_js_dataTable_last'] = 'Last'; ! $string['stackReport_js_dataTable_next'] = 'Next'; ! $string['stackReport_js_dataTable_previous'] = 'Previous'; ! $string['stackReport_js_dataTable_tableInfo'] = 'Showing _START_ to _END_ of _TOTAL_ entries'; ! $string['stackReport_js_dataTable_tableInfoEmpty'] = 'Showing 0 to 0 of 0 entries'; ! $string['stackReport_js_dataTable_tableInfoFiltered'] = '(filtered from _MAX_ total entries)'; ! $string['stackReport_js_dataTable_processing'] = 'Procssing'; ! $string['stackReport_js_dataTable_search'] = 'Search'; ! $string['stackReport_js_dataTable_zeroRecords'] = 'No matching records found'; ! ! // Older strings from an reporting, may be no long needed ! $string['stackReport_questions'] = 'Questions'; $string['stackReport_allAttempts'] = 'All Attempts'; $string['stackReport_lastAttempt'] = 'Last Attempt'; *************** *** 1149,1153 **** $string['stackReport_rawmark'] = 'Raw Mark'; $string['stackReport_modmark'] = 'Mod Mark'; ! $string['stackReport_ansNote'] = 'Answer Note'; $string['stackReport_errors'] = 'Errors'; $string['stackReport_noMarks'] = 'No marks for this attempt.'; --- 1259,1263 ---- $string['stackReport_rawmark'] = 'Raw Mark'; $string['stackReport_modmark'] = 'Mod Mark'; ! $string['stackReport_answerNote'] = 'Answer Note'; $string['stackReport_errors'] = 'Errors'; $string['stackReport_noMarks'] = 'No marks for this attempt.'; *************** *** 1167,1196 **** $string['stackReport_IEfeedback'] = 'Invalid: full feedback as ALT-text to icon.'; $string['stackReport_feedback'] = 'Full feedback as ALT-text to icon.'; - $string['stackReport_last100AttemptsScores'] = 'The scores of the last 100 attempts'; - $string['stackReport_tooltipHint'] = 'Move your mouse over a point on the graph to see more information about the attempt.'; - $string['stackReport_attemptInfoString'] = 'Student #[student] tried question #[question] on [date] and scored [score]'; - $string['stackReport_studentsWhoAttempted'] = 'Students who attempted question #[question]'; - $string['stackReport_questionsAttemptedBy'] = 'Questions which [name] attempted'; - $string['stackReport_potentialResponseTrees'] = 'Potential Response Trees'; - $string['stackReport_workedSolution'] = 'Worked Solution'; - $string['stackReport_radarChart'] = 'Radar Chart'; - $string['stackReport_answerNote'] = 'Answer Note'; - $string['stackReport_percentage'] = 'Percentage'; - $string['stackReport_questionNotes'] = 'Question Notes'; - $string['stackReport_attemptsGraph'] = 'Attempts graph'; - $string['stackReport_attemptsTable'] = 'Attempts table'; - $string['stackReport_attemptsHistory'] = 'History of attempts'; - $string['stackReport_tryQuestion'] = 'Try question'; - $string['stackReport_loading'] = 'Loading'; - $string['stackReport_first'] = 'First'; - $string['stackReport_last'] = 'Last'; - $string['stackReport_next'] = 'Next'; - $string['stackReport_previous'] = 'Previous'; - $string['stackReport_tableInfo'] = 'Showing _START_ to _END_ of _TOTAL_ entries'; - $string['stackReport_tableInfoEmpty'] = 'Showing 0 to 0 of 0 entries'; - $string['stackReport_tableInfoFiltered'] = '(filtered from _MAX_ total entries)'; - $string['stackReport_processing'] = 'Procssing'; - $string['stackReport_search'] = 'Search'; - $string['stackReport_zeroRecords'] = 'No matching records found'; //Question search strings --- 1277,1280 ---- *************** *** 1224,1228 **** $string['stackUpdate_complete'] = 'Update completed successfully.'; $string['stackUpdate_problems'] = 'There were problems during the update.'; ! $string['stackUpdate_configWriteFailed'] = 'Stack could not automatically update your configuration file. Please copy and paste the text below into your config.php file, overwriting any previous information.'; $string['stackUpdate_backedup'] = 'You can find a backup of your database, before any updates were installed in {$a}.'; --- 1308,1312 ---- $string['stackUpdate_complete'] = 'Update completed successfully.'; $string['stackUpdate_problems'] = 'There were problems during the update.'; ! $string['stackUpdate_configWriteFailed'] = 'Stack could not automatically update your configuration file. Please copy and paste the text below into your <tt>config.php</tt> file, overwriting any previous information.'; $string['stackUpdate_backedup'] = 'You can find a backup of your database, before any updates were installed in {$a}.'; |
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/opaque/stack Modified Files: Tag: question_reporting soapPage.php stackAuthor.php stackLib.php stackDeploy.php stackQuestionList.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackAuthor.php,v retrieving revision 1.13 retrieving revision 1.13.4.1 diff -C2 -d -r1.13 -r1.13.4.1 *** stackAuthor.php 26 Jun 2009 17:03:41 -0000 1.13 --- stackAuthor.php 22 Nov 2010 23:05:52 -0000 1.13.4.1 *************** *** 110,113 **** --- 110,114 ---- $clean = stripslashes($post); $posted[$key] = $clean; + $posted[$key] = get_magic_quotes_gpc() ? $post : stripslashes($post); } } *************** *** 135,139 **** else { - $engineName = getEngineName($SESSION->stackSelectedEngine); $strtitle = get_string('authorEngine', 'qtype_opaque').$engineName; --- 136,139 ---- *************** *** 153,178 **** print_box_start(); ! print_heading($strtitle); ! ! if($soapPage->form == true) { echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; } ! //echo '<input type="text" name="texttest" />'; - - echo $soapPage->XHTML; - if($soapPage->form == true) { //echo '<input type="hidden" name="pageRequested" value="'.$pageRequest.'" />'; //echo '<input type="submit" name="submit" value="Update" /> <input type="submit" name="submit" value="Save" /> <input type="submit" name="submit" value="Save as New" /> <input type="submit" name="submit" value="Export as XML" />'; echo '<input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_save','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_savenew','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_exportAsXml','qtype_opaque').'" />'; ! echo '</form>'; ! //echo '<hr>'; ! //var_dump($_POST); } print_box_end(); --- 153,201 ---- print_box_start(); ! if($soapPage->form == true) { echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; } ! //print_heading($strtitle); //echo '<input type="text" name="texttest" />'; if($soapPage->form == true) { //echo '<input type="hidden" name="pageRequested" value="'.$pageRequest.'" />'; //echo '<input type="submit" name="submit" value="Update" /> <input type="submit" name="submit" value="Save" /> <input type="submit" name="submit" value="Save as New" /> <input type="submit" name="submit" value="Export as XML" />'; + echo '<div id="authoringControls">'; + //echo + //print_heading($strtitle); echo '<input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_save','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_savenew','qtype_opaque').'" /> <input type="submit" name="submit" value="'.get_string('stackAuthor_button_exportAsXml','qtype_opaque').'" />'; ! ?> ! <ul> ! <li><a href="#stem">Stem</a></li> ! <li><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a></li> ! <li><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a></li> ! <li><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a></li> ! <li><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a></li> ! <li><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a></li> ! </ul> ! <?php ! echo '<p><small>'.get_string('stackAuthor_finish_reminder','qtype_opaque').'</small></p>'; ! echo '</div>'; } + echo $soapPage->XHTML; + echo '</form>'; + + // bit of an optional hack to improve UI while keeping things SOAP page simple + ?> + <script language="JavaScript" type="text/javascript"> + $(document).ready(function() { + console.log($('#versionHistory').children('br').length); + // $('#authoringControls').append($('#versionHistory').detach().html()); // move + $('#authoringControls').append($('#versionHistory').html()); // copy + // would like to limit side to last n items since it is fixed and so doesn't scroll + + }); + </script> + + <?php print_box_end(); *************** *** 186,188 **** } ! ?> --- 209,211 ---- } ! ?> \ No newline at end of file Index: stackDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackDeploy.php,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** stackDeploy.php 23 Jun 2009 16:18:28 -0000 1.2 --- stackDeploy.php 22 Nov 2010 23:05:52 -0000 1.2.4.1 *************** *** 21,29 **** require_once($CFG->libdir . '/formslib.php'); require_once($CFG->libdir . '/datalib.php'); require_once(dirname(__FILE__) . '/../locallib.php'); ! require_once('stackLib.php'); require_once('../../../editlib.php'); - // Check the user is logged in. require_login(); --- 21,29 ---- require_once($CFG->libdir . '/formslib.php'); require_once($CFG->libdir . '/datalib.php'); + require_once(dirname(__FILE__) . '/../locallib.php'); ! //require_once('stackLib.php'); require_once('../../../editlib.php'); // Check the user is logged in. require_login(); *************** *** 46,78 **** redirect('stackEngineSelector.php'); } ! $param = $_POST + $_GET; ! // handle drops ! if(!empty($param['drop']) && is_numeric($param['drop'])) { ! $dropSpecs['id'] = $param['id']; ! $dropSpecs['instance'] = $param['drop']; ! stackDropinstance($SESSION->stackSelectedEngine, $dropSpecs); ! //echo "trying to drop instance".$param['drop']; } ! // handle adds ! if(!empty($param['add']) && is_numeric($param['add'])) { ! // addSpecs contains details of instances to add. Initially random but may be systematic later. ! $addSpecs['id'] = $param['id']; ! $addSpecs['number'] = $param['add']; ! stackAddInstances($SESSION->stackSelectedEngine, $addSpecs); ! //echo "trying to add instance".$param['add']; } ! $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); $engineName = getEngineName($SESSION->stackSelectedEngine); ! $strtitle = get_string('instantiationsOf', 'qtype_opaque').$param['id'].' : '.$engineName.get_string('qEngine', 'qtype_opaque'); ! $navlinks = array(); ! $navlinks[] = array('name' => get_string('StackQuestions', 'qtype_opaque', ''), 'link' => 'stackQuestionList.php', 'type' => 'title'); ! $navlinks[] = array('name' => $strtitle, 'link' => '', 'type' => 'title'); ! $navigation = build_navigation($navlinks); print_header_simple($strtitle, '', $navigation, '', $deployedPage->head); --- 46,141 ---- redirect('stackEngineSelector.php'); } + //*/ + //print_r($_POST); + //print_r($USER); + //exit(); + if(!empty($_POST['submit'])) { ! switch($_POST['submit']) { ! case 'add': // String from Deployment.php - TODO. ! if(!is_numeric($_POST['add'])) break; ! $specs['id'] = $_GET['id']; ! $specs['number'] = $_POST['add']; ! $specs['autoprime'] = isset($_POST['autoprime'])? 1 : 0; ! stackAddInstances($SESSION->stackSelectedEngine, $specs); ! break; ! ! case get_string('stackDeploy_button_undeploy', 'qtype_opaque'): ! if(!isset($_POST['instances'])) break; ! foreach($_POST['instances'] as $iid => $on) { ! $specs['id'] = $_GET['id']; // not sure this is needed but, hey. ! $specs['instance'] = $iid; ! stackDropInstance($SESSION->stackSelectedEngine, $specs); ! } ! break; ! ! case get_string('stackDeploy_button_prime', 'qtype_opaque'): ! if(!isset($_POST['instances'])) break; ! foreach($_POST['instances'] as $iid => $on) { ! $specs['id'] = $_GET['id']; // not sure this is needed but, hey. ! $specs['instance'] = $iid; ! stackPrimeInstance($SESSION->stackSelectedEngine, $specs); ! } ! break; ! ! case get_string('stackDeploy_button_update', 'qtype_opaque'): ! if(!is_numeric($_POST['prior'])) break; ! $specs['id'] = $_GET['id']; // not sure this is needed but, hey. ! $specs['prior'] = $_POST['prior']; ! $specs['number'] = $_POST['add']; ! $specs['category'] = $_POST['category']; ! $specs['operation'] = 'update'; ! //print_r($specs); ! stackUpdateDeployment($SESSION->stackSelectedEngine, $specs); ! break; ! ! case get_string('stackDeploy_button_moveTo', 'qtype_opaque'): ! $specs['id'] = $_GET['id']; // not sure this is needed but, hey. ! $specs['category'] = $_POST['category']; ! $specs['operation'] = 'move'; ! //print_r($specs); ! stackMoveDeployment($SESSION->stackSelectedEngine, $specs); ! break; ! } } ! // handle single deletions ! if(!empty($_GET['drop']) && is_numeric($_GET['drop'])) { ! $specs['id'] = $_GET['id']; ! $specs['instance'] = $_GET['drop']; ! stackDropinstance($SESSION->stackSelectedEngine, $specs); } ! // handle version undeploy ! if(!empty($_GET['dropall']) && is_numeric($_GET['dropall'])) { ! $specs['id'] = $_GET['id']; ! $specs['version'] = $_GET['dropall']; ! stackUndeployVersion($SESSION->stackSelectedEngine, $specs); ! } ! ! // handle single primings ! if(!empty($_GET['prime']) && is_numeric($_GET['prime'])) { ! $specs['id'] = $_GET['id']; ! $specs['instance'] = $_GET['prime']; ! stackPrimeInstance($SESSION->stackSelectedEngine, $specs); ! } ! ! unset($_POST['instances']); // handled above since can't easily pass an array over Opaque. ! $param = $_POST + $_GET; ! ! $deployedPage = stackDeployedList($SESSION->stackSelectedEngine, $param); // problem here ! ! //echo '<pre>'.print_r($deployedPage, 1); ! ! $deployedList = $deployedPage->deployedInstances; $engineName = getEngineName($SESSION->stackSelectedEngine); ! $strtitle = get_string('deployingQuestion', 'qtype_opaque').' '.$param['id'];//.' : '.$engineName.get_string('qEngine', 'qtype_opaque'); ! $navlinks = array(); ! $navlinks[] = array('name' => get_string('StackQuestions', 'qtype_opaque', ''), 'link' => 'stackQuestionList.php', 'type' => 'title'); ! $navlinks[] = array('name' => $strtitle, 'link' => '', 'type' => 'title'); ! $navigation = build_navigation($navlinks); print_header_simple($strtitle, '', $navigation, '', $deployedPage->head); *************** *** 80,111 **** print_heading($strtitle); ! echo $deployedPage->xhtml; - $deployedList = $deployedPage->deployedInstances; if($deployedList == NULL) { ! echo get_string('noInstances', 'qtype_opaque'); } else { $opts = new stdClass; $opts->noclean = true; ! echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; ! echo '<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="0"> <tbody>'; ! echo '<tr><th>question note</th><th>Operations</th></tr>'; foreach($deployedList as $instance) { ! echo '<tr> ! <td>'.format_text($instance->qNote, FORMAT_MOODLE, $opts).'</td> ! <td>' . ! '<a href="stackDeploy.php?id='.$param['id'].'&drop='.$instance->id.'" >Drop</a> ' . ! '<a href="stackSessionPage.php?page=try&id='.$param['id'].'&instance='.$instance->id.'&seed='.$instance->seed.'" />Try</a></td> ! </tr>'; } echo '</tbody></table>'; echo '</form>'; } --- 143,196 ---- print_heading($strtitle); + echo "<form method='POST' action='?id=".$_GET['id']."'>"; + echo "<div class='mdl-align'>".$deployedPage->xhtml."</div>"; // may include form fields ! //echo " <input type='checkbox' name='autoprime' checked='checked'> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); ! //echo " <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('stackDeploy_autoprime', 'qtype_opaque'); if($deployedList == NULL) { ! // nothing required: ! echo '<p class="mdl-align">'.get_string('noInstances', 'qtype_opaque').'</p>'; } else { + echo '<p>'.get_string('nodeployed', 'qtype_opaque').': '.count($deployedList); + $opts = new stdClass; $opts->noclean = true; + $opts->para = false; ! // form starts with $deployedPage->xhtml (!) echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; ! echo '<table style="text-align: left;" width="100%" border="0" cellpadding="5" cellspacing="0"> <tbody>'; ! echo '<tr>'; ! echo '<th class="header"><input type="checkbox" onclick="c=this.checked;$(\'.groupCB\').each(function() {this.checked = c})"></th>'; ! echo '<th align="center" class="header">'.get_string('actions', 'qtype_opaque').'</th>'; ! echo '<th class="header">'.get_string('qNote', 'qtype_opaque').'</th>'; ! //echo '<th align="center" class="header">'.get_string('stackDeploy_primed?', 'qtype_opaque').'</th>'; ! echo '</tr>'; ! $i = 0; foreach($deployedList as $instance) { ! if($i++ % 2 == 0) echo '<tr class="even">'; ! else echo '<tr class="odd">'; ! ! echo '<td><input type="checkbox" name="instances['.$instance->id.']" class="groupCB"></td>'; ! echo '<td align="center">' . ! '<a href="stackSessionPage.php?page=try&id='.$param['id'].'&instance='.$instance->id.'&seed='.$instance->seed.'" /><img alt="'.get_string('preview', 'qtype_opaque').'" title="'.get_string('preview', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/preview.gif" /></a> '. ! //'<a href="stackDeploy.php?id='.$param['id'].'&prime='.$instance->id.'"><img alt="'.get_string('primed?', 'qtype_opaque').'" title="'.get_string('prime', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/go.gif" /></a> '. ! '<a onclick="return confirm(\''.get_string('confirmUndeploy', 'qtype_opaque').'\')" href="stackDeploy.php?id='.$param['id'].'&drop='.$instance->id.'" ><img alt="'.get_string('undeploy', 'qtype_opaque').'" title="'.get_string('undeploy', 'qtype_opaque').'" src="'.$CFG->wwwroot.'/pix/t/delete.gif" /></a></td>'; ! $qID = 'q'.$instance->id; ! $previewBox = ' <a href="javascript:;" onClick="$(\'#'.$qID.'\').slideToggle(\'fast\')" /><small>'.get_string('stackDeploy_showStem', 'qtype_opaque').'</small></a><div style="clear:both; border:#999 solid 1px; display:none; padding:10px" id="'.$qID.'">'.$instance->xhtml; ! echo '<td align="left">'.format_text($instance->qNote.$previewBox.'</div>', FORMAT_MOODLE, $opts).'</td>'; ! //echo '<td align="center">'.($instance->isPrimed ? '<img alt="'.get_string('primed', 'qtype_opaque').'." src="'.$CFG->wwwroot.'/pix/i/tick_green_small.gif" />':'').'</td>'; ! echo '</tr>'; } echo '</tbody></table>'; + echo '<a href="javascript:;" onclick="$(\'.groupCB\').click()">'.get_string('invertSelection', 'qtype_opaque').'</a><br /><b>'.get_string('withSelected', 'qtype_opaque').':</b>'; + echo '<input type="submit" value="'.get_string('stackDeploy_button_undeploy', 'qtype_opaque').'" name="submit" Xonclick="return confirm(\''.get_string('confirmUndeploy','qtype_opaque').'\')" />'; + //echo '<input type="submit" value="'.get_string('stackDeploy_button_prime', 'qtype_opaque').'" name="submit" />'; echo '</form>'; } Index: stackQuestionList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackQuestionList.php,v retrieving revision 1.33 retrieving revision 1.33.2.1 diff -C2 -d -r1.33 -r1.33.2.1 *** stackQuestionList.php 22 Oct 2009 17:37:56 -0000 1.33 --- stackQuestionList.php 22 Nov 2010 23:05:52 -0000 1.33.2.1 *************** *** 13,16 **** --- 13,17 ---- * * @author Jonathan Hart (j.p...@bh...) + * @author Simon Hammond (s.h...@bh...) * @copyright © 2007 University of Birmingham * @license http://www.gnu.org/copyleft/gpl.html GNU Public License *************** *** 49,52 **** --- 50,54 ---- $questionPage = stackQuestionList($SESSION->stackSelectedEngine, $param); + //echo "<pre>".print_r($questionPage, 1)."</pre>"; $engineName = getEngineName($SESSION->stackSelectedEngine); *************** *** 55,82 **** print_header_simple($strtitle, '', $strtitle, '', $questionPage->head); print_box_start(); ! print_heading($strtitle); ! ! ! /*echo '<pre>'; ! var_dump($questionPage); ! echo '</pre>';*/ //$url = getStackURL($SESSION->stackSelectedEngine); $docsUrl = 'http://stack.bham.ac.uk/wiki/index.php/Main_Page'; ! echo '<div class="section80"> ! <h3 class="section">'.get_string('addquestion', 'qtype_opaque').'</h3> ! <ul class="horizontal"> ! ! <li><a href="stackAuthor.php?id=new">'.get_string('newQ', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=import">'.get_string('import', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=chat">'.get_string('chat', 'qtype_opaque').'</a></li> ! <li><a href="soapPage.php?page=search">'.get_string('search', 'qtype_opaque').'</a></li> ! <li><a href="stackSessionPage.php?page=report">'.get_string('reports', 'qtype_opaque').'</a></li> ! <!--<li><a href="soapPage.php?page=optionsEditor">'.get_string('stackOptions', 'qtype_opaque').'</a></li>--> ! <li><a href="'.$docsUrl.'">Stack Documentation</a></li> ! ! </ul> ! </div>'; $questionList = $questionPage->questionItems; --- 57,72 ---- print_header_simple($strtitle, '', $strtitle, '', $questionPage->head); print_box_start(); ! //print_heading($strtitle); //$url = getStackURL($SESSION->stackSelectedEngine); $docsUrl = 'http://stack.bham.ac.uk/wiki/index.php/Main_Page'; ! echo '<a href="stackAuthor.php?id=new">'.get_string('newQ', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=import">'.get_string('import', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=chat">'.get_string('chat', 'qtype_opaque').'</a> | ! <a href="soapPage.php?page=search">'.get_string('search', 'qtype_opaque').'</a> | ! <a href="stackSessionPage.php?page=report">'.get_string('reports', 'qtype_opaque').'</a> | ! <!--<li><a href="soapPage.php?page=optionsEditor">'.get_string('stackOptions', 'qtype_opaque').'</a>--> ! <a href="'.$docsUrl.'">Stack Documentation</a>'; $questionList = $questionPage->questionItems; *************** *** 90,105 **** } ! if($questionList == NULL && !isset($_POST['filter'])) ! { echo '<h3>'.get_string('myQuestions','qtype_opaque').'</h3>'; echo ''.get_string('noQuestions', 'qtype_opaque').''; } ! else ! { echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; /*echo '<pre>'; var_dump($questionList); ! echo '</pre>';*/ // Filter echo "<p>".count($questionList).' '.get_string('question(s)', 'qtype_opaque')." <input type='text' id='filter' name='filter' value='". --- 80,171 ---- } ! if($questionList == NULL && !isset($_POST['filter'])) { echo '<h3>'.get_string('myQuestions','qtype_opaque').'</h3>'; echo ''.get_string('noQuestions', 'qtype_opaque').''; } ! ! else { ! // tot up keywords ! $kwFreq = array(); ! if(!empty($questionList)) { ! foreach($questionList as $q) { ! if(!empty($q->keywords)) { ! foreach($q->keywords as $kw) { ! if(!isset($kwFreq[$kw])) $kwFreq[$kw] = 1; ! else $kwFreq[$kw]++; ! } ! } ! } ! } ! ! ksort($kwFreq); // sort keywords alphanumerically but still case-sensitive ! $kws = array_keys($kwFreq); ! echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">'; /*echo '<pre>'; var_dump($questionList); ! echo '</pre>';//*/ ! ! if(!empty($questionPage->keywords)) { ! // List ALL used keywords ! echo get_string('keywords', 'qtype_opaque').": <a href='stackQuestionList.php'>" . ! (isset($_GET['keywords'])?'*':'<b>*</b>') . ! "</a>, "; ! $firstKeyword = true; ! //foreach($kwFreq as $kw => $freq) { ! $i = 1; ! foreach($questionPage->keywords as $kw) { ! if(!$firstKeyword) { ! echo ', '; ! } else $firstKeyword = false; ! $kwLink = "<a href='?keywords=$kw'>$kw</a>"; ! echo isset($_GET['keywords']) && in_array($kw, $kws) ? "<b>$kwLink</b>": $kwLink; ! if($i++ == 50) { ! echo "<span onmouseover='$(this).hide();$(this).next().show()'>, <b>more...</b></span></a><span style='display:none' class='moreTags'>"; ! } ! } ! if(!$firstKeyword) echo '.'; ! ! if($i > 50) echo "</span>";// closing moretags ! ! if (count($kwFreq) > 0) { ! // keywords associated with given keyword ! if(isset($_GET['keywords'])) { ! echo "<p>".get_string('keywordsRelatedTo', 'qtype_opaque')." <b>".$_GET['keywords']."</b>: "; ! ! $firstKeyword = true; ! foreach($kwFreq as $kw => $freq) { ! //foreach($questionPage->keywords as $kw) { ! if(!$firstKeyword && $_GET['keywords'] != $kw) { ! echo ', '; ! } else $firstKeyword = false; ! ! $kwLink = "<a title='$freq' href='?keywords=$kw'>$kw</a>"; ! //$kwLink = "<a href='?keywords=$kw'>$kw</a>"; ! echo $_GET['keywords'] == $kw ? '': $kwLink; ! } ! if(!$firstKeyword) echo '.'; ! } else if (!empty($kwFreq)) { ! // most common keywords ! arsort($kwFreq); ! $toShow = 10; ! echo "<p>".get_string('mostCommonKeywords', 'qtype_opaque').": "; ! $firstKeyword = true; ! foreach($kwFreq as $kw => $freq) { ! //foreach($questionPage->keywords as $kw) { ! if(!$firstKeyword) { ! echo ', '; ! } else $firstKeyword = false; + $kwLink = "<a title='$freq' href='?keywords=$kw'>$kw</a>"; + echo $kwLink; + $toShow--; + if($toShow <= 0) break; + } + if(!$firstKeyword) echo '.'; + } + } + } + //*/ // Filter echo "<p>".count($questionList).' '.get_string('question(s)', 'qtype_opaque')." <input type='text' id='filter' name='filter' value='". *************** *** 108,124 **** (isset($_POST['casesensitive'])?"checked='checked'":'')."> ".get_string('caseSensitive', 'qtype_opaque')."<p>"; echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="4px" cellspacing="0"> <tbody> ! <tr><td></td>'; ! ! /*echo '<pre>'; ! var_dump($questionList); ! echo '</pre>';*/ ! $tableHeadings['id'] = '<th class="header"><a href="stackQuestionList.php?sortBy=id&sortOrder=dec">'.get_string('id', 'qtype_opaque').'</a></th>'; ! $tableHeadings['name'] = '<th class="header"><a href="stackQuestionList.php?sortBy=name&sortOrder=asc">'.get_string('name', 'qtype_opaque').'</a></th>'; ! $tableHeadings['description'] = '<th class="header"><a href="stackQuestionList.php?sortBy=description&sortOrder=asc">'.get_string('description', 'qtype_opaque').'</a></th>'; ! $tableHeadings['valid'] = '<th class="header"><a href="stackQuestionList.php?sortBy=valid&sortOrder=asc">'.get_string('valid', 'qtype_opaque').'</a></th>'; ! $tableHeadings['nodeployed'] = '<th class="header" nowrap><a href="stackQuestionList.php?sortBy=nodeployed&sortOrder=asc">'.get_string('nodeployed', 'qtype_opaque').'</a></th>'; $tableHeadings['published'] = '<th class="header"><a href="stackQuestionList.php?sortBy=published&sortOrder=asc">'.get_string('published', 'qtype_opaque').'</a></th>'; $tableHeadings['dateEdited'] = '<th class="header"><a href="stackQuestionList.php?sortBy=dateEdited&sortOrder=asc">'.get_string('dateEdited', 'qtype_opaque').'</a></th>'; --- 174,204 ---- (isset($_POST['casesensitive'])?"checked='checked'":'')."> ".get_string('caseSensitive', 'qtype_opaque')."<p>"; + // keywords associate with given filter + if(isset($_POST['filter']) && !empty($_POST['filter'])) { + echo "<p>".get_string('keywordsRelatedTo', 'qtype_opaque')." '".$_POST['filter']."': "; + + $firstKeyword = true; + foreach($kwFreq as $kw => $freq) { + //foreach($questionPage->keywords as $kw) { + if(!$firstKeyword) { + echo ', '; + } else $firstKeyword = false; + + echo "<a title='$freq' href='?keywords=$kw'>$kw</a>"; + } + if(!$firstKeyword) echo '.'; + } + echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="4px" cellspacing="0"> <tbody> ! <tr><th class="header">'; ! ?> ! <input type="checkbox" onclick="c=this.checked;$('.groupingCheckbox').each(function() {this.checked = c})"> ! <?php ! echo '</th>'; ! $tableHeadings['name'] = '<th class="header"><a href="stackQuestionList.php?sortBy=name&sortOrder=asc">'.get_string('name', 'qtype_opaque').'</a>: <span style="font-weight: normal">'.get_string('description', 'qtype_opaque').' <small>'.get_string('keywords', 'qtype_opaque').'</small></span></th>'; ! $tableHeadings['valid'] = '<th class="header"><a href="stackQuestionList.php?sortBy=valid&sortOrder=asc">'.get_string('valid', 'qtype_opaque').'</a></th>'; ! $tableHeadings['nodeployed'] = '<th class="header" nowrap><a href="stackQuestionList.php?sortBy=nodeployed&sortOrder=asc"><abbr title="'.get_string('nodeployed', 'qtype_opaque').'">#</abbr></a></th>'; $tableHeadings['published'] = '<th class="header"><a href="stackQuestionList.php?sortBy=published&sortOrder=asc">'.get_string('published', 'qtype_opaque').'</a></th>'; $tableHeadings['dateEdited'] = '<th class="header"><a href="stackQuestionList.php?sortBy=dateEdited&sortOrder=asc">'.get_string('dateEdited', 'qtype_opaque').'</a></th>'; *************** *** 153,156 **** --- 233,237 ---- $opts = new stdClass; $opts->noclean = true; + $opts->para = false; for($i=0; $i < count($questionList); $i++) *************** *** 160,167 **** echo '<td><input type="checkbox" class="groupingCheckbox" name="'.$questionList[$i]->id.'" value="selected" /></td>'; ! echo '<td>'.$questionList[$i]->id.'</td> ! <td>'.$questionList[$i]->name.'</td>' . ! '<td>'.$questionList[$i]->description.'</td>'; ! //'<td>'.format_text($questionList[$i]->description, FORMAT_MOODLE, $opts).'</td>'; echo '<td align="center">'; --- 241,261 ---- echo '<td><input type="checkbox" class="groupingCheckbox" name="'.$questionList[$i]->id.'" value="selected" /></td>'; ! //echo '<td>'.$questionList[$i]->id.'.'.$questionList[$i]->version.'</td>'; ! echo '<td><b>'.$questionList[$i]->name.'</b>: '.format_text($questionList[$i]->description, FORMAT_MOODLE, $opts); ! if(!empty($questionList[$i]->keywords)) { ! echo '<br /><small>'; ! $keywords = $questionList[$i]->keywords; ! asort($keywords); ! $firstKeyword = true; ! foreach($keywords as $keyword) { ! if(!$firstKeyword) { ! echo ', '; ! } else $firstKeyword = false; ! $kwLink = "<a href='?keywords=$keyword'>".$keyword."</a>"; ! echo $kwLink; ! } ! echo '</small>'; ! } ! echo '</td>'; echo '<td align="center">'; *************** *** 229,233 **** <tbody> <tr> - <td>'.get_string('id', 'qtype_opaque').'</td> <td>'.get_string('name', 'qtype_opaque').'</td> <td>'.get_string('description', 'qtype_opaque').'</td> --- 323,326 ---- *************** *** 244,261 **** else echo '<tr class="odd">'; ! echo '<td>'.$questionList[$i]->id.'</td> ! <td>'.$questionList[$i]->name.'</td> <td>'.$questionList[$i]->description.'</td>'; if($questionList[$i]->valid == 1) { ! echo '<td>1</td>'; } else { ! echo '<td>0</td>'; } ! echo '<td>'.$questionList[$i]->dateEdited.'</td>'; echo '<td>'; if(!empty($questionList[$i]->moodleCategories)) --- 337,354 ---- else echo '<tr class="odd">'; ! //echo '<td>'.$questionList[$i]->id.'</td> ! echo '<td>'.$questionList[$i]->name.'</td> <td>'.$questionList[$i]->description.'</td>'; if($questionList[$i]->valid == 1) { ! echo '<img alt="1" src="'.$CFG->wwwroot.'/pix/i/tick_green_small.gif" />'; } else { ! echo '<img alt="0" src="'.$CFG->wwwroot.'/pix/i/cross_red_small.gif" />'; } ! echo '<td>'.formatDate($questionList[$i]->dateEdited).'</td>'; echo '<td>'; if(!empty($questionList[$i]->moodleCategories)) *************** *** 270,274 **** } } ! } echo '</td>'; global $USER; --- 363,369 ---- } } ! } else { ! echo get_string('noCategories', 'qtype_opaque'); ! } echo '</td>'; global $USER; *************** *** 288,293 **** if($questionPage->questionItems != NULL) { ! //echo '<br/><a href="javascript:;" onclick="toggleSelection()">invert selection</a>'; ! echo '<br /> <input type="radio" name="selectall" onclick="selectAll(this.form,0);" />Select all<input type="radio" name="selectall" onclick="selectAll(this.form,1);" />Inverse selection'; echo '<br /><h4>'.get_string('withSelected', 'qtype_opaque').'</h4>'; echo '<input type="submit" value="Delete" name="Submit" class="stackbutton" onclick="return confirm(\''.get_string('confirmDeletion','qtype_opaque').'\')" /> <input type="submit" value="Export" name="Submit" class="stackbutton" /> <input type="submit" value="Validate" name="Submit" />'; --- 383,387 ---- if($questionPage->questionItems != NULL) { ! echo '<a href="javascript:;" onclick="$(\'.groupingCheckbox\').click()">'.get_string('invertSelection', 'qtype_opaque').'</a>'; echo '<br /><h4>'.get_string('withSelected', 'qtype_opaque').'</h4>'; echo '<input type="submit" value="Delete" name="Submit" class="stackbutton" onclick="return confirm(\''.get_string('confirmDeletion','qtype_opaque').'\')" /> <input type="submit" value="Export" name="Submit" class="stackbutton" /> <input type="submit" value="Validate" name="Submit" />'; *************** *** 303,310 **** if(!empty($catList)) { ! echo '<span class="relatedBox"><input type="submit" value="Move to Moodle Question Bank:" name="Submit"> '; echo $catList; echo '</span>'; ! } echo '<input type="hidden" name="stackEngine" value="'.$SESSION->stackSelectedEngine.'" />'; --- 397,406 ---- if(!empty($catList)) { ! echo '<p /><span class="relatedBox"><input type="submit" value="Move to Moodle Question Bank:" name="Submit"> '; echo $catList; echo '</span>'; ! } else { ! echo get_string('noCategories', 'qtype_opaque'); ! } echo '<input type="hidden" name="stackEngine" value="'.$SESSION->stackSelectedEngine.'" />'; Index: soapPage.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/soapPage.php,v retrieving revision 1.14 retrieving revision 1.14.4.1 diff -C2 -d -r1.14 -r1.14.4.1 *** soapPage.php 23 Jun 2009 16:18:28 -0000 1.14 --- soapPage.php 22 Nov 2010 23:05:52 -0000 1.14.4.1 *************** *** 33,37 **** redirect('stackEngineSelector.php?return=soapPage.php?page='.$param['page']); } ! if($pageRequest != 'chat') //caschat pages don't need permissions { --- 33,37 ---- redirect('stackEngineSelector.php?return=soapPage.php?page='.$param['page']); } ! if($pageRequest != 'chat' && $pageRequest != 'diagnostic') //caschat/diagnostic pages don't need permissions { Index: stackLib.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackLib.php,v retrieving revision 1.17 retrieving revision 1.17.4.1 diff -C2 -d -r1.17 -r1.17.4.1 *** stackLib.php 23 Jun 2009 16:18:28 -0000 1.17 --- stackLib.php 22 Nov 2010 23:05:52 -0000 1.17.4.1 *************** *** 310,313 **** --- 310,317 ---- $values[] = $USER->id; } + + $keys[] = 'engineID'; + $values[] = $engineID; + $passkey = stackGetPassKey($engineID, $USER->id); *************** *** 319,323 **** /** ! * Drops an instance (or version) of a question given its cache ID. * * @param int engineID --- 323,327 ---- /** ! * Drops an instance of a question given its cache ID. * * @param int engineID *************** *** 359,363 **** /** ! * Drops an instance (or version) of a question given its cache ID. * * @param int engineID --- 363,407 ---- /** ! * Undeploys a question version. ! * ! * @param int engineID ! * @param int id ! */ ! function stackUndeployVersion($engineID, $param) ! { ! $engine = load_engine_def($engineID); ! if(is_string($engine)) ! { ! echo $engine; //error occured. ! } ! else ! { ! $connection = connect_to_engine($engine); ! if (is_string($connection)) ! { ! echo $connection; ! } ! ! global $USER; ! $keys[] = 'userID'; ! $values[] = $USER->id; ! ! $keys[] = 'id'; ! $values[] = $param['id']; ! ! $passkey = stackGetPassKey($engineID, $USER->id); ! ! $keys[] = 'operation'; ! $values[] = 'undeploy'; ! ! $keys[] = 'version'; ! $values[] = $param['version']; ! ! echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); ! } ! } ! ! /** ! * Adds an instance (or version) of a question. * * @param int engineID *************** *** 394,398 **** $values[] = $param['number']; ! //echo "param in AddInstances: ".print_r($param, true); echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); --- 438,483 ---- $values[] = $param['number']; ! $keys[] = 'autoprime'; ! $values[] = $param['autoprime']; ! ! echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); ! } ! } ! ! /** ! * Primes an instance of a question. ! * ! * @param int engineID ! * @param int id ! */ ! function stackPrimeInstance($engineID, $param) ! { ! $engine = load_engine_def($engineID); ! if(is_string($engine)) ! { ! echo $engine; //error occured. ! } ! else ! { ! $connection = connect_to_engine($engine); ! if (is_string($connection)) ! { ! echo $connection; ! } ! ! global $USER; ! $keys[] = 'userID'; ! $values[] = $USER->id; ! ! $keys[] = 'id'; ! $values[] = $param['id']; ! ! $passkey = stackGetPassKey($engineID, $USER->id); ! ! $keys[] = 'operation'; ! $values[] = 'prime'; ! ! $keys[] = 'instance'; ! $values[] = $param['instance']; echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); *************** *** 400,403 **** --- 485,575 ---- } + + /** + * Replaces one deployment to the Moodle quesiton bank with another. + * + * @param array + */ + function stackUpdateDeployment($engineID, $param) { + $engine = load_engine_def($engineID); + if(is_string($engine)) + { + echo $engine; //error occured. + } + else + { + $connection = connect_to_engine($engine); + if (is_string($connection)) + { + echo $connection; + } + + global $USER; + $keys[] = 'userID'; + $values[] = $USER->id; + + $keys[] = 'id'; + $values[] = $param['id']; + + $passkey = stackGetPassKey($engineID, $USER->id); + + $keys[] = 'operation'; + $values[] = 'update'; + + $keys[] = 'prior'; + $values[] = $param['prior']; + + $keys[] = 'number'; + $values[] = $param['number']; + + $keys[] = 'category'; + $values[] = $param['category']; + + $keys[] = 'engineID'; + $values[] = $engineID; + + echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); + } + } + + + function stackMoveDeployment($engineID, $param) { + + $engine = load_engine_def($engineID); + if(is_string($engine)) + { + echo $engine; //error occured. + } + else + { + $connection = connect_to_engine($engine); + if (is_string($connection)) + { + echo $connection; + } + + global $USER; + $keys[] = 'userID'; + $values[] = $USER->id; + + $keys[] = 'id'; + $values[] = $param['id']; + + $passkey = stackGetPassKey($engineID, $USER->id); + + $keys[] = 'operation'; + $values[] = 'move'; + + $keys[] = 'category'; + $values[] = $param['category']; + + $keys[] = 'engineID'; + $values[] = $engineID; + + echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); + } + } + + /** * Returns the name of the engine from its id *************** *** 600,606 **** { ! ereg('([0-9]*):([0-9]*) ([0-9]*)/([0-9]*)/([0-9]*)',$value->dateEdited, $time); ! ! $ts = mktime($time[1], $time[2], 0, $time[4],$time[3],$time[5]); //works on UK dates only. TODO generate date based of Moodle settings --- 772,776 ---- { ! preg_match('|([0-9]*):([0-9]*) ([0-9]*)/([0-9]*)/([0-9]*)|',$value->dateEdited, $time); $ts = mktime($time[1], $time[2], 0, $time[4],$time[3],$time[5]); //works on UK dates only. TODO generate date based of Moodle settings *************** *** 641,643 **** --- 811,820 ---- } + function formatDate($date) { + preg_match('|([0-9]*):([0-9]*) ([0-9]*)/([0-9]*)/([0-9]*)|',$date, $time); + $ts = mktime($time[1], $time[2], 0, $time[4],$time[3],$time[5]); //works on UK dates only. TODO generate date based of Moodle settings + if($ts < strtotime('00:00')) return date('j M Y', $ts); + else return date('g:ia', $ts); + } + ?> \ No newline at end of file |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:01
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack_diagnostic/images In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/stack_diagnostic/images Added Files: Tag: question_reporting readme.txt warning.png readme.html Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: warning.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: readme.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- Document HEAD --> <head> <title>famfamfam.com: Silk Icons</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="mssmarttagspreventparsing" content="true" /> <meta name="robots" content="all" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="author" content="Mark James" /> <meta name="copyright" content="Mark James" /> <meta name="revisit-after" content="7 days" /> <style type="text/css"> [...1456 lines suppressed...] <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr></table> </p> </div><!-- /content_inner --> <!-- A break! --> <br class="clear" /> </div><!-- /content_outer --> </div><!-- /container_inner --> </div><!-- /container_outer --> </body> </html> --- NEW FILE: readme.txt --- Silk icon set 1.3 _________________________________________ Mark James http://www.famfamfam.com/lab/icons/silk/ _________________________________________ This work is licensed under a Creative Commons Attribution 2.5 License. [ http://creativecommons.org/licenses/by/2.5/ ] This means you may use it for any purpose, and make any changes you like. All I ask is that you include a link back to this page in your credits. Are you using this icon set? Send me an email (including a link or picture if available) to mj...@gm... Any other questions about this icon set please contact mj...@gm... |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:01
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/lang/en_utf8 In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/opaque/moodleModule/opaque/lang/en_utf8 Modified Files: Tag: question_reporting qtype_opaque.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: qtype_opaque.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/lang/en_utf8/qtype_opaque.php,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -C2 -d -r1.20 -r1.20.2.1 *** qtype_opaque.php 22 Oct 2009 17:37:56 -0000 1.20 --- qtype_opaque.php 22 Nov 2010 23:05:53 -0000 1.20.2.1 *************** *** 64,69 **** $string['noQuestions'] = 'No available Questions'; $string['question(s)'] = 'question(s)'; ! $string['id'] = 'Id'; $string['name'] = 'Name'; $string['description'] = 'Description'; $string['valid'] = 'Valid'; --- 64,73 ---- $string['noQuestions'] = 'No available Questions'; $string['question(s)'] = 'question(s)'; ! $string['id.v'] = 'id.v';// see below ! $string['id.version'] = 'Id.revision'; $string['name'] = 'Name'; + $string['keywords'] = 'keywords'; + $string['keywordsRelatedTo'] = 'Keywords related to'; + $string['mostCommonKeywords'] = 'Most common keywords'; $string['description'] = 'Description'; $string['valid'] = 'Valid'; *************** *** 71,85 **** $string['preview'] = 'Preview'; $string['deploy'] = 'Deploy'; ! $string['nodeployed'] = "# dep'd"; $string['actions'] = 'Actions'; $string['export'] = 'Export'; ! $string['delete'] = 'Delete'; ! $string['confirmDeletion'] = 'Are you sure you want to delete?'; $string['caseSensitive'] = 'case sensitive'; ! $string['withSelected'] = 'With Selected'; $string['xml'] = 'XML'; $string['qAvailable'] = 'Questions available from '; ! $string['instantiationsOf'] = 'Instantiations of question '; $string['noInstances'] = 'No instances have been deployed'; $string['qEngine'] = ' question engine'; $string['selectEngine'] = 'Please select a Stack Question Engine to work with.'; --- 75,96 ---- $string['preview'] = 'Preview'; $string['deploy'] = 'Deploy'; ! $string['deployingQuestion'] = 'Deploying question'; ! $string['prime'] = 'Prime'; ! $string['nodeployed'] = 'Number deployed'; $string['actions'] = 'Actions'; $string['export'] = 'Export'; ! $string['delete'] = 'Delete'; // still used? ! $string['undeploy'] = 'Undeploy'; ! $string['confirmUndeploy'] = 'Are you sure you want to undeploy?'; // for dropping versions ! $string['confirmDeletion'] = 'Are you sure you want to delete?'; // for dropping lines $string['caseSensitive'] = 'case sensitive'; ! $string['invertSelection'] = 'invert selection'; ! $string['withSelected'] = 'With selected'; $string['xml'] = 'XML'; $string['qAvailable'] = 'Questions available from '; ! $string['instancesOf'] = 'Instances of question version '; $string['noInstances'] = 'No instances have been deployed'; + $string['noCategories'] = 'No categories available: please create a quiz for this Moodle site.'; + $string['qNote'] = 'Question note'; $string['qEngine'] = ' question engine'; $string['selectEngine'] = 'Please select a Stack Question Engine to work with.'; *************** *** 118,121 **** --- 129,133 ---- $string['stackAuthor_button_exportXML'] = 'Save & export as XML'; $string['stackAuthor_button_addPR'] = 'Add'; + $string['stackAuthor_finish_reminder'] = '<b>Remember:</b> Finish Authoring with button at bottom of page.'; $string['stackImport_button_Import'] = 'Import'; $string['stackQuestionList_filter'] = 'Filter'; *************** *** 125,130 **** $string['stackQuestionList_updateStatus'] = 'Update Status'; $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; ! //get_string('', 'qtype_opaque') ! ?> \ No newline at end of file --- 137,149 ---- $string['stackQuestionList_updateStatus'] = 'Update Status'; $string['stackAuthor_button_exportAsXml'] = 'Export as XML'; ! $string['stackDeploy_autoprime'] = 'automatically prime'; ! $string['stackDeploy_showStem'] = 'show/hide stem'; ! $string['stackDeploy_primed?'] = 'Primed?'; ! $string['stackDeploy_button_undeploy'] = 'Undeploy'; ! $string['stackDeploy_button_prime'] = 'Prime'; ! $string['stackDeploy_button_update'] = 'Update'; // MUST match up with $string['stackDeploy_button_update'] in stack.php ! $string['stackDeploy_button_moveTo'] = 'Move to'; // MUST match up with FE_deployQuestion_moveTo in stack.php + //diagnostic + $string['diagnostic'] = 'Diagnostic Report'; ?> \ No newline at end of file |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:01
|
Update of /cvsroot/stack/stack-dev/install/update/updates In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/install/update/updates Added Files: Tag: question_reporting TwoPointTwo.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. --- NEW FILE: TwoPointTwo.php --- <?php /** * * Welcome to STACK. A system for teaching and assessment using a * computer algebra kernel. * * This file is licensed under the GPL License. * * A copy of the license is in your STACK distribution called * license.txt. If you are missing this file you can obtain * it from: * http://www.stack.bham.ac.uk/license.txt * * @package stackUpdate * @author Simon Hammond * */ /** * Updates stack alpha to 2.2. */ global $config; $root = $config->get('docroot'); require_once($root.'/lib/error.php'); require_once($root.'/lib/items/Item.php'); require_once($root.'/lib/items/QuestionPart.php'); require_once($root.'/lib/database/StackDBItem.php'); require_once($root.'/other/adodb5/adodb.inc.php'); require_once($root.'/lib/database/StackDBADOdb.php'); class TwoPointTwo{ private $errorLog; public function __construct(&$errorLog) { $this->errorLog = $errorLog; } /** * Updates the database */ public function performUpdate() { // Add the new 'question_lines' table global $config; // below from adodbinit.php - expecting to be safer than simple mySQL query: $db = NewADOConnection($config->getDB('dbType')); // Maybe this should be PConnect $db->Connect($config->getDB('host'), $config->getDB('user'), $config->getDB('password'), $config->getDB('database')); $dict = NewDataDictionary($db); // Table structure for table `question_lines` $fields = 'id I(11) UNSIGNED NOTNULL AUTO PRIMARY, latestVersion I(11) UNSIGNED, modified T NOTNULL DEFTIMESTAMP ON UPDATE '.$db->sysTimeStamp; $sqlarray = $dict->CreateTableSQL("question_lines", $fields, ""); if(!$dict->ExecuteSQLArray($sqlarray)) { $toReturn = $dict->ErrorMsg().'<br /><br />'; } // Add 'line' column in stackquestions $conn = new StackDBADOdb(); $conn->connect(); $sqlarray = $dict->AddColumnSQL('stackquestion', 'line I(11) UNSIGNED'); if(!$dict->ExecuteSQLArray($sqlarray)) { $toReturn = $dict->ErrorMsg().'<br /><br />'; } // Create new line for each question, i.e. create row in question_lines and set line with that id. $conn->query('SELECT questionID FROM stackquestion'); // new queries seem to lose prior result so temporarily saving them for($i = 0; $i < $conn->noRows(); $i++) { $qid[] = $conn->result($i, 'questionID'); } for($i = 0; $i < count($qid); $i++) { //insert line for each question $conn->query("INSERT INTO question_lines(latestVersion) VALUES(".$qid[$i].")"); // shortcut: we know sequence of insert ids will be 1,2,3,... i.e. $i // set line id in each question //$conn->query("UPDATE stackquestion SET line=".($i+1)." WHERE questionID=".$qid[$i]); // row indices start at 1 // $item = new Item(NULL, $qid[$i]); // $item->setLine($i+1); // $item->store(); } // update all items for($i = 0; $i < count($qid); $i++) { //$item = new Item(NULL, $qid[$i]); //$item->setLine($i+1); /* echo "<br />post setLine(): "; print_r($item->getLine()); */ // $item->store(); bypassing // we are going to update the questionVariables // get questionVariables field for qID $conn->query("SELECT questionVariables FROM stackquestion where questionID = ".$qid[$i]); $serialisedQV = $conn->result(0, 'questionVariables'); $questionVariables = $conn->base64_unserialize($serialisedQV); $questionVariables['line'] = $i+1; // just changing the relevant field $serialisedQV = $conn->base64_serialize($questionVariables); $sql = "UPDATE stackquestion SET line=".($i+1).", questionVariables=".$conn->dbSafeString($serialisedQV)." WHERE questionID=".$qid[$i]; $conn->query($sql); // row indices start at 1 //echo $sql; // go back and check // $item = new Item(NULL, $qid[$i]); // echo "<br />line stored: "; //print_r($item->getLine()); } //load up each question in turn and set it's line (code from earlier update scripts) /* $db = new StackDBItem(); $db->connect(); $questions = $db->getListOfQuestions(); $i = 0; if(!empty($questions)) { foreach($questions as $question) { $qid = $question['id']; //load the question $item = new Item(NULL, $qid); $item->store(); //save item. $i++; } } //*/ $this->errorLog->addUserError('',$i.' question lines created.'); return true; } } |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:01
|
Update of /cvsroot/stack/stack-dev/lib/database In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/database Modified Files: Tag: question_reporting StackDBMySQL.php MoodleDB.php StackDBReporting.php StackDB.php StackDBItem.php StackDBADOdb.php StackDBAttemptPRTMeta.php devCache.php StackDBBackup.php StackDBCache.php StackDBKeywords.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: MoodleDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/MoodleDB.php,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** MoodleDB.php 27 Aug 2009 16:23:00 -0000 1.14 --- MoodleDB.php 22 Nov 2010 23:05:52 -0000 1.14.2.1 *************** *** 70,78 **** public function batchAdd($questions, $userID, $engineID, $category='1') { if(!empty($questions)) { foreach($questions as $question) { ! $result = $this->addQuestion($question, $userID, $engineID, $category); if($result == false) --- 70,79 ---- public function batchAdd($questions, $userID, $engineID, $category='1') { + $this->logger->debug("busy: $questions, $userID, $engineID, $category"); if(!empty($questions)) { foreach($questions as $question) { ! $result = $this->addQuestion($question, NULL, $userID, $engineID, $category); // line is unchanged if($result == false) *************** *** 106,118 **** * @return bool $return true if successful */ ! public function addQuestion($stackID, $userID, $engineID, $category='1') { global $config; $moodleEnabled = $config->getMoodle('enabled'); if(($moodleEnabled == 'true') && ($engineID != NULL)) //if moodle config is setup { //load up the question from the stack db & grab its name, grade & guid. ! $item = new Item(NULL, $stackID); $itemName = $item->questionName->getSelection(); --- 107,120 ---- * @return bool $return true if successful */ ! public function addQuestion($id, $line, $userID, $engineID, $category='1') { global $config; $moodleEnabled = $config->getMoodle('enabled'); + $this->logger->debug("mycat:".$category." and userid:".$userID); if(($moodleEnabled == 'true') && ($engineID != NULL)) //if moodle config is setup { //load up the question from the stack db & grab its name, grade & guid. ! $item = new Item(NULL, $id); $itemName = $item->questionName->getSelection(); *************** *** 134,144 **** //check whether the question is already in the moodle question bank. ! $inQBank = $this->inMoodleQuestionBank($stackID, $engineID); if($inQBank === false) { //add the question ! return $this->newQuestion($engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } else { //update the question(s) return $this->updateQuestion($inQBank, $engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } --- 136,148 ---- //check whether the question is already in the moodle question bank. ! $inQBank = $this->inMoodleQuestionBank($id, $engineID); if($inQBank === false) { + $this->logger->debug("New question"); //add the question ! return $this->newQuestion($engineID, $userID, $category, $itemID, $line, $itemName, $itemMaxMark, $itemGUID); } else { //update the question(s) + $this->logger->debug("Updating question in $inQBank"); return $this->updateQuestion($inQBank, $engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } *************** *** 152,156 **** /** ! * Updates a question already in the moodle question bank * * @param int $qID moodle's question id --- 156,160 ---- /** ! * Updates a question already in the moodle question bank. * * @param int $qID moodle's question id *************** *** 163,167 **** protected function updateQuestion($qID, $engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->finer("Updating item $stackID to Moodles database"); global $config; $prefix = $config->getMoodle('prefix'); --- 167,172 ---- protected function updateQuestion($qID, $engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->debug("Updating item $stackID to Moodles database"); ! global $config; $prefix = $config->getMoodle('prefix'); *************** *** 188,191 **** --- 193,208 ---- $result = false; } + + $sql = "UPDATE {$prefix}question_opaque SET + remoteid = ".$this->dbSafeString('q'.$stackID).", + WHERE questionid = $id"; + + $result = $this->query($sql); + if(!$result){ + $this->logger->error("Failed to add the question to the opaque_questions table"); + } + else{ + $this->logger->finer("Added to opaque_questions table"); + } } return true; *************** *** 203,210 **** * @return bool */ ! protected function newQuestion($engineID, $userID, $category, $stackID, $qName, $qMaxMark, $qGUID) { ! $this->logger->finer("Adding item $stackID to Moodles database"); ! $stackID = 'q'.$stackID; global $config; $prefix = $config->getMoodle('prefix'); --- 220,231 ---- * @return bool */ ! protected function newQuestion($engineID, $userID, $category, $versionID, $lineID, $qName, $qMaxMark, $qGUID) { ! if($lineID == NULL) $lineID = 12345; ! ! $this->logger->debug("Adding item $versionID (line $lineID) to Moodles database by user: $userID"); ! ! ! global $config; $prefix = $config->getMoodle('prefix'); *************** *** 235,239 **** $category, 0, ".$this->dbSafeString($qName)." , ".$this->dbSafeString('').", 0, ".$this->dbSafeString('').", ".$this->dbSafeString('').", $qMaxMark, 0,".$this->dbSafeString(QTYPE).", 1, ".$this->dbSafeString($qGUID).", ".$this->dbSafeString($timestamp).", 0, $timestamp, $timestamp, $userID );"; ! $this->connectMoodleDB(); $added = $this->query($sql); --- 256,260 ---- $category, 0, ".$this->dbSafeString($qName)." , ".$this->dbSafeString('').", 0, ".$this->dbSafeString('').", ".$this->dbSafeString('').", $qMaxMark, 0,".$this->dbSafeString(QTYPE).", 1, ".$this->dbSafeString($qGUID).", ".$this->dbSafeString($timestamp).", 0, $timestamp, $timestamp, $userID );"; ! $this->logger->finer("trying adding to moodle question bank with sql: $sql"); $this->connectMoodleDB(); $added = $this->query($sql); *************** *** 253,257 **** remoteversion ) ! VALUES ( $qid, $engineID, ".$this->dbSafeString($stackID).", ".$this->dbSafeString('1.0').");"; $result = $this->query($sql); --- 274,278 ---- remoteversion ) ! VALUES ( $qid, $engineID, ".$this->dbSafeString('q'.$versionID).", ".$this->dbSafeString($lineID.'.'.$versionID).");"; // some redundancy for now until versioning get more sophisticated, e.g. with milestones $result = $this->query($sql); *************** *** 312,315 **** --- 333,372 ---- } + /** + * Attempts to remove a stack question from moodle's question bank. Return success status. + * + * @param int $engineID Opaque engine id + * @param int $stackID The id of the question on stack. + * @access public + * @return bool + */ + public function hideQuestion($stackID, $engineID) + { + $this->logger->debug("attempting to hide stack question $stackID on engine $engineID"); + // find moodle question id + $moodleQuestions = $this->inMoodleQuestionBank($stackID, $engineID); // an array + + if(empty($moodleQuestions)) { + $this->logger->debug("STACK question $stackID does not appear to be in Moodle question bank"); + return false; + } + + // remove, i.e. set hidden flag to 1 + if(count($moodleQuestions) > 1) { + $where = "id IN (".implode($moodleQuestions).")"; //multiple questions + } + else { + $where = "id = ".$moodleQuestions[0]; // single question + } + + $sql = "UPDATE {$prefix}question SET hidden=1 WHERE ".$where; + + $this->connect(); + $result = $this->query($sql); + + $this->logger->debug("Query ".$sql."\n\n Returned".print_r($result,true)); + //$no = $this->noRows(); + } + /** * Recursively checks for child question categories, returning an array of sub categories. *************** *** 466,470 **** if($categories[$i]['id'] == $selected) { ! $xhtml .= '<option value="'.$categories[$i]['id'].'" selected>'.$categories[$i]['name'].'</option>'; } else --- 523,527 ---- if($categories[$i]['id'] == $selected) { ! $xhtml .= '<option value="'.$categories[$i]['id'].'" selected="">'.$categories[$i]['name'].'</option>'; } else *************** *** 594,597 **** --- 651,766 ---- } } + + /** + * PROBABLY NOT NEEDED + * Return an mapping from the quizzes the student has taken to the attempts made. + * @access public + * @param int $student + * @return array $attempts + */ + public function getQuizAttempts($student, $course = NULL) { + global $config; + $prefix = $config->getMoodle('prefix'); + if(NULL == $course) { // irrespective of course + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts WHERE userid = ".$this->dbSafeString($student); + } else { // course specific + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts, {$prefix}quiz " . + "WHERE userid = ".$this->dbSafeString($student). + " AND course =".$this->dbSafeString($course). + " AND {$prefix}quiz.id = quiz"; + } + //$this->logger->debug($sql); + $result = $this->query($sql); + $attempts = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $attempts[$this->result($i, 'quiz')][] = $this->result($i, 'id'); // NOT result($i, 'attempt')! + } + } + return $attempts; + } + + /** + * Return an mapping from the questions the student has attempted to the attempt. + * @access public + * @param int $student + * @return array $attempts + */ + public function getQuestionAttempts($student, $course = NULL) { + global $config; + $prefix = $config->getMoodle('prefix'); + if(NULL == $course) { // irrespective of course + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts WHERE userid = ".$this->dbSafeString($student); + } else { // course specific + $sql = "SELECT quiz, {$prefix}quiz_attempts.id FROM {$prefix}quiz_attempts, {$prefix}quiz " . + "WHERE userid = ".$this->dbSafeString($student). + " AND course =".$this->dbSafeString($course). + " AND {$prefix}quiz.id = quiz"; + } + //$this->logger->debug($sql); + $result = $this->query($sql); + $attempts = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $attempts[$this->result($i, 'quiz')][] = $this->result($i, 'id'); // NOT result($i, 'attempt')! + } + } + return $attempts; + } + + /** + * Return all the responses from the student for the given attempt, in order, as well as (Moodle) question id + * @access public + * @param int $attempt + * @return array $responses + */ + public function getQuestionAttemptResponses($attempt) { + global $config; + $prefix = $config->getMoodle('prefix'); + + $sql = "SELECT seq_number, answer, event, question, remoteid" . + " FROM {$prefix}question_states, {$prefix}question_opaque" . + " WHERE attempt = ".$this->dbSafeString($attempt). + " AND {$prefix}question_opaque.questionid = {$prefix}question_states.question". + " ORDER BY seq_number"; + + $result = $this->query($sql); + // $responses = NULL; + if($result) { + for($i = 0; $i < $this->noRows(); $i++) { + $q = $this->result($i, 'question'); + $s = $this->result($i, 'seq_number'); + $return[$q]['version'] = substr($this->result($i, 'remoteid'), 1); // strip off 'q' + $return[$q][$s]['answer'] = $this->result($i, 'answer'); + $return[$q][$s]['event'] = $this->result($i, 'event'); + } + } + return $return; + } + + /** + * Returns the number of attempts on an STACK question + * @access public + * @param int $id + * @return int + */ + public function attemptsOnQuestion($id) { + global $config; + $prefix = $config->getMoodle('prefix'); + + $id = 'q'.$id; + $sql = "SELECT * FROM {$prefix}question_states, {$prefix}question_opaque " . + "WHERE question = questionid " . + "AND remoteid = ".$this->dbSafeString($id); + + $sql = "SELECT * FROM {$prefix}question_states";// test + $result = $this->query($sql); + $n = $this->noRows(); + //return $sql.$this->getErrors(); + //return $n; + //return $this->noRows(); + if($this->noRows() === false) return "noRows() === false for $sql"; + else return $this->noRows()." attempt states for this question"; + } } Index: StackDBAttemptPRTMeta.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBAttemptPRTMeta.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** StackDBAttemptPRTMeta.php 16 Sep 2009 12:04:22 -0000 1.7 --- StackDBAttemptPRTMeta.php 22 Nov 2010 23:05:52 -0000 1.7.2.1 *************** *** 69,73 **** VALUES ($CacheID, ".$this->dbSafeString($name).", $rawmark , $modmark , $ansnote , $error);"; ! $this->logger->critical($sql); $this->query($sql); --- 69,73 ---- VALUES ($CacheID, ".$this->dbSafeString($name).", $rawmark , $modmark , $ansnote , $error);"; ! $this->logger->finest($sql); $this->query($sql); *************** *** 114,120 **** } } - - - } --- 114,117 ---- Index: StackDBBackup.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBBackup.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** StackDBBackup.php 27 Aug 2009 16:23:00 -0000 1.5 --- StackDBBackup.php 22 Nov 2010 23:05:52 -0000 1.5.2.1 *************** *** 19,25 **** * Database backup functions */ ! require_once 'StackDBMySQL.php'; ! class StackDBBackup extends StackDBMySQL { // Attributes --- 19,25 ---- * Database backup functions */ ! require_once 'StackDBADOdb.php'; ! class StackDBBackup extends StackDBADOdb { // Attributes Index: StackDBADOdb.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBADOdb.php,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** StackDBADOdb.php 27 Aug 2009 16:23:00 -0000 1.7 --- StackDBADOdb.php 22 Nov 2010 23:05:52 -0000 1.7.2.1 *************** *** 81,85 **** $driver = $this->config->getDB('dbType'); ! $this->conn = &NewADOConnection($driver); //$this->conn->debug=true; $this->conn->PConnect($server, $username, $password, $database); --- 81,85 ---- $driver = $this->config->getDB('dbType'); ! $this->conn = NewADOConnection($driver); //$this->conn->debug=true; $this->conn->PConnect($server, $username, $password, $database); *************** *** 163,166 **** --- 163,190 ---- /** + * Performs a query using adoDB SelectLimit + * + * @param string $sql + * @return Array|bool + * @access public + */ + public function selectLimit($sql, $rows, $start) + { + $this->logger->finest("Performing Query with selectLimit: ".$sql); + $rs=NULL; + try { + $rs=$this->conn->SelectLimit($sql, $rows, $start); + //$this->logger->finest("Result of Query: ".$rs); + } catch (exception $e) { + $this->errorLog->addError('Invalid query '.$this->conn->ErrorMsg()); + $this->logger->critical('Invalid query '.$this->conn->ErrorMsg()); + return false; + } + + $this->lastResult = $rs; + return $rs; + } + + /** * Returns the number of rows from the last query. * *************** *** 325,330 **** } ! public function insert_id() { ! return Insert_ID(); // PO_Insert_ID() is a more portable but untested alternative. } --- 349,354 ---- } ! public function last_insert_id() { ! return $this->conn->Insert_ID(); // PO_Insert_ID() is a more portable but untested alternative. } Index: StackDBCache.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBCache.php,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** StackDBCache.php 8 Oct 2009 16:36:41 -0000 1.12 --- StackDBCache.php 22 Nov 2010 23:05:52 -0000 1.12.2.1 *************** *** 18,21 **** --- 18,22 ---- require_once 'StackDBADOdb.php'; + require_once $config->get('docroot').'/other/adodb5/adodb-pager.inc.php'; /** *************** *** 49,56 **** // add a transition using the new state id ! $transition = $this->addTransition($lastNode, $stateID, $post, $event); ! // add attempt_meta information ! if($userEvent) $this->addMeta($stateID, $state); } --- 50,59 ---- // add a transition using the new state id ! if($stateID !== NULL) { // state added successfully: go ahead and reference it! ! $transition = $this->addTransition($lastNode, $stateID, $post, $event); ! // add attempt_meta information ! if($userEvent) $this->addMeta($stateID, $state); ! } } *************** *** 58,62 **** $this->query("UNLOCK TABLES"); ! return $transition; // either the new or recent prior one } --- 61,65 ---- $this->query("UNLOCK TABLES"); ! return $transition; // either the new or recent prior one (or NULL on failure) } *************** *** 77,87 **** ", NOW())"; ! $this->query($sql); ! // NOTE: if this fails it will mess the transition table because of 'last index' method below. ! $this->logger->debug("SQL debug: ".$sql); ! // would be nice to be able to obtain the index for the last insert (like mysql_insert_id) without this extra call but would require extending the StackDB interface ! $this->query("SELECT id FROM display_cache ORDER BY id DESC LIMIT 1"); // safe for multi-threading? if($this->noRows()<=0) { // no rows in display_cache? --- 80,92 ---- ", NOW())"; ! //$this->logger->debug("SQL:".$sql); ! $result = $this->query($sql); ! if(empty($result)) { // insert failed! ! $this->logger->critical("Failed to store a question state!"); ! return NULL; // don't add a transition! ! } // would be nice to be able to obtain the index for the last insert (like mysql_insert_id) without this extra call but would require extending the StackDB interface ! $this->query("SELECT id FROM display_cache ORDER BY id DESC LIMIT 1"); // safe for multi-threading if higher-level lock maintained if($this->noRows()<=0) { // no rows in display_cache? *************** *** 141,144 **** --- 146,150 ---- } + // not guaranteed to produce all of n instances! public static function deployCache($qID, $n = 1) { // get connection to cache *************** *** 146,149 **** --- 152,156 ---- $db->connect(); + $newStates = array(); for($i = 0; $i < $n; $i++) { $seed = time() + $i*104; // ensuring differing seeds *************** *** 152,155 **** --- 159,169 ---- $instance = new DisplayItem($userID, $qID, false, $seed); // non user-specific starter question + // discard if this duplicates an existing instance (defined by question note) + $sql = "SELECT * FROM display_cache, display_cache_sequence WHERE qID = ".$instance->getQuestionID(). + " AND questionNote = ".$db->dbSafeString(StackDBCache::hackSlashes($instance->getQuestionNote())). + " AND display_cache_sequence.currentNode=0 AND display_cache_sequence.nextNode=display_cache.id"; + $db->query($sql); + if($db->noRows() > 0) { continue; } // discard and go round again + // create a cache state $xhtml = $instance->processQuestion(NULL, true, false); *************** *** 168,171 **** --- 182,187 ---- // set cacheNode for this instance $instance->setCacheID($id); + $newStates[] = $id; // to return + //$this->logger->debug('in deployCache, id='.$id); $db->query("UPDATE display_cache" . *************** *** 182,185 **** --- 198,202 ---- } $db->disconnect(); + return $newStates; } *************** *** 214,218 **** */ public function nextNode($transition) { - // takes current node and posted answers // returns next node id (used for obtaining cache state) $sql = "SELECT nextNode FROM display_cache_sequence " . --- 231,234 ---- *************** *** 254,258 **** */ public function getDisplayItem($id) { ! $this->query("SELECT state FROM display_cache WHERE id = $id"); return $this->base64_unserialize($this->result(0, 'state')); } --- 270,274 ---- */ public function getDisplayItem($id) { ! $this->query("SELECT state FROM display_cache WHERE id = $id LIMIT 1"); return $this->base64_unserialize($this->result(0, 'state')); } *************** *** 314,317 **** --- 330,353 ---- } + /* + * Determines whether a question can be changed without fear. + * i.e. even if it has available initial states, these have not been processed. + */ + public function hasActiveStates($qID) { + // initial states have a transition from a state id of 0 + + // get all starting configs for given question + $sql = "SELECT display_cache.id, display_cache.state FROM display_cache_sequence, display_cache " . + "LEFT JOIN display_cache_sequence AS successor " . + "ON successor.currentNode = $qID ". + "WHERE display_cache.qID = $qID " . + "AND display_cache_sequence.currentNode = 0 " . + "AND display_cache_sequence.nextNode = display_cache.id"; + $this->query($sql); + + // return 0 if question not deployed + return ($this->noRows() === 0); + } + /** * Empties the entire cache *************** *** 371,375 **** $this->query($sql); - //echo "<pre>";print_r($this); echo"</pre>"; $xhtml = '<table id="transitionstable" border=1>'; --- 407,410 ---- *************** *** 384,389 **** //$xhtml .= '<tr><td>'. $this->result($i,'id').'</td>'; $post = $this->base64_unserialize($this->result($i, 'post')); ! $xhtml .= '<td>'. $this->result($i,'currentNode').'</td>'; ! $xhtml .= '<td>'. $this->result($i,'nextNode').'</td>'; $showpost = $this->pretty_post($post); $xhtml .= '<td>'. $showpost.'</td>'; --- 419,426 ---- //$xhtml .= '<tr><td>'. $this->result($i,'id').'</td>'; $post = $this->base64_unserialize($this->result($i, 'post')); ! $xhtml .= '<td><a href="?sid='. $this->result($i,'currentNode').'">'. ! $this->result($i,'currentNode') .'</td>'; ! $xhtml .= '<td><a href="?sid='. $this->result($i,'nextNode').'">'. ! $this->result($i,'nextNode') .'</td>'; $showpost = $this->pretty_post($post); $xhtml .= '<td>'. $showpost.'</td>'; *************** *** 396,400 **** } ! public function dumpCacheState($qid = NULL) { if(!empty($qid)) { $sql .= "SELECT * FROM display_cache WHERE qID=".$qid." ORDER BY id"; --- 433,437 ---- } ! public function dumpCacheState($qid = NULL, $rows = 3, $startrow = 0) { if(!empty($qid)) { $sql .= "SELECT * FROM display_cache WHERE qID=".$qid." ORDER BY id"; *************** *** 402,406 **** else $sql = "SELECT * FROM display_cache ORDER BY id"; ! $this->query($sql); //echo "<pre>";print_r($this); echo"</pre>"; --- 439,444 ---- else $sql = "SELECT * FROM display_cache ORDER BY id"; ! //$this->query($sql); ! $this->selectLimit($sql, $rows, $startrow); //echo "<pre>";print_r($this); echo"</pre>"; *************** *** 423,429 **** --- 461,587 ---- $xhtml .= '</table>'; + $xhtml .= "next "; + $xhtml .= "<a href='?qid=$GET[qid]&startrow=".($startrow+$rows)."&rowcount=10'>10</a> | "; + $xhtml .= "<a href='?qid=$GET[qid]&startrow=".($startrow+$rows)."&rowcount=100'>100</a>"; + return $xhtml; + } + + public function showInitialStates($qid) { + $sql = "SELECT display_cache.* FROM display_cache_sequence, display_cache " . + "WHERE display_cache.qID = $qid " . + "AND currentNode = 0 " . + "AND nextNode = display_cache.id"; + + $this->query($sql); + //echo $this->noRows(); + + // store these initial states since we'll need to use the connection for finding successive states + for ($i=0; $i<$this->noRows(); $i++) { + $id = $this->result($i,'id'); + $initials[$id]['id'] = $id; + $initials[$id]['post'] = $this->base64_unserialize($this->result($i, 'post')); + $initials[$id]['state'] = $this->base64_unserialize($this->result($i, 'state')); + $initials[$id]['answers'] = $this->pretty_post($this->base64_unserialize($this->result($i, 'answers')), true); + $initials[$id]['currentTotalMark'] = $this->result($i, 'currentTotalMark'); + $initials[$id]['totalPossibleMarks'] = $this->result($i, 'totalPossibleMarks'); + $initials[$id]['expired'] = $this->result($i, 'expired'); + $initials[$id]['questionNote'] = $this->result($i, 'questionNote'); + $initials[$id]['xhtml'] = $this->result($i,'xhtml'); + } + + //echo "<pre>";print_r($this); echo"</pre>"; + + $xhtml .= '<table id="statestable" border=1>'; + $xhtml .= '<tr><th>id</th><th>answers</th><th>current / total mark</th><th>exp.</th><th>questionNote</th><th>xhtml</th><th>transitions</th></tr>'; + + foreach($initials as $i) { + $xhtml .= '<td>'.$i['id'].'</td>'; + $xhtml .= '<td>'.$i['answers'].'</td>'; + $xhtml .= '<td>'.$i['currentTotalMark'].' / '.$i['totalPossibleMarks'].'</td>'; + $xhtml .= '<td>'.$i['expired'].'</td>'; + $xhtml .= '<td>'.$i['questionNote'].'</td>'; + $xhtml .= '<td>'.$i['xhtml'].'</td>'; + + $xhtml .= '<td>'.$this->innerTransitionsTable($i['id']).'</td></tr>'; + } + $xhtml .= '</table>'; + return $xhtml; + } + + private function innerTransitionsTable($id) { + $transitions = $this->stateTransitions($id); + $xhtml = ''; + if($transitions) { + $xhtml .= '<table>'; // start inner table + foreach($transitions as $t) { + if($t['previous'] !== null) { + if($t['previous'] > 0) $xhtml .= '<tr><td><a href="?sid='.$t['previous'].'">« back to '.$t[previous].'</a></td></tr>'; + } + else if($t['nextNode'] != $id) $xhtml .= + '<tr><td><a href="?sid='.$t['nextNode'].'">» '.$this->pretty_post($this->base64_unserialize($t['post'])).'</a> ('.$t['event'].')</td></tr>'; + else $xhtml .= '(loopback) '.$this->pretty_post($this->base64_unserialize($t['post'])); + } + $xhtml .= '</table>'; // end inner table + } + return $xhtml; + } + + public function showCacheState($id) { + $sql .= "SELECT * FROM display_cache WHERE id=".$id; + + $this->query($sql); + + //echo "<pre>";print_r($this); echo"</pre>"; + $xhtml .= '<table id="statestable" border=1>'; + $xhtml .= '<tr><th>id</th><th>answers</th><th>current / total mark</th><th>exp.</th><th>questionNote</th><th>xhtml</th><th>transitions</th></tr>'; + for ($i=0; $i<$this->noRows(); $i++) { + $post = $this->base64_unserialize($this->result($i, 'post')); + $state = $this->base64_unserialize($this->result($i, 'state')); + $xhtml .= '<tr><td>'. $this->result($i,'id').'</td>'; + //$xhtml .= '<td>'.$this->elementsToHTML($state).'</td>'; + $xhtml .= '<td>'. $this->pretty_post($this->base64_unserialize($this->result($i, 'answers')), true) .'</td>'; + $xhtml .= '<td>'. $this->result($i, 'currentTotalMark') .' / '. $this->result($i, 'totalPossibleMarks') .'</td>'; + $xhtml .= '<td>'. $this->result($i, 'expired') .'</td>'; + $xhtml .= '<td>'. $this->result($i, 'questionNote') .'</td>'; + $xhtml .= '<td>'. $this->result($i,'xhtml').'</td>'; + $xhtml .= '<td>'; + $xhtml .= $this->innerTransitionsTable($this->result($i,'id')); + $xhtml .= '</td></tr>'; + } return $xhtml; } + private function stateTransitions($id) + { + $sql = "SELECT * FROM display_cache_sequence WHERE currentNode=$id OR nextNode=$id"; + $this->query($sql); + for ($i=0; $i<$this->noRows(); $i++) { + $tid = $this->result($i,'id'); + if($this->result($i, 'currentNode') == $id) { // transition FROM this node + $transitions[$tid]['nextNode'] = $this->result($i, 'nextNode'); + $transitions[$tid]['post'] = $this->result($i, 'post'); + $transitions[$tid]['event'] = $this->result($i, 'event'); + } else { // transition TO this node + $transitions[$tid]['previous'] = $this->result($i, 'currentNode'); + } + } + + //print_r($transitions); + return $transitions; + } + + public function cacheStatePager($qid = NULL) { + if(!empty($qid)) { + //$sql .= "SELECT * FROM display_cache WHERE qID=".$qid." ORDER BY id"; + $sql .= "SELECT id,qID,answers,questionNote,currentTotalMark,totalPossibleMarks,xhtml,expired,lastActive FROM display_cache WHERE qID=".$qid." ORDER BY id"; + } + //else $sql = "SELECT * FROM display_cache ORDER BY id"; + else $sql = "SELECT id,qID,answers,questionNote,currentTotalMark,totalPossibleMarks,xhtml,expired,lastActive FROM display_cache ORDER BY id"; + + $pager = new ADODB_Pager($this->conn,$sql,'adodb', true); + $pager->Render(); + //return $xhtml; + } + public function elementsToHTML($a) { foreach($a as $key => $value) { *************** *** 436,443 **** public function getInstances($qID) { ! $sql= "SELECT display_cache.id, xhtml, questionNote FROM display_cache, display_cache_sequence " . "WHERE currentNode = 0 " . "AND nextNode = display_cache.id " . ! "AND qID=$qID"; $this->query($sql); --- 594,604 ---- public function getInstances($qID) { ! $sql= "SELECT display_cache.state, display_cache.id, xhtml, questionNote " . ! "FROM display_cache, display_cache_sequence " . "WHERE currentNode = 0 " . "AND nextNode = display_cache.id " . ! "AND qID=$qID " . ! "ORDER BY questionNote"; ! $this->query($sql); *************** *** 449,454 **** $array[$f] = $this->result($i, $f); } $result[$i] = $array; ! } return $result; } --- 610,620 ---- $array[$f] = $this->result($i, $f); } + // potentially costly item deserialisation but can we justify an extra field for reversion? + //$item = $this->base64_unserialize($this->result($i, 'state')); + + //$array['version'] = $item->getVersion(); + $result[$i] = $array; ! } return $result; } *************** *** 465,468 **** --- 631,649 ---- } + // Array mapping all deployed versions to their instance frequency + public function countAllInstances() { + $sql = "SELECT qID, COUNT(qID) as freq FROM display_cache, display_cache_sequence " . + "WHERE currentNode = 0 " . + "AND nextNode = display_cache.id ". + "GROUP BY qID"; + $this->query($sql); + $count = array(); + for($i=0; $i<$this->noRows(); $i++) { + $this->result($i, 'freq'); + $count[$this->result($i, 'qID')] = $this->result($i, 'freq'); + } + return $count; + } + // returns deployed instances of the specified question public function dumpInstances($qID) { *************** *** 470,474 **** "WHERE currentNode = 0 " . "AND nextNode = display_cache.id " . ! "AND qID=$qID"; $this->query($sql); --- 651,655 ---- "WHERE currentNode = 0 " . "AND nextNode = display_cache.id " . ! "AND qID=$qID "; $this->query($sql); *************** *** 485,498 **** } ! // Returns array of question IDs in cache. // To help identify errors, not restricted to states that follow an initial state. ! public function getQuestionIDs() { ! $sql = "SELECT qID, count(*) AS freq FROM display_cache GROUP BY qID ORDER BY freq DESC"; $this->query($sql); for($i=0; $i<$this->noRows(); $i++) { ! $qid[] = $this->result($i, 'qID'); ! // adoDB no like aliases: $qid[$this->result($i, 'qID')] = $qid[$this->result($i, 'freq')]; } ! return $qid; } --- 666,680 ---- } ! // Returns array of frequencies of the question states in cache. // To help identify errors, not restricted to states that follow an initial state. ! public function getQuestionFreqs() { ! $sql = "SELECT qID, count(qID) as freq FROM display_cache GROUP BY qID"; $this->query($sql); for($i=0; $i<$this->noRows(); $i++) { ! $qid = $this->result($i, 'qID'); ! $freq = $this->result($i, 'freq'); ! $freqMap[$qid] = $freq; } ! return $freqMap; } *************** *** 501,505 **** $this->query("DELETE FROM display_cache WHERE id=$id"); ! // delete any transitions that lead to this $this->query("DELETE FROM display_cache_sequence WHERE nextNode=$id"); --- 683,687 ---- $this->query("DELETE FROM display_cache WHERE id=$id"); ! // delete any transitions that lead to this (should only be initial transitions) $this->query("DELETE FROM display_cache_sequence WHERE nextNode=$id"); *************** *** 512,521 **** if($children) { foreach ($children as $child) { ! // drop each transition, and recursively drop the state ! $this->query("DELETE FROM display_cache_sequence WHERE id=$child"); ! $this->dropState($this->result($i, 'nextNode')); } } } } ?> \ No newline at end of file --- 694,717 ---- if($children) { foreach ($children as $child) { ! $this->dropState($child); } } } + + /** + * Effectively 'undeploys' a version instance without removing it (and it's sucessors) from + * the cache as dropState() does. + */ + public function deinitialiseState($id) { + $this->query("DELETE FROM display_cache_sequence WHERE currentNode=0 AND nextNode=$id"); + } + + // checks whether a version is deployed, i.e. has instances which are initial states + // return number of insances deployed + public function instancesDeployed($id) { + $this->query("SELECT * FROM display_cache, display_cache_sequence " . + "WHERE display_cache.qID=$id AND currentNode=0 AND nextNode=display_cache.id"); + return $this->noRows(); + } } ?> \ No newline at end of file Index: devCache.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/devCache.php,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** devCache.php 8 Oct 2009 16:36:41 -0000 1.11 --- devCache.php 22 Nov 2010 23:05:52 -0000 1.11.2.1 *************** *** 20,29 **** require_once $root.'/lib/ui/DisplayItem.php'; require_once $root.'/lib/ui/frontend.php'; ! //echo html_head('dev cache','../../',"@import \"../../styles.css\";\n"); $cache = new StackDBCache(); $cache->connect(); ! $qidfilter = $_GET['qid']; // process button presses --- 20,30 ---- require_once $root.'/lib/ui/DisplayItem.php'; require_once $root.'/lib/ui/frontend.php'; ! //require_once $root.'/other/jquery.js'; ! echo html_head('dev cache','../../',"@import \"../../styles.css\";\n", 'LaTeX', 1); $cache = new StackDBCache(); $cache->connect(); ! $qid = $_GET['qid']; // process button presses *************** *** 39,43 **** ?> <head> ! <title>Direct Cache Access</title> <style> .box { --- 40,44 ---- ?> <head> ! <title>CAS Cache Admin</title> <style> .box { *************** *** 46,73 **** } </style> </head> ! <div class="box"> ! <?php echo $cache->dumpCacheSequence($qidfilter) ?> ! </div> ! <div class="box"> <?php ! $allQs = $cache->getQuestionIDs(); ! echo "Show question: "; ! if(empty($qidfilter)) echo "All "; ! else echo "<a href='devCache.php'>All</a> "; ! foreach($allQs as $qid) { ! if($qid == $qidfilter) echo $qid." "; ! else echo "<a href='?qid=".$qid."'>$qid</a> "; } ?> - <form method="POST" action="devCache.php"> - <input type="submit" value="Refresh"> - <input type="submit" name="op" value="clear successive states"> - <input type="submit" name="op" onClick="return confirm('Are you sure you want to clear the ENTIRE cache?')" value="clear ENTIRE cache"> - </form> - </div> - <br clear="left" /> <?php ! echo $cache->dumpCacheState($qidfilter); ! ?> \ No newline at end of file --- 47,113 ---- } + .hidden { + display: none; + } + + table { + border: 1; + } + + tr, td, th { + border: 0; + } + + .freq { + color: #ccc; + font-size: small; + } + </style> </head> ! <body> ! <form method="POST" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>"> ! <input type="submit" name="op" value="clear non-initial states"> ! <input type="submit" name="op" onClick="return confirm('Are you sure you want to clear the ENTIRE cache?')" value="clear ENTIRE cache"> ! <b>Note:</b> Initial states represent deployed questions. ! </form> ! ! ! <h2>Questions with cached states</h2> <?php ! $allQs = $cache->getQuestionFreqs(); ! if(NULL !== $allQs) { ! echo "Questions: "; ! foreach($allQs as $id => $freq) { ! if($id == $qid) echo $id."<span class='freq'>×$freq</span> "; ! else echo "<a href='?qid=".$id."'>$id</a><span class='freq'>×$freq</span> "; ! } } + else echo "Cache is completely empty."; ?> <?php ! //var_dump($qid); ! if(isset($_GET['sid'])) { ! echo "<h2>State #$_GET[sid]</h2>"; ! echo $cache->showCacheState($_GET['sid']); ! } ! ! if(!empty($qid)) { ! echo "<h2>Initial states for question #$qid</h2>"; ! echo $cache->showInitialStates($qid); ! } ! ! //echo $cache->dumpCacheSequence($qid); ! ?> ! <script> ! $(document).ready(function() { ! /* $('table#statestable td:last-child') ! .wrapInner('<div class="hidden">') ! .mouseover(function(x) {$(this).children('.hidden').slideDown('fast').next().remove()}) ! .append('<p>hover over to view</p>');*/ ! ! $('tr:odd').css('background-color', '#e6e6e6'); ! $('tr:even').css('background-color', '#ffffff'); ! }); ! </script> ! </body> \ No newline at end of file Index: StackDBReporting.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBReporting.php,v retrieving revision 1.27.2.20 retrieving revision 1.27.2.21 diff -C2 -d -r1.27.2.20 -r1.27.2.21 *** StackDBReporting.php 15 Mar 2010 20:18:05 -0000 1.27.2.20 --- StackDBReporting.php 22 Nov 2010 23:05:52 -0000 1.27.2.21 *************** *** 42,286 **** } - /** - * - * - * @return string - * @access public - */ - public function getQuestionSelector($name=NULL, $size=1, $all=true, $selected=NULL) - { [...1553 lines suppressed...] + // { + // $attemptId = $this->result($i, 'AttemptID'); + // $questionId = $this->result($i, 'QuestionID'); + // $userId = $this->result($i, 'UserID'); + // $PRTName = $this->result($i, 'PRTName'); + // $RawMark = $this->result($i, 'RawMark'); + // $ModMark = $this->result($i, 'ModMark'); + // + // if(!array_key_exists($questionId, $resultsArray) || !array_key_exists($userId, $resultsArray[$questionId])) + // { + // $resultsArray[$questionId][$userId] = new MarksAttempt($userId, $questionId); + // } + // $resultsArray[$questionId][$userId]->addAttempt($attemptId, $PRTName, $RawMark, $ModMark); + // } + // + // return $resultsArray; + // } + // } Index: StackDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDB.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** StackDB.php 27 Aug 2009 16:23:00 -0000 1.5 --- StackDB.php 22 Nov 2010 23:05:52 -0000 1.5.2.1 *************** *** 78,81 **** --- 78,83 ---- public function allResults($field = NULL); + + //public function last_insert_id(); } Index: StackDBMySQL.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBMySQL.php,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** StackDBMySQL.php 27 Aug 2009 16:23:00 -0000 1.17 --- StackDBMySQL.php 22 Nov 2010 23:05:52 -0000 1.17.2.1 *************** *** 21,25 **** /** * MySQL connection class ! * Depricated in favour of ADOdb database connection * * @author Jonathan Hart (j.p...@bh...) --- 21,25 ---- /** * MySQL connection class ! * Deprecated in favour of ADOdb database connection * * @author Jonathan Hart (j.p...@bh...) Index: StackDBKeywords.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBKeywords.php,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** StackDBKeywords.php 27 Aug 2009 16:23:00 -0000 1.10 --- StackDBKeywords.php 22 Nov 2010 23:05:52 -0000 1.10.2.1 *************** *** 261,271 **** /** * Returns all the keywords currently in the database ! * * @access public * @return array */ ! public function getAllKeywords() { ! $sql = 'SELECT keyword FROM keywords'; $query = $this->query($sql); --- 261,277 ---- /** * Returns all the keywords currently in the database ! * @param bool active * @access public * @return array */ ! public function getAllKeywords($activeOnly = false) { ! if($activeOnly) { ! $sql = 'SELECT keyword FROM keywords, question_keyword ' . ! 'WHERE question_keyword.kwid = keywords.id GROUP BY keyword'; ! } ! else { ! $sql = 'SELECT keyword FROM keywords'; ! } $query = $this->query($sql); *************** *** 283,287 **** } } - } --- 289,292 ---- Index: StackDBItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBItem.php,v retrieving revision 1.32.2.3 retrieving revision 1.32.2.4 diff -C2 -d -r1.32.2.3 -r1.32.2.4 *** StackDBItem.php 1 Jan 2010 22:53:47 -0000 1.32.2.3 --- StackDBItem.php 22 Nov 2010 23:05:52 -0000 1.32.2.4 *************** *** 71,74 **** --- 71,75 ---- questionKeywords , questionUserLastEdited , + line , questionPublisher , questionFormat , *************** *** 90,96 **** ) VALUES ( ! $meta[questionGUID], $meta[questionName], $meta[questionDescription], $meta[questionKeywords], $meta[lastUserEditor], $meta[questionPublisher], $meta[questionFormat], $meta[language], $meta[questionRights], $meta[questionLearningContext], $meta[questionDifficulty], $meta[questionCompetency], $meta[questionCompentencyLevel], $meta[questionTimeAllocated], $meta[questionExerciseType], ".$this->conn->sysTimeStamp." , ".$this->dbSafeString($dbQuestionVariables).", ".$this->dbSafeString($dbItemOptions).", ".$this->dbSafeString($dbItemTests)." , ".$this->dbSafeString($valid==1?1:0)." , ".$this->dbSafeString($status)." , ".$this->dbSafeString($published).");"; ! $added = $this->query($sql); if($added) --- 91,97 ---- ) VALUES ( ! $meta[questionGUID], $meta[questionName], $meta[questionDescription], $meta[questionKeywords], $meta[lastUserEditor], $meta[line], $meta[questionPublisher], $meta[questionFormat], $meta[language], $meta[questionRights], $meta[questionLearningContext], $meta[questionDifficulty], $meta[questionCompetency], $meta[questionCompentencyLevel], $meta[questionTimeAllocated], $meta[questionExerciseType], ".$this->conn->sysTimeStamp." , ".$this->dbSafeString($dbQuestionVariables).", ".$this->dbSafeString($dbItemOptions).", ".$this->dbSafeString($dbItemTests)." , ".$this->dbSafeString($valid==1?1:0)." , ".$this->dbSafeString($status)." , ".$this->dbSafeString($published).");"; + $this->logger->debug($sql); $added = $this->query($sql); if($added) *************** *** 98,103 **** //get question id for newly added item & return. //$result = $this->query("SELECT `questionID` FROM `stackQuestion` WHERE `questionGUID` = '$meta[questionGUID]'"); ! $result = $this->query("SELECT max(questionId) FROM stackquestion"); ! $result = $this->result(0,0); //echo 'Last inserted: '.$result; } --- 99,104 ---- //get question id for newly added item & return. //$result = $this->query("SELECT `questionID` FROM `stackQuestion` WHERE `questionGUID` = '$meta[questionGUID]'"); ! $result = $this->query("SELECT questionID FROM stackquestion ORDER BY questionID desc limit 1"); ! $result = $this->result(0,'questionID'); //echo 'Last inserted: '.$result; } *************** *** 117,123 **** * @return int * @access public ! */ public function updateItem($id, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published) { //make meta db safe foreach($meta as $label => $val) --- 118,128 ---- * @return int * @access public ! **/ public function updateItem($id, $dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published) { + //return addNewItem($dbItemOptions, $dbItemTests, $dbQuestionVariables, $meta, $valid, $status, $published); + + //update line + //make meta db safe foreach($meta as $label => $val) *************** *** 142,146 **** //build query - $sql = "UPDATE stackquestion SET questionGUID = $meta[questionGUID], questionName = $meta[questionName], --- 147,150 ---- *************** *** 148,151 **** --- 152,156 ---- questionKeywords = $meta[questionKeywords], questionUserLastEdited = $meta[lastUserEditor], + line = $meta[line], questionPublisher = $meta[questionPublisher], questionFormat = $meta[questionFormat], *************** *** 167,185 **** WHERE questionID = $id;"; ! $updated = $this->query($sql); if($updated) { ! return $id; } else { ! $this->errorLog->addError('Could not update Item'); ! $this->logger->critical('Failed to save item id '.$id); ! return false; } } /** --- 172,224 ---- WHERE questionID = $id;"; ! $updated = $this->query($sql); if($updated) { ! $this->logger->fine('Item updated.'); ! $result = true; } else { ! $result = false; ! $this->errorLog->addError('Could not update item.'); ! $this->logger->critical('Failed to update item named '.$meta['questionDescription'].' to the database'); } + return $result; + }//*/ + + + /** + + * @param + * @return bool + * @access public + */ + public function newLine() + { + $sql = "INSERT INTO question_lines() VALUES()"; + $this->logger->debug($sql); + $this->query($sql); + $this->query("SELECT id FROM question_lines ORDER BY id DESC LIMIT 1"); + return $this->result(0,'id'); } + public function setLatestVersion($line, $version) { + $sql = "UPDATE question_lines SET latestVersion=$version WHERE id=$line"; + $this->logger->debug("trying to set latest version with sql:$sql"); + $this->query($sql); + } + + public function getLatestVersion($qid) { + $sql = "SELECT latestVersion FROM question_lines, stackquestion WHERE questionID=$qid AND line=question_lines.id"; + $this->logger->debug("trying to get latest version with sql:$sql"); + $this->query($sql); + return $this->result(0, 'latestVersion'); + } + public function nameExists($name) { + $this->query("SELECT * FROM stackquestion WHERE questionName='$name'"); + return $this->noRows() > 0; + } /** *************** *** 207,210 **** --- 246,283 ---- } + /** + * Removes a line of items, their PRTrees and keywords + * + * @param int $id + * @return bool + * @access public + */ + public function removeLineContainingItem($id) + { + // get line from item id + $sql = "SELECT line FROM stackquestion WHERE questionID = $id"; + $result = $this->query($sql); + $line = $this->result(0, 'line'); + $this->logger->finer('Removing line '.$line); + + // get all question IDs + $sql = "SELECT questionID from stackquestion WHERE line = $line"; + $result = $this->query($sql); + if($result !== false) { + foreach($result as $row) { + $toRemove[] = $row['questionID']; + } + } + + foreach($toRemove as $id) { + $this->removeItem($id); + } + + // finally, remove line record + $sql = "DELETE FROM question_lines WHERE id = $line"; + $result = $this->query($sql); + return $result; + } + /** * Removes an items PRTrees. *************** *** 417,420 **** --- 490,531 ---- } + /** + * Returns the line that contains this Item version + * + * @param int $id + * @return int version + **/ + public function getLine($id) { + $sql = "SELECT line FROM stackquestion WHERE questionID = $id"; + //echo $sql; + $result = $this->query($sql); + if(!$result) + { + $this->logger->critical('No line recorded for item with id '.$id); + return false; + } + else + { + $toReturn = $this->result(0,'line'); + return $toReturn; + } + + } + + // returned in descending order + public function getVersions($line) { + if(!is_numeric($line)) { + $this->logger->critical("line not defined!"); + } + $sql = "SELECT questionID, questionDateLastEdited from stackquestion WHERE line=$line ORDER BY questionID DESC"; + //echo $sql; + $result = $this->query($sql); + if($result !== false) { + foreach($result as $row) { + $history[$row['questionDateLastEdited']] = $row['questionID']; + } + } + return $history; + } /** *************** *** 429,437 **** { $this->logger->finest('getListOfQuestions, userID='.$userID); ! $dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! $dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! $OrderBy = ' ORDER BY questionID'; // First level if (NULL != $filter) { --- 540,551 ---- { $this->logger->finest('getListOfQuestions, userID='.$userID); + $this->logger->debug('getListOfQuestions, filter='.print_r($filter, 1)); ! $qList = NULL; ! //$dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! //$dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! ! $OrderBy = ' ORDER BY questionID DESC'; // First level if (NULL != $filter) { *************** *** 453,471 **** } ! if($userID === NULL) { ! $sql = "SELECT questionID, questionName, questionDescription, valid, published, status, $dateQuery AS dateEdited FROM stackquestion".$OrderBy; ! } else { if ($public) { ! $sql = "SELECT questionID, questionName, questionDescription, valid, published, status, $dateQuery AS dateEdited FROM stackquestion WHERE (questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")".$OrderBy; } else { ! $sql = "SELECT questionID, questionName, questionDescription, valid, published, status, $dateQuery AS dateEdited FROM stackquestion WHERE (questionUserLastEdited = $userID)".$OrderBy; } } - $this->logger->finest('getListOfQuestions, sql='.$sql); - $result = $this->query($sql); if($result === false) --- 567,691 ---- } + $sql = "SELECT questionID, line, questionName, questionDescription, valid, published, status, questionDateLastEdited AS dateEdited " . + "FROM stackquestion, question_lines"; + if(!empty($tags)) $sql .= ", question_keyword, keywords "; // tbc + if($userID !== NULL) { + if ($public) { + $sql .= " WHERE (questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")"; + } else { + $sql .= " WHERE (questionUserLastEdited = $userID)"; + } + } + + if($userID !== NULL) $sql .= " AND "; + else $sql .= " WHERE "; + $sql .= "question_lines.latestVersion = stackquestion.questionID"; + // filter + //if($filter !== NULL) $sql .= " AND questionName LIKE '%$filter%' "; ! $sql .= $OrderBy; ! ! $this->logger->debug('getListOfQuestions, sql='.$sql); ! $result = $this->query($sql); ! //print_r($sql); ! ! if($result === false) { ! $this->logger->error('getListOfQuestions: Failed to load question list'); ! return false; ! } ! else ! { ! global $config; ! ! // get a count of deployed instances of each version from cache ! $dbc = new StackDBCache(); ! $dbc->connect(); ! $deployCount = $dbc->countAllInstances(); ! $dbc->disconnect(); ! ! //print_r($deployCount); ! ! $i=0; ! if($this->noRows()>0) ! { ! ! foreach($result as $row) ! { ! $qList[$i]['id'] = $this->result($i,'questionID'); ! $qList[$i]['line'] = $this->result($i,'line'); ! $qList[$i]['questionName'] = $this->result($i,'questionName'); ! $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); ! $qList[$i]['valid'] = $this->result($i,'valid'); ! $qList[$i]['questionDateLastEdited'] = $this->result($i,'dateEdited'); ! $qList[$i]['published'] = $this->result($i,'published'); ! $qList[$i]['status'] = $this->result($i,'status'); ! $qList[$i]['nodeployed'] = $deployCount[$qList[$i]['id']];//TOO MANY QUERIES --> $dbc->countInstances($qList[$i]['id']); ! if(!isset($qList[$i]['nodeployed'])) $qList[$i]['nodeployed'] = 0; ! $i++; ! } ! ! ! $moodleEnabled = $config->getMoodle('enabled'); ! if('true' === $moodleEnabled) ! { ! $mdb = new MoodleDB(); ! $mdb->connect(); ! foreach($qList as $key => $val){ ! $qList[$key]['moodleCategories'] = $mdb->getQuestionCategoryName($val['id']); ! } ! $mdb->disconnect(); ! } ! ! } ! return $qList; ! } ! } ! ! public function getLines($userID=NULL,$public=false,$filter=NULL,$tags=NULL) ! { ! $this->logger->finest('getLines, userID='.$userID); ! $this->logger->debug('getLines, filter='.print_r($filter, 1)); ! ! $qList = NULL; ! ! //$dateFormat = stack_sqlDateFormat(true); //uses to date format in the config file to give a sql date format. ! //$dateQuery = $this->conn->SQLDate($dateFormat,'questionDateLastEdited'); ! ! $OrderBy = ' ORDER BY questionID DESC'; ! ! $sql = "SELECT questionID, line, questionName, questionDescription, valid, published, status, questionDateLastEdited AS dateEdited " . ! "FROM stackquestion, question_lines "; ! if(!empty($tags)) $sql .= ", question_keyword, keywords "; ! if($userID !== NULL) { if ($public) { ! $where[] = "(questionUserLastEdited = $userID or published=".$this->dbSafeString('Published').")"; } else { ! $where[] = "(questionUserLastEdited = $userID)"; } } + if(!empty($tags)) { + // create multi-keyword conditions + foreach(explode(' ', $tags) as $tag) { + $or[] = "keywords.keyword = ".$this->dbSafeString($tag); + + } + $where[] = '('.implode($or, ' OR ').')'; + $where[] = "keywords.id = kwid AND qid = stackquestion.questionID"; + } + + $where[] = "question_lines.latestVersion = stackquestion.questionID"; + + // filter + if($filter !== NULL) $where[] = "(questionName LIKE '%$filter%' OR questionDescription LIKE '%$filter%')"; + + $sql .= ' WHERE '.implode($where, ' AND '); // stitch conditions together + + $sql .= $OrderBy; + + $this->logger->debug('getListOfQuestions, sql='.$sql); + $result = $this->query($sql); if($result === false) *************** *** 486,489 **** --- 706,710 ---- { $qList[$i]['id'] = $this->result($i,'questionID'); + $qList[$i]['line'] = $this->result($i,'line'); $qList[$i]['questionName'] = $this->result($i,'questionName'); $qList[$i]['questionDescription'] = $this->result($i, 'questionDescription'); *************** *** 492,495 **** --- 713,770 ---- $qList[$i]['published'] = $this->result($i,'published'); $qList[$i]['status'] = $this->result($i,'status'); + $qList[$i]['nodeployed'] = $dbc->countInstances($qList[$i]['id']); + + $i++; + } + $dbc->disconnect(); + + $moodleEnabled = $config->getMoodle('enabled'); + if('true' === $moodleEnabled) + { + $mdb = new MoodleDB(); + $mdb->connect(); + foreach($qList as $key => $val){ + $qList[$key]['moodleCategories'] = $mdb->getQuestionCategoryName($val['id']); + ... [truncated message content] |
From: Ben H. <bdv...@us...> - 2010-11-22 23:06:00
|
Update of /cvsroot/stack/stack-dev/lib/filters/active/Hints In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/filters/active/Hints Modified Files: Tag: question_reporting Hints.php Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: Hints.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/filters/active/Hints/Hints.php,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Hints.php 11 Sep 2009 08:43:55 -0000 1.2 --- Hints.php 22 Nov 2010 23:05:53 -0000 1.2.2.1 *************** *** 63,67 **** // CJS 3/9/2009. Avoid popups. //$rep = '<html><a href="javascript:helpPopup(\''.$root.'/lib/ui/helpViewer.php?reference=fact§ion='.$val.'\');"><img align="middle" border="0" alt="Question value" src="'.$root.'/pix/help.gif" /></a></html>'; ! $hintroot = '../../lang/'.$config->get('lang').'/doc/'; require_once($hintroot.'student_factsformula.php'); --- 63,67 ---- // CJS 3/9/2009. Avoid popups. //$rep = '<html><a href="javascript:helpPopup(\''.$root.'/lib/ui/helpViewer.php?reference=fact§ion='.$val.'\');"><img align="middle" border="0" alt="Question value" src="'.$root.'/pix/help.gif" /></a></html>'; ! $hintroot = $config->get('docroot').'/lang/'.$config->get('lang').'/doc/'; require_once($hintroot.'student_factsformula.php'); |