]> mj.ucw.cz Git - eval.git/commitdiff
Combining local and remote operations.
authorMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 16:15:07 +0000 (18:15 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 10 Jun 2007 16:15:07 +0000 (18:15 +0200)
TODO
public/status
public/submit
submit/MO/Submit.pm
submit/contest
userlist

diff --git a/TODO b/TODO
index 3f8f8dba2207721217e895c210b7bbc306221d8f..da76d309b1d152005d664685f1d63e3986ef1cbe 100644 (file)
--- a/TODO
+++ b/TODO
@@ -5,6 +5,9 @@ score: better formatting of the score table
 interactive tasks: solve deadlocks?
 interactive tasks: logging of messages
 
+!!!!!!!!! copy all users
+!!!!!!!!! contest: call check with the right filename and don't let it guess
+
 Environment
 ~~~~~~~~~~~
 fpc: add switch -gl (runtime errors write line#)
index a8c81f1b5abee44b8bc94a85bb050bd8f25591e5..9e795dc3c303f8e1415d07b19971c5adfc05e1cd 100755 (executable)
@@ -1,3 +1,4 @@
+#!/bin/bash
 # The Evaluator -- Public Status Script
 # (c) 2004 Martin Mares <mj@ucw.cz>
 
@@ -10,6 +11,10 @@ set -e
 
 echo -e "Submitted tasks:\n"
 
+if [ -n "$REMOTE_SUBMIT" ] ; then
+       exec $MO_ROOT/bin/remote-status
+fi
+
 for PROBLEM in `cd $MO_ROOT/problems/ ; echo *` ; do
        (
        PDIR=$MO_ROOT/problems/$PROBLEM
index eaab532b524a7bab3b7e4b8db009cc1ca0f2e2c9..fc7c08e9553324be44fbe5c8d56611e7050fbb74 100755 (executable)
@@ -1,3 +1,4 @@
+#!/bin/bash
 # The Evaluator -- Public Submit Script
 # (c) 2001--2004 Martin Mares <mj@ucw.cz>
 
@@ -13,6 +14,7 @@ if [ "$1" = --force ] ; then
 fi
 [ -n "$1" -o "$1" = "--help" ] || die "Usage: submit [--force] <problem> [<test-number>]"
 PROBLEM=$1
+PART=$2
 public-setup
 . $PDIR/config
 
@@ -24,8 +26,8 @@ function test-verdict
 
 FAILED=0
 if [ $TASK_TYPE == open-data ] ; then
-       [ -n "$2" ] || die "You need to specify test number for open data problems."
-       TEST=$2
+       [ -n "$PART" ] || die "You need to specify test number for open data problems."
+       TEST=$PART
        pstart "Test case $TEST: "
        open-locate
        (
@@ -34,7 +36,7 @@ if [ $TASK_TYPE == open-data ] ; then
                test-result 1 OK
        ) || FAILED=1
 else
-       [ -z "$2" ] || die "Test number should be given only for open data problems."
+       [ -z "$PART" ] || die "Test number should be given only for open data problems."
        locate-source
        compile
        for TEST in $SAMPLE_TESTS ; do
@@ -58,11 +60,18 @@ if [ $FAILED != 0 ] ; then
        fi
 fi
 
+if [ -n "$REMOTE_SUBMIT" ] ; then
+       pstart "Submitting to the server... "
+       $MO_ROOT/bin/remote-submit $PROBLEM $PART $SRCN
+       pend "OK"
+       exit 0
+fi
+
 pstart "Submitting... "
 mkdir -p ~/.submit
 if [ $TASK_TYPE == open-data ] ; then
        mkdir -p ~/.submit/$PROBLEM
-       cp $SRCN ~/.submit/$PROBLEM/$TEST.out
+       cp $SRCN ~/.submit/$PROBLEM/$PART.out
 else
        rm -rf ~/.submit/$PROBLEM
        mkdir -p ~/.submit/$PROBLEM
index f85852cfb008f3a2aeb4dd7eb4d4e6b7072efd50..4497eef41ea391637633141bc167cfcc2c473f07 100644 (file)
@@ -23,8 +23,10 @@ sub new($) {
                "Cert" => "$mo/cert.pem",
                "CACert" => "$mo/ca-cert.pem",
                "Trace" => defined $ENV{"MO_SUBMIT_TRACE"},
-               "History" => "$home/.history",  # Keep submission history in this directory
-               "RefreshTimer" => 5000,         # How often GUI sends STATUS commands [ms]
+               "Checks" => 1,
+#              "History" => "$home/.history",  # Keep submission history in this directory
+               "RefreshTimer" => 60000,        # How often GUI sends STATUS commands [ms]
+               "root" => $root,
                "user" => $user,
                "sk" => undef,
                "error" => undef,
index 4566c7ce9616aae7e48270492a2e10adca5e93f6..17e1b3921a63d4a53880d2f8de23845dc1a849af 100755 (executable)
@@ -312,7 +312,7 @@ sub run_submit() {
        defined $part or $part = $task;
 
        if (defined $conn->{"History"}) {
-               busy("Submitting locally");
+               busy("Submitting locally to " . $conn->{"History"});
                my $err = $conn->local_submit($task, $part, $submit_extension, $submit_filename);
                if (defined $err) {
                        submit_failed("Recording to local history failed\n($err)");
@@ -382,8 +382,15 @@ sub checks_failed($) {
        $text_view->set_editable(0);
        $text_view->set_cursor_visible(0);
 
+       my $text_scroll = Gtk2::ScrolledWindow->new;
+       $text_scroll->set_policy("automatic", "automatic");
+       $text_scroll->add($text_view);
+
+       my $text_frame = Gtk2::Frame->new("Checker log");
+       $text_frame->add($text_scroll);
+
        $submitting_label->destroy;
-       $subwin_vbox->pack_start_defaults($text_view);
+       $subwin_vbox->pack_start_defaults($text_frame);
 
        finish_submit();
 }
@@ -415,9 +422,19 @@ sub run_checks() {
                checks_failed("The filename does not have a valid extension");
                return;
        }
-       sleep 1;
-       #checks_failed("One\nTwo\nThree...\n");
-       checks_ok();
+       if (!$conn->{"Checks"}) {
+               checks_ok();
+               return;
+       }
+       my $root = $conn->{"root"};
+       my ($task, $part) = split /\//, $selected_task;
+       defined $part or $part = "";
+       my $verdict = `$root/bin/check $task $part 2>&1`;
+       if ($?) {
+               checks_failed($verdict);
+       } else {
+               checks_ok();
+       }
 }
 
 sub do_submit() {
index f8520803da73adad0bdd4cc22260d4b8f4197354..556c728d9d5b396cc002c64068738c21ed657e49 100644 (file)
--- a/userlist
+++ b/userlist
@@ -1,2 +1,21 @@
-authors        The Authors
-testuser       The Testuser
+cz1    Pavel Klavik
+cz2    Miroslav Klimos
+cz3    Josef Pihera
+cz4    Lukas Lansky
+cz5    Libor Plucnar
+cz6    Roman Smrz
+sk1    Vladimir Boza
+sk2    Michal Danilak
+sk3    Jozef Jirasek
+sk4    Peter Ondruska
+sk5    Peter Hlavaty
+sk6    Alena Kosinarova
+pl1    Tomasz Kulczynski
+pl2    Jakub Kallas
+pl3    Marcin Kurczych
+pl4    Piotr Niedzwiedz
+pl5    Jaroslaw Gomulka
+pl6    Maciej Klimek
+cz     CZ organizers
+sk     SK organizers
+pl     PL organizers