You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(486) |
Jul
(201) |
Aug
(194) |
Sep
(87) |
Oct
(72) |
Nov
(72) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(41) |
Mar
(22) |
Apr
(4) |
May
(12) |
Jun
|
Jul
|
Aug
(42) |
Sep
(21) |
Oct
(14) |
Nov
(10) |
Dec
|
2007 |
Jan
(14) |
Feb
(34) |
Mar
(61) |
Apr
(54) |
May
(140) |
Jun
(184) |
Jul
(164) |
Aug
(130) |
Sep
(241) |
Oct
(175) |
Nov
(148) |
Dec
(96) |
2008 |
Jan
(5) |
Feb
(38) |
Mar
(30) |
Apr
(46) |
May
(25) |
Jun
(22) |
Jul
(5) |
Aug
(17) |
Sep
(2) |
Oct
(100) |
Nov
(83) |
Dec
(33) |
2009 |
Jan
(127) |
Feb
(43) |
Mar
(86) |
Apr
(34) |
May
(50) |
Jun
(168) |
Jul
(48) |
Aug
(66) |
Sep
(38) |
Oct
(75) |
Nov
(113) |
Dec
(72) |
2010 |
Jan
(123) |
Feb
(68) |
Mar
(26) |
Apr
(11) |
May
(39) |
Jun
(131) |
Jul
(56) |
Aug
(79) |
Sep
(69) |
Oct
(17) |
Nov
(166) |
Dec
(32) |
2011 |
Jan
(21) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(8) |
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/lang/en Modified Files: stack.php Log Message: Stable interim commit towards deployment updating. Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** stack.php 27 Oct 2010 08:26:49 -0000 1.158 --- stack.php 1 Nov 2010 18:18:30 -0000 1.159 *************** *** 394,397 **** --- 394,398 ---- $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'; *************** *** 399,403 **** $string['FE_deployQuestion_xInstances'] = '{$a} instances '; $string['FE_deployQuestion_instanceDeployed'] = '1 instance deployed.'; ! $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.'; --- 400,404 ---- $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.'; *************** *** 1166,1170 **** $string['stackMoodle_questionNotDeployed'] = 'This question currently has no instances deployed.'; ! // Reporting Strings --- 1167,1172 ---- $string['stackMoodle_questionNotDeployed'] = 'This question currently has no instances deployed.'; ! // Deployment strings ! $string['stackDeploy_button_update'] = 'Update'; // MUST match qtype_opaque // Reporting Strings |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/lib/deployment In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/lib/deployment Modified Files: Deployment.php Log Message: Stable interim commit towards deployment updating. Index: Deployment.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/deployment/Deployment.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Deployment.php 30 Sep 2010 16:56:21 -0000 1.12 --- Deployment.php 1 Nov 2010 18:18:30 -0000 1.13 *************** *** 54,58 **** $this->engineID = $engineid; ! $this->logger->debug("minstrels: ".$this->engineID); } --- 54,58 ---- $this->engineID = $engineid; ! $this->logger->debug("engine id in Deployment constructor: ".$this->engineID); } *************** *** 61,65 **** //$xhtml = "<form method='POST' action='?id=".$this->version."'> $xhtml = "<input type='submit' name='submit' value='add'> ! <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newversions', 'stack'); //" <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('FE_deployQuestion_autoprime', 'stack'); /*" <input type='submit' onclick='return confirm(\"" . --- 61,65 ---- //$xhtml = "<form method='POST' action='?id=".$this->version."'> $xhtml = "<input type='submit' name='submit' value='add'> ! <input type='text' name='add' value='1' size='3' maxlength='3'/> " . get_string('FE_deployQuestion_newRandomInstances', 'stack'); //" <input type='checkbox' name='autoprime' ".(isset($_POST['autoprime'])?'checked="checked"':"")."> ".get_string('FE_deployQuestion_autoprime', 'stack'); /*" <input type='submit' onclick='return confirm(\"" . *************** *** 82,86 **** if(!empty($this->engineID)) { ! $this->logger->debug('we is in moodle checking your engine ids'); $db = new MoodleDB(); $db->connect(); --- 82,86 ---- if(!empty($this->engineID)) { ! $this->logger->debug('In moodle, checking your engine ids'); $db = new MoodleDB(); $db->connect(); *************** *** 130,133 **** --- 130,150 ---- + // update request (the caching part - Moddle Question Bank handled elsewhere) + if (isset($param['operation']) && $param['operation'] == 'update' && is_numeric($param['prior'])) { + // take id, prior, number, category and update + + // undeploy all old + $toDrop = new Deployment($param['prior']); + $this->logger->debug('trying to drop version'.$param['version'].' during update'); + $toDrop->drop($param['engine']); + + // Do new deploy last in case of timeout? + // create new deployment + if (!$this->isSingleton()) { // should auto-deploy in constructor + $msg = get_string('FE_deployQuestion_attemptingDeploy', 'stack', $param['number']); + $initialStates = $this->cache->deployCache($this->version, $param['number']); + } + } + // prime requests if (isset ($param['operation']) && $param['operation'] == 'prime' && is_numeric($param['instance'])) { *************** *** 348,351 **** --- 365,372 ---- return $this->line; } + + function getEngineID() { + return $this->engineID; + } } ?> \ No newline at end of file |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/opaque/moodleModule/opaque/stack Modified Files: stackDeploy.php stackLib.php Log Message: Stable interim commit towards deployment updating. Index: stackDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackDeploy.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** stackDeploy.php 30 Sep 2010 16:56:21 -0000 1.5 --- stackDeploy.php 1 Nov 2010 18:18:30 -0000 1.6 *************** *** 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,52 **** redirect('stackEngineSelector.php'); } ! //print_r($_POST); ! if(!empty($_POST['submit'])) { --- 46,53 ---- redirect('stackEngineSelector.php'); } ! //*/ //print_r($_POST); ! //print_r($USER); ! //exit(); if(!empty($_POST['submit'])) { *************** *** 78,81 **** --- 79,93 ---- } 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; } } *************** *** 113,117 **** $engineName = getEngineName($SESSION->stackSelectedEngine); ! $strtitle = get_string('instancesOf', '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'); --- 125,129 ---- $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'); *************** *** 123,130 **** print_heading($strtitle); - echo '<p>'.get_string('nodeployed', 'qtype_opaque').': '.count($deployedList); - echo "<form method='POST' action='?id=".$_GET['id']."'>"; echo $deployedPage->xhtml; // 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'); --- 135,142 ---- print_heading($strtitle); echo "<form method='POST' action='?id=".$_GET['id']."'>"; + echo $deployedPage->xhtml; // 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'); *************** *** 136,139 **** --- 148,153 ---- else { + echo '<p>'.get_string('nodeployed', 'qtype_opaque').': '.count($deployedList); + $opts = new stdClass; $opts->noclean = true; *************** *** 147,151 **** 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></tr>'; $i = 0; foreach($deployedList as $instance) { --- 161,166 ---- 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) { *************** *** 156,165 **** 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>'; } --- 171,180 ---- 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>'; } *************** *** 167,171 **** 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>'; } --- 182,186 ---- 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: stackLib.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/stack/stackLib.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** stackLib.php 30 Sep 2010 16:56:21 -0000 1.20 --- stackLib.php 1 Nov 2010 18:18:30 -0000 1.21 *************** *** 398,404 **** $values[] = $param['version']; - $keys[] = 'engine'; - $values[] = $engineID; - echo soap_call($connection, 'stackDeployOperation', array($passkey, $USER->id, $keys, $values)); } --- 398,401 ---- *************** *** 449,453 **** /** ! * primes an instance (or version) of a question. * * @param int engineID --- 446,450 ---- /** ! * Primes an instance of a question. * * @param int engineID *************** *** 488,491 **** --- 485,536 ---- } + + /** + * 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)); + } + } + /** * Returns the name of the engine from its id |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/lang/en_utf8 In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/opaque/moodleModule/opaque/lang/en_utf8 Modified Files: qtype_opaque.php Log Message: Stable interim commit towards deployment updating. Index: qtype_opaque.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/moodleModule/opaque/lang/en_utf8/qtype_opaque.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** qtype_opaque.php 30 Sep 2010 16:56:22 -0000 1.26 --- qtype_opaque.php 1 Nov 2010 18:18:30 -0000 1.27 *************** *** 75,78 **** --- 75,79 ---- $string['preview'] = 'Preview'; $string['deploy'] = 'Deploy'; + $string['deployingQuestion'] = 'Deploying question'; $string['prime'] = 'Prime'; $string['nodeployed'] = 'Number deployed'; *************** *** 141,144 **** --- 142,146 ---- $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 //get_string('', 'qtype_opaque') |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:38
|
Update of /cvsroot/stack/stack-dev/lib/database In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/lib/database Modified Files: StackDBItem.php MoodleDB.php Log Message: Stable interim commit towards deployment updating. Index: MoodleDB.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/MoodleDB.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MoodleDB.php 30 Sep 2010 16:56:13 -0000 1.15 --- MoodleDB.php 1 Nov 2010 18:18:29 -0000 1.16 *************** *** 137,149 **** //check whether the question is already in the moodle question bank. $inQBank = $this->inMoodleQuestionBank($id, $engineID); - $this->logger->debug("tap"); if($inQBank === false) { ! $this->logger->debug("noob q"); //add the question return $this->newQuestion($engineID, $userID, $category, $itemID, $line, $itemName, $itemMaxMark, $itemGUID); } else { //update the question(s) ! $this->logger->debug("updating q in $inQBank"); return $this->updateQuestion($inQBank, $engineID, $userID, $category, $itemID, $itemName, $itemMaxMark, $itemGUID); } --- 137,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); } *************** *** 157,161 **** /** ! * 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 *************** *** 334,337 **** --- 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. *************** *** 488,492 **** 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 *************** *** 703,706 **** --- 738,765 ---- 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 $n; + //return $this->noRows(); + if($this->noRows() === false) return "noRows() === false for $sql"; + else return "$this->noRows() attempt states for this question"; + } } Index: StackDBItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBItem.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** StackDBItem.php 1 Oct 2010 15:02:54 -0000 1.37 --- StackDBItem.php 1 Nov 2010 18:18:29 -0000 1.38 *************** *** 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) --- 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) *************** *** 172,176 **** WHERE questionID = $id;"; ! }*/ --- 172,189 ---- 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; ! }//*/ |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:37
|
Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/lib/ui Modified Files: report.php Log Message: Stable interim commit towards deployment updating. Index: report.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/report.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** report.php 30 Sep 2010 16:56:15 -0000 1.11 --- report.php 1 Nov 2010 18:18:29 -0000 1.12 *************** *** 80,88 **** echo '<h1>Select a report type</h1>'; ! echo ' <div class="section"> <h3>Interactive report</h3> <p> <a href="report.php?type=interactive"><button >Load the interactive interface</button></a> </p> </div>'; ! echo '<form action="report.php?type=question" method="post">' . $report->questionFilterInterface($_REQUEST) --- 80,88 ---- echo '<h1>Select a report type</h1>'; ! /*echo ' <div class="section"> <h3>Interactive report</h3> <p> <a href="report.php?type=interactive"><button >Load the interactive interface</button></a> </p> </div>'; ! */ echo '<form action="report.php?type=question" method="post">' . $report->questionFilterInterface($_REQUEST) |
From: Simon H. <sim...@us...> - 2010-11-01 18:18:37
|
Update of /cvsroot/stack/stack-dev/other In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12921/other Modified Files: flyfeedback.js Log Message: Stable interim commit towards deployment updating. Index: flyfeedback.js =================================================================== RCS file: /cvsroot/stack/stack-dev/other/flyfeedback.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** flyfeedback.js 30 Sep 2010 16:56:12 -0000 1.2 --- flyfeedback.js 1 Nov 2010 18:18:29 -0000 1.3 *************** *** 14,16 **** --- 14,19 ---- jsMath.ConvertTeX(obj); jsMath.ProcessBeforeShowing(obj); + + jsMath.Autoload.ConvertTeX(obj); + jsMath.Autoload.ProcessBeforeShowing(obj); } \ No newline at end of file |
From: Chris S. <san...@us...> - 2010-11-01 14:34:38
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30819/maxima Modified Files: unittests.mac stackmaxima.mac maximafun.php stacktex.lisp Log Message: log10 support Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** stackmaxima.mac 27 Oct 2010 13:34:24 -0000 1.83 --- stackmaxima.mac 1 Nov 2010 14:34:29 -0000 1.84 *************** *** 51,57 **** stack_reset(1000); - alias(int,integrate); /* Allows integrate to be called with int() */ - alias(ln,log); alias(simplify,fullratsimp); /* Allows simplify to be something */ --- 51,55 ---- *************** *** 62,65 **** --- 60,72 ---- /* ********************************** */ + /* Logarithms */ + /* ********************************** */ + alias(ln,log); + load("log10"); + texput(log10,"\\log\\mathrm{10}",prefix); + alias(lg,log10); + texput(lg,"\\mathrm{lg}",prefix); + + /* ********************************** */ /* Load contributed packages */ /* ********************************** */ Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stacktex.lisp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stacktex.lisp 13 Oct 2010 14:58:07 -0000 1.7 --- stacktex.lisp 1 Nov 2010 14:34:29 -0000 1.8 *************** *** 150,151 **** --- 150,153 ---- (defprop mlessp (" < ") texsym) (defprop mgreaterp (" > ") texsym) + + Index: maximafun.php =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/maximafun.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** maximafun.php 30 Sep 2010 16:56:14 -0000 1.7 --- maximafun.php 1 Nov 2010 14:34:29 -0000 1.8 *************** *** 3489,3492 **** --- 3489,3495 ---- $maxima_cmd['log']['use'] = 's'; + $maxima_cmd['log10']['urls'][] = 'maxima_14.html#IDX529'; + $maxima_cmd['log10']['use'] = 's'; + $maxima_cmd['log_gamma']['urls'][] = 'maxima_16.html#IDX595'; $maxima_cmd['log_gamma']['use'] = 's'; Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** unittests.mac 27 Oct 2010 13:34:24 -0000 1.17 --- unittests.mac 1 Nov 2010 14:34:29 -0000 1.18 *************** *** 199,200 **** --- 199,203 ---- 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: Chris S. <san...@us...> - 2010-11-01 14:30:36
|
Update of /cvsroot/stack/stack-dev/install In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30118/install Modified Files: answer_test_testsuite.php Log Message: log10 support Index: answer_test_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/answer_test_testsuite.php,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** answer_test_testsuite.php 27 Oct 2010 13:40:51 -0000 1.57 --- answer_test_testsuite.php 1 Nov 2010 14:30:27 -0000 1.58 *************** *** 77,80 **** --- 77,81 ---- $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,'',''); |
From: Chris S. <san...@us...> - 2010-10-27 13:40:59
|
Update of /cvsroot/stack/stack-dev/install In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12304/install Modified Files: answer_test_testsuite.php p3.php installFunctions.php Log Message: Support for Maxima 5.22.1 Index: p3.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/p3.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** p3.php 24 May 2010 10:22:15 -0000 1.28 --- p3.php 27 Oct 2010 13:40:51 -0000 1.29 *************** *** 265,269 **** <?php ! $maximaVersions = array('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) { --- 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) { Index: installFunctions.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/installFunctions.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** installFunctions.php 30 Sep 2010 16:56:19 -0000 1.41 --- installFunctions.php 27 Oct 2010 13:40:51 -0000 1.42 *************** *** 223,227 **** break; ! case "5.21.1": $this->casArray["command"] = $this->configArray["docroot"]."/maxima/stackmaxima_5.20.1.bat"; break; --- 223,231 ---- 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; Index: answer_test_testsuite.php =================================================================== RCS file: /cvsroot/stack/stack-dev/install/answer_test_testsuite.php,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** answer_test_testsuite.php 24 May 2010 10:22:15 -0000 1.56 --- answer_test_testsuite.php 27 Oct 2010 13:40:51 -0000 1.57 *************** *** 64,68 **** $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','-%i/sqrt(x)','sqrt(-1/x)',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,'',''); --- 64,67 ---- *************** *** 133,136 **** --- 132,136 ---- $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. *************** *** 235,241 **** // Factored form - $testsuite[] = stack_testsuite_construct('FacForm','1/0','0',0,'',''); $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','2','2',1,'x','Trivial cases'); $testsuite[] = stack_testsuite_construct('FacForm','1/3','1/3',1,'x',''); --- 235,241 ---- // 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',''); *************** *** 277,280 **** --- 277,281 ---- $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',''); *************** *** 318,321 **** --- 319,323 ---- $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'); *************** *** 353,356 **** --- 355,359 ---- $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'); *************** *** 372,375 **** --- 375,379 ---- $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',''); *************** *** 381,385 **** --- 385,393 ---- $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',''); *************** *** 412,417 **** $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','e^x+c','e^x',1,'x','These tests currently fail'); - $testsuite[] = stack_testsuite_construct('GT','1/0','1',0,'',''); --- 420,423 ---- *************** *** 433,436 **** --- 439,445 ---- + $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,'',''); *************** *** 447,450 **** --- 456,461 ---- $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]',''); *************** *** 536,540 **** C: cd \xampp\htdocs\stack-dev\install\ ! \xampp\php\php.exe answer_test_testsuite.php > test.html */ --- 547,551 ---- C: cd \xampp\htdocs\stack-dev\install\ ! \xampp\php\php.exe answer_test_testsuite.php > c:\tmp\test.html */ *************** *** 617,621 **** //$maxima_str .= 'AT'.$ts['AnswerTest'].'('.$ts['SAns'].',['.$ts['TAns'].','.$ts['AnsTestOpt']."]);\n"; - $err = ''; --- 628,631 ---- |
From: Chris S. <san...@us...> - 2010-10-27 13:34:34
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10961/maxima Modified Files: unittests.mac stackmaxima.mac Log Message: Bug fix in Maxima 5.22.1 forced us to update our code. Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** stackmaxima.mac 13 Oct 2010 14:32:11 -0000 1.82 --- stackmaxima.mac 27 Oct 2010 13:34:24 -0000 1.83 *************** *** 393,401 **** /* ********************************** */ - if is(MAXIMA_VERSION_NUM <= 5.12) then block( - round(x) := ?round(x), - truncate(x) := ?truncate(x) - ); - /* numberp() does not "work" when simp:false, since unary minus is an unevaluated function... */ simp_numberp(ex) := block( --- 393,396 ---- *************** *** 420,437 **** )$ - - stack_matrix_size(m) := block( - mLength : length(m), - if(mLength > 0) then mWidth : length(m[1]) - else mWidth : 0, - - ret : [mLength, mWidth], - return(ret))$ - - if is(MAXIMA_VERSION_NUM <= 5.11) then block( - matrix_size(x) := stack_matrix_size(x) - ); /* MAXMA >= 5.12 includes matrix_size function. JPH 10-12-07 */ - - decimalplaces(x,n) := block([simp:true,fpprintprec],fpprintprec:n,float(round(10^n*float(x))/(10^n)))$ --- 415,418 ---- *************** *** 520,533 **** )$ - /* Old code 25/9/9 - ex1:part(ex,1), - ex2:part(ex,2), - ex1:ev(setify(factorlist(ex1)),simp), - ex2:ev(setify(factorlist(ex2)),simp), - ex3:intersect(ex1,ex2), - if ex3={} then return(true), - return(false) - */ - /* Create a list with all parts for which numberp(ex)=true */ list_expression_numbers(ex) := block([ex2], --- 501,504 ---- *************** *** 815,819 **** )$ ! /* Equationss */ stack_eqnprepare(ex):=block([ret], ret:fullratsimp(trigexpand(rhs(ex)-lhs(ex))), --- 786,790 ---- )$ ! /* Equations */ stack_eqnprepare(ex):=block([ret], ret:fullratsimp(trigexpand(rhs(ex)-lhs(ex))), *************** *** 1085,1143 **** - - /******************************************************************/ - - /* This takes an expression of the student and a list of expressions from the teacher. - The purpose of this test is to allow many comparisons with a single call to the CAS. - The results are returned in the AnswerNote as a list of lists, one list for each test - - 0 = false - 1 = true - -1 = test not applied (eg SameType=false, means no point in looking for algebraic equivalence) - - Three tests applied. - (1) SameType - (2) AlgEquiv - (3) Equal_com_ass - Validity, errors and feedback are not used in the main test. The "raw mark" is always 0. - */ - ATMultiEquiv(SA,SBl) :=block([ret,k,SAe,SB,SBe,SBlen,SBSameType,SBALgEquiv,SBEqualComAss,AnswerNote], - /* Error catch */ - if listp(SBl)=false then return(StackReturnOb("0","Teacher's answer not list","")), - SAe:errcatch(ev(SA,simp,fullratsimp,nouns)), - if is(SAe=[STACKERROR]) then return(StackReturnOb(0,"ATMultiEquiv_STACKERROR_SAns","")), - SBe:errcatch(ev(SBl,simp,fullratsimp,nouns)), - if is(SBe=[STACKERROR]) then return(StackReturnOb(0,"ATMultiEquiv_STACKERROR_TAns","")), - /* Set up return arrays */ - SBlen:length(SBl), - SBSameType:makelist(0,i,1,SBlen), - SBALgEquiv:makelist(0,i,1,SBlen), - SBEqualComAss:makelist(0,i,1,SBlen), - /* Loop over SBl */ - for k:1 thru SBlen step 1 do block( - k:ev(k,simp), - SB:SBl[k], - /* Are the expressions the same type? */ - ret:ATSameTypefun(SA,SB), - SBSameType[k]:ret[2], - if ret[2]=0 then - (SBALgEquiv[k]:-1,SBEqualComAss[k]:-1) - else block( - /* Check for Algebraic Equivalence */ - ret:block([simp:true,ret],ATAlgEquivfun(SA,SB)), - SBALgEquiv[k]:ret[2], - if ret[2]=0 then - (SBEqualComAss[k]:-1) - else block( - SBEqualComAss[k]:if equals_commute_associate(SA,SB) then 1 else 0 - ) - ) /* End of if AlgEquiv */ - ), /* End of loop over SBL */ - /* Send back results */ - AnswerNote:[SBSameType,SBALgEquiv,SBEqualComAss], - return(StackReturnOb("0",string(AnswerNote),"")) - )$ - - /*****************************************************************/ --- 1056,1059 ---- *************** *** 1486,1524 **** )$ - /*********************************************************/ - /* Test added by Chris Sangwin, 21/2/8. */ - /* Extends notion of "partial fractions" to equations */ - /* Needed for ECP's trials of the ODE code */ - /*********************************************************/ - - PartFracEq(SA,TA,var) := block([ret], - ret:ATAlgEquivfun(SA,SB), - if ret[2]=1 then block( - if equationp(TA) then - block ([ret1,ret2], - ret1:PartFracfun(lhs(SA),lhs(TA),var), - ret2:PartFracfun(rhs(SA),rhs(TA),var), - if ret1[2]=1 then - (if rhs(SA)=rhs(TA) then - true - else if ret2[2]=1 then - true - else - false - ) - else if ret2[2]=1 then - (if lhs(SA)=lhs(TA) then - true - else - false - ) - ) else - block ([ret:PartFracfun(SA,TA,var)], - ret[2] - ) - ) else - false - )$ - /* ************************ATSingFracTest****************************** */ /* requires: Student Answer */ --- 1402,1405 ---- *************** *** 1803,1806 **** --- 1684,1695 ---- )$ + /* This function strips off any trailing constant of integration from an expression, which is not a number */ + strip_int_const(ex,v):=block([ex2], + ex2:ex, + if not(atom(ex)) then + if op(ex)="+" then + ex2:apply("+",filter(lambda([ex2],not(freeof(v,ex2)) or simp_numberp(ex2)),args(ex))), + return(ex2))$ + /* An answer test for integration questions.*/ /* sa is the students' ansewer, sbl is a list consisting of (1) the answer, and (2) the variable */ *************** *** 1843,1850 **** val:true, rawmk:0, fb:"", ansnote:"", ret:[val,rawmk,ansnote,fb], ! SB:ev(SB,logexpand:super), /* This expands out logarithms for constants eg ln(k*|x|) */ ! if freeof(v,coeff(SB,v,0)) then SB:SB-coeff(SB,v,0), /* This strips off any trailing constant of integration from the teacher's answer */ ! SAa:ev(SA,logexpand:super)-coeff(ev(SA,logexpand:super),v,0), /* This strips off any trailing constant of integration */ ! /* check for constant of integration - code copied from Stack_Test */ ex:errcatch(ev(fullratsimp(SA-SB),simp,trigexpand:true,logexpand:super,keepfloat:true)), if ex=[] then return(false), --- 1732,1742 ---- val:true, rawmk:0, fb:"", ansnote:"", ret:[val,rawmk,ansnote,fb], ! /* This expands out logarithms for constants, e.g. ln(k*|x|) */ ! SB:ev(SB,logexpand:super), ! /* This strips off any trailing constant of integration from the teacher's answer */ ! SB:strip_int_const(SB,v), ! /* This strips off any trailing constant of integration from the student's answer */ ! SAa:strip_int_const(ev(SA,logexpand:super),v), ! /* Check for constant of integration - code copied from Stack_Test */ ex:errcatch(ev(fullratsimp(SA-SB),simp,trigexpand:true,logexpand:super,keepfloat:true)), if ex=[] then return(false), *************** *** 1976,2163 **** )$ - ATEquationfun(SA,SB,var,AT) := block([ret,ret0,ret1,ret2,lLHSv,lRHSv,mLHSv,mRHSv], - ret:ATEqnRet(SA,SB,var,"AE"), - ret0:ret, - - /* if is("I"=AT) then ( - lLHSv:append(listofvars(lhs(SA)),listofvars(lhs(SB))), - lRHSv:append(listofvars(rhs(SA)),listofvars(rhs(SB))), - mLHSv:member(var,lLHSv), - mRHSv:member(var,lRHSv) - ),*/ - - /* print("ATEqnRet for AE of SA with SB ",ret),*/ - if (is(ret[1]=true) and not(is("AE"=AT)))then block( - if (equationp(SB) and equationp(SA)) then block ([ret1,ret2], - ret1:ATEqnRet(lhs(SA),lhs(SB),var,AT), - /* print("ATEqnRet for AT LHSs of SA with SB ",ret1),*/ - ret2:ATEqnRet(rhs(SA),rhs(SB),var,AT), - /* print("ATEqnRet for AT RHSs of SA with SB ",ret2),*/ - if (ret1[3]=concat("ATE_unknowntest_",AT) or ret2[3]=concat("ATE_unknowntest_",AT)) then - ret:[false,0,ret1[3],""] - else ( - if (is(ret1[1]=false)) then /* Checks for validity of L and RHSs before continuing */ - if (is(ret2[1]=false)) then - ret:[false,0,concat(AT,"E_LF_RF"),""] - else - ret:[false,0,concat(AT,"E_LF_RV"),""] - else - if (is(ret2[1]=false)) then - ret:[false,0,concat(AT,"E_LV_RF"),""] - else block( - /* print("In [1]<>false else loop"),*/ - if (is(ret1[2]=1) and is(ret2[2]=1) and not(is(rhs(SA)=rhs(SB))) and not(is(lhs(SA)=lhs(SB)))) then - ret:[true,1,concat(AT,"E_L",AT,"_R",AT),""] /* e.g. PFE_LPF_RPF or IE_LI_RI */ - else - if (is(ret1[2]=0) and is(ret2[2]=0)) then block( - ret[2]:0, - ret[3]:concat(concat(AT,"E_N",AT)," ",ret1[3]," ",ret2[3]), /* the inner concat is probably unnecessary but is there for clarity, for now */ - ret[4]:concat(ret1[4],ret2[4]), - return(ret) - ) - else - if is(rhs(SA)=rhs(SB)) then block( - /* print("RHSs equal"),*/ - if is(lhs(SA)=lhs(SB)) then - if is(ret1[2]=1) then - if is(ret2[2]=1) then - ret[3]:concat(AT,"E_LU_RU") - else - (ret[3]:concat(concat(AT,"E_LU_RU")," ",ret2[3]),ret[2]:0) - else - if is(ret2[2]=1) then - (ret[3]:concat(concat(AT,"E_LU_RU")," ",ret1[3]),ret[2]:0) - else /* ret1[2]=0=ret2[2] */ - (ret[3]:concat(concat(AT,"E_LU_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else /* RHS equal, LHSs not equal */ - if is(ret1[2]=1) then - if is(ret2[2]=1) then - (ret[3]:concat(AT,"E_L",AT,"_RU"),ret[2]:1) - else - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret2[3]),ret[2]:0) - else - if is(ret2[2]=1) then - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RU")," ",ret1[3]," ",ret2[3]),ret[2]:0), - /* if is(ret1[2]=1) then - ret[3]:concat(AT,"E_L",AT,"_RU") - else - (ret[3]:concat(concat(AT,"E_LN",AT,"_RU")," ",ret1[3]),ret[2]:0), */ - return(ret) - ) /* RHSs not equal */ - else - if is(lhs(SA)=lhs(SB)) then block( - if is(ret1[2]=1) then - if is(ret2[2]=1) then - (ret[3]:concat(AT,"E_LU_R",AT),ret[2]:1) - else - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret2[3]),ret[2]:0) - else /* ret1[2]=0 */ - if is(ret2[2]=1) then - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_R",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_R",AT)," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_LU_R",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_LU_R",AT)," ",ret1[3]),ret[2]:0) - else - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_LU_RN",AT)," ",ret1[3]),ret[2]:0), - return(ret) - ) - else - if is(ret1[2]=1) then - if (is(AT="I")) then - if (is(ret1[3]="ATInt_const") and is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RN")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else if (is(ret1[3]="ATInt_const") or is(ret2[3]="ATInt_const")) then - (ret[3]:concat(concat(AT,"E_L",AT,"_RN")," ",ret1[3]," ",ret2[3]),ret[2]:1) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RN")," ",ret1[3]," ",ret2[3]),ret[2]:0) - else - (ret[3]:concat(concat(AT,"E_L",AT,"_RN")," ",ret2[3]),ret[2]:0) - else block( - ret[3]:concat(concat(AT,"E_LN_R",AT)," ",ret1[3]), - ret[2]:0, - return(ret) - ) - ) - ) - ) - else block( - ret:ATEqnRet(SA,SB,var,AT), - if is(ret[2]=0) then - ret[3]:concat(concat(AT,"E_not_eqns")," ",ret[3]) - else - ret[3]:concat(AT,"E_not_eqns") - ) - ) - else ( - if not(is("AE"=AT)) then - if equationp(SA) then - ret:[false,0,concat(AT,"E_SAE_SBN"),"ATAlgEquiv_SA_not_equation"] - else - if equationp(SB) then - ret:[false,0,concat(AT,"E_SBE_SAN"),"ATAlgEquiv_TA_not_equation"] - else - ret:[false,0,concat(AT,"E_NAE_other"),""] - ), - return(ret) - )$ - - ATEqnRet(cl,ll,opt,test) := block([rt], - if is(test="I") then - rt:Intfun(cl,ll,opt) - else if is(test="D") then - rt:Difffun(cl,ll,opt) - else if is(test="PF") then - if (atom(cl) or atom(ll)) then - rt:ATAlgEquivfun(cl,ll) - else - rt:PartFracfun(cl,ll,opt) - else if is(test="FF") then - rt:FacFormfun(cl,ll,opt) - else if is(test="AE") then - rt:ATAlgEquivfun(cl,ll) - else /* Something invalid passed */ - rt:[false,0,concat("ATE_unknowntest_",test),""], /* val,rawmk,ansnote,fb */ - return(rt) - )$ - /* Description : forme echelonne par lignes d'une matrice rectangulaire --- 1868,1871 ---- Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** unittests.mac 13 Oct 2010 16:57:50 -0000 1.16 --- unittests.mac 27 Oct 2010 13:34:24 -0000 1.17 *************** *** 195,196 **** --- 195,200 ---- 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: Chris S. <san...@us...> - 2010-10-27 08:26:58
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23150/lang/en Modified Files: stack.php Log Message: Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** stack.php 13 Oct 2010 12:15:02 -0000 1.157 --- stack.php 27 Oct 2010 08:26:49 -0000 1.158 *************** *** 632,636 **** $string['stackAuthor_invalid_workedSolution'] = 'Worked Solution is invalid:'; $string['stackAuthor_invalid_questionNote'] = 'Question Note is invalid:'; ! $string['stackAuthor_empty_questionNote'] = 'Question Note cannot be empty. 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:'; --- 632,636 ---- $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:'; |
From: Chris S. <san...@us...> - 2010-10-13 16:57:58
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27610/maxima Modified Files: unittests.mac Log Message: Index: unittests.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/unittests.mac,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** unittests.mac 30 Sep 2010 16:56:14 -0000 1.15 --- unittests.mac 13 Oct 2010 16:57:50 -0000 1.16 *************** *** 187,188 **** --- 187,196 ---- 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)"); + |
From: Chris S. <san...@us...> - 2010-10-13 14:58:15
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv2102/maxima Modified Files: stacktex.lisp Log Message: Fix to the unary minus display problem. Index: stacktex.lisp =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stacktex.lisp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** stacktex.lisp 30 Sep 2010 16:56:14 -0000 1.6 --- stacktex.lisp 13 Oct 2010 14:58:07 -0000 1.7 *************** *** 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) *************** *** 147,149 **** (defprop mlessp (" < ") texsym) ! (defprop mgreaterp (" > ") texsym) \ No newline at end of file --- 149,151 ---- (defprop mlessp (" < ") texsym) ! (defprop mgreaterp (" > ") texsym) |
From: Chris S. <san...@us...> - 2010-10-13 14:32:19
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27313/maxima Modified Files: stackmaxima.mac Log Message: Comma validation bug Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** stackmaxima.mac 13 Oct 2010 12:14:28 -0000 1.81 --- stackmaxima.mac 13 Oct 2010 14:32:11 -0000 1.82 *************** *** 278,297 **** )$ ! /*JPH validate an expression without type checking. Floats and mathematical errors only. */ ! stack_validate_typeless(ex,ForbidFloats,LowestTerms) := block( [simp:false,exs], /* Try to simply the expression to catch CAS errors */ ! exs:errcatch(ev(ex,simp)), if exs=[] then return(false), if length(expr)#1 then print(StackAddFeedback("","CommaError",expr,setify(expr))), expr:first(expr), /* Check for floats, and if there are any then throw an error */ ! if ForbidFloats and anyfloatex(ex) then print(StackAddFeedback("","Illegal_floats")), /* Checks fractions are in lowest terms */ ! if LowestTerms and all_lowest_termsex(ex)=false then print(StackAddFeedback("","Lowest_Terms")), /* Now display the result */ simp:false, ! return(ex) )$ --- 278,297 ---- )$ ! /*validate an expression without type checking. Floats and mathematical errors only. */ ! stack_validate_typeless(expr,ForbidFloats,LowestTerms) := block( [simp:false,exs], /* Try to simply the expression to catch CAS errors */ ! exs:errcatch(ev(expr,simp)), if exs=[] then return(false), if length(expr)#1 then print(StackAddFeedback("","CommaError",expr,setify(expr))), expr:first(expr), /* Check for floats, and if there are any then throw an error */ ! if ForbidFloats and anyfloatex(expr) then print(StackAddFeedback("","Illegal_floats")), /* Checks fractions are in lowest terms */ ! if LowestTerms and all_lowest_termsex(expr)=false then print(StackAddFeedback("","Lowest_Terms")), /* Now display the result */ simp:false, ! return(expr) )$ |
From: Chris S. <san...@us...> - 2010-10-13 12:15:28
|
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28571/lib/reporting Modified Files: SkillsResources.php Log Message: Comma validation bug Index: SkillsResources.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/SkillsResources.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SkillsResources.php 30 Sep 2010 16:56:15 -0000 1.2 --- SkillsResources.php 13 Oct 2010 12:15:19 -0000 1.3 *************** *** 562,568 **** $question = $this->getQuestionStem($qname); ! $quiz.= "<h2><b>($question[0]) {$question[1]}</b>:</h2>"; ! $quiz.= "<p>".$question[2]."</p>"; $quiz.= "<p><hr /></p>"; } --- 562,571 ---- $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>"; } |
From: Chris S. <san...@us...> - 2010-10-13 12:15:27
|
Update of /cvsroot/stack/stack-dev/lib/items In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28571/lib/items Modified Files: RawKeyVal.php StudentAns.php CasTextType.php CasString.php Log Message: Comma validation bug Index: CasTextType.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/CasTextType.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CasTextType.php 30 Sep 2010 16:56:15 -0000 1.26 --- CasTextType.php 13 Oct 2010 12:15:19 -0000 1.27 *************** *** 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; Index: StudentAns.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/StudentAns.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** StudentAns.php 30 Sep 2010 16:56:15 -0000 1.46 --- StudentAns.php 13 Oct 2010 12:15:19 -0000 1.47 *************** *** 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; --- 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; Index: RawKeyVal.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/RawKeyVal.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** RawKeyVal.php 30 Sep 2010 16:56:15 -0000 1.32 --- RawKeyVal.php 13 Oct 2010 12:15:19 -0000 1.33 *************** *** 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; Index: CasString.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/CasString.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CasString.php 27 Aug 2009 16:23:00 -0000 1.16 --- CasString.php 13 Oct 2010 12:15:19 -0000 1.17 *************** *** 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; } |
From: Chris S. <san...@us...> - 2010-10-13 12:15:12
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28065/lang/en Modified Files: stack.php Log Message: Comma validation bug Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** stack.php 1 Oct 2010 17:34:11 -0000 1.156 --- stack.php 13 Oct 2010 12:15:02 -0000 1.157 *************** *** 724,727 **** --- 724,728 ---- $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 |
From: Chris S. <san...@us...> - 2010-10-13 12:14:36
|
Update of /cvsroot/stack/stack-dev/maxima In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27973/maxima Modified Files: stackmaxima.mac Log Message: Comma validation bug Index: stackmaxima.mac =================================================================== RCS file: /cvsroot/stack/stack-dev/maxima/stackmaxima.mac,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** stackmaxima.mac 30 Sep 2010 16:56:14 -0000 1.80 --- stackmaxima.mac 13 Oct 2010 12:14:28 -0000 1.81 *************** *** 260,263 **** --- 260,265 ---- exs:errcatch(ev(expr,simp)), if exs=[] then return(false), + if length(expr)#1 then print(StackAddFeedback("","CommaError",string(expr),string(setify(expr)))), + expr:first(expr), /* Check for floats, and if there are any then throw an error */ if ForbidFloats and anyfloatex(expr) then *************** *** 281,284 **** --- 283,288 ---- exs:errcatch(ev(ex,simp)), if exs=[] then return(false), + if length(expr)#1 then print(StackAddFeedback("","CommaError",expr,setify(expr))), + expr:first(expr), /* Check for floats, and if there are any then throw an error */ if ForbidFloats and anyfloatex(ex) then |
From: Simon H. <sim...@us...> - 2010-10-08 14:27:13
|
Update of /cvsroot/stack/stack-dev/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1103/opaque Modified Files: MoodleQuestionList.php Log Message: Fixes keyword filtering in Moodle, bug #3083669. Index: MoodleQuestionList.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/MoodleQuestionList.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MoodleQuestionList.php 30 Sep 2010 16:56:21 -0000 1.10 --- MoodleQuestionList.php 8 Oct 2010 13:38:45 -0000 1.11 *************** *** 158,162 **** $this->db->connect(); ! $questions = $this->db->getListOfQuestions($param['userID'], true, $param['filter'], $param['keywords']); $this->db->disconnect(); --- 158,162 ---- $this->db->connect(); ! $questions = $this->db->getLines($param['userID'], true, $param['filter'], $param['keywords']); $this->db->disconnect(); |
From: Simon H. <sim...@us...> - 2010-10-07 16:34:13
|
Update of /cvsroot/stack/stack-dev/opaque In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv18406/opaque Modified Files: StackServer.php Log Message: Partial fix for bug 3083096. Still needs jsMath rendering. Index: StackServer.php =================================================================== RCS file: /cvsroot/stack/stack-dev/opaque/StackServer.php,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** StackServer.php 30 Sep 2010 16:56:21 -0000 1.50 --- StackServer.php 7 Oct 2010 16:34:05 -0000 1.51 *************** *** 683,687 **** <script type="text/javascript" src="' . $webroot . '/other/moo.fx/prototype.lite.js"></script> <script type="text/javascript" src="' . $webroot . '/other/moo.fx/moo.fx.js"></script> ! <script type="text/javascript" src="' . $webroot . '/other/moo.fx/moo.fx.js"></script> <script type="text/javascript" src="' . $webroot . '/other/jquery.js"></script> --- 683,687 ---- <script type="text/javascript" src="' . $webroot . '/other/moo.fx/prototype.lite.js"></script> <script type="text/javascript" src="' . $webroot . '/other/moo.fx/moo.fx.js"></script> ! <script type="text/javascript" src="' . $webroot . '/other/flyfeedback.js"></script> <script type="text/javascript" src="' . $webroot . '/other/jquery.js"></script> |
From: Simon H. <sim...@us...> - 2010-10-04 15:00:36
|
Update of /cvsroot/stack/stack-dev/lib/items In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv27194/lib/items Modified Files: Item.php Log Message: Equality comparison now includes checking validity status to fix bulk validation operation. Index: Item.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/items/Item.php,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Item.php 30 Sep 2010 16:56:15 -0000 1.65 --- Item.php 4 Oct 2010 15:00:28 -0000 1.66 *************** *** 1401,1404 **** --- 1401,1407 ---- if($this->line !== $other->line) return false; + // Might be nicer to update rather than create new 'valid' version of exact same question, but meanwhile... + if($this->valid !== $other->valid) return false; + return true; // all tests passed } |
From: Simon H. <sim...@us...> - 2010-10-01 17:34:19
|
Update of /cvsroot/stack/stack-dev/lang/en In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3716/lang/en Modified Files: stack.php Log Message: Minor change. Index: stack.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lang/en/stack.php,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** stack.php 30 Sep 2010 16:56:21 -0000 1.155 --- stack.php 1 Oct 2010 17:34:11 -0000 1.156 *************** *** 1158,1162 **** $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.'; --- 1158,1162 ---- $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.'; |
From: Simon H. <sim...@us...> - 2010-10-01 15:03:02
|
Update of /cvsroot/stack/stack-dev/lib/database In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7863/lib/database Modified Files: StackDBItem.php StackDBCache.php Log Message: Much needed optimisation of question listing. Index: StackDBItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBItem.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** StackDBItem.php 30 Sep 2010 16:56:13 -0000 1.36 --- StackDBItem.php 1 Oct 2010 15:02:54 -0000 1.37 *************** *** 587,595 **** global $config; $i=0; if($this->noRows()>0) { ! $dbc = new StackDBCache(); ! $dbc->connect(); foreach($result as $row) { --- 587,602 ---- 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) { *************** *** 602,610 **** $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'); --- 609,617 ---- $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'); Index: StackDBCache.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/database/StackDBCache.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** StackDBCache.php 30 Sep 2010 16:56:13 -0000 1.22 --- StackDBCache.php 1 Oct 2010 15:02:54 -0000 1.23 *************** *** 631,634 **** --- 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) { |
From: Simon H. <sim...@us...> - 2010-10-01 15:03:02
|
Update of /cvsroot/stack/stack-dev In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7863 Modified Files: index.php Log Message: Much needed optimisation of question listing. Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-dev/index.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** index.php 30 Sep 2010 16:56:15 -0000 1.43 --- index.php 1 Oct 2010 15:02:54 -0000 1.44 *************** *** 21,36 **** session_start(); - /*echo "<pre>"; - print_r($_SESSION); - echo "-------------------"; - print_r($_POST); - echo "-------------------"; - print_r($_GET); - echo "</pre>"; - - unset($_SESSION['S_item']); - unset($_SESSION['authorItem']); - */ - $configFile = 'config.php'; if(!file_exists($configFile)) --- 21,24 ---- |