X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/8db41c98817b1b48532dc3cebf4bea166e42bb70..311a7991e63b57767d675dda37476a0cbd2bb0d8:/summary.php diff --git a/summary.php b/summary.php index 3354ca3..38c56f2 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']); @@ -12,34 +13,88 @@ block("black", "summary for " . $_POST['mnumber']); - print "Examples Submitted"; + if ( isset($SESSIONS_next) ) { + print "Submitted for next session on " . $SESSIONS[$SESSIONS_next]['timestr'] . ""; + + print ""; + + if($db->query("SELECT COUNT(*) FROM workdone WHERE mnumber = $mnumber AND session = $SESSIONS_next")->fetch(PDO::FETCH_NUM)[0] == 0) { + print ""; + } + else { + $wdone = $db->query("SELECT thisdone,manydone FROM workdone WHERE mnumber = $mnumber AND session = $SESSIONS_next")->fetch(PDO::FETCH_NUM); + print "
"; + } + + print "
0 (0/" . $SESSIONS[$SESSIONS_next]['nexamples'] . ")
" . $wdone[0] . " (" . $wdone[1] . "/" . $SESSIONS[$SESSIONS_next]['nexamples'] . ")
"; + + print "
"; + } + + print "Examples submitted so far"; print ""; $tot_done = 0; - foreach ($SESSIONS as $session) { - if ($session['id'] == $SESSIONS_next) { break; } + if( isset($SESSIONS) ) { + foreach ($SESSIONS as $session) { + if ( isset($SESSIONS_next) ) { + if ($session['id'] == $SESSIONS_next) { break; } + } - $exdone = $db->query("SELECT thisdone, manydone FROM workdone WHERE mnumber=" . $mnumber . " AND session=" . $session['id'])->fetch(PDO::FETCH_NUM); + $exdone = $db->query("SELECT thisdone, manydone FROM workdone WHERE mnumber=" . $mnumber . " AND session=" . $session['id'])->fetch(PDO::FETCH_NUM); - if ( $exdone[1] == "" ) { $exdone[1] = "0"; } + if ( $exdone[1] == "" ) { $exdone[1] = "0"; } - $tot_done = $tot_done + $exdone[1]; + $tot_done = $tot_done + $exdone[1]; - print ""; - print ""; - print ""; - print ""; - print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + } } print ""; - print ""; + print ""; print ""; print "
" . $session['timestr'] . "  " . $session['examples'] . "(" . $session['nexamples'] . ")" . "  " . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  
" . $session['timestr'] . "  " . $session['examples'] . "(" . $session['nexamples'] . ")" . "  " . $exdone[1] . "/" . $session['nexamples'] . "(" . $exdone[0] . ")" . "  
" . $tot_done . "/" . $SESSIONS_totex . "" . $tot_done . "/" . $SESSIONS_totex . " ==> " . round(100 * $tot_done / $SESSIONS_totex) . "%
"; 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]; @@ -47,13 +102,13 @@ for( $ib=0; $ib<$blackdone; $ib++ ) { echo " * "; } - break; + exit; } ?>
- +
Last submission
Summary
@@ -61,7 +116,7 @@ - +
Mat.nummer:
Password: Password: