\n"; ?> Computability Assignments

Computability Assignments

Remarks:

Assignment List

Comprehensive PDF file.

Assignment Submission

All fields below are mandatory.
Matriculation number: /> (will be logged, but not made public)
Assignment number: />
LyX file to upload:

Error: " . $msg . "

\n"; } $t = microtime(true); $maxSize = 1000000; # 1 MB $basename = "assignment_" . normalizeAssignment($assignment) . "__" . $t . ".lyx" ; $filename = "/home/zunino/stuff/uploads/" . $basename; $logfile = "/home/zunino/stuff/uploads/log_" . $matriculation . ".txt" ; if (! isset($_POST["dummy"])) { # Hack: not a post, don't complain about missing stuff } else if (! checkMatriculation($matriculation)) { uploadError("matriculation number should be 5 or 6 digits"); } else if (! checkAssignment($assignment)) { uploadError("wrong assignment number"); } else if (! $_FILES["userfile"]["tmp_name"]) { uploadError("no file specified"); } else if (! checkLyX($_FILES["userfile"]["name"])) { uploadError("uploaded file must be a LyX file"); } else if ($_FILES["userfile"]["size"] > $maxSize) { uploadError("uploaded file is too large (max " . $maxSize . " bytes)"); } else { # echo "File uploaded: " . $_FILES["userfile"]["tmp_name"] . " -
\n"; # echo "File name: " . $_FILES["userfile"]["name"] . " -
\n"; # echo "File size: " . $_FILES["userfile"]["size"] . " -
\n"; # echo "Logfile: " . $logfile . "
\n"; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $filename)) { # if (true) { echo "\n"; echo "\n"; echo "\n"; echo "
" . "Your file was successfully uploaded.
You should now bookmark this link " . "to access your submission. If you do not do so, it will be " . "hard to locate your submission among all the others in the " . "future.
\n"; $handle = fopen($logfile, "a"); fwrite($handle, "uploaded " . $matriculation . " " . $filename . "\n"); fclose($handle); } else { uploadError("Internal error. Please contact me by email."); $handle = fopen($logfile, "a"); fwrite($handle, "FAIL uploading " . $matriculation . " " . $filename . "\n"); fclose($handle); } } ?>

Submitted Answers So Far

Reminder: you can browse other submissions, but copying from them is pointless.

List of all submissions " . $i . ""; } ?>

Home - Teaching - Computability


Valid CSS Valid XHTML 1.1 Roberto Zunino, 2013