From: Simon H. <sim...@us...> - 2010-11-29 15:40:13
|
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv30474/lib/reporting Modified Files: StackReport.php Log Message: Ongoing quick reporting interface. Index: StackReport.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/StackReport.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** StackReport.php 29 Nov 2010 08:21:46 -0000 1.25 --- StackReport.php 29 Nov 2010 15:40:04 -0000 1.26 *************** *** 1341,1364 **** $widgets = new ReportWidgets(); ! /*$xhtml .= "<select>"; foreach($students as $student) { ! $xhtml .= "<option value='$student[0]'>$student[2] $student[3]</option>"; } $xhtml .= "</select>"; ! *///$xhtml = print_r($students,1); ! //$questions = $db->questionList(); ! $xhtml .= "<form method='POST' action='report.php?type=simple'>"; /* $xhtml .= $db->getStudentSelector('student'). ' or '. $db->getQuestionSelector('question', 1, $_POST['question']);*/ ! $xhtml .= $widgets->studentSelector($_POST['studentSelector']); ! $xhtml .= '<input type="submit" name="submit" value="student report" /><p />'; ! $xhtml .= $widgets->questionSelector($_POST['questionSelector']); ! $xhtml .= '<input type="submit" name="submit" value="question report" />'; $xhtml .= '</form>'; ! if($_POST['submit'] == 'student report' && isset($_POST['studentSelector'])) { $xhtml .= print_r($db->questionsByStudent($_POST['studentSelector']),1); $questions = $db->questionsByStudent($_POST['studentSelector']); --- 1341,1382 ---- $widgets = new ReportWidgets(); ! ! $xhtml .= print_r($_POST,1); ! ! $xhtml .= "<form id='form1' method='POST' action='report.php?type=simple'>"; ! ! $xhtml .= "<select name='studentSelector' onChange='document.getElementById(\"form1\").submit()'>"; ! $xhtml .= "<option value=''>All students</option>"; foreach($students as $student) { ! $xhtml .= "<option value='$student[0]'"; ! if($student[0] == $_POST['studentSelector']) $xhtml .= " SELECTED"; ! $xhtml .= ">$student[2] $student[3]</option>"; } $xhtml .= "</select>"; ! ! $questions = $db->questionList(); ! $xhtml .= "<select name='questionSelector' onChange='document.getElementById(\"form1\").submit()'>"; ! $xhtml .= "<option value=''>All questions</option>"; ! foreach($questions as $question) { ! $xhtml .= "<option value='$question[0]'"; ! if($question[0] == $_POST['questionSelector']) $xhtml .= " SELECTED"; ! $xhtml .= ">$question[1]</option>"; ! } ! $xhtml .= "</select>"; ! ! ! //$xhtml .= print_r($questions,1); /* $xhtml .= $db->getStudentSelector('student'). ' or '. $db->getQuestionSelector('question', 1, $_POST['question']);*/ ! //$xhtml .= $widgets->studentSelector($_POST['studentSelector']); ! //$xhtml .= '<input type="submit" name="submit" value="student report" /><p />'; ! //$xhtml .= $widgets->questionSelector($_POST['questionSelector']); ! // $xhtml .= '<input type="submit" name="submit" value="question report" />'; $xhtml .= '</form>'; ! if(!empty($_POST['studentSelector'])) { $xhtml .= print_r($db->questionsByStudent($_POST['studentSelector']),1); $questions = $db->questionsByStudent($_POST['studentSelector']); *************** *** 1370,1377 **** } } ! if($_POST['submit'] == 'question report' && isset($_POST['questionSelector'])) { //$xhtml .= print_r($db->studentAnswerNotes($_POST['questionSelector']),1); ! $xhtml .= print_r($_POST['questionSelector']); $xhtml .= $db->answerNoteChart($_POST['questionSelector']); } --- 1388,1395 ---- } } ! if(!empty($_POST['questionSelector'])) { //$xhtml .= print_r($db->studentAnswerNotes($_POST['questionSelector']),1); ! $xhtml .= print_r($_POST['questionSelector'],1); $xhtml .= $db->answerNoteChart($_POST['questionSelector']); } |