From: Chris S. <san...@us...> - 2010-12-20 18:05:18
|
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv17435/lib/reporting Modified Files: StackReport.php Log Message: Localise the URLs from the config file. Index: StackReport.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/StackReport.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** StackReport.php 20 Dec 2010 14:19:11 -0000 1.29 --- StackReport.php 20 Dec 2010 18:05:10 -0000 1.30 *************** *** 68,74 **** $xhtml .= $this->simpleInterface(); break; ! // The rest probably aren't worth considering anymore. ! case 'question': $qID = $posted['questionSelector']; --- 68,74 ---- $xhtml .= $this->simpleInterface(); break; ! // The rest probably aren't worth considering anymore. ! case 'question': $qID = $posted['questionSelector']; *************** *** 94,98 **** default: ! break; } --- 94,98 ---- default: ! break; } *************** *** 1344,1351 **** public function simpleInterface() { ! $db = new StackDBReporting(); ! $widgets = new ReportWidgets(); ! $xhtml = '<div class="section"><h3>Quick report</h3>'; $xhtml .= "<form method='POST' action='report.php?type=simple'>"; --- 1344,1353 ---- public function simpleInterface() { ! global $config; ! $root = $config->get('weburl'); ! $db = new StackDBReporting(); ! $widgets = new ReportWidgets(); ! $xhtml = '<div class="section"><h3>Quick report</h3>'; $xhtml .= "<form method='POST' action='report.php?type=simple'>"; *************** *** 1353,1379 **** $xhtml .= $widgets->questionSelector($_POST['questionSelector']); ! $selQ = ! empty($_POST['questionSelector']); $selS = ! empty($_POST['studentSelector']); ! if ($selQ and $selS) { // both question and student selected ! $data = $db->latestAttemptItem($_POST['questionSelector'], $_POST['studentSelector']); //$xhtml .= print_r ($data, true); ! ! $xhtml .= '<h4>The student was presented with this question note:</h4><p>' . $data['note'] . '</p><p> ! <a href="http://localhost/stack/lib/ui/questionTest.php?id=19&seed=' ! . $data['item']->getQuestionSeed() ! . '"> Click here to try it in the test question interface.</a></p>'; ! $xhtml .= '<h4>They made the following attempts:</h4><p>' . $data['item']->displayAttempts() . '</p>'; ! ! $xhtml .= '<h4>And here is a worked solution:</h4><p>' . $data['item']->getWorkedSolution() . '</p>'; ! ! } else if ($selS) { // just a student selected ! $qsTried = $db->questionsByStudent($_POST['studentSelector']); ! if ($qsTried) { $xhtml .= '<table>'; --- 1355,1381 ---- $xhtml .= $widgets->questionSelector($_POST['questionSelector']); ! $selQ = ! empty($_POST['questionSelector']); $selS = ! empty($_POST['studentSelector']); ! if ($selQ and $selS) { // both question and student selected ! $data = $db->latestAttemptItem($_POST['questionSelector'], $_POST['studentSelector']); //$xhtml .= print_r ($data, true); ! ! if (''!=trim($data['note'])) { ! $xhtml .= '<h4>The student was presented with this question note:</h4><p>' . $data['note'] . '</p>'; ! } ! $xhtml .= '<p><a href="'.$root.'/lib/ui/questionTest.php?id='.$selQ.'&seed='.$data['item']->getQuestionSeed(). '"> Click here to try it in the test question interface.</a></p>'; ! $xhtml .= '<h4>They made the following attempts:</h4><p>' . $data['item']->displayAttempts() . '</p>'; ! ! $xhtml .= '<h4>And here is a worked solution:</h4><p>' . $data['item']->getWorkedSolution() . '</p>'; ! ! } else if ($selS) { // just a student selected ! $qsTried = $db->questionsByStudent($_POST['studentSelector']); ! if ($qsTried) { $xhtml .= '<table>'; *************** *** 1399,1411 **** $xhtml .= '<p>It would appear this student has never tried a question.</p>'; } ! } else if ($selQ) { // just a question selected ! // Some question notes ! $xhtml .= '<h4>The question has the following question notes</h4>'; ! $qNotes = $db->questionNotes($_POST['questionSelector']); ! if ($qNotes) { foreach ($qNotes as $note) { --- 1401,1413 ---- $xhtml .= '<p>It would appear this student has never tried a question.</p>'; } ! } else if ($selQ) { // just a question selected ! // Some question notes ! $xhtml .= '<h4>The question has the following question notes</h4>'; ! $qNotes = $db->questionNotes($_POST['questionSelector']); ! if ($qNotes) { foreach ($qNotes as $note) { *************** *** 1415,1429 **** $xhtml .= "<p>There are no question notes!</p>"; } ! /* // Lots of PRTs ! $xhtml .= '<h4>PRTs for this question</h4>'; ! $prts = $db->PRTs($_POST['questionSelector']); ! $xhtml .= '<div style="display: block; border: 1px solid #000; padding: 10px; margin: 10px;"> prts by q gives <pre>' . print_r($prts,1) . '</pre></div>'; ! foreach ($prts as $name => $prt) { $xhtml .= "<h5>$name has {$prt['total']} had attempt(s) made at it</h5>"; --- 1417,1431 ---- $xhtml .= "<p>There are no question notes!</p>"; } ! /* // Lots of PRTs ! $xhtml .= '<h4>PRTs for this question</h4>'; ! $prts = $db->PRTs($_POST['questionSelector']); ! $xhtml .= '<div style="display: block; border: 1px solid #000; padding: 10px; margin: 10px;"> prts by q gives <pre>' . print_r($prts,1) . '</pre></div>'; ! foreach ($prts as $name => $prt) { $xhtml .= "<h5>$name has {$prt['total']} had attempt(s) made at it</h5>"; *************** *** 1435,1452 **** } $xhtml .= '<th>Total attempts</td><th>Percentage</th></tr>'; ! // And the rest is to be done in the MORNING, well later in the morning. // refer to report.js:409 ! $xhtml .= '</table>'; } */ ! // and lots of students ! $xhtml .= '<h4>Students who attempted this question</h4>'; ! $ssTried = $db->studentsByQuestion($_POST['questionSelector']); ! if ($ssTried) { $xhtml .= '<table>'; --- 1437,1454 ---- } $xhtml .= '<th>Total attempts</td><th>Percentage</th></tr>'; ! // And the rest is to be done in the MORNING, well later in the morning. // refer to report.js:409 ! $xhtml .= '</table>'; } */ ! // and lots of students ! $xhtml .= '<h4>Students who attempted this question</h4>'; ! $ssTried = $db->studentsByQuestion($_POST['questionSelector']); ! if ($ssTried) { $xhtml .= '<table>'; *************** *** 1472,1478 **** $xhtml .= '<p>Apparently no attempt has ever been made at this question.</p>'; } ! } ! $xhtml .= '</form>'; $xhtml .= '</div>'; --- 1474,1480 ---- $xhtml .= '<p>Apparently no attempt has ever been made at this question.</p>'; } ! } ! $xhtml .= '</form>'; $xhtml .= '</div>'; |