Update of /cvsroot/stack/stack-dev/lib/ui In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29766/lib/ui Modified Files: Tag: question_reporting frontend.php OptionsEdit.php authorTest.php questionBank.php selectAll.js DisplayItem.php AdminInterface.php questionExporter.php OptionsEditor.php questionReview.php AuthorDisplay.php report.php questionTest.php GhostWriter.php questionImporter.php questionDeploy.php Added Files: Tag: question_reporting report.css report.js Removed Files: Tag: question_reporting reportScripts.js reportStyle.css Log Message: Merging from the current HEAD into question_reporting. Apologies in advance if this all goes horribly wrong. Index: selectAll.js =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/selectAll.js,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** selectAll.js 22 Oct 2009 17:37:56 -0000 1.2 --- selectAll.js 22 Nov 2010 23:05:49 -0000 1.2.2.1 *************** *** 12,20 **** f.target = '_self'; f.submit(); ! }; ! ! // requires jQuery ! function toggleSelection() { ! alert($("#filter").val()); ! // $("table").hide(); ! } \ No newline at end of file --- 12,14 ---- f.target = '_self'; f.submit(); ! }; \ No newline at end of file Index: questionImporter.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/questionImporter.php,v retrieving revision 1.17 retrieving revision 1.17.4.1 diff -C2 -d -r1.17 -r1.17.4.1 *** questionImporter.php 28 Jul 2009 15:39:26 -0000 1.17 --- questionImporter.php 22 Nov 2010 23:05:49 -0000 1.17.4.1 *************** *** 21,28 **** --- 21,40 ---- */ + session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + $root = $config->get('docroot'); $webroot = $config->get('webroot'); Index: AdminInterface.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AdminInterface.php,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** AdminInterface.php 27 Aug 2009 16:23:01 -0000 1.9 --- AdminInterface.php 22 Nov 2010 23:05:49 -0000 1.9.2.1 *************** *** 98,102 **** echo '<form action="'.$index_url.'" method="post" name="login" id="login"><table align="center"><tr>'; echo '<td>'.get_string('USR_Password','stack','').'</td>'; ! echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td><td>'.$errps.'</td></tr>'; echo '<tr><td></td><td><font color="red">'.$error_message.'</font><td></tr>'; echo '<tr><td> --- 98,102 ---- echo '<form action="'.$index_url.'" method="post" name="login" id="login"><table align="center"><tr>'; echo '<td>'.get_string('USR_Password','stack','').'</td>'; ! echo '<td><input type="password" name="password" size="15" value="" alt="Password" /></td></tr>'; echo '<tr><td></td><td><font color="red">'.$error_message.'</font><td></tr>'; echo '<tr><td> Index: authorTest.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/authorTest.php,v retrieving revision 1.15 retrieving revision 1.15.4.1 diff -C2 -d -r1.15 -r1.15.4.1 *** authorTest.php 23 Jun 2009 14:39:36 -0000 1.15 --- authorTest.php 22 Nov 2010 23:05:49 -0000 1.15.4.1 *************** *** 17,26 **** --- 17,39 ---- */ session_start(); + require_once('../../config.php'); $config = new stackConfig(); global $config; + $url = $config->get('weburl'); + $diemessage = "Please <a href='$url'>login</a>."; + if (array_key_exists('loggedin',$_SESSION)) { + $loggedin = $_SESSION['loggedin']; + if (!$loggedin) { die($diemessage); } + } else { + die($diemessage); + } + + require_once('AuthorDisplay.php'); + require_once $config->get('docroot').'/lib/ui/frontend.php'; + if(empty($_SESSION['authorItem']) || ($_POST == NULL)) { *************** *** 48,115 **** //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); - ?> - - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - <html> - <head> - <style type="text/css" media="all"> - @import "../../styles.css"; - </style> - <script type="text/javascript" src="../../other/moo.fx/prototype.lite.js"></script> - - <script type="text/javascript" src="../../other/moo.fx/moo.fx.js"></script> - - <script type="text/javascript"> - // Initialise the effects - var metaContainer; - var optionsContainer; - var moodleContainer; - var prtContainer; - var qpContainer; - - - window.onload = function() { - metaContainer = new fx.Height('meta', {duration: 400}); - metaContainer.hide(); - optionsContainer = new fx.Height('options', {duration: 400}); - optionsContainer.hide(); - moodleContainer = new fx.Height('moptions', {duration: 400}); - moodleContainer.hide(); - prtContainer = new fx.Height('prtContainer', {duration: 400}); - qpContainer = new fx.Height('qpContainer', {duration: 400}); - - } ! </script> ! <script type="text/javascript"> ! function swapper(container, icon) ! { ! var iconPath = '<?php echo $config->get('weburl'); ?>/pix/'; ! container.toggle(icon, iconPath); ! } ! </script> ! <title>Question test</title> ! </head> <body> - <h2><?php echo get_string('stackAuthor_title'.$key,'stack') ?></h2> - - <p><a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a></p> <form action="authorTest.php" method="POST"> ! <p> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> ! <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> </p> <?php echo $author->displayAuthor(); ?> - <p><input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /></p> </form> ! <?php - echo '<p><a href="../../index.php">'.get_string('FE_index_main','stack','').'</a></p>'; - if(function_exists('memory_get_peak_usage')) { --- 61,102 ---- //unset($_SESSION['authorItem']); $_SESSION['authorItem'] = serialize($author); ! echo html_head(get_string('stackQuestion_authorEditQuestion', 'stack'),'../../',"@import \"../../styles.css\";\n", 'LaTeX', true); ! ?> <body> <form action="authorTest.php" method="POST"> ! <div id="authoringControls"> ! <a href="../../index.php"><?php echo get_string('FE_index_main','stack','') ?></a><p /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_update','stack'); ?>" /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_save','stack'); ?>" /> + <p /> <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_savenew','stack'); ?>" /> ! <input type="submit" name="submit" value="<?php echo get_string('stackAuthor_button_exportAsXml','stack'); ?>" /> ! <p> ! <ul> ! <li><a href="#stem">Stem</a></li> ! <li><a href="#parts" onClick="$('#partContainer').slideDown();">Interactions</a></li> ! <li><a href="#prts" onClick="$('#prtContainer').slideDown();">Responses</a></li> ! <li><a href="#options" onClick="$('#optionContainer').slideDown();">Options</a></li> ! <li><a href="#tests" onClick="$('#testContainer').slideDown();">Tests</a></li> ! <li><a href="#meta" onClick="$('#metaContainer').slideDown();">Meta</a></li> ! </ul> ! <?php ! // line history ! //echo $author->displayVersionHistory(); ! ?> ! ! </div> <?php echo $author->displayAuthor(); ?> </form> ! <script language="JavaScript" type="text/javascript"> ! $(document).ready(function() { ! $('#authoringControls').append($('#versionHistory').detach().html()); ! }); ! </script> <?php if(function_exists('memory_get_peak_usage')) { Index: DisplayItem.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/DisplayItem.php,v retrieving revision 1.89 retrieving revision 1.89.2.1 diff -C2 -d -r1.89 -r1.89.2.1 *** DisplayItem.php 20 Oct 2009 14:44:47 -0000 1.89 --- DisplayItem.php 22 Nov 2010 23:05:49 -0000 1.89.2.1 *************** *** 82,93 **** * * - * @var string - * @access protected - */ - protected $questionForDisplay; - - /** - * - * * @var StudentAns * @access protected --- 82,85 ---- *************** *** 178,189 **** private $logger; - /** - * - * - * @var state - * @access protected - */ - protected $state; - /** * --- 170,173 ---- *************** *** 247,253 **** $this->updateAnsBoxes(); } - - // set question display state - $this->state = new ItemState($this->studentAnswers, $this->answerBox, $this->itemOpts); } --- 231,234 ---- *************** *** 309,313 **** /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No caching; that logic is handled higher up. * * @param array $posted values --- 290,294 ---- /** Processes the question inserting in the students answer, answerboxes and feedback as needed. * Returns the XHTML representation of the question. ! * No display caching; that logic is handled higher up. * * @param array $posted values *************** *** 327,331 **** if($this->answerBox == NULL) { ! $xhtml = '<p>'.get_string('stackQuestion_noQuestionParts','stack','')."</p> $this->cachedQuestionStem"; } else --- 308,312 ---- if($this->answerBox == NULL) { ! $xhtml = '<div class="secondaryFeedback">'.get_string('stackQuestion_noQuestionParts','stack','').'</div>'.$this->cachedQuestionStem; } else *************** *** 385,388 **** --- 366,370 ---- //check status, $status = $IE->getStatus(); + $hideFeedback = 'true' == $this->item->questionPart[$label]->getHideFeedback()->getSelected(); switch($status) *************** *** 391,395 **** $all_elements_at_score_WS = false; $disp = $IE->getDisplayValue(); - $feedback = $IE->getFeedback(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); --- 373,376 ---- *************** *** 397,404 **** $full .= $disp.'</p>'; //$full .= " #$label# ".'<span class="feedback">'.$feedback.'</span>'; ! $full .= '<span class="feedback">'.$feedback.'</span>'; $full .= "</div>\n\n"; //$full .= '<span class="solutionButton"> '.get_string('stackQuestionDisplay_viewSolution','stack','').'<input type="checkbox" value="true" name="'."SR__$label".'" />'; $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; --- 378,391 ---- $full .= $disp.'</p>'; //$full .= " #$label# ".'<span class="feedback">'.$feedback.'</span>'; ! $feedback = $IE->getFeedback(); ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } $full .= "</div>\n\n"; //$full .= '<span class="solutionButton"> '.get_string('stackQuestionDisplay_viewSolution','stack','').'<input type="checkbox" value="true" name="'."SR__$label".'" />'; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 410,414 **** $full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_invalid','stack','').'" alt="'.get_string('stackIcon_invalid_alt','stack','').'" width="40" height="36" /> </span>'; $feedback = $IE->getFeedback(); ! $full .= '<span class="feedback">'.$feedback.' </span>'; //$full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack','').'</p>'; --- 397,403 ---- $full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_invalid','stack','').'" alt="'.get_string('stackIcon_invalid_alt','stack','').'" width="40" height="36" /> </span>'; $feedback = $IE->getFeedback(); ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } //$full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack','').'</p>'; *************** *** 419,422 **** --- 408,414 ---- $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 424,434 **** case 'score': $disp = $IE->getDisplayValue(); - $feedback = $IE->getFeedback(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); //$full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_valid','stack','').'" alt="'.get_string('stackIcon_valid_alt','stack','').'" /> </span>'; $full .= $disp.'</p>'; ! $full .= '<span class="feedback">'.$feedback.'</span>'; $full .= "</div>\n\n"; $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; --- 416,430 ---- case 'score': $disp = $IE->getDisplayValue(); $full = '<div class="InteractionElementFeedback">'; $full .= '<p class="studentFeedback">'.get_string('stackQuestionDisplay_yourLastAnswer','stack',''); //$full .= '<span class="icon"> <img src="'.$config->get('weburl').'/pix/'.get_string('stackIcon_valid','stack','').'" alt="'.get_string('stackIcon_valid_alt','stack','').'" /> </span>'; $full .= $disp.'</p>'; ! if (''!=$feedback) { ! $full .= '<span class="feedback">'.$feedback.'</span>'; ! } $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); break; *************** *** 447,450 **** --- 443,449 ---- $full .= '<br />'.get_string('stackQuestionDisplay_ThisCanDisplay','stack','').' <span class="SyntaxExample2">'.$this->cachedTAnsValue[$label].'</span> '; $full .= "</div>\n\n"; + if($hideFeedback) { + $full = ''; + } $xhtml = str_replace("<IEfeedback>$label</IEfeedback>", $full, $xhtml); *************** *** 488,492 **** // but first check that there is a worked solution to display $rawWS = $this->item->workedSolution->getRawCasText(); ! if(($this->workedSolutionRequested == true || $this->expired == true) && !empty($rawWS)) { $xhtml .= '<div class="secondaryFeedback">'; --- 487,498 ---- // but first check that there is a worked solution to display $rawWS = $this->item->workedSolution->getRawCasText(); ! $OptWorkedSol = $this->item->getItemOption('OptWorkedSol'); ! ! if(null !== $OptWorkedSol) { ! $OptWorkedSol = $OptWorkedSol->getSelected(); ! } else { ! $OptWorkedSol = 'true'; ! } ! if(($this->workedSolutionRequested == true || $this->expired == true) && !empty($rawWS)) { $xhtml .= '<div class="secondaryFeedback">'; *************** *** 500,504 **** //.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" />'; } ! elseif(!empty($rawWS) && $all_elements_at_score_WS) { $xhtml .= '<div class="secondaryFeedback">'.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" /></div>'; --- 506,510 ---- //.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" />'; } ! elseif(!empty($rawWS) && $all_elements_at_score_WS && 'true'===$OptWorkedSol) { $xhtml .= '<div class="secondaryFeedback">'.get_string('stackQuestionDisplay_requestWS','stack','').' <input type="checkbox" name="workedSolution" value="true" /></div>'; *************** *** 514,520 **** } while ($count > 0); - return $xhtml; } // endif has answerboxes } // endif valid item } --- 520,526 ---- } while ($count > 0); } // endif has answerboxes } // endif valid item + return $xhtml; } *************** *** 672,676 **** foreach($posted as $label => $post) { ! $exploded = explode('-', $label); if(count($exploded) == 1) --- 678,682 ---- foreach($posted as $label => $post) { ! $exploded = explode('|', $label); if(count($exploded) == 1) *************** *** 722,732 **** protected function updateSAnswer($posted, $process=true) { ! //preprocess the students answers, if required by the answertest used //for example the matrix input type needs to join multiple answers into one maxima command. $posted = $this->filterInputs($posted); //update the studentsAnswers or create if does not exist - if($this->studentAnswers === NULL) { --- 728,739 ---- protected function updateSAnswer($posted, $process=true) { ! //preprocess the students answers, if required by the input element used //for example the matrix input type needs to join multiple answers into one maxima command. + //echo "<pre>";print_r($posted); $posted = $this->filterInputs($posted); + //print_r($posted);echo "</pre>"; //update the studentsAnswers or create if does not exist if($this->studentAnswers === NULL) { *************** *** 756,759 **** --- 763,767 ---- //var_dump($implicitForbid); $this->studentAnswers->syntaxCheck($this->itemOpts, $this->item->getQuestionPartsByStudentAnsKey(), $implicitForbid); + $this->studentAnswers->scoreIfValid($this->item->getQuestionPartsByStudentAnsKey()); $this->studentAnswers->casValidate($this->itemOpts, $this->item->getSeed(), $this->item->getQuestionPartsByStudentAnsKey(), $this->cachedTAnsValue); *************** *** 1293,1296 **** --- 1301,1305 ---- } + public function getTestInput($test) { *************** *** 1349,1356 **** } ! //echo "<pre>"; print_r($postcalc); echo "</pre>"; ! foreach ($test as $key => $val) { ! $test_post[$key] = $postcalc[$key]; ! } return $test_post; --- 1358,1377 ---- } ! ! //echo "<pre>.."; print_r($testIE); echo "..</pre>"; ! $questionParts = $this->item->getQuestionPartsByStudentAnsKey(); ! $test_post=array(); ! if(!empty($questionParts)) ! { ! foreach($questionParts as $SA => $QP) ! { ! $type = $QP->getInputType(); ! $inputType = new InputTypeController($type,$SA); ! $result = $inputType->getTestPostData($postcalc[$SA]); ! foreach($result as $key => $val) { ! $test_post['sAns__'.$key] = $val; ! } ! } ! } return $test_post; *************** *** 1374,1378 **** // Generate header row for table. ! $table .="\n<table class='interactionElementsTable' border='1' cellpadding='2' cellspacing='0''>\n<tr>\n"; foreach($qpNames as $name) { $table .= '<td class="tableTitle" colspan="3">'.$name.'</td>'; --- 1395,1399 ---- // Generate header row for table. ! $table .="\n<table class='interactionElementsTable' border='1' cellpadding='2' cellspacing='0'>\n<tr>\n"; foreach($qpNames as $name) { $table .= '<td class="tableTitle" colspan="3">'.$name.'</td>'; *************** *** 1394,1400 **** if($PRTs != NULL) { foreach($PRTs as $name => $PRT) { ! $table .= '<td class="tableTitle">M</td>'; ! $table .= '<td class="tableTitle">P</td>'; ! $table .= '<td class="tableTitle">N</td>'; } } --- 1415,1421 ---- if($PRTs != NULL) { foreach($PRTs as $name => $PRT) { ! $table .= '<td class="tableTitle">Mark</td>'; ! $table .= '<td class="tableTitle">Penalty</td>'; ! $table .= '<td class="tableTitle">Answer note and feedback</td>'; } } *************** *** 1446,1455 **** $table .= '<td>'.$attempt->getPenalty($name).'</td>'; $table .= "\n<td>"; ! if (array_key_exists($name,$feedback)) { ! $table .= '<img src="'.$config->get('weburl').'/pix/page.png" alt="'.htmlentities($feedback[$name]).'" width="16" height="16" />'; ! } ! if (array_key_exists($name,$ansNote)) { $table .= ' '.$ansNote[$name]; } $table .= "\n</td>\n"; } --- 1467,1478 ---- $table .= '<td>'.$attempt->getPenalty($name).'</td>'; $table .= "\n<td>"; ! if (array_key_exists($name,$ansNote)) { $table .= ' '.$ansNote[$name]; } + if (array_key_exists($name,$feedback)) { + //$table .= '<img src="'.$config->get('weburl').'/pix/page.png" alt="'.htmlentities($feedback[$name]).'" width="16" height="16" />'; + $table .= '<a href="#" onClick="javascript:$(this).siblings(\'div\').slideToggle(\'fast\'); return false;" />'.get_string('stack_show/hide_feedback','stack','').'</a><div style="display:none">'.$feedback[$name].'</div>'; + } + $table .= "\n</td>\n"; } *************** *** 1477,1481 **** } } ! if($showKey) { $table .="<table>\n"; --- 1500,1504 ---- } } ! /* if($showKey) { $table .="<table>\n"; *************** *** 1487,1490 **** --- 1510,1514 ---- $table .="\n</table>\n"; } + */ } *************** *** 1531,1535 **** $QTs = $this->item->itemTests->getTests(); ! $qpNames = array_keys($this->item->questionPart); $PRTs = $this->item->getPRTs(); --- 1555,1561 ---- $QTs = $this->item->itemTests->getTests(); ! if (is_array($this->item->questionPart)) { ! $qpNames = array_keys($this->item->questionPart); ! } $PRTs = $this->item->getPRTs(); *************** *** 1541,1552 **** foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE']['sAns__'.$name] = $QT['IE_'.$name]; } } ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } } } --- 1567,1580 ---- foreach($qpNames as $name) { if (array_key_exists('IE_'.$name,$QT)) { ! $tests[$key]['IE'][$name] = $QT['IE_'.$name]; } } ! if (!empty($PRTs)) { ! foreach($PRTs as $name =>$PRT) { ! if (array_key_exists('PRT_'.$name,$QT)) { ! $tests[$key]['PRT'][$name] = $QT['PRT_'.$name]; ! } ! } } } *************** *** 1565,1568 **** --- 1593,1600 ---- } + public function getVersion() { + return $this->item->getVersion(); + } + /* Actually perform the tests on the item */ private function getTestOutcomes() *************** *** 1588,1596 **** // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } } --- 1620,1630 ---- // If a PRT is not traversed then the answernote should not exist. // This is different from an answernote existing with the value "NONE", so unset where necessary. ! if (array_key_exists('PRT',$test)) { ! foreach($test['PRT'] as $key=>$val){ ! if ('NONE'==trim($val)) ! { ! unset($test['PRT'][$key]); ! } ! } } Index: AuthorDisplay.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/ui/AuthorDisplay.php,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -C2 -d -r1.65 -r1.65.2.1 *** AuthorDisplay.php 27 Aug 2009 16:23:01 -0000 1.65 --- AuthorDisplay.php 22 Nov 2010 23:05:49 -0000 1.65.2.1 *************** *** 26,33 **** --- 26,35 ---- require_once $root.'/lib/ui/DisplayItem.php'; require_once $root.'/lib/translator.php'; + require_once $root.'/lib/stringUtil.php'; require_once $root.'/lib/XML/ExportStackTwoItem.php'; require_once $root.'/lib/ui/inputTypes/InputTypeController.php'; require_once($root.'/lib/database/MoodleDB.php'); require_once($root.'/lib/database/StackDBCache.php'); + require_once($root.'/lib/database/StackDBItem.php'); /** *************** *** 109,113 **** else { ! //load a question from the database, if it exists. (loads the itemOptions form the database too. $this->item = new Item(NULL, $questionId); } --- 111,115 ---- else { ! //load a question from the database, if it exists (loads the itemOptions form the database too). $this->item = new Item(NULL, $questionId); } *************** *** 138,141 **** --- 140,146 ---- $display = ''; } + + $display .= $this->displayJS(); + $display .= $this->displayStem(); *************** *** 152,155 **** --- 157,161 ---- $display .= $this->displayMeta(); $display .= $this->displayMoodleAuthor($engineID); + $display .= $this->displayVersionHistory($engineID); return $display; *************** *** 166,182 **** private function displayStem() { ! $stem = '<div class="section">'; ! ! // var_dump($this); ! ! if($this->item->getQuestionId() != NULL) ! { ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qid', 'stack','').' </span><span class="formw">'.$this->item->getQuestionId().'</span></div>'; ! } $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' </span><span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) --- 172,184 ---- private function displayStem() { ! global $config; ! $stem = '<div id="stem" class="section">'; ! // <h3>'.get_string('stackAuthor_stem', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'" href="http://stack.bham.ac.uk/wiki/index.php/Stem"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></h3>'; + $stem .= '<div id="authoringVersionID">v.'.$this->item->getQuestionId().'</div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_name', 'stack','').' </span><span class="formw">'.$this->item->questionName->editWidget('questionName', 64).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_description', 'stack','').' </span><span class="formw"> '.$this->item->questionDescription->editWidget('questionDescription', 65,2,12).'</span></div>'; $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_keywords', 'stack','').' </span><span class="formw"> '.$this->item->questionKeywords->editWidget('questionKeywords', 64).'</span></div>'; ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qvariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Question_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a> </span> <span class="formw"> '.$this->item->questionVariables->editWidget('questionVariables', 65, 4, 12).'</span></div>'; if(!empty($this->authoringErrors['questionVariables']) && ($this->refreshCycle > 0)) *************** *** 188,192 **** //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_stem', 'stack','').'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code></span><span class="formw"> '.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 190,199 ---- //the question stem itself ! $stem .= '<br /><br /><div class="row"><span class="label"><strong>'.get_string('stackAuthor_questionStem', 'stack','') ! .'</strong> <br /><br /><code>'.get_string('stackAuthor_stemInfo', 'stack','').'</code>' ! .'<p />Preview<input onclick="$(\'#stemPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span>'; ! $stem .= '<span class="formw" onkeyup="authorPreview(\'questionStem\',\'#stemPreview\')">'.$this->item->questionStem->editWidget('questionStem', 65, 15, 30).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="stemPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'questionStem\',\'#stemPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; *************** *** 197,201 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').'</span><span class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) --- 204,211 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_workedSolution', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/CASText#Worked_solution"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a>'; ! $stem .= '<p />Preview<input onclick="$(\'#workedSolutionPreview\').slideToggle(\'fast\')" type="checkbox" name="previewstem"></span></span><span class="formw" onkeyup="authorPreview(\'workedSolution\',\'#workedSolutionPreview\')" class="formw"> '.$this->item->workedSolution->editWidget('workedSolution', 65, 2, 10).'</span></div>'; ! $stem .= '<div class="row"><span class="label"> </span><span class="formw"><div id="workedSolutionPreview" class="authorMath"></div></div></span>'; ! $stem .= '<script>authorPreview(\'workedSolution\',\'#workedSolutionPreview\')</script>'; $stem .= '<div class="clearer"> </div>'; if(!empty($this->authoringErrors['workedSolution']) && ($this->refreshCycle > 0)) *************** *** 204,208 **** } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' </span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; --- 214,218 ---- } ! $stem .= '<div class="row"><span class="label">'.get_string('stackAuthor_qnote', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/Question_note"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a></span><span class="formw"> '.$this->item->questionNote->editWidget('questionNote', 65, 2, 10).'</span></div>'; $stem .= '<div class="clearer"> </div>'; *************** *** 213,217 **** ! $stem .= '<div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $stem .= '<div class="clearer"> </div><br /> </div>'; --- 223,228 ---- ! //$stem .= '<div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; ! $stem .= '<div class="clearer"> </div><br /> </div>'; *************** *** 228,232 **** { global $config; ! $form = '<div class="section"><h3><a onclick="swapper(prtContainer, \'prtIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" />'.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; --- 239,249 ---- { global $config; ! $form = '<div id="prts" class="section"> ! <h3><a onclick="$(\'#prtContainer\').slideToggle();swapper(prtContainer, \'prtIcon\');"> ! <img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="prtIcon" /> '. ! get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a> ! <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Potential_response_trees"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$form = '<div class="section"><h3><a onclick="prtContainer.toggle();"> '.get_string('stackAuthor_potentialResponseTrees', 'stack','').'</a></h3>'; $form .= '<div id="prtContainer">'; *************** *** 245,253 **** } - $PRTs = $this->item->getPRTs(); if($PRTs != NULL) { - foreach($PRTs as $name => $PRT) { --- 262,268 ---- *************** *** 272,276 **** $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; --- 287,291 ---- $widget = $PRT->feedbackVariables->editWidget($prefix.'-feedbackVariables', 65, 2, 6); ! $form .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackVariables', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack').'"href="http://stack.bham.ac.uk/wiki/index.php/KeyVals#Feedback_variables"><img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" /></a><br /><br /></span><span class="formw">'.$widget.'</span></div>'; $form .= '<div style="clear: both"> </div>'; *************** *** 299,303 **** } ! $form .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $form .= '</div></div>'; // id=PRT, class=section --- 314,318 ---- } ! //$form .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $form .= '</div></div>'; // id=PRT, class=section *************** *** 325,331 **** { global $config; ! $xhtml = '<div class="section"><h3><a onclick="swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; ! $xhtml .= '<div id="qpContainer">'; $qpNames = array_keys($this->item->questionPart); --- 340,348 ---- { global $config; ! $xhtml = '<div id="parts" class="section"><h3><a onclick="$(\'#partContainer\').slideToggle();swapper(qpContainer, \'qpIcon\');"><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="qpIcon" />'.get_string('stackAuthor_interactionElements', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$xhtml = '<div class="section"><h3><a onclick="qpContainer.toggle();">'.get_string('stackAuthor_interactionElements', 'stack','').'</a></h3>'; ! $xhtml .= '<div id="partContainer">'; $qpNames = array_keys($this->item->questionPart); *************** *** 335,340 **** $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr> ! <td class="tableTitle">'.get_string('stackAuthor_studentAnsKey', 'stack','').'</td>'; foreach($qpNames as $name) --- 352,359 ---- $xhtml .= '<table class="interactionElementsTable" border="1" cellpadding="2" cellspacing="0"> <tbody> ! <tr><td class="IElabel"> </td> ! <td colspan="'.$noQPs.'">'.get_string('stackAuthor_studentAnsKey', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Students.27s_Answer_Key"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td></tr><tr><td class="IElabel"> </td>'; foreach($qpNames as $name) *************** *** 342,346 **** $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= "</tr><tr><td>".get_string('stackAuthor_inputType', 'stack','')."</td>"; //inputtypes --- 361,367 ---- $xhtml .= '<td class="tableTitle">'.$name.'</td>'; } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_inputType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Input_Type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //inputtypes *************** *** 354,358 **** } ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_teachersAns', 'stack','').'</td>'; //teachers answer foreach($qpNames as $name) --- 375,381 ---- } ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_teachersAns', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Teacher.27s_Answer"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; //teachers answer foreach($qpNames as $name) *************** *** 366,370 **** //box size ! $xhtml .= '</tr><tr><td>'.get_string('stackAuthor_boxsize', 'stack','').'</td>'; foreach($qpNames as $name) { --- 389,395 ---- //box size ! $xhtml .= '</tr><tr><td class="IElabel">'.get_string('stackAuthor_boxsize', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Box_Size"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) { *************** *** 374,378 **** } //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_strictsyntax', 'stack','').'</td>'; foreach($qpNames as $name) --- 399,405 ---- } //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_strictsyntax', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Strict_Syntax"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 385,389 **** //allow informal syntax ! $xhtml .='</tr><tr><td>'.get_string('stackAuthor_insertStars', 'stack','').'</td>'; foreach($qpNames as $name) --- 412,418 ---- //allow informal syntax ! $xhtml .='</tr><tr><td class="IElabel">'.get_string('stackAuthor_insertStars', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Insert_Stars"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 397,401 **** //syntax hint ! $xhtml .= '</tr><td>'.get_string('stackAuthor_syntaxHint', 'stack','').'</td>'; foreach($qpNames as $name) --- 426,432 ---- //syntax hint ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_syntaxHint', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Syntax_Hint"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 408,412 **** //forbidden words, comma separated. ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbiddenWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 439,445 ---- //forbidden words, comma separated. ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbiddenWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbidden_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 430,434 **** //allowed words, same as forbidden words ! $xhtml .= '</tr><td>'.get_string('stackAuthor_allowedWords', 'stack','').'</td>'; foreach($qpNames as $name) --- 463,469 ---- //allowed words, same as forbidden words ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_allowedWords', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Allowed_words"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 452,456 **** //forbid floats ! $xhtml .= '</tr><td>'.get_string('stackAuthor_forbidFloats', 'stack','').'</td>'; foreach($qpNames as $name) --- 487,493 ---- //forbid floats ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_forbidFloats', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Forbid_Floats"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 463,467 **** //Require in lowest terms ! $xhtml .= '</tr><td>'.get_string('stackAuthor_LowestTerms', 'stack','').'</td>'; foreach($qpNames as $name) --- 500,506 ---- //Require in lowest terms ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_LowestTerms', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Require_lowest_terms"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 474,478 **** //SameType ! $xhtml .= '</tr><td>'.get_string('stackAuthor_sameType', 'stack','').'</td>'; foreach($qpNames as $name) --- 513,519 ---- //SameType ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_sameType', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Check_Students_answer.27s_type"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 487,493 **** } //finally add in any input type options ! $xhtml .= '</tr><td>'.get_string('stackAuthor_inputTypeOpt', 'stack').'</td>'; foreach($qpNames as $name) --- 528,568 ---- } + //StudentVerify + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_studentVerify', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Student_must_verify"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-studentVerify'; + $studentVerify = $this->item->questionPart[$name]->getStudentVerify(); + if($studentVerify !== NULL) + { + $widget = $studentVerify->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + + //HideFeedback + $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_hideFeedback', 'stack','').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). + '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements#Hide_feedback"> + <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; + + foreach($qpNames as $name) + { + $prefix = 'qp-'.$name.'-hideFeedback'; + $hideFeedback = $this->item->questionPart[$name]->getHideFeedback(); + if($hideFeedback !== NULL) + { + $widget = $hideFeedback->editWidget($prefix); + $xhtml .= '<td>'.$widget.'</td>'; + } + } + //finally add in any input type options ! $xhtml .= '</tr><td class="IElabel">'.get_string('stackAuthor_inputTypeOpt', 'stack').' <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Interaction_elements"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></td>'; foreach($qpNames as $name) *************** *** 507,511 **** $xhtml .= '</tr></tbody></table>'; ! $xhtml .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $xhtml .= '<div class="clearer"> </div></div></div>'; } --- 582,586 ---- $xhtml .= '</tr></tbody></table>'; ! //$xhtml .= '<div class="clearer"> </div><div class="row"><span class="label"><input type="submit" name="submit" value="'.get_string('stackAuthor_button_update','stack').'" /></span></div>'; $xhtml .= '<div class="clearer"> </div></div></div>'; } *************** *** 561,567 **** { global $config; ! $meta = '<div class="section"><h3><a onclick="swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a></h3>'; //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; ! $meta .= '<div id="meta">'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_publish','stack','').' </span><span class="formw">'.$this->item->published->editWidget('questionPublished', 45).'</span></div>'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_qstatus','stack','').' </span><span class="formw">'.$this->item->questionStatus->editWidget('questionStatus', 45).'</span></div>'; --- 636,645 ---- { global $config; ! $meta = '<div id="meta" class="section"><h3><a onclick="$(\'#metaContainer\').slideToggle();swapper(metaContainer, \'metaIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="metaIcon" />'.get_string('stackAuthor_metadata', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Metadata"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; ! //$meta = '<div class="section"><h3><a onclick="metaContainer.toggle();">'.get_string('stackAuthor_metadata','stack','').'</a></h3>'; ! $meta .= '<div id="metaContainer">'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_publish','stack','').' </span><span class="formw">'.$this->item->published->editWidget('questionPublished', 45).'</span></div>'; $meta .= '<div class="row"><span class="label">'.get_string('stackAuthor_qstatus','stack','').' </span><span class="formw">'.$this->item->questionStatus->editWidget('questionStatus', 45).'</span></div>'; *************** *** 589,595 **** { global $config; ! $opt = '<div class="section"><h3><a onclick="swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; ! $opt .= '<div id="options">'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_questionLevelSimp','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('Simplify', 45).'</span></div>'; //$opt .= '<div class="row"><span class="label">Insert Stars: </span><span class="formw">'.$this->item->itemOptions->getWidget('InsertStars', 45).'</span></div>'; --- 667,675 ---- { global $config; ! $opt = '<div id="options" class="section"><h3><a onclick="$(\'#optionContainer\').slideToggle();swapper(optionsContainer, \'optIcon\');"><img src="'.$config->get('weburl').'/pix/triangleUp.gif" name="optIcon" />'.get_string('stackAuthor_options', 'stack','').'</a> <a target="_blank" alt="'.get_string('stackAuthor_onlineGuide','stack'). ! '" href="http://stack.bham.ac.uk/wiki/index.php/Options"> ! <img title="'.get_string('stackAuthor_onlineGuide','stack').'" src="'.$config->get('weburl').'/pix/help.png" name="help" /></a></h3>'; //$opt = '<div class="section"><h3><a onclick="optionsContainer.toggle();">'.get_string('stackAuthor_options','stack','').'</a></h3>'; ! $opt .= '<div id="optionContainer">'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_questionLevelSimp','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('Simplify', 45).'</span></div>'; //$opt .= '<div class="row"><span class="label">Insert Stars: </span><span class="formw">'.$this->item->itemOptions->getWidget('InsertStars', 45).'</span></div>'; *************** *** 601,604 **** --- 681,685 ---- $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackPartially','stack','').'</span><span class="formw">'.$this->item->itemOptions->getWidget('FeedbackGenericPCorrect', 45).'</span></div>'; $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_feedbackIncorrect','stack','').'</span><span class="formw">'.$this->item->itemOptions->getWidget('FeedbackGenericIncorrect', 45).'</span></div>'; + $opt .= '<div class="row"><span class="label">'.get_string('stackAuthor_OptWorkedSol','stack','').' </span><span class="formw">'.$this->item->itemOptions->getWidget('OptWorkedSol', 45).'</span></div>'; $opt .= '<h4>'.get_string('stackAuthor_output', 'stack', '').'</h4>'; *************** *** 614,619 **** { global $config; ! $tests = '<div class="section"><h3><img src="'.$config->get('weburl').'/pix/triangleDown.gif" name="testsIcon" />'.get_string('stackAuthor_questionTests', 'stack','').'</a></h3>'; ! $tests .= '<div id="tests">'; if(!empty($this->item->q... [truncated message content] |