From: <br...@us...> - 2009-02-03 22:54:18
|
Revision: 484 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=484&view=rev Author: brus07 Date: 2009-02-03 22:54:13 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Change IoiInformerPlugin to save results to HTML file. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs 2009-02-03 22:50:29 UTC (rev 483) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs 2009-02-03 22:54:13 UTC (rev 484) @@ -28,5 +28,10 @@ numericUpDown1.UpButton(); } } + + public void LoadURL(Uri URL) + { + //browser.Url = URL; + } } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs 2009-02-03 22:50:29 UTC (rev 483) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs 2009-02-03 22:54:13 UTC (rev 484) @@ -2,6 +2,7 @@ using AcmContester.Plugins.PluginsFramework; using AcmContester.Library.LibraryExtention; using AcmContester.Library.LibraryExtention.Data; +using System.IO; namespace AcmContester.Plugins.IoiPlugins.IoiInformerPlugin { @@ -19,7 +20,59 @@ ResultIoi result = ResultIoi.CreateFromXml(message.Message); ((IoiInformerControl)base.Control).UpCount(); - //\xF2\xF3\xF2 \xEE\xE1\xF0\xEE\xE1\xEA\xE0 \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF + HtmlBuilder h=new HtmlBuilder(); + h.Title = "\xD0\xE5\xE7\xF3\xEB\xFC\xF2\xE0\xF2\xE8 \xF2\xE5\xF1\xF2\xF3\xE2\xE0\xED\xED\xFF"; + h.AddHeader("\xC4\xE0\xED\xB3 \xEF\xF0\xEE \xF1\xE0\xE1\xEC\xB3\xF2:", 4, "left"); + h.AddText("\xD3\xF7\xE0\xF1\xED\xE8\xEA: " + result.Submit.name + "<br>"); + h.AddText("\xCA\xEB\xE0\xF1: " + result.Submit.form + "<br>"); + h.AddText("\xC7\xE0\xE4\xE0\xF7\xE0: " + result.Submit.submit.pbolemID + "<br>"); + h.AddText("\xCC\xEE\xE2\xE0 \xEF\xF0\xEE\xE3\xF0\xE0\xEC\xF3\xE2\xE0\xED\xED\xFF: " + result.Submit.submit.language + "<br>"); + h.AddText("\xCD\xEE\xEC\xE5\xF0 \xF1\xE0\xE1\xEC\xB3\xF2\xF3: " + result.Submit.submit.id + "<br>"); + h.AddHorizLine(); + h.AddHeader("\xC2\xE8\xF5\xB3\xE4\xED\xE8\xE9 \xEA\xEE\xE4",4,"center"); + h.AddCode(result.Submit.submit.sourceCode); + h.AddHorizLine(); + h.AddHeader("\xD0\xE5\xE7\xF3\xEB\xFC\xF2\xE0\xF2 \xE2\xE8\xEA\xEE\xED\xE0\xED\xED\xFF", 4, "center"); + + string[,] data=new string[result.testResults.Length+1,8]; + string[] header = new string[8]; + header[0] = "\xB9"; + header[1] = "\xE2\xF5\xB3\xE4"; + header[2] = "\xEA\xEE\xF0\xE5\xEA\xF2\xED\xE8\xE9 \xF0\xE5\xE7\xF3\xEB\xFC\xF2\xE0\xF2"; + header[3] = "\xF0\xE5\xE7\xF3\xEB\xFC\xF2\xE0\xF2 \xF3\xF7\xE0\xF1\xED\xE8\xEA\xE0"; + header[4] = "\xE2\xE8\xEA\xEE\xF0\xE8\xF1\xF2\xE0\xED\xE8\xE9 \xF7\xE0\xF1"; + header[5] = "\xE2\xE8\xEA\xEE\xF0\xE8\xF1\xF2\xE0\xED\xE0 \xEF\xE0\xEC\'\xFF\xF2\xFC"; + header[6] = "\xE2\xE5\xF0\xE4\xE8\xEA\xF2 \xF1\xF3\xE4\xE4\xB3"; + header[7] = "\xEA-\xF1\xF2\xFC \xE1\xE0\xEB\xB3\xE2 \xE7\xE0 \xF2\xE5\xF1\xF2"; + int n = result.testResults.Length; + int sumPoints = 0; + for (int i = 0; i < n; i++) + { + data[i,0] = result.testResults[i].id.ToString(); + data[i,1] = result.testResults[i].input; + data[i,2] = result.testResults[i].output; + data[i,3] = result.testResults[i].contestantOutput; + data[i,4] = result.testResults[i].usedTime.ToString(); + data[i,5] = result.testResults[i].usedMemory.ToString(); + data[i,6] = result.testResults[i].res; + data[i,7] = result.testResults[i].points.ToString(); + sumPoints += result.testResults[i].points; + } + data[n,0] = "\xD1\xF3\xEC\xE0\xF0\xED\xB3"; + data[n,4] = result.usedTime.ToString(); + data[n,5] = result.usedMemory.ToString(); + data[n,6] = result.res; + data[n,7] = sumPoints.ToString(); + h.AddTable(data, header, ""); + + h.AddReference("http://acm.lviv.ua","<small><small>\xC0\xD1\xCC \xCA\xEE\xED\xF2\xE5\xF1\xF2\xE5\xF0 - \xF0\xF3\xF5 \xE2\xEF\xE5\xF0\xE5\xE4</small></small>","right"); + + StreamWriter w = File.CreateText(result.Submit.submit.id.ToString() + ".html"); + w.Write(h.Result); + w.Close(); + + //Uri url=new Uri(result.Submit.submit.id.ToString() + ".html"); + //((IoiInformerControl)base.Control).LoadURL(url); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |