aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2013-09-13 10:45:39 +0000
committercassio <cassiopc@gmail.com>2013-09-13 10:45:39 +0000
commit5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe (patch)
tree03693df96c381d62a0577922ef443a4c0b1b1b84
parentc34c9ffe0f37385e28964c1ef431f8aabac26b43 (diff)
downloadboca-5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe.tar.gz
boca-5e7b4f6a355b62791dd6d318c2b2b3153f6e2dfe.zip
autojudge now replies in a more appropriate way when multiple in/out files exist
-rw-r--r--doc/changelog.txt3
-rwxr-xr-xsrc/private/autojudging.php35
-rw-r--r--src/version2
-rw-r--r--src/versionnum.php2
4 files changed, 27 insertions, 15 deletions
diff --git a/doc/changelog.txt b/doc/changelog.txt
index 5636450..fd71676 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,3 +1,6 @@
+version 1.5.6:
+- reviewed way autojudge reply in the case of multiple input/output files
+
version 1.5.5:
- bug fix: some passwords didnt work because of an error in the calculations
with hex numbers
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';
?>