diff --git a/index.php b/index.php index ee1acf6..42d453e 100755 --- a/index.php +++ b/index.php @@ -101,15 +101,33 @@ if (isset($_POST['mark'])) { 600 Questions (All Questions)

Score ".(($score['correct']/$score['total'])*100)."% (".$score['correct']."/".$score['total'].")"; echo $output; } elseif (isset($results)) { - foreach ($results as $result) { + $day = []; + foreach ($results as $i=>$result) { $score = $result->getScore(); - echo date("Y-m-d", $result->getTime())." Score ".(($score['correct']/$score['total'])*100)."% (".$score['correct']."/".$score['total']."). ". + $date = date("Y-m-d", $result->getTime()); + $day[$date][] = date("h:i a", $result->getTime())." - Score ".(($score['correct']/$score['total'])*100)."% (".$score['correct']."/".$score['total']."). ". "View Result
"; + if(!isset($day[$date]['total'])) { + $day[$date]['total'] = ($score['correct'] / $score['total']) * 100; + } else { + $original = $day[$date]['total']; + $day[$date]['total'] = ($original + (($score['correct'] / $score['total']) * 100)) / 2; + } } + + foreach ($day as $t=>$da) { + echo "".$t."
"; + $total = $da['total']; + unset($da['total']); + foreach($da as $c=>$d) { + echo $d; + } + echo $total."% Average

"; + } + } else { if(!is_object($user)) { ?> Please Login to track results.