diff options
| author | cassio <cassiopc@gmail.com> | 2013-09-13 10:45:39 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2013-09-13 10:45:39 +0000 |
| commit | 5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe (patch) | |
| tree | 03693df96c381d62a0577922ef443a4c0b1b1b84 /src | |
| parent | c34c9ffe0f37385e28964c1ef431f8aabac26b43 (diff) | |
| download | boca-5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe.tar.gz boca-5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe.zip | |
autojudge now replies in a more appropriate way when multiple in/out files exist
Diffstat (limited to 'src')
| -rwxr-xr-x | src/private/autojudging.php | 35 | ||||
| -rw-r--r-- | src/version | 2 | ||||
| -rw-r--r-- | src/versionnum.php | 2 |
3 files changed, 24 insertions, 15 deletions
diff --git a/src/private/autojudging.php b/src/private/autojudging.php index 2c16110..d077866 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 11/sep/2013 by cassio@ime.usp.br +// Last modified 13/sep/2013 by cassio@ime.usp.br $ds = DIRECTORY_SEPARATOR; if($ds=="") $ds = "/"; @@ -443,7 +443,8 @@ if($retval != 0) { escapeshellarg($dir . $ds . "output" . $ds . $file)." ". escapeshellarg($dir . $ds . "input" . $ds . $file) . " >compout"; echo "Executing " . $ex . " at " . getcwd() . " for output file $file\n"; - $answer = system($ex, $localretval); + if(system($ex, $localretval)===false) + $localretval = -1; $fp = fopen($dir . $ds . "allerr", "a+"); fwrite($fp, "\n\n===OUTPUT OF COMPARING SCRIPT FOLLOWS FOR FILE " .$file ." (EMPTY MEANS NO DIFF)===\n"); @@ -463,19 +464,27 @@ if($retval != 0) { if($localretval < 4 || $localretval > 6) { // contact staff $retval = 7; - $answer='Contact staff'; + $answer='(Contact staff)' . $answer; + break; + } + if($localretval == 6) { + $retval=$localretval; + $answer='(Wrong answer)'. $answer; + break; } - else if($retval==0) { - if($localretval==4) { + if($localretval == 5) { + $retval=$localretval; + $answer='(Presentation error)'. $answer; + } else { + if($localretval != 4) { + $retval = 7; + $answer='(Contact staff)' . $answer; + break; + } + if($retval == 0) { // YES! - $answer='YES'; + $answer='(YES)' . $answer; $retval = 1; - } else $retval=$localretval; - } - else if($retval==1) { - if($localretval!=4) { - $retval=$localretval; - $answer='Presentation error'; } } } else { @@ -484,7 +493,7 @@ if($retval != 0) { } } } -if($retval > 9) { +if($retval == 0 || $retval > 9) { $ans = file("allout"); $anstmp = trim(escape_string($ans[count($ans)-1])); unset($ans); diff --git a/src/version b/src/version index 45adf7e..98cd6a5 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -boca-1.5.5 +boca-1.5.6 diff --git a/src/versionnum.php b/src/versionnum.php index 49c494b..0b30398 100644 --- a/src/versionnum.php +++ b/src/versionnum.php @@ -1,5 +1,5 @@ <?php -$BOCAVERSION='boca-1.5.5'; +$BOCAVERSION='boca-1.5.6'; $YEAR='2013'; ?> |