From: <br...@us...> - 2008-06-23 21:03:59
|
Revision: 279 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=279&view=rev Author: brus07 Date: 2008-06-23 14:02:46 -0700 (Mon, 23 Jun 2008) Log Message: ----------- Transfer to web usedMemory and usedTime in testing result Modified Paths: -------------- ACMServer/trunk/ACMServer/Checker/Class1.cs ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/web/set.php ACMServer/trunk/web/table.php Added Paths: ----------- ACMServer/trunk/web/update.php ACMServer/trunk/web/update3.0.0.1.sql Modified: ACMServer/trunk/ACMServer/Checker/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Checker/Class1.cs 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/ACMServer/Checker/Class1.cs 2008-06-23 21:02:46 UTC (rev 279) @@ -78,6 +78,8 @@ //TODO: Result result = new Result(submit); result.res = TSource.TestResultToString(c.Summary.res.res); + result.usedMemory = c.Summary.res.UsedMemory; + result.usedTime = c.Summary.res.UsedTime; return result.ToStringX(); } public static int GetResult1(string code) Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-23 21:02:46 UTC (rev 279) @@ -39,18 +39,27 @@ { string res = ""; string id = ""; + string usedMemory = ""; + string usedTime = ""; try { //TODO: Result result = Result.CreateFromXml(message); res = result.res; id = result.Submit.id.ToString(); + usedMemory = result.usedMemory.ToString(); + usedTime = result.usedTime.ToString(); } catch (Exception) { return; } - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/set.php?res=" + res + "&id=" + id); + string fullURL = fullPathToWebPages + "/set.php?"; + fullURL += "res=" + res; + fullURL += "&id=" + id; + fullURL += "&usedMemory=" + usedMemory; + fullURL += "&usedTime=" + usedTime; + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullURL); myRequest.Method = "GET"; WebResponse myResponse = myRequest.GetResponse(); myResponse.Close(); Modified: ACMServer/trunk/web/set.php =================================================================== --- ACMServer/trunk/web/set.php 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/web/set.php 2008-06-23 21:02:46 UTC (rev 279) @@ -8,7 +8,7 @@ echo "<p>"; echo $id; $res = mysql_real_escape_string($res); - $Query = "UPDATE `v3_submits` SET `result` = \"$res\" WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; + $Query = "UPDATE `v3_submits` SET `result` = \"$res\", `usedMemory`=$usedMemory, `usedTime`=$usedTime WHERE `result` IS NULL AND `id` = $id LIMIT 1 ;"; echo "<p>"; echo $Query; Modified: ACMServer/trunk/web/table.php =================================================================== --- ACMServer/trunk/web/table.php 2008-06-23 11:44:43 UTC (rev 278) +++ ACMServer/trunk/web/table.php 2008-06-23 21:02:46 UTC (rev 279) @@ -51,6 +51,12 @@ echo "\t\t<td>"; echo "<b>result</b>"; echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedMemory</b>"; + echo "</td>\n"; + echo "\t\t<td>"; + echo "<b>usedTime</b>"; + echo "</td>\n"; echo "\t</tr>\n"; while($arr = mysql_fetch_array($result)) { echo "\t<tr>\n"; @@ -60,6 +66,12 @@ echo $arr[$i]; echo "</td>\n"; } + for ($i=3; $i<5; $i++) + { + echo "\t\t<td>"; + echo $arr[$i]/1000.0; + echo "</td>\n"; + } echo "\t</tr>\n"; } echo "</table>\n"; Added: ACMServer/trunk/web/update.php =================================================================== --- ACMServer/trunk/web/update.php (rev 0) +++ ACMServer/trunk/web/update.php 2008-06-23 21:02:46 UTC (rev 279) @@ -0,0 +1,7 @@ +<?php + + require_once("connect.php"); + + $sql = 'ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL, ADD `usedTime` VARCHAR( 20 ) NOT NULL '; + + $result = MySql_Query ($sql); \ No newline at end of file Added: ACMServer/trunk/web/update3.0.0.1.sql =================================================================== --- ACMServer/trunk/web/update3.0.0.1.sql (rev 0) +++ ACMServer/trunk/web/update3.0.0.1.sql 2008-06-23 21:02:46 UTC (rev 279) @@ -0,0 +1,5 @@ +-- +-- Insert new column to table +-- +ALTER TABLE `v3_submits` ADD `usedMemory` VARCHAR( 20 ) NOT NULL , +ADD `usedTime` VARCHAR( 20 ) NOT NULL ; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |