From: Simon H. <sim...@us...> - 2010-12-01 12:05:23
|
Update of /cvsroot/stack/stack-dev/lib/reporting In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29333/lib/reporting Modified Files: StackReport.php Log Message: Fixed error from no attempts. Index: StackReport.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/reporting/StackReport.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** StackReport.php 29 Nov 2010 15:40:04 -0000 1.26 --- StackReport.php 1 Dec 2010 12:05:14 -0000 1.27 *************** *** 112,127 **** $generalAttemptsData = $generalAttemptsGraph = array(); ! foreach ($attempts as $attempt) { ! $time = $attempt['timeSeconds']; ! // This data is used to lookup detailed information about graph entries ! $generalAttemptsData[strval($time)] = array( ! $attempt['runningTotal'], // effectively the score ! $attempt['question'], ! $attempt['student'] ! ); ! // The data that is used to actually render the graph ! $generalAttemptsGraph[] = array( $time * 1000, (float) $attempt['runningTotal'] ); // JS likes milliseconds } --- 112,129 ---- $generalAttemptsData = $generalAttemptsGraph = array(); ! if(!empty($attempts)) { ! foreach ($attempts as $attempt) { ! $time = $attempt['timeSeconds']; ! // This data is used to lookup detailed information about graph entries ! $generalAttemptsData[strval($time)] = array( ! $attempt['runningTotal'], // effectively the score ! $attempt['question'], ! $attempt['student'] ! ); ! // The data that is used to actually render the graph ! $generalAttemptsGraph[] = array( $time * 1000, (float) $attempt['runningTotal'] ); // JS likes milliseconds ! } } |