Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv25193/lib/ui Modified Files: Tag: item_state_separation questionTest.php authorTest.php questionBank.php AuthorDisplay.php questionReview.php questionExporter.php OptionsEdit.php OptionsEditor.php questionDeploy.php DisplayItem.php questionImporter.php report.php GhostWriter.php AdminInterface.php frontend.php Added Files: Tag: item_state_separation report.js report.css Removed Files: Tag: item_state_separation BlockHandler.php Log Message: Brought back up to date with big HEAD merge. Index: questionImporter.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionImporter.php,v retrieving revision 1.17 retrieving revision 1.17.10.1 diff -C2 -d -r1.17 -r1.17.10.1 *** questionImporter.php 28 Jul 2009 15:39:26 -0000 1.17 --- questionImporter.php 9 Nov 2010 16:51:37 -0000 1.17.10.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: questionDeploy.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionDeploy.php,v retrieving revision 1.8.6.1 retrieving revision 1.8.6.1.2.1 diff -C2 -d -r1.8.6.1 -r1.8.6.1.2.1 *** questionDeploy.php 3 Nov 2009 16:03:28 -0000 1.8.6.1 --- questionDeploy.php 9 Nov 2010 16:51:37 -0000 1.8.6.1.2.1 *************** *** 23,26 **** --- 23,36 ---- 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'); require_once('DisplayItem.php'); *************** *** 31,81 **** require_once $root.'/lib/deployment/Deployment.php'; $cache = new StackDBCache(); $cache->connect(); ! echo html_head(get_string('FE_deployQuestion', 'stack'),'../../',"@import \"../../styles.css\";\n"); ! $qid = $_GET['id']; // TODO: needs sanitization ?> - <body> ! <h1><?php echo get_string('FE_deployQuestion', 'stack').' '.$qid; ?></h1> <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a> ! <a href="authorTest.php?id=<?php echo $qid ?>"><?php echo get_string('stackQuestion_filterLinkEdit','stack'); ?></a></p> <div class="section80"> ! <h3 class="section"><?php echo get_string('FE_deployQuestion_instancesOfQuestion', 'stack').' '.$qid; ?></h3> <p> <?php - $deployment = new Deployment($qid); // will auto-deploy as necessary - $request = $_POST + $_GET; // POST from this page with possible GET via Opaque if(!$deployment->isSingleton()) { // multiple versions - $result = $deployment->processOperations($request); if(!empty($result)) echo "<div class='warning'>".$result."</div>"; ! echo "<form method='POST' action='?id=".$qid."'>".$deployment->formXHTML()."</form"; } else { // single version echo "<div class='warning'>"; ! echo $deployment->processOperations($request); if($deployment->autoDeployed) { echo get_string('FE_deployQuestion_auto', 'stack'); } echo "</div>"; } ! //echo $deployment->listXHTML(); ! if($deployment->getInstances() == NULL) { echo '<i>'.get_string('FE_deployQuestion_noi', 'stack').'</i>'; } else { ! if (1 == count($deployment->getInstances())) { ! echo '<p>'.get_string('FE_deployQuestion_version', 'stack').'</p>'; } else { ! echo '<p>'.count($deployment->getInstances()).get_string('FE_deployQuestion_versions', 'stack').'</p>'; } echo '<table class="deploymentTable" border="1">'; echo '<tr><th>'; ! echo '</th><th>'; echo get_string('stackQuestion_questionStem', 'stack'); echo '</th><th>'; --- 41,121 ---- require_once $root.'/lib/deployment/Deployment.php'; + $id = $_GET['id']; // TODO: needs sanitization + + $itemDB = new StackDBItem(); + $itemDB->connect(); + $latestVersion = $itemDB->getLatestVersion($id); + $cache = new StackDBCache(); $cache->connect(); ! $deployment = new Deployment($id); // will auto-deploy as necessary ! $request = $_POST + $_GET; // POST from this page with possible GET via Opaque ! $result = $deployment->processOperations($request); + echo html_head(get_string('FE_deployVersion', 'stack'),'../../',"@import \"../../styles.css\";\n"); ?> <body> ! <h1><?php echo get_string('FE_deployVersion', 'stack').' '.$id; ?></h1> <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a> ! <a href="authorTest.php?id=<?php echo $id ?>"><?php echo get_string('stackQuestion_filterLinkEdit','stack'); ?></a></p> <div class="section80"> ! <h3 class="section"> ! <?php ! if(isset($_GET['dropall'])) { ! $undeployment = new Deployment($_GET['dropall']); ! $undeployment->drop(); ! } ! ! echo get_string('FE_deployQuestion_instancesOfVersion', 'stack').' '.$id; ! ?></h3> <p> <?php + $earliest = $deployment->earliestDeployedVersion(); // any stale deployments? if(!$deployment->isSingleton()) { // multiple versions if(!empty($result)) echo "<div class='warning'>".$result."</div>"; ! if($latestVersion == $deployment->getVersion()) { // this is latest version ! if($latestVersion == $earliest || false == $earliest) { ! echo "<form method='POST' action='?id=".$id."'>".$deployment->formXHTML()."</form>"; ! } else { ! echo get_string('FE_deployQuestion_oldVersionDeployed', 'stack'); ! $deployment = new Deployment($earliest); ! echo '<p><a href="?id='.$id.'&dropall='.$earliest.'">'.get_string('FE_deployQuestion_undeployAll', 'stack').'</a>'; ! } ! } else { // this is an old version ! echo get_string('FE_deployQuestion_newerVersionCannotDeploy', 'stack', $latestVersion); ! echo '<a href="?id='.$latestVersion.'">deploy latest</a>'; ! } } else { // single version echo "<div class='warning'>"; ! echo $result;//$deployment->processOperations($request); if($deployment->autoDeployed) { echo get_string('FE_deployQuestion_auto', 'stack'); + } else { + echo get_string('FE_deployQuestion_oldVersionDeployed', 'stack'); + $deployment = new Deployment($earliest); } echo "</div>"; } ! $instances = $deployment->getInstances(); ! ! if($instances == NULL) { echo '<i>'.get_string('FE_deployQuestion_noi', 'stack').'</i>'; } else { ! if (1 == count($instances)) { ! echo '<p>'.get_string('FE_deployQuestion_instanceDeployed', 'stack').'</p>'; } else { ! echo '<p>'.get_string('FE_deployQuestion_xInstances', 'stack', $deployment->size()); } + echo get_string('FE_deployQuestion_ofVersionXdeployed', 'stack', $deployment->getVersion()).'</p>'; echo '<table class="deploymentTable" border="1">'; echo '<tr><th>'; ! //echo 'v';//get_string('stackQuestion_id.revision', 'stack'); ! //echo '</th><th>'; echo get_string('stackQuestion_questionStem', 'stack'); echo '</th><th>'; *************** *** 84,91 **** echo '</th></tr>'; ! foreach($deployment->getInstances() as $instance) { $item = $cache->getDisplayItem($instance['id']); echo '<tr>'; ! echo '<td>'. $instance['id'] .'</td>'; echo '<td>'. $instance['xhtml'] .'</td>'; echo '<td>'.$item->getQuestionNote().'</td>'; --- 124,132 ---- echo '</th></tr>'; ! foreach($instances as $instance) { ! //print_r($instance); $item = $cache->getDisplayItem($instance['id']); echo '<tr>'; ! //echo "<td>$instance[version]</td>"; echo '<td>'. $instance['xhtml'] .'</td>'; echo '<td>'.$item->getQuestionNote().'</td>'; *************** *** 99,113 **** ?> </div> - <div class="section80"> - <h3 class="section"><?php echo get_string('FE_deployQuestion_primedResponses', 'stack')?></h3> - 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. - <form method="POST" action="questionDeploy.php?id=<?php echo $qid ?>"> - <input type="submit" value="Regenerate"> - </form> <?php $responses = $deployment->primeResponses(); if($responses === NULL) echo "No question tests defined!"; else echo sizeof($responses)." new responses primed."; // should output responses defined (counted) and their test result ?> </div> \ No newline at end of file --- 140,155 ---- ?> </div> <?php + if($earliest == $latestVersion) { + echo '<div class="section80">'; + echo '<h3 class="section">'.get_string('FE_deployQuestion_primedResponses', 'stack').'</h3>'; + echo get_string('FE_deployQuestion_primedResponsesBlurb', 'stack'); + echo '<form method="POST" action="questionDeploy.php?id='.$id.'"><input type="submit" value="Regenerate"></form>'; + $responses = $deployment->primeResponses(); if($responses === NULL) echo "No question tests defined!"; else echo sizeof($responses)." new responses primed."; // should output responses defined (counted) and their test result + } ?> </div> \ No newline at end of file Index: OptionsEdit.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/OptionsEdit.php,v retrieving revision 1.5 retrieving revision 1.5.20.1 diff -C2 -d -r1.5 -r1.5.20.1 *** OptionsEdit.php 4 Oct 2007 12:58:48 -0000 1.5 --- OptionsEdit.php 9 Nov 2010 16:51:37 -0000 1.5.20.1 *************** *** 19,23 **** $config = new stackConfig(); global $config; ! require_once('OptionsEditor.php'); $editor = new OptionsEditor(); --- 19,33 ---- $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('OptionsEditor.php'); $editor = new OptionsEditor(); *************** *** 25,29 **** ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> --- 35,39 ---- ?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> *************** *** 41,51 **** var optionsContainer; var copyContainer; ! window.onload = function() { optionsContainer = new fx.Height('options', {duration: 400}); copyContainer = new fx.Height('copy', {duration: 400}); ! //copyContainer.hide(); ! //optionsContainer.hide(); ! <?php //display last edited page. if(!empty($_POST['edit_new']) || !empty($_POST['edit_overwrite'])) --- 51,61 ---- var optionsContainer; var copyContainer; ! window.onload = function() { optionsContainer = new fx.Height('options', {duration: 400}); copyContainer = new fx.Height('copy', {duration: 400}); ! //copyContainer.hide(); ! //optionsContainer.hide(); ! <?php //display last edited page. if(!empty($_POST['edit_new']) || !empty($_POST['edit_overwrite'])) *************** *** 59,63 **** ?> } ! function toggleBoth() { --- 69,73 ---- ?> } ! function toggleBoth() { *************** *** 66,72 **** optionsContainer.toggle('optIcon', iconPath); } ! ! </script> ! <title>Question test</title> </head> --- 76,82 ---- optionsContainer.toggle('optIcon', iconPath); } ! ! </script> ! <title>Question test</title> </head> Index: authorTest.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/authorTest.php,v retrieving revision 1.15.10.1 retrieving revision 1.15.10.2 diff -C2 -d -r1.15.10.1 -r1.15.10.2 *** authorTest.php 2 Dec 2009 20:13:03 -0000 1.15.10.1 --- authorTest.php 9 Nov 2010 16:51:37 -0000 1.15.10.2 *************** *** 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,104 **** //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" src="../../other/jquery.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); ! } ! ! function toggleIcon(container) { ! var iconPath = '<?php echo $config->get('weburl'); ?>/pix/'; ! alert($(container).child()); ! } ! </script> ! <title>Question test</title> ! </head> <body> <form action="authorTest.php" method="POST"> <div id="authoringControls"> ! <h2><?php echo get_string('stackAuthor_title'.$key,'stack').' #'.$_GET['id'] ?></h2> ! <p><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'); ?>" /> --- 61,71 ---- //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'); ?>" /> *************** *** 107,116 **** <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> <p> ! <a href="#stem">Stem</a> ! <br /><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a> ! <br /><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a> ! <br /><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a> ! <br /><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a> ! <br /><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a> </div> <?php --- 74,90 ---- <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 *************** *** 118,122 **** ?> </form> ! <?php --- 92,100 ---- ?> </form> ! <script language="JavaScript" type="text/javascript"> ! $(document).ready(function() { ! $('#authoringControls').append($('#versionHistory').detach().html()); ! }); ! </script> <?php Index: DisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/DisplayItem.php,v retrieving revision 1.91.2.4.2.1 retrieving revision 1.91.2.4.2.2 diff -C2 -d -r1.91.2.4.2.1 -r1.91.2.4.2.2 *** DisplayItem.php 4 Dec 2009 10:11:14 -0000 1.91.2.4.2.1 --- DisplayItem.php 9 Nov 2010 16:51:37 -0000 1.91.2.4.2.2 *************** *** 41,46 **** require_once $root.'/lib/database/StackDBCache.php'; - // Block Handler - require_once $root.'/lib/ui/BlockHandler.php'; /** * Creates instantiated item & provides methods for displaying it. --- 41,44 ---- *************** *** 311,315 **** /** 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 --- 309,313 ---- /** 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 *************** *** 387,390 **** --- 385,389 ---- //check status, $status = $IE->getStatus(); + $hideFeedback = 'true' == $this->item->questionPart[$label]->getHideFeedback()->getSelected(); switch($status) *************** *** 405,408 **** --- 404,410 ---- //$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; *************** *** 425,428 **** --- 427,433 ---- $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 438,441 **** --- 443,449 ---- } $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 454,457 **** --- 462,468 ---- $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); *************** *** 495,499 **** // 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">'; --- 506,517 ---- // 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">'; *************** *** 507,511 **** //.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>'; --- 525,529 ---- //.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>'; *************** *** 679,683 **** foreach($posted as $label => $post) { ! $exploded = explode('-', $label); if(count($exploded) == 1) --- 697,701 ---- foreach($posted as $label => $post) { ! $exploded = explode('|', $label); if(count($exploded) == 1) *************** *** 729,739 **** 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) { --- 747,758 ---- 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) { *************** *** 763,766 **** --- 782,786 ---- //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); *************** *** 856,859 **** --- 876,880 ---- } + /** * Sends the question stem to the cas, then caches it for later use. *************** *** 881,884 **** --- 902,906 ---- } + //add in the teachers answers $tansStartAt = $count; //index teachers answer start at. *************** *** 886,889 **** --- 908,912 ---- if($questionPart != NULL) { + foreach($questionPart as $label => $part) { *************** *** 903,920 **** } } - $castextheader = $castext; // may need this for conditional cas calls // Mark the point in the text before which we need to ignore. $castext .= '<qv_end>'; ! // process blocks in stem before adding it ! $bh = new BlockHandler($this->item->questionStem->getRawCasText(), $this->seed, $castextheader, $this->itemOpts->getSelected('Display')); ! $castext .= $bh->getProcessed(); ! $ct = new casText($castext, 't', false, true); //send to cas with teacher privilages $casCommands = $ct->extractCASCommands($this->errorLog); - //var_dump($casCommands); - $displayFormat = $this->itemOpts->getSelected('Display'); if ($casCommands === false) --- 926,939 ---- } } // Mark the point in the text before which we need to ignore. $castext .= '<qv_end>'; + $castext .= $this->item->questionStem->getRawCasText(); ! //echo 'Question stem raw: '.$this->item->questionStem->getRawCasText(); ! //$ct = new casText($this->item->questionStem->getRawCasText(), 't', false, true); //send to cas with teacher privilages $ct = new casText($castext, 't', false, true); //send to cas with teacher privilages $casCommands = $ct->extractCASCommands($this->errorLog); $displayFormat = $this->itemOpts->getSelected('Display'); if ($casCommands === false) *************** *** 937,945 **** //extract out and store the teachers answers $maximaOptions = new maximaPreferences($displayFormat, $this->itemOpts); $mconn = new maximaConnector($maximaOptions, 't', $this->seed); //WARNING: using teacher security level. $displayResults = $mconn->sendCASCommands($casCommands); $errs = $mconn->returnErrors(); $valuesResults = $mconn->returnValues(); - //var_dump($valuesResults); if($mconn->displayErrorString() !== NULL) --- 956,964 ---- //extract out and store the teachers answers $maximaOptions = new maximaPreferences($displayFormat, $this->itemOpts); + $mconn = new maximaConnector($maximaOptions, 't', $this->seed); //WARNING: using teacher security level. $displayResults = $mconn->sendCASCommands($casCommands); $errs = $mconn->returnErrors(); $valuesResults = $mconn->returnValues(); if($mconn->displayErrorString() !== NULL) *************** *** 1106,1115 **** } } - $castextheader = $castext; // may need this for conditional cas calls $castext .= '<qv_end>'; ! ! // process blocks in worked solution before adding it ! $bh = new BlockHandler($this->item->workedSolution->getRawCasText(), $this->seed, $castextheader, $this->itemOpts->getSelected('Display')); ! $castext .= $bh->getProcessed(); $ct = new casText($castext, 't', false, true); //send to cas with teacher privilages --- 1125,1130 ---- } } $castext .= '<qv_end>'; ! $castext .= $this->item->workedSolution->getRawCasText(); $ct = new casText($castext, 't', false, true); //send to cas with teacher privilages *************** *** 1305,1308 **** --- 1320,1324 ---- } + public function getTestInput($test) { *************** *** 1361,1368 **** } ! //echo "<pre>"; print_r($postcalc); echo "</pre>"; ! foreach ($test as $key => $val) { ! $test_post[$key] = $postcalc[$key]; ! } return $test_post; --- 1377,1396 ---- } ! ! //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; *************** *** 1386,1390 **** // 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>'; --- 1414,1418 ---- // 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>'; *************** *** 1406,1412 **** 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>'; } } --- 1434,1440 ---- 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>'; } } *************** *** 1458,1467 **** $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"; } --- 1486,1497 ---- $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"; } *************** *** 1489,1493 **** } } ! if($showKey) { $table .="<table>\n"; --- 1519,1523 ---- } } ! /* if($showKey) { $table .="<table>\n"; *************** *** 1499,1502 **** --- 1529,1533 ---- $table .="\n</table>\n"; } + */ } *************** *** 1555,1559 **** foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE']['sAns__'.$name] = $QT['IE_'.$name]; } } --- 1586,1590 ---- foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE'][$name] = $QT['IE_'.$name]; } } *************** *** 1581,1584 **** --- 1612,1619 ---- } + public function getVersion() { + return $this->item->getVersion(); + } + /* Actually perform the tests on the item */ private function getTestOutcomes() *************** *** 1604,1608 **** // 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 (!empty($test['PRT'])) { foreach($test['PRT'] as $key=>$val){ if ('NONE'==trim($val)) --- 1639,1643 ---- // 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)) *************** *** 1610,1615 **** unset($test['PRT'][$key]); } ! } ! } // Slight hack to ensure we have a clean version of the instantiated item without the effort of creating it again! --- 1645,1650 ---- unset($test['PRT'][$key]); } ! } ! } // Slight hack to ensure we have a clean version of the instantiated item without the effort of creating it again! Index: AuthorDisplay.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AuthorDisplay.php,v retrieving revision 1.65.8.1 retrieving revision 1.65.8.2 diff -C2 -d -r1.65.8.1 -r1.65.8.2 *** AuthorDisplay.php 2 Dec 2009 20:13:03 -0000 1.65.8.1 --- AuthorDisplay.php 9 Nov 2010 16:51:37 -0000 1.65.8.2 *************** *** 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 id="stem" 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>'; *************** *** 215,218 **** --- 225,229 ---- //$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>'; return $stem; *************** *** 228,232 **** { 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></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>'; *************** *** 325,329 **** { 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></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; $xhtml .= '<div id="partContainer">'; --- 340,346 ---- { 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">'; *************** *** 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... [truncated message content] |