X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/7b7a9103e0252d7accb3c456e0f16e50ce3ace96..7c6abf783f4b583b0c8bc43ad434fcce37a3dcc7:/summary.php?ds=sidebyside diff --git a/summary.php b/summary.php index d63c765..3ebfea9 100644 --- a/summary.php +++ b/summary.php @@ -3,6 +3,7 @@ require 'include/db.inc'; require 'include/session.inc'; require 'include/common.inc'; + require 'include/exams.inc'; if(isset($_POST['submit']) && $_POST['mnumber']!="") { $mnumber = trim($_POST['mnumber']); @@ -55,13 +56,45 @@ } } print ""; - print "" . $tot_done . "/" . $SESSIONS_totex . ""; + print "" . $tot_done . "/" . $SESSIONS_totex . " ==> " . round(100 * $tot_done / $SESSIONS_totex) . "%"; print ""; print ""; print "
"; + print "Exams
"; + + print ""; + + $examscore=0; + foreach ($EXAMS as $exam) { + $scorestr = $db->query("SELECT scorestr FROM examscore WHERE mnumber=" . $mnumber . " AND exam=" . $exam['id'])->fetch(PDO::FETCH_NUM)[0]; + $singlescore = 0; + if ($scorestr != "") { + foreach (explode(',',$scorestr) as $points) { $singlescore = $singlescore + $points; } + $examscore = $examscore + $singlescore/$exam['totscore']; + } + + print ""; + print ""; + print ""; + print ""; + print ""; + } + $examscore = ($examscore / $EXAMS_n)*100; + + if ($EXAMS_n > 0 ) { + print ""; + print ""; + print ""; + print ""; + } + + print "
" . $exam['timestr'] . "  {" . $scorestr . "}=" . $singlescore . "/" . $exam['totscore'] . "  " . round(100*$singlescore/$exam['totscore']) . "%  
" . round($examscore) . "%
"; + + print "
"; + print "Blackboard"; $blackdone = $db->query("SELECT blackboard FROM students WHERE mnumber=" . $mnumber)->fetch(PDO::FETCH_NUM)[0];