diff options
author | pzread <netfirewall@gmail.com> | 2013-03-10 15:02:19 +0800 |
---|---|---|
committer | pzread <netfirewall@gmail.com> | 2013-03-10 15:02:19 +0800 |
commit | 0bcc905d92d2f69a0b961746be1f19ef096857a3 (patch) | |
tree | 514abd4fd4319cb6e05df7007580f8afc5896040 /toj/php/problem.inc.php | |
parent | 898913018b1d3f289f10d4716e28489497c977cb (diff) | |
download | taiwan-online-judge-lantw44-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.gz taiwan-online-judge-lantw44-0bcc905d92d2f69a0b961746be1f19ef096857a3.tar.zst taiwan-online-judge-lantw44-0bcc905d92d2f69a0b961746be1f19ef096857a3.zip |
Add Virtual URI System. New UI design. Improve sqmod_test
Diffstat (limited to 'toj/php/problem.inc.php')
-rw-r--r-- | toj/php/problem.inc.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/toj/php/problem.inc.php b/toj/php/problem.inc.php index e41e633..d6f8851 100644 --- a/toj/php/problem.inc.php +++ b/toj/php/problem.inc.php @@ -131,6 +131,7 @@ class problem mkdir($pardir.$subid, 0755) or die('Ecannot_mkdir'); mkdir($pardir.$subid.'/data', 0755) or die('Ecannot_mkdir'); mkdir($pardir.$subid.'/result', 0755) or die('Ecannot_mkdir'); + chmod($pardir.$subid.'/result', 0775) or die('Ecannot_chmod'); //$file = fopen($pardir.$subid.'/data/'.$subid.'.'.$ext,'w'); //20130205 tmp change @@ -246,6 +247,33 @@ class problem return $ret; } + + public static function rejudge_pro($sqlc, $proid) + { + $sqlstr = 'SELECT "subid" FROM "submit" WHERE "proid"=$1 ORDER BY "subid";'; + $sqlarr = array($proid); + $res = pg_query_params($sqlc, $sqlstr, $sqlarr); + $ok = true; + $sublist = pg_fetch_all_columns($res, 0); + if(!$sublist)return false; + foreach($sublist as $sub) + { + $subid = intval($sub); + if(!problem::send_socket($subid, $proid))$ok = false; + } + return $ok; + } + + public static function rejudge_sub($sqlc, $subid) + { + $sqlstr = 'SELECT "proid" FROM "submit" WHERE "subid"=$1;'; + $sqlarr = array($subid); + $res = pg_query_params($sqlc, $sqlstr, $sqlarr); + $proid = intval(pg_fetch_result($res, 0)); + if(!$proid)return false; + + return problem::send_socket($subid, $proid); + } } |