From eff3e813ec7d6c246dfadea41432fd68ec2e86fd Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 10 Jun 2007 18:15:07 +0200 Subject: [PATCH] Combining local and remote operations. --- TODO | 3 +++ public/status | 5 +++++ public/submit | 17 +++++++++++++---- submit/MO/Submit.pm | 6 ++++-- submit/contest | 27 ++++++++++++++++++++++----- userlist | 23 +++++++++++++++++++++-- 6 files changed, 68 insertions(+), 13 deletions(-) diff --git a/TODO b/TODO index 3f8f8db..da76d30 100644 --- 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#) diff --git a/public/status b/public/status index a8c81f1..9e795dc 100755 --- a/public/status +++ b/public/status @@ -1,3 +1,4 @@ +#!/bin/bash # The Evaluator -- Public Status Script # (c) 2004 Martin Mares @@ -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 diff --git a/public/submit b/public/submit index eaab532..fc7c08e 100755 --- a/public/submit +++ b/public/submit @@ -1,3 +1,4 @@ +#!/bin/bash # The Evaluator -- Public Submit Script # (c) 2001--2004 Martin Mares @@ -13,6 +14,7 @@ if [ "$1" = --force ] ; then fi [ -n "$1" -o "$1" = "--help" ] || die "Usage: submit [--force] []" 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 diff --git a/submit/MO/Submit.pm b/submit/MO/Submit.pm index f85852c..4497eef 100644 --- a/submit/MO/Submit.pm +++ b/submit/MO/Submit.pm @@ -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, diff --git a/submit/contest b/submit/contest index 4566c7c..17e1b39 100755 --- a/submit/contest +++ b/submit/contest @@ -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() { diff --git a/userlist b/userlist index f852080..556c728 100644 --- 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 -- 2.39.2