aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fcontest.php11
-rw-r--r--src/fextdata.php10
-rwxr-xr-xsrc/private/autojudging.php10
-rw-r--r--src/team/run.php4
4 files changed, 17 insertions, 18 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index 0bbe94e..0bd14f0 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -15,8 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-//Last updated 26/oct/2014 by cassio@ime.usp.br
-// inclusion of default extra language C++11
+//Last updated 11/nov/2015 by cassio@ime.usp.br
//
function DBDropContestTable() {
$c = DBConnect();
@@ -991,10 +990,10 @@ function insertlanguages($n,$c=null) {
$param['name']='Java';
$param['extension']='java';
DBNewLanguage($n, $param, $c);
- $param['number']=4;
- $param['name']='C++11';
- $param['extension']='cc';
- DBNewLanguage($n, $param, $c);
+// $param['number']=4;
+// $param['name']='C++11';
+// $param['extension']='cc';
+// DBNewLanguage($n, $param, $c);
}
function insertanswers($n,$c) {
DBExec($c, "insert into answertable (contestnumber, answernumber, runanswer, yes, fake) values ".
diff --git a/src/fextdata.php b/src/fextdata.php
index 0e500ec..28d8257 100644
--- a/src/fextdata.php
+++ b/src/fextdata.php
@@ -24,7 +24,7 @@ function scoretransfer($putname, $localsite) {
if(is_readable('/etc/boca.conf')) {
$pif=parse_ini_file('/etc/boca.conf');
$bocaproxy = @trim($pif['proxy']);
- if(substr($bocaproxy,0,6) != 'tcp://')
+ if($bocaproxy != "" && substr($bocaproxy,0,6) != 'tcp://')
$bocaproxy = 'tcp://' . $bocaproxy;
$bocaproxylogin = @trim($pif['proxylogin']);
$bocaproxypass = @trim($pif['proxypassword']);
@@ -76,8 +76,8 @@ function scoretransfer($putname, $localsite) {
);
if($bocaproxy != "")
$opts['http']['proxy'] = $bocaproxy;
- if($bocapass != "")
- $opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocapass;
+ if($bocaproxypass != "")
+ $opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$context = stream_context_create($opts);
@@ -131,8 +131,8 @@ function scoretransfer($putname, $localsite) {
);
if($bocaproxy != "")
$opts['http']['proxy'] = $bocaproxy;
- if($bocapass != "")
- $opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocapass;
+ if($bocaproxypass != "")
+ $opts['http']['header'] .= "\r\nProxy-Authorization: Basic " . $bocaproxypass;
$context = stream_context_create($opts);
$s = @file_get_contents($siteurl . $urldiv . "site/putfile.php", 0, $context);
diff --git a/src/private/autojudging.php b/src/private/autojudging.php
index bda7d38..cbdc1ec 100755
--- a/src/private/autojudging.php
+++ b/src/private/autojudging.php
@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-// Last modified 10/sep/2015 by cassio@ime.usp.br
+// Last modified 19/Oct/2015 by cassio@ime.usp.br
$ds = DIRECTORY_SEPARATOR;
if($ds=="") $ds = "/";
@@ -387,7 +387,7 @@ if($retval != 0) {
DBGiveUpRunAutojudging($contest, $site, $number, $ip, "warning: problem package has no input files");
continue;
} else {
- $errp=0;
+ $errp=0; $ncor=0;
foreach($inputlist as $file) {
$file = basename($file);
if(is_file($dir . $ds . "input" . $ds . $file)) {
@@ -456,7 +456,6 @@ if($retval != 0) {
$answer = "(WHILE RUNNING) " . $answer;
break;
}
- $ncor = 0;
if(is_file($dir . $ds . 'output' . $ds . $file)) {
@unlink($dir . $ds . 'compout');
$ex = escapeshellcmd($scriptcomp) ." ".
@@ -597,7 +596,7 @@ if($retval != 0) {
}
if($retval >= 7 && $retval <= 9) {
$ans = file("allout");
- $anstmp = trim(escape_string($ans[count($ans)-1]));
+ $anstmp = substr(trim(escape_string($ans[count($ans)-1])),0,100);
unset($ans);
$answer = "(probably runtime error - unusual code: $retval) " . $anstmp;
// runtime error
@@ -605,7 +604,7 @@ if($retval >= 7 && $retval <= 9) {
}
if($retval == 0 || $retval > 9) {
$ans = file("allout");
- $anstmp = trim(escape_string($ans[count($ans)-1]));
+ $anstmp = substr(trim(escape_string($ans[count($ans)-1])),0,100);
unset($ans);
LogLevel("Autojudging: Script returned unusual code: $retval ($anstmp)".
"(run=$number, site=$site, contest=$contest)",1);
@@ -619,6 +618,7 @@ if($retval == 0 || $retval > 9) {
echo "Sending results to server...\n";
//echo "out==> "; system("tail -n1 ". $dir.$ds.'allout');
//echo "err==> "; system("tail -n1 ". $dir.$ds.'allerr');
+$answer=substr($answer,0,200);
DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $dir.$ds.'allout', $dir.$ds.'allerr', $retval);
LogLevel("Autojudging: answered '$answer' (run=$number, site=$site, contest=$contest)",3);
echo "Autojudging answered '$answer' (contest=$contest, site=$site, run=$number)\n";
diff --git a/src/team/run.php b/src/team/run.php
index b14d387..a5f9993 100644
--- a/src/team/run.php
+++ b/src/team/run.php
@@ -151,7 +151,7 @@ if (isset($_POST["problem"]) && isset($_POST["language"]) &&
}
///////CASO DE COMECAR MAIS TARDE NO CENTRALIZADO
- if(substr($_SESSION["usertable"]["username"],0,3) == 'XXX') {
+ if(false && substr($_SESSION["usertable"]["username"],0,3) == 'XXX') {
$param['rundate']=$param['rundate'] - 60*10; // 10 minutos
$param['rundatediff']=$param['rundatediff'] - 60*10;
}
@@ -168,7 +168,7 @@ if (isset($_POST["problem"]) && isset($_POST["language"]) &&
exit;
}
///////CASO DE COMECAR MAIS TARDE NO CENTRALIZADO
- if(substr($_SESSION["usertable"]["username"],0,3) == 'XXX') {
+ if(false && substr($_SESSION["usertable"]["username"],0,3) == 'XXX') {
$param['rundate']=$param['rundate'] - 60*10; // 10 minutos
$param['rundatediff']=$param['rundatediff'] - 60*10;
}