query("SELECT COUNT(*) FROM workdone WHERE mnumber=$up_mnumber AND session=$up_sessionid AND tstamp=$up_tstamp")->fetch(PDO::FETCH_NUM)[0] == 0 ) { $db->query("DELETE FROM workdone WHERE mnumber=$up_mnumber AND session=$up_sessionid"); $db->query("INSERT INTO workdone (session,mnumber,thisdone,manydone,tstamp) values ($up_sessionid,$up_mnumber,\"$up_editsub\",$up_manydone,$up_tstamp)"); block("lightgreen", "modified submit"); } } print "
"; block("black", "summary for session " . $SESSIONS[$showsession]['timestr'] . " (" . $SESSIONS[$showsession]['examples'] . ")"); $result = $db->query("SELECT firstname, lastname, mnumber, blackboard FROM students ORDER BY LOWER(lastname)"); print "First name | Last name | Matr.nummer | Examples | "; if( isset($SESSIONS_actual) && $showsession == $SESSIONS_actual ) { print "Blackboard | "; } else { print "Modify | "; } while ($student = $result->fetch(PDO::FETCH_ASSOC)) { $result2 = $db->query("SELECT manydone, thisdone FROM workdone WHERE mnumber=" . $student['mnumber'] . " AND session=" . $showsession)->fetch(PDO::FETCH_NUM); $exdone = $result2[0]; if ($exdone == "") { $exdone=0; } $thisdone = $result2[1]; print "
" . $student['firstname'] . " | "; print "" . $student['lastname'] . " | "; print "" . $student['mnumber'] . " | "; print "" . $thisdone . " (" . $exdone . "/" . $SESSIONS[$showsession]['nexamples'] . ") | "; if( (! isset($SESSIONS_actual)) || $showsession != $SESSIONS_actual ) { print ""; } else { print " | " . $student['blackboard'] . " | "; } print "