a:focus { text-decoration:none; font-weight:normal; color:blue; }
</style>
+<a href="nextsession.php">next session</a>
+ |
<a href="summary.php">summary</a>
|
<a href="blackboard.php">blackboard</a>
--- /dev/null
+<?php
+ require 'include/head.inc';
+ require 'include/db.inc';
+ require 'include/session.inc';
+ require 'include/common.inc';
+
+ block("black", "summary for session " . $SESSIONS[$SESSIONS_actual]['timestr'] . " (" . $SESSIONS[$SESSIONS_actual]['examples'] . ")");
+
+ $result = $db->query("SELECT firstname, lastname, mnumber, blackboard FROM students ORDER BY lastname");
+
+ print "<table>";
+ print "<td><b>First name </b></td><td><b>Last name </b></td><td><b>Matr.nummer </b></td><td><b>Examples </b></td><td><b>Blackboard </b></td>";
+ while ($student = $result->fetch(PDO::FETCH_ASSOC)) {
+ $result2 = $db->query("SELECT manydone, thisdone FROM workdone WHERE mnumber=" . $student['mnumber'] . " AND session=" . $SESSIONS_actual)->fetch(PDO::FETCH_NUM);
+
+ $exdone = $result2[0];
+ if ($exdone == "") { $exdone=0; }
+
+ $thisdone = $result2[1];
+
+ print "<tr>";
+ print "<td>" . $student['firstname'] . "</td>";
+ print "<td>" . $student['lastname'] . "</td>";
+ print "<td>" . $student['mnumber'] . "</td>";
+ print "<td>" . $thisdone . " (" . $exdone . "/" . $SESSIONS[$SESSIONS_actual]['nexamples'] . ")</td>";
+ print "<td>" . $student['blackboard'] . "</td>";
+ print "</tr>";
+ }
+ print "</table>";
+?>
\ No newline at end of file
print "<td>" . $student['firstname'] . "</td>";
print "<td>" . $student['lastname'] . "</td>";
print "<td>" . $student['mnumber'] . "</td>";
- print "<td>" . $totexdone . "/" . $SESSIONS_totex . "</td>";
+ print "<td>" . $totexdone . "/" . $SESSIONS_totex_nextinc . "</td>";
print "<td>" . $student['blackboard'] . "</td>";
print "</tr>";
}
<?php
$result=$db->query("SELECT id,examples,nexamples FROM sessions ORDER BY id");
$SESSIONS_next = -1;
+ $SESSIONS_actual = -1;
+
while ($session = $result->fetch(PDO::FETCH_ASSOC)) {
$SESSIONS[$session['id']] = array("id" => $session['id'], "timestr" => date("d.m.Y H:i", $session['id']),
"workdone" => $db->query("SELECT COUNT(*) FROM workdone WHERE session=" . $session['id'])->fetch(PDO::FETCH_NUM)[0],
if ( strtotime("now") < $session['id'] && ( $SESSIONS_next==-1 || $SESSIONS_next > $session['id'] ) ) {
$SESSIONS_next = $session['id'];
}
+ if ( strtotime("now") < $session['id'] + 3600 && ( $SESSIONS_actual==-1 || $SESSIONS_actual > $session['id'] ) ) {
+ $SESSIONS_actual = $session['id'];
+ }
}
if($SESSIONS_next == -1) unset($SESSIONS_next);
foreach ($SESSIONS as $session) {
if($session['id'] < $SESSIONS_next) { $SESSIONS_totex += $session['nexamples']; }
}
+
+ $SESSIONS_totex_nextinc = 0;
+ foreach ($SESSIONS as $session) {
+ if($session['id'] <= $SESSIONS_next) { $SESSIONS_totex_nextinc += $session['nexamples']; }
+ }
?>