You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(128) |
Jun
(97) |
Jul
(13) |
Aug
(40) |
Sep
(50) |
Oct
(27) |
Nov
(7) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(18) |
Feb
(47) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
|
Sep
(14) |
Oct
(22) |
Nov
|
Dec
|
From: <br...@us...> - 2009-02-04 13:56:57
|
Revision: 487 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=487&view=rev Author: brus07 Date: 2009-02-04 13:56:55 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Now can work with many client. (bug this type of work very bad) Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-04 13:54:23 UTC (rev 486) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-04 13:56:55 UTC (rev 487) @@ -38,7 +38,17 @@ { if (message.Description.IndexOf("not check busy") != -1) { - DataSender(message, 0); + for (int index = 0; index < this.CountClients(); index++) + { + try + { + ServerSend(message, index); + //DataSender(message, 0); + } + catch (Exception) + { + } + } return true; } List<int> freeTesters = GetFreeTesters(); @@ -50,6 +60,7 @@ } return false; } + protected virtual void DataSender(SystemMessage message, int clientIndex) { //TODO: dlja cjogo bulo potribno pidkljuchyty EasySocket Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-04 13:54:23 UTC (rev 486) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-04 13:56:55 UTC (rev 487) @@ -92,7 +92,7 @@ mes += " " + result.res; OnLogMessage("Receive", mes); - message.Description = "not check busy"; + message.Description += " not check busy"; base.Send(message); dataContainer.Return(result); } @@ -104,7 +104,7 @@ mes += " " + result.res; OnLogMessage("Receive", mes); - message.Description = "not check busy"; + message.Description += " not check busy"; base.Send(message); dataContainer.Return(result.ToResult()); } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-04 13:54:23 UTC (rev 486) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-04 13:56:55 UTC (rev 487) @@ -2,6 +2,7 @@ using AcmContester.Library.LibraryExtention; using AcmContester.Library.Connector; using AcmContester.Library.LibraryExtention.Data; +using System.Collections.Generic; namespace AcmContester.Plugins.TesterPlugins.SocketClientGatePlugin { @@ -11,6 +12,9 @@ SocketClientTask client; + + Dictionary<int, bool> colectSubmitId = new Dictionary<int, bool>(); + private SocketClientGate() { } @@ -41,7 +45,7 @@ bool IsBusy() { OnDataArrived(new SystemMessage("isbusy", "CheckState")); - if (mutex.WaitOne(200, false) == true) + if (mutex.WaitOne(2000, false) == true) { return busyState; } @@ -51,6 +55,7 @@ void SocketClientGate_onDataArrived(SystemMessage message) { + OnAddLogText("Receive", message.Message); if (message.IsType("TestingSubmit") == true) @@ -67,8 +72,12 @@ if (message.IsType("TestingResultIoi")) { ResultIoi res = ResultIoi.CreateFromXml(message.Message); - OnAddLogText("Receive", "ID " + res.Submit.submit.id + " result - " + res.res); - OnDataArrived(message); + if (colectSubmitId.ContainsKey(res.Submit.submit.id) == true) + { + colectSubmitId.Remove(res.Submit.submit.id); + OnAddLogText("Receive", "ID " + res.Submit.submit.id + " result - " + res.res); + OnDataArrived(message); + } } } @@ -95,6 +104,8 @@ } if (message.IsType("TestingSubmitIoi")) { + SubmitIoi submit = SubmitIoi.CreateFromXml(message.Message); + colectSubmitId.Add(submit.submit.id, true); OnAddLogText("Send", message.Message); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-04 13:54:24
|
Revision: 486 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=486&view=rev Author: brus07 Date: 2009-02-04 13:54:23 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Generate and show Message when error on loading plugins. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2009-02-04 11:37:21 UTC (rev 485) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2009-02-04 13:54:23 UTC (rev 486) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Reflection; using System.IO; +using System.Windows.Forms; namespace AcmContester.Plugins.PluginsFramework { @@ -85,9 +86,10 @@ if (t.GetInterface(typeof(T).FullName) != null || t.IsSubclassOf(typeof(T))) lst.Add((T)Activator.CreateInstance(t)); } - catch (TargetInvocationException) + catch (TargetInvocationException ex) { - //throw ex; + MessageBox.Show(ex.ToString(), "Error when load plugin " + filename); + throw ex; } catch (MissingMethodException) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-04 12:22:24
|
Revision: 485 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=485&view=rev Author: brus07 Date: 2009-02-04 11:37:21 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Added LogDataGridView to SubmitIoi form. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs 2009-02-03 22:54:13 UTC (rev 484) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs 2009-02-04 11:37:21 UTC (rev 485) @@ -40,7 +40,10 @@ this.languageTextBox = new System.Windows.Forms.TextBox(); this.submitButton = new System.Windows.Forms.Button(); this.sourceTextBox = new System.Windows.Forms.TextBox(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox1.SuspendLayout(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.SuspendLayout(); this.SuspendLayout(); // // label1 @@ -85,9 +88,6 @@ // // groupBox1 // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Controls.Add(this.comboBox1); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.problemTextBox); @@ -95,9 +95,10 @@ this.groupBox1.Controls.Add(this.languageTextBox); this.groupBox1.Controls.Add(this.submitButton); this.groupBox1.Controls.Add(this.sourceTextBox); - this.groupBox1.Location = new System.Drawing.Point(6, 56); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(450, 343); + this.groupBox1.Size = new System.Drawing.Size(450, 177); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; this.groupBox1.Text = "\xD4\xEE\xF0\xEC\xE0 \xE2\xB3\xEF\xF0\xE0\xE2\xEA\xE8 \xF0\xEE\xE7\xE2\'\xFF\xE7\xEA\xF3"; @@ -154,7 +155,7 @@ // this.submitButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.submitButton.Location = new System.Drawing.Point(6, 314); + this.submitButton.Location = new System.Drawing.Point(6, 148); this.submitButton.Name = "submitButton"; this.submitButton.Size = new System.Drawing.Size(438, 23); this.submitButton.TabIndex = 9; @@ -170,15 +171,31 @@ this.sourceTextBox.Location = new System.Drawing.Point(6, 39); this.sourceTextBox.Multiline = true; this.sourceTextBox.Name = "sourceTextBox"; - this.sourceTextBox.Size = new System.Drawing.Size(438, 269); + this.sourceTextBox.Size = new System.Drawing.Size(438, 103); this.sourceTextBox.TabIndex = 8; this.sourceTextBox.Text = "begin\r\nend."; // + // splitContainer1 + // + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Location = new System.Drawing.Point(6, 56); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.groupBox1); + this.splitContainer1.Size = new System.Drawing.Size(450, 343); + this.splitContainer1.SplitterDistance = 177; + this.splitContainer1.TabIndex = 6; + // // IoiSubmitGuiControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.groupBox1); + this.Controls.Add(this.splitContainer1); this.Controls.Add(this.formComboBox); this.Controls.Add(this.label2); this.Controls.Add(this.nameTextBox); @@ -187,6 +204,8 @@ this.Size = new System.Drawing.Size(459, 402); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -206,5 +225,6 @@ private System.Windows.Forms.TextBox languageTextBox; private System.Windows.Forms.Button submitButton; private System.Windows.Forms.TextBox sourceTextBox; + private System.Windows.Forms.SplitContainer splitContainer1; } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs 2009-02-03 22:54:13 UTC (rev 484) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs 2009-02-04 11:37:21 UTC (rev 485) @@ -15,8 +15,16 @@ public IoiSubmitGuiControl() { InitializeComponent(); + initGridSe(); } + LogDataGridView.LogDataGridView view = new LogDataGridView.LogDataGridView(); + private void initGridSe() + { + view.Dock = DockStyle.Fill; + splitContainer1.Panel2.Controls.Add(view); + } + internal void SetPlugin(IoiSubmitGuiPlugin ioiSubmitGuiPlugin) { plugin = ioiSubmitGuiPlugin; @@ -37,5 +45,10 @@ string soucreCode = sourceTextBox.Text; plugin.SendSubmit(contestantName, form, soucreCode, lang, problem); } + + public void AddText(string type, string text) + { + view.AddRow(new LogDataGridView.SystemMessage(text, type)); + } } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs 2009-02-03 22:54:13 UTC (rev 484) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs 2009-02-04 11:37:21 UTC (rev 485) @@ -15,6 +15,14 @@ public override void Send(SystemMessage message) { + if (message.IsType("TestingResultIoi") == true) + { + ResultIoi result = ResultIoi.CreateFromXml(message.Message); + string text = result.Submit.submit.id.ToString() + + Environment.NewLine + + result.res; + ((IoiSubmitGuiControl)base.Control).AddText("Receive", text); + } } internal void SendSubmit(string contestantName, int form, string soucreCode, int lang, int problem) @@ -32,6 +40,12 @@ SystemMessage message = new SystemMessage(submit.ToString(), "TestingSubmitIoi"); base.DataArrived(message); + + string text = submit.submit.id.ToString() + + Environment.NewLine + + submit.name + " lang:" + submit.submit.language.ToString() + " problem:" + submit.submit.pbolemID.ToString(); + + ((IoiSubmitGuiControl)base.Control).AddText("Send", text); } } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj 2009-02-03 22:54:13 UTC (rev 484) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj 2009-02-04 11:37:21 UTC (rev 485) @@ -28,6 +28,10 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="LogDataGridView, Version=1.1.3198.29045, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\Resource\LogDataGridView.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <br...@us...> - 2009-02-03 22:50:37
|
Revision: 483 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=483&view=rev Author: brus07 Date: 2009-02-03 22:50:29 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Added HtmlBuilder for Build html page to LibraryExtention. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj Added Paths: ----------- ACMServer/trunk/ACMServer/Library/LibraryExtention/HtmlBuilder.cs Added: ACMServer/trunk/ACMServer/Library/LibraryExtention/HtmlBuilder.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/HtmlBuilder.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/HtmlBuilder.cs 2009-02-03 22:50:29 UTC (rev 483) @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace AcmContester.Library.LibraryExtention +{ + public class HtmlBuilder + { + private string title; + private string body; + private string bgcolor; + + public string Title + { + get + { + return title; + } + set + { + title = value; + } + } + + public string BackgroundColor + { + get + { + return bgcolor; + } + set + { + bgcolor = value; + } + } + + public string Result + { + get + { + string res = "<html>\n<head>\n\t<title>" + title + "</title>\n</head>"; + res = res + "<body bgcolor=\"" + bgcolor + ">\n" + body + "</body>\n</html>"; + return res; + } + } + + public void AddTable(string[,] data,string[] header,string caption) + { + body += "<table>\n"; + if (caption!="") + body+="<caption>" + caption + "</caption>\n"; + if (header.Length>0) + { + body+="<tr>"; + for (int i = 0; i < header.Length; i++) + body += "<th>" + header[i] + "</th>"; + body+="\n"; + } + for (int i=0;i<data.GetLength(0);i++) + { + body += "<tr>"; + for (int j = 0; j < data.GetLength(1); j++) + body += "<td>" + data[i,j] + "</td>"; + body += "</tr>\n"; + } + body += "</table>"; + } + + public void AddReference(string URL, string text) + { + body += "<a href=\"" + URL + "\">" + text + "</a> "; + } + + public void AddReference(string URL, string text, string align) + { + body += "<a align=\""+align+"\" href=\"" + URL + "\">" + text + "</a> "; + } + + public void AddParagraph(string data, string align, string color) + { + body += "<p align=\"" + align + "\" color=\"" + color + "\" >" + data + "</p>\n"; + } + + public void AddParagraph(string data, string align) + { + body += "<p align=\"" + align + "\" >" + data + "</p>\n"; + } + + public void AddParagraph(string data) + { + body += "<p>" + data + "</p>\n"; + } + + public void AddHorizLine() + { + body+="\n<hr>\n"; + } + + public void AddList(string[] data, bool ordered) + { + if (ordered) + body += "<ol>\n"; + else + body += "<ul>\n"; + for (int i = 0; i < data.Length; i++) + body += "<li>" + data[i] + "\n"; + if (ordered) + body += "</ol>\n"; + else + body += "</ul>\n"; + } + + public void AddText(string data) + { + body += data; + } + + public void AddCode(string data) + { + body += "<code>" + data + "</code>\n"; + } + + public void AddHeader(string data, int size, string align) //size from 1 to 6 + { + body += "<h" + size.ToString() + " align=\"" + align + "\">" + data + "</h" + size.ToString() + ">\n"; + } + } +} Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj 2009-02-03 11:33:16 UTC (rev 482) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/LibraryExtention.csproj 2009-02-03 22:50:29 UTC (rev 483) @@ -34,6 +34,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Configuration.cs" /> + <Compile Include="HtmlBuilder.cs" /> <Compile Include="IniFile.cs" /> <Compile Include="Log.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> @@ -51,4 +52,4 @@ <Target Name="AfterBuild"> </Target> --> -</Project> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-03 12:22:23
|
Revision: 482 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=482&view=rev Author: brus07 Date: 2009-02-03 11:33:16 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Now SocketServer and -Client can work in opposite direction. Submits come from Client and go to Server, Result from Server to Client. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPool.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPoolArrived.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -36,6 +36,11 @@ } public override bool Send(SystemMessage message) { + if (message.Description.IndexOf("not check busy") != -1) + { + DataSender(message, 0); + return true; + } List<int> freeTesters = GetFreeTesters(); if (freeTesters.Count != 0) { Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -20,12 +20,14 @@ DataMediator dataContainer = new DataMediator(); WorkingPool pool = new WorkingPool(); + WorkingPoolArrived poolArrived = new WorkingPoolArrived(); private SocketServerGate() { base.Start(); base.onDataArrived += DataArrived; pool.onSendData += base.Send; + poolArrived.onSendData += DataArrived; } public static SocketServerGate GetInstance() { @@ -82,19 +84,80 @@ return true; } + if (message.IsType("TestingResult")) + { + Result result = Result.CreateFromXml(message.Message); + + string mes = "result " + result.Submit.id; + mes += " " + result.res; + OnLogMessage("Receive", mes); + + message.Description = "not check busy"; + base.Send(message); + dataContainer.Return(result); + } + if (message.IsType("TestingResultIoi")) + { + ResultIoi result = ResultIoi.CreateFromXml(message.Message); + + string mes = "result " + result.Submit.submit.id; + mes += " " + result.res; + OnLogMessage("Receive", mes); + + message.Description = "not check busy"; + base.Send(message); + dataContainer.Return(result.ToResult()); + } + if (message.IsType("CheckStateResult")) + { + poolArrived.Send(message); + } + return false; } protected override void DataArriver(SystemMessage message) { - Result result = Result.CreateFromXml(message.Message); + if (message.IsType("TestingResult")) + { + Result result = Result.CreateFromXml(message.Message); - string mes = "result " + result.Submit.id; - mes += " " + result.res; - OnLogMessage("Receive", mes); + string mes = "result " + result.Submit.id; + mes += " " + result.res; + OnLogMessage("Receive", mes); - base.DataArriver(message); - dataContainer.Return(result); + base.DataArriver(message); + dataContainer.Return(result); + } + + if (message.IsType("TestingSubmit")) + { + Submit submit = Submit.CreateFromXml(message.Message); + + if (dataContainer.Add(submit)) + { + OnLogMessage("SystemSend", submit.id + " to Pool"); + poolArrived.Send(message); + } + else + { + OnLogMessage("SystemReceive", submit.id + "is in queue"); + } + } + if (message.IsType("TestingSubmitIoi")) + { + SubmitIoi submit = SubmitIoi.CreateFromXml(message.Message); + + if (dataContainer.Add(submit.submit)) + { + OnLogMessage("SystemSend", submit.submit.id + " to Pool"); + poolArrived.Send(message); + } + else + { + OnLogMessage("SystemReceive", submit.submit.id + "is in queue"); + } + } } private void DataArrived(SystemMessage message) { Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj 2009-02-03 11:33:16 UTC (rev 482) @@ -39,6 +39,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="WorkingPoolArrived.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SocketServerGate.cs" /> <Compile Include="SocketServerGatePlugin.cs" /> Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPool.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPool.cs 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPool.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -13,8 +13,16 @@ private bool OnSendData(SystemMessage sysMes) { - if (onSendData != null) - return onSendData(sysMes); + if (sysMes.IsType("TestingSubmit") == true) + { + if (onSendData != null) + return onSendData(sysMes); + } + if (sysMes.IsType("TestingSubmitIoi") == true) + { + if (onSendData != null) + return onSendData(sysMes); + } //TODO: ne znaju sho same maje povertatysja u takomu vypadku return false; } Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPoolArrived.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPoolArrived.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/WorkingPoolArrived.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -0,0 +1,158 @@ +using System; +using AcmContester.Library.LibraryExtention; +using System.Collections.Generic; +using System.Threading; +using AcmContester.Library.LibraryExtention.Data; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin +{ + class WorkingPoolArrived + { + internal delegate void SendDataDelegate(SystemMessage s); + internal event SendDataDelegate onSendData; + + private bool OnSendData(SystemMessage sysMes) + { + if (sysMes.IsType("TestingSubmit")) + { + if (onSendData != null) + onSendData(sysMes); + } + if (sysMes.IsType("TestingSubmitIoi")) + { + if (onSendData != null) + onSendData(sysMes); + } + if (sysMes.IsType("CheckState")) + { + if (onSendData != null) + onSendData(sysMes); + } + return true; + } + + private bool OnSendData2(SystemMessage sysMes) + { + if (IsFreeTester()) + return OnSendData(sysMes); + return false; + } + + private Dictionary<int, SystemMessage> poolWork = new Dictionary<int, SystemMessage>(); + private bool poolWorking = false; + + private void runPool() + { + if (poolWorking == true) + return; + poolWorking = true; + while (true) + { + Thread.Sleep(2000); + lock (poolWork) + { + if (poolWork.Count == 0) + break; + foreach (int key in poolWork.Keys) + { + SystemMessage sysMes = poolWork[key]; + //TODO: potribno zrobyty, shob pry posylci "poolWork" ne buv zalokanyj + if (OnSendData2(sysMes) == true) + { + poolWork.Remove(key); + break; + } + } + } + } + poolWorking = false; + } + private static void StartPool(Object ob) + { + WorkingPoolArrived ssg = (WorkingPoolArrived)ob; + ssg.runPool(); + } + private void startPool() + { + if (poolWorking == false) + { + ThreadPool.QueueUserWorkItem(StartPool, this); + } + } + + internal void Send(SystemMessage sysMes) + { + if (sysMes.IsType("CheckStateResult")) + { + if (SystemMessageX(sysMes)) + return; + } + + lock (poolWork) + { + if (sysMes.IsType("TestingSubmit")) + { + //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE1\xF3\xE4\xE5 \xF6\xE5 \xE7\xE2\xB3\xE4\xF1\xE8 \xE7\xE0\xE1\xF0\xE0\xF2\xE8 + Submit submit = Submit.CreateFromXml(sysMes.Message); + if (poolWork.ContainsKey(submit.id) == false) + poolWork.Add(submit.id, sysMes); + } + if (sysMes.IsType("TestingSubmitIoi")) + { + //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE1\xF3\xE4\xE5 \xF6\xE5 \xE7\xE2\xB3\xE4\xF1\xE8 \xE7\xE0\xE1\xF0\xE0\xF2\xE8 + SubmitIoi submit = SubmitIoi.CreateFromXml(sysMes.Message); + if (poolWork.ContainsKey(submit.submit.id) == false) + poolWork.Add(submit.submit.id, sysMes); + } + } + startPool(); + } + + + readonly Queue<string> q = new Queue<string>(); + + private bool IsFreeTester() + { + q.Clear(); + SystemMessage mesa = new SystemMessage("isbusy", "CheckState"); + OnSendData(mesa); + + DateTime start = DateTime.Now; + while (true) + { + if ((DateTime.Now - start).TotalSeconds > 1.0) + { + break; + } + lock (q) + { + while (q.Count != 0) + { + string curStr = q.Dequeue(); + if (curStr == "free") + { + return true; + } + else + { + return false; + } + } + } + System.Threading.Thread.Sleep(50); + } + return false; + } + + private bool SystemMessageX(SystemMessage message) + { + if (message.Message == "busy" || message.Message == "free") + { + lock (q) + q.Enqueue(message.Message); + return true; + } + return false; + } + } +} Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -57,6 +57,19 @@ { OnDataArrived(message); } + + if (message.IsType("TestingResult")) + { + Result res = Result.CreateFromXml(message.Message); + OnAddLogText("Receive", "ID " + res.Submit.id + " result - " + res.res); + OnDataArrived(message); + } + if (message.IsType("TestingResultIoi")) + { + ResultIoi res = ResultIoi.CreateFromXml(message.Message); + OnAddLogText("Receive", "ID " + res.Submit.submit.id + " result - " + res.res); + OnDataArrived(message); + } } public override bool Send(SystemMessage message) @@ -76,6 +89,15 @@ OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res); } + if (message.IsType("TestingSubmit")) + { + OnAddLogText("Send", message.Message); + } + if (message.IsType("TestingSubmitIoi")) + { + OnAddLogText("Send", message.Message); + } + if (client == null) return true; Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 21:53:07 UTC (rev 481) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-03 11:33:16 UTC (rev 482) @@ -17,13 +17,13 @@ private bool runner_onDataArrived(SystemMessage message) { - if (message.IsType("TestingResult") == true) + if (message.IsType("TestingResult")) { SendResultToControl(message.Message, "Send"); base.DataArrived(message); return true; } - if (message.IsType("TestingResultIoi") == true) + if (message.IsType("TestingResultIoi")) { ResultIoi res = ResultIoi.CreateFromXml(message.Message); Result result = res.ToResult(); @@ -31,6 +31,11 @@ base.DataArrived(message); return true; } + if (message.IsType("CheckStateResult")) + { + base.DataArrived(message); + return true; + } throw new Exception(); } private void SendResultType(string text) @@ -88,7 +93,7 @@ mes = new SystemMessage("free", "CheckStateResult"); } SendMessageToControl(mes.Message, "SystemSend"); - Send(mes); + runner_onDataArrived(mes); return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 22:23:50
|
Revision: 481 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=481&view=rev Author: brus07 Date: 2009-02-02 21:53:07 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Added TextBox for set Port for SocketServer. SocketServer and SocketClient can configure different Port number. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketClientTask.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -13,6 +13,12 @@ client.onDataArrived +=SocketClientGate_onDataArrived; } + public SocketClientTask(string IP, int port) + { + client = new SocketClient(IP, port); + client.onDataArrived += SocketClientGate_onDataArrived; + } + void SocketClientGate_onDataArrived(SystemMessage message) { if (message.IsType("SystemTestBusyMessage")) Modified: ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Library/Connector/SocketServerTask.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -6,7 +6,7 @@ { public class SocketServerTask: AbstractConnector { - readonly SocketServer server; + SocketServer server; //val: //free - vilnyj @@ -177,5 +177,12 @@ } return false; } + + public void Start(int p) + { + server = new SocketServer(p); + server.onDataArrived += DataArrived; + this.Start(); + } } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.Designer.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.Designer.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -37,6 +37,8 @@ this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.portTextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); this.socketGateStatusStrip.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -92,10 +94,10 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Location = new System.Drawing.Point(3, 26); + this.tabControl1.Location = new System.Drawing.Point(3, 58); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(211, 130); + this.tabControl1.Size = new System.Drawing.Size(211, 98); this.tabControl1.TabIndex = 5; // // tabPage1 @@ -103,7 +105,7 @@ this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(203, 104); + this.tabPage1.Size = new System.Drawing.Size(203, 72); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "tabPage1"; this.tabPage1.UseVisualStyleBackColor = true; @@ -119,10 +121,32 @@ this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // + // portTextBox + // + this.portTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.portTextBox.Location = new System.Drawing.Point(114, 3); + this.portTextBox.Name = "portTextBox"; + this.portTextBox.Size = new System.Drawing.Size(100, 20); + this.portTextBox.TabIndex = 6; + this.portTextBox.Text = "4120"; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(114, 29); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(100, 23); + this.button1.TabIndex = 7; + this.button1.Text = "Recreate"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // // SocketServerGatePluginUserControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button1); + this.Controls.Add(this.portTextBox); this.Controls.Add(this.tabControl1); this.Controls.Add(this.autoScrollCheckBox); this.Controls.Add(this.socketGateStatusStrip); @@ -149,5 +173,7 @@ private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TextBox portTextBox; + private System.Windows.Forms.Button button1; } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePluginUserControl.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -76,5 +76,12 @@ { clientCountTimer.Enabled = true; } + + private void button1_Click(object sender, EventArgs e) + { + SocketServerGate gate = SocketServerGate.GetInstance(); + gate.Stop(); + gate.Start(Int32.Parse(portTextBox.Text)); + } } } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -28,6 +28,14 @@ client.isBusy += IsBusy; } + public void CreateClient(string ip, int port) + { + client = new SocketClientTask(ip, port); + client.onDataArrived += new SocketClient.DataArrivedDelegate(SocketClientGate_onDataArrived); + client.onAddLogText += OnAddLogText; + client.isBusy += IsBusy; + } + System.Threading.Mutex mutex = new System.Threading.Mutex(); bool busyState = false; bool IsBusy() Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -30,6 +30,7 @@ { this.components = new System.ComponentModel.Container(); this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); @@ -38,7 +39,9 @@ this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.tabPage2 = new System.Windows.Forms.TabPage(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.portTextBox = new System.Windows.Forms.TextBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.statusStrip1.SuspendLayout(); @@ -57,6 +60,16 @@ this.tabControl1.Size = new System.Drawing.Size(238, 161); this.tabControl1.TabIndex = 0; // + // tabPage2 + // + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(230, 135); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "tabPage2"; + this.tabPage2.UseVisualStyleBackColor = true; + // // tabPage1 // this.tabPage1.Controls.Add(this.textBox1); @@ -125,20 +138,39 @@ this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // - // tabPage2 + // label1 // - this.tabPage2.Location = new System.Drawing.Point(4, 22); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(230, 135); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "tabPage2"; - this.tabPage2.UseVisualStyleBackColor = true; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(115, 6); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(20, 13); + this.label1.TabIndex = 5; + this.label1.Text = "IP:"; // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(106, 32); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(29, 13); + this.label2.TabIndex = 7; + this.label2.Text = "Port:"; + // + // portTextBox + // + this.portTextBox.Location = new System.Drawing.Point(141, 29); + this.portTextBox.Name = "portTextBox"; + this.portTextBox.Size = new System.Drawing.Size(100, 20); + this.portTextBox.TabIndex = 6; + this.portTextBox.Text = "4120"; + // // SocketClientGatePluginUserControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label2); + this.Controls.Add(this.portTextBox); + this.Controls.Add(this.label1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.button2); this.Controls.Add(this.button1); @@ -168,5 +200,8 @@ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; private System.Windows.Forms.Timer timer1; private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox portTextBox; } } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs 2009-02-02 16:55:04 UTC (rev 480) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs 2009-02-02 21:53:07 UTC (rev 481) @@ -58,7 +58,7 @@ private void button1_Click(object sender, EventArgs e) { SocketClientGate gate = SocketClientGate.GetInstance(); - gate.CreateClient(textBox2.Text); + gate.CreateClient(textBox2.Text, Int32.Parse(portTextBox.Text)); gate.Connect(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 16:55:07
|
Revision: 480 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=480&view=rev Author: brus07 Date: 2009-02-02 16:55:04 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Bug fix. Update XMLSchema, when CE in IOI type, then XML have not testResults child. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/testData/data.xsd Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsd =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-02 16:06:28 UTC (rev 479) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-02 16:55:04 UTC (rev 480) @@ -47,7 +47,7 @@ <xs:element name="result" type="xs:int" /> <xs:element name="usedTime" type="xs:double" /> <xs:element name="usedMemory" type="xs:double" /> - <xs:element name="testResults" type="testResultList" /> + <xs:element name="testResults" type="testResultList" minOccurs="0" /> <xs:element name="submitioi" type="submitIOIType" /> </xs:sequence> </xs:complexType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 16:06:35
|
Revision: 479 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=479&view=rev Author: brus07 Date: 2009-02-02 16:06:28 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Added sample action to IoiInformerControl. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs 2009-02-02 16:04:20 UTC (rev 478) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs 2009-02-02 16:06:28 UTC (rev 479) @@ -28,18 +28,31 @@ /// </summary> private void InitializeComponent() { + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.SuspendLayout(); // + // numericUpDown1 + // + this.numericUpDown1.Location = new System.Drawing.Point(3, 3); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(120, 20); + this.numericUpDown1.TabIndex = 0; + // // IoiInformerControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.numericUpDown1); this.Name = "IoiInformerControl"; this.Size = new System.Drawing.Size(396, 383); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.ResumeLayout(false); } #endregion + + private System.Windows.Forms.NumericUpDown numericUpDown1; } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs 2009-02-02 16:04:20 UTC (rev 478) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs 2009-02-02 16:06:28 UTC (rev 479) @@ -14,5 +14,19 @@ { InitializeComponent(); } + + delegate void UpCountCallback(); + public void UpCount() + { + if (this.InvokeRequired) + { + UpCountCallback d = new UpCountCallback(UpCount); + this.Invoke(d); + } + else + { + numericUpDown1.UpButton(); + } + } } } Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs 2009-02-02 16:04:20 UTC (rev 478) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs 2009-02-02 16:06:28 UTC (rev 479) @@ -17,6 +17,8 @@ if (message.IsType("TestingResultIoi") == true) { 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 } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 16:04:25
|
Revision: 478 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=478&view=rev Author: brus07 Date: 2009-02-02 16:04:20 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Now Tester plugins and Runner can work with ResultIoi type message. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs ACMServer/trunk/ACMServer/Runner/Class1.cs ACMServer/trunk/ACMServer/Runner/Runner.csproj ACMServer/trunk/ACMServer/Runner/Test.dll Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 15:59:55 UTC (rev 477) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 16:04:20 UTC (rev 478) @@ -23,6 +23,14 @@ base.DataArrived(message); return true; } + if (message.IsType("TestingResultIoi") == true) + { + ResultIoi res = ResultIoi.CreateFromXml(message.Message); + Result result = res.ToResult(); + SendResultToControl(result.ToStringX(), "Send"); + base.DataArrived(message); + return true; + } throw new Exception(); } private void SendResultType(string text) Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs 2009-02-02 15:59:55 UTC (rev 477) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs 2009-02-02 16:04:20 UTC (rev 478) @@ -105,8 +105,10 @@ lock (this) { if (message.IndexOf("submitioi") != -1) - this.Send(new SystemMessage(result, "TestingResult")); + { //this.Send(new SystemMessage(result, "TestingResultIoi")); + this.Send(new SystemMessage(result, "TestingResultIoi")); + } else this.Send(new SystemMessage(result, "TestingResult")); } Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-02-02 15:59:55 UTC (rev 477) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-02-02 16:04:20 UTC (rev 478) @@ -5,6 +5,7 @@ using AcmContester.Library.LibraryExtention.Data; using Main; using Test; +using Load; namespace Checker { @@ -140,8 +141,104 @@ public static string GetResultIoi(string message) { + Log log = Log.GetLog(); + log.Loging(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(), Log.Priority.INFO); + log.Loging(message, Log.Priority.INFO); + log.Loging("", Log.Priority.INFO); + + IniFile iniFile = new IniFile("RealTesterConfig.ini"); + string secureLever = iniFile.GetString("MainConfig", "SecureLevel", "Double"); + SubmitIoi submit = SubmitIoi.CreateFromXml(message); - return GetResult(submit.submit.ToString()); + + //TODO: + string code = submit.submit.sourceCode; + code = HtmlEntityDecode(code); + int language = submit.submit.language; + ResultIoi result = new ResultIoi(submit); + try + { + //Console.SetOut(File.CreateText("logout.txt")); + string[] data = File.ReadAllLines("InData.txt"); + data[2] = data[2] + submit.submit.pbolemID + "\\"; + string src = code; + TestEnv test = new TestEnv(src, language, data[1], data[2]); + test.Compile(); + + log.Loging("------------------BEGIN SOURCE--------------------------", Log.Priority.INFO); + Console.WriteLine("------------------BEGIN SOURCE--------------------------"); + + log.Loging(src, Log.Priority.INFO); + Console.WriteLine(src); + + log.Loging("-------------------END SOURCE---------------------------", Log.Priority.INFO); + Console.WriteLine("-------------------END SOURCE---------------------------"); + + log.Loging(String.Format("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result, test.comp.Details, test.comp.UsedTime), Log.Priority.INFO); + Console.WriteLine("Compile result: {0}, details: {1}, usedtime:{2}", test.comp.Result, test.comp.Details, test.comp.UsedTime); + + log.Loging(String.Format("Comp Output: {0}", test.comp.CompilerOutput), Log.Priority.INFO); + Console.WriteLine("Comp Output: {0}", test.comp.CompilerOutput); + + if (test.comp.Result == CompRes.OK) + { + SecureType secureType = SecureType.Double; + try + { + secureType = (SecureType)Enum.Parse(typeof(SecureType), secureLever, true); + } + catch (ArgumentException) + { + } + if (secureLever == "None") + secureType = SecureType.None; + test.RunAllTests(secureType); + + for (int i = 0; i < test.run.results.Length; i++) + { + log.Loging(String.Format("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, + test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory), Log.Priority.INFO); + Console.WriteLine("Test #{0} result: {1}, details: {2}, usedtime:{3}, usedRealTime: {4}, usedmemory: {5}", i + 1, + test.run.results[i].res, test.run.results[i].Details, test.run.results[i].UsedTime, test.run.results[i].UsedRealTime, test.run.results[i].UsedMemory); + } + } + + + //TODO: + result.res = test.comp.Result.ToString(); + if (test.comp.Result == CompRes.OK) + { + int usedTime = -1; + int usedMemory = -1; + result.testResults = new TestResIoi[test.run.results.Length]; + for (int i = 0; i < test.run.results.Length; i++) + { + result.testResults[i] = new TestResIoi(); + + usedTime = Math.Max(usedTime, test.run.results[i].UsedTime); + usedMemory = Math.Max(usedMemory, test.run.results[i].UsedMemory); + result.res = test.run.results[i].res.ToString(); + + result.testResults[i].input = test.run.test.tests[i].input; + result.testResults[i].output = test.run.test.tests[i].output; + result.testResults[i].points = test.run.test.tests[i].points; + result.testResults[i].contestantOutput = test.run.results[i].UserOutput; + result.testResults[i].usedMemory = test.run.results[i].UsedMemory; + result.testResults[i].usedTime = test.run.results[i].UsedTime; + result.testResults[i].id = i; + result.testResults[i].res = test.run.results[i].res.ToString(); + } + result.usedMemory = usedTime; + result.usedTime = usedMemory; + } + } + catch (Exception tex) + { + log.Loging("Runner:GetResult - Exception (" + tex + ": " + tex.Message, Log.Priority.INFO); + log.Loging(tex.StackTrace, Log.Priority.INFO); + result.res = "Exception"; + } + return result.ToStringX(); } } } Modified: ACMServer/trunk/ACMServer/Runner/Runner.csproj =================================================================== --- ACMServer/trunk/ACMServer/Runner/Runner.csproj 2009-02-02 15:59:55 UTC (rev 477) +++ ACMServer/trunk/ACMServer/Runner/Runner.csproj 2009-02-02 16:04:20 UTC (rev 478) @@ -28,11 +28,12 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="Load, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="Main, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="Test, Version=1.0.3267.427, Culture=neutral, processorArchitecture=x86" /> + <Reference Include="Test, Version=1.0.3320.28735, Culture=neutral, processorArchitecture=x86" /> </ItemGroup> <ItemGroup> <Compile Include="Class1.cs" /> Modified: ACMServer/trunk/ACMServer/Runner/Test.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 16:00:01
|
Revision: 477 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=477&view=rev Author: brus07 Date: 2009-02-02 15:59:55 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Update ResultIoi. Now is good version. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/Data.csproj ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs ACMServer/trunk/ACMServer/Library/testData/data.xsd Added Paths: ----------- ACMServer/trunk/ACMServer/Library/Data/TestResIoi.cs Modified: ACMServer/trunk/ACMServer/Library/Data/Data.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Data.csproj 2009-02-02 12:55:50 UTC (rev 476) +++ ACMServer/trunk/ACMServer/Library/Data/Data.csproj 2009-02-02 15:59:55 UTC (rev 477) @@ -40,6 +40,7 @@ <Compile Include="Result.cs" /> <Compile Include="Submit.cs" /> <Compile Include="SubmitList.cs" /> + <Compile Include="TestResIoi.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\LibraryExtention\LibraryExtention.csproj"> Modified: ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs 2009-02-02 12:55:50 UTC (rev 476) +++ ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs 2009-02-02 15:59:55 UTC (rev 477) @@ -3,10 +3,10 @@ namespace AcmContester.Library.LibraryExtention.Data { - [XmlRoot("resultIoi")] + [XmlRoot("resultioi")] public class ResultIoi { - [XmlElement("submitIoi", typeof(Submit))] + [XmlElement("submitioi", typeof(SubmitIoi))] public SubmitIoi Submit { get @@ -27,9 +27,15 @@ public double usedTime; [XmlElement("usedMemory", typeof(int))] public int usedMemory; + [XmlElement("testResults", typeof(TestResIoi[]))] + public TestResIoi[] testResults; readonly string temp; + public ResultIoi() + { + } + public ResultIoi(SubmitIoi ssubmit) { submit = ssubmit; @@ -45,7 +51,7 @@ public static ResultIoi CreateFromXml(string message) { - return XmlHelper.GetObject<ResultIoi>(message, "resultIoi", "data.xsd"); + return XmlHelper.GetObject<ResultIoi>(message, "resultioi", "data.xsd"); } public override string ToString() @@ -56,5 +62,16 @@ { return XmlSerializer<ResultIoi>.Serialization(this); } + + public Result ToResult() + { + Result result = new Result(); + result.res = res; + result.result = this.result; + result.usedMemory = usedMemory; + result.usedTime = usedTime; + result.Submit = this.Submit.submit; + return result; + } } } Added: ACMServer/trunk/ACMServer/Library/Data/TestResIoi.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/TestResIoi.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/Data/TestResIoi.cs 2009-02-02 15:59:55 UTC (rev 477) @@ -0,0 +1,34 @@ +using System.Xml.Serialization; +using AcmContester.AcmLibraryExtention.XML; + +namespace AcmContester.Library.LibraryExtention.Data +{ + [XmlRoot("testResultIoi")] + public class TestResIoi + { + [XmlElement("id", typeof(int))] + public int id; + [XmlElement("res", typeof(string))] + public string res; + [XmlElement("usedTime", typeof(double))] + public double usedTime; + [XmlElement("usedMemory", typeof(int))] + public int usedMemory; + [XmlElement("input", typeof(string))] + public string input; + [XmlElement("output", typeof(string))] + public string output; + [XmlElement("contestantOutput", typeof(string))] + public string contestantOutput; + [XmlElement("point", typeof(int))] + public int points; + + public TestResIoi() + { + res = ""; + input = ""; + output = ""; + contestantOutput = ""; + } + } +} \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsd =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-02 12:55:50 UTC (rev 476) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-02 15:59:55 UTC (rev 477) @@ -41,10 +41,42 @@ <xs:element name="submit" type="submitType" /> </xs:sequence> </xs:complexType> + <xs:complexType name="resultIOIType"> + <xs:sequence> + <xs:element name="res" type="xs:string" /> + <xs:element name="result" type="xs:int" /> + <xs:element name="usedTime" type="xs:double" /> + <xs:element name="usedMemory" type="xs:double" /> + <xs:element name="testResults" type="testResultList" /> + <xs:element name="submitioi" type="submitIOIType" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="testResultList"> + <xs:sequence> + <xs:sequence> + <xs:element name="TestResIoi" type="testResultIoiType" maxOccurs="unbounded" minOccurs="0" /> + </xs:sequence> + </xs:sequence> + </xs:complexType> + <xs:complexType name="testResultIoiType"> + <xs:sequence> + <!-- обмеження для ID: не має бути відємним --> + <xs:element name="id" type="xs:int" /> + <xs:element name="res" type="xs:string" /> + <xs:element name="usedTime" type="xs:double" /> + <xs:element name="usedMemory" type="xs:double" /> + <xs:element name="input" type="xs:string" /> + <xs:element name="output" type="xs:string" /> + <xs:element name="contestantOutput" type="xs:string" /> + <xs:element name="point" type="xs:int" /> + </xs:sequence> + </xs:complexType> <xs:element name="result" type="resultType"> </xs:element> <xs:element name="submit" type="submitType"> </xs:element> <xs:element name="submitioi" type="submitIOIType"> </xs:element> + <xs:element name="resultioi" type="resultIOIType"> + </xs:element> </xs:schema> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2009-02-02 12:55:54
|
Revision: 476 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=476&view=rev Author: Oracle_ Date: 2009-02-02 12:55:50 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Added UserOutput to results. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2009-02-02 01:54:43 UTC (rev 475) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2009-02-02 12:55:50 UTC (rev 476) @@ -278,9 +278,9 @@ result->Details=gcnew String(sec->Details.c_str())+" No output file"; return false; } + result->UserOutput=ReadAllFile(oupath); + Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,result->UserOutput,test->tests[index-1]->output); - Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,ReadAllFile(oupath),test->tests[index-1]->output); - switch (check->Check()) { case CheckResult::OE: Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2009-02-02 01:54:43 UTC (rev 475) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2009-02-02 12:55:50 UTC (rev 476) @@ -36,6 +36,7 @@ public ref struct TestRes { String^ Details; + String^ UserOutput; TestResult res; int UsedTime; int UsedMemory; @@ -45,6 +46,7 @@ TestRes() { Details=""; + UserOutput=""; UsedTime=-1; UsedMemory=-1; UsedRealTime=-1; @@ -54,6 +56,7 @@ TestRes^ operator=(TestRes^ value) { this->Details=value->Details; + this->UserOutput=value->UserOutput; this->Points=value->Points; this->res=value->res; this->UsedMemory=value->UsedMemory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 01:54:52
|
Revision: 474 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=474&view=rev Author: brus07 Date: 2009-02-02 01:50:51 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Bug fixed Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/Result.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs Modified: ACMServer/trunk/ACMServer/Library/Data/Result.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Result.cs 2009-02-02 01:10:49 UTC (rev 473) +++ ACMServer/trunk/ACMServer/Library/Data/Result.cs 2009-02-02 01:50:51 UTC (rev 474) @@ -30,6 +30,10 @@ readonly string temp; + public Result() + { + } + public Result(Submit ssubmit) { submit = ssubmit; Modified: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs 2009-02-02 01:10:49 UTC (rev 473) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs 2009-02-02 01:50:51 UTC (rev 474) @@ -24,6 +24,8 @@ submit.form = form; submit.submit = new Submit(); submit.submit.id = Guid.NewGuid().GetHashCode(); + if (submit.submit.id < 0) + submit.submit.id = -submit.submit.id + 1; submit.submit.language = lang; submit.submit.pbolemID = problem; submit.submit.sourceCode = soucreCode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 01:54:45
|
Revision: 475 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=475&view=rev Author: brus07 Date: 2009-02-02 01:54:43 +0000 (Mon, 02 Feb 2009) Log Message: ----------- TesterRunner understand about TestingSubmitIoi type of SystemMessage. Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs ACMServer/trunk/ACMServer/Runner/Class1.cs Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 01:50:51 UTC (rev 474) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 01:54:43 UTC (rev 475) @@ -91,6 +91,12 @@ runner.AddWork(message.Message); } + if (message.IsType("TestingSubmitIoi") == true) + { + SendSubmitToControl(message.Message, "Receive"); + runner.AddWork(message.Message); + } + if (message.IsType("TestingSubmitList") == true) { SendMessageToControl("TestingSubmitList", "Receive"); Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs 2009-02-02 01:50:51 UTC (rev 474) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/WorkRunner.cs 2009-02-02 01:54:43 UTC (rev 475) @@ -2,6 +2,7 @@ using System.Threading; using AcmContester.Library.LibraryExtention; using System.IO; +using AcmContester.Library.LibraryExtention.Data; namespace AcmContester.Plugins.TesterPlugins.TestRunnerPlugin { @@ -86,7 +87,11 @@ string result; try { - result = Checker.Checker.GetResult(message); + //HACK: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xF2\xF3\xF2 \xEF\xE5\xF0\xE5\xE4\xE0\xE2\xE0\xF2\xE8 SystemMessage + if (message.IndexOf("submitioi") != -1) + result = Checker.Checker.GetResultIoi(message); + else + result = Checker.Checker.GetResult(message); } catch (Exception ex) { @@ -99,7 +104,11 @@ //TODO: ne znaju chy tut potriben lock lock (this) { - this.Send(new SystemMessage(result, "TestingResult")); + if (message.IndexOf("submitioi") != -1) + this.Send(new SystemMessage(result, "TestingResult")); + //this.Send(new SystemMessage(result, "TestingResultIoi")); + else + this.Send(new SystemMessage(result, "TestingResult")); } } Modified: ACMServer/trunk/ACMServer/Runner/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-02-02 01:50:51 UTC (rev 474) +++ ACMServer/trunk/ACMServer/Runner/Class1.cs 2009-02-02 01:54:43 UTC (rev 475) @@ -137,5 +137,11 @@ { htmlEntityList.Add(new KeyValuePair<string, string>(p, p_2)); } + + public static string GetResultIoi(string message) + { + SubmitIoi submit = SubmitIoi.CreateFromXml(message); + return GetResult(submit.submit.ToString()); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 01:10:52
|
Revision: 473 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=473&view=rev Author: brus07 Date: 2009-02-02 01:10:49 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Added new plugin IoiSubmitGuiPlugin. Plugin for submit from application, without web. Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.resx ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties/AssemblyInfo.cs Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-02 01:07:17 UTC (rev 472) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-02 01:10:49 UTC (rev 473) @@ -43,6 +43,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoiInformerPlugin", "Plugins\IoiPlugin\IoiInformerPlugin\IoiInformerPlugin.csproj", "{F36370C3-E1EB-47E8-AFAC-F4840953D60B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoiSubmitGuiPlugin", "Plugins\IoiPlugin\IoiSubmitGuiPlugin\IoiSubmitGuiPlugin.csproj", "{96664041-18B2-42BD-941F-117B54E2AE64}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -109,6 +111,10 @@ {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Release|Any CPU.Build.0 = Release|Any CPU + {96664041-18B2-42BD-941F-117B54E2AE64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96664041-18B2-42BD-941F-117B54E2AE64}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96664041-18B2-42BD-941F-117B54E2AE64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96664041-18B2-42BD-941F-117B54E2AE64}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -131,5 +137,6 @@ {E255910C-499D-48E2-9846-7EB24DE32C4A} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {45B4D72E-CD81-42A7-AD46-3471380A290F} = {4E42F296-7321-4193-9E35-9B7202005229} {F36370C3-E1EB-47E8-AFAC-F4840953D60B} = {4BEB97A7-7AAB-42A3-B30A-B6CCF75AAD64} + {96664041-18B2-42BD-941F-117B54E2AE64} = {4BEB97A7-7AAB-42A3-B30A-B6CCF75AAD64} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin ___________________________________________________________________ Added: svn:ignore + obj bin Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.Designer.cs 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,210 @@ +namespace AcmContester.Plugins.IoiPlugins.IoiSubmitGuiPlugin +{ + partial class IoiSubmitGuiControl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.formComboBox = new System.Windows.Forms.ComboBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.problemTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.languageTextBox = new System.Windows.Forms.TextBox(); + this.submitButton = new System.Windows.Forms.Button(); + this.sourceTextBox = new System.Windows.Forms.TextBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 6); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(38, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Name:"; + // + // nameTextBox + // + this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.nameTextBox.Location = new System.Drawing.Point(47, 3); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(409, 20); + this.nameTextBox.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 32); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(33, 13); + this.label2.TabIndex = 2; + this.label2.Text = "Form:"; + // + // formComboBox + // + this.formComboBox.FormattingEnabled = true; + this.formComboBox.Items.AddRange(new object[] { + "9", + "10", + "11"}); + this.formComboBox.Location = new System.Drawing.Point(47, 29); + this.formComboBox.Name = "formComboBox"; + this.formComboBox.Size = new System.Drawing.Size(121, 21); + this.formComboBox.TabIndex = 4; + this.formComboBox.Text = "9"; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.comboBox1); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.problemTextBox); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.languageTextBox); + this.groupBox1.Controls.Add(this.submitButton); + this.groupBox1.Controls.Add(this.sourceTextBox); + this.groupBox1.Location = new System.Drawing.Point(6, 56); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(450, 343); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "\xD4\xEE\xF0\xEC\xE0 \xE2\xB3\xEF\xF0\xE0\xE2\xEA\xE8 \xF0\xEE\xE7\xE2\'\xFF\xE7\xEA\xF3"; + // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "1 (Pascal)", + "2 (C++)"}); + this.comboBox1.Location = new System.Drawing.Point(100, 13); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(67, 21); + this.comboBox1.TabIndex = 14; + this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(173, 16); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(45, 13); + this.label3.TabIndex = 13; + this.label3.Text = "Problem"; + // + // problemTextBox + // + this.problemTextBox.Location = new System.Drawing.Point(224, 13); + this.problemTextBox.Name = "problemTextBox"; + this.problemTextBox.Size = new System.Drawing.Size(100, 20); + this.problemTextBox.TabIndex = 12; + this.problemTextBox.Text = "1"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(6, 16); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(55, 13); + this.label4.TabIndex = 11; + this.label4.Text = "Language"; + // + // languageTextBox + // + this.languageTextBox.Enabled = false; + this.languageTextBox.Location = new System.Drawing.Point(67, 13); + this.languageTextBox.Name = "languageTextBox"; + this.languageTextBox.Size = new System.Drawing.Size(27, 20); + this.languageTextBox.TabIndex = 10; + this.languageTextBox.Text = "1"; + // + // submitButton + // + this.submitButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.submitButton.Location = new System.Drawing.Point(6, 314); + this.submitButton.Name = "submitButton"; + this.submitButton.Size = new System.Drawing.Size(438, 23); + this.submitButton.TabIndex = 9; + this.submitButton.Text = "Submit"; + this.submitButton.UseVisualStyleBackColor = true; + this.submitButton.Click += new System.EventHandler(this.submitButton_Click); + // + // sourceTextBox + // + this.sourceTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.sourceTextBox.Location = new System.Drawing.Point(6, 39); + this.sourceTextBox.Multiline = true; + this.sourceTextBox.Name = "sourceTextBox"; + this.sourceTextBox.Size = new System.Drawing.Size(438, 269); + this.sourceTextBox.TabIndex = 8; + this.sourceTextBox.Text = "begin\r\nend."; + // + // IoiSubmitGuiControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.formComboBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.label1); + this.Name = "IoiSubmitGuiControl"; + this.Size = new System.Drawing.Size(459, 402); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox formComboBox; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox problemTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox languageTextBox; + private System.Windows.Forms.Button submitButton; + private System.Windows.Forms.TextBox sourceTextBox; + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.cs 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace AcmContester.Plugins.IoiPlugins.IoiSubmitGuiPlugin +{ + public partial class IoiSubmitGuiControl : UserControl + { + IoiSubmitGuiPlugin plugin; + + public IoiSubmitGuiControl() + { + InitializeComponent(); + } + + internal void SetPlugin(IoiSubmitGuiPlugin ioiSubmitGuiPlugin) + { + plugin = ioiSubmitGuiPlugin; + } + + private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) + { + languageTextBox.Text = "" + comboBox1.Text[0]; + } + + private void submitButton_Click(object sender, EventArgs e) + { + string contestantName = nameTextBox.Text; + int form = Int32.Parse(formComboBox.Text); + + int lang = Int32.Parse(languageTextBox.Text); + int problem = Int32.Parse(problemTextBox.Text); + string soucreCode = sourceTextBox.Text; + plugin.SendSubmit(contestantName, form, soucreCode, lang, problem); + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.resx =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.resx (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiControl.resx 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.cs 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,35 @@ +using System; +using AcmContester.Plugins.PluginsFramework; +using AcmContester.Library.LibraryExtention; +using AcmContester.Library.LibraryExtention.Data; + +namespace AcmContester.Plugins.IoiPlugins.IoiSubmitGuiPlugin +{ + public class IoiSubmitGuiPlugin : BaseMediatorPlugin + { + public IoiSubmitGuiPlugin() + { + base.Control = new IoiSubmitGuiControl(); + ((IoiSubmitGuiControl)base.Control).SetPlugin(this); + } + + public override void Send(SystemMessage message) + { + } + + internal void SendSubmit(string contestantName, int form, string soucreCode, int lang, int problem) + { + SubmitIoi submit = new SubmitIoi(); + submit.name = contestantName; + submit.form = form; + submit.submit = new Submit(); + submit.submit.id = Guid.NewGuid().GetHashCode(); + submit.submit.language = lang; + submit.submit.pbolemID = problem; + submit.submit.sourceCode = soucreCode; + + SystemMessage message = new SystemMessage(submit.ToString(), "TestingSubmitIoi"); + base.DataArrived(message); + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/IoiSubmitGuiPlugin.csproj 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,75 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{96664041-18B2-42BD-941F-117B54E2AE64}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AcmContester.Plugins.IoiPlugins.IoiSubmitGuiPlugin</RootNamespace> + <AssemblyName>IoiSubmitGuiPlugin</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IoiSubmitGuiControl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="IoiSubmitGuiControl.Designer.cs"> + <DependentUpon>IoiSubmitGuiControl.cs</DependentUpon> + </Compile> + <Compile Include="IoiSubmitGuiPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Library\Data\Data.csproj"> + <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project> + <Name>Data</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="IoiSubmitGuiControl.resx"> + <SubType>Designer</SubType> + <DependentUpon>IoiSubmitGuiControl.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiSubmitGuiPlugin/Properties/AssemblyInfo.cs 2009-02-02 01:10:49 UTC (rev 473) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IoiSubmitGuiPlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("IoiSubmitGuiPlugin")] +[assembly: AssemblyCopyright("Copyright © Home 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a2aba821-d39d-4e8d-8ba2-b0fd604236d3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 01:07:21
|
Revision: 472 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=472&view=rev Author: brus07 Date: 2009-02-02 01:07:17 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Fix bug in SubmitIoi. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs Modified: ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs 2009-02-02 01:04:03 UTC (rev 471) +++ ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs 2009-02-02 01:07:17 UTC (rev 472) @@ -4,13 +4,15 @@ namespace AcmContester.Library.LibraryExtention.Data { - [XmlRoot("submitIoi")] + [XmlRoot("submitioi")] public class SubmitIoi { [XmlElement("submit", typeof(Submit))] public Submit submit; [XmlElement("name", typeof(string))] - public int name; + public string name; + [XmlElement("form", typeof(int))] + public int form; public SubmitIoi() { @@ -24,7 +26,7 @@ public static SubmitIoi CreateFromXml(string message) { - return XmlHelper.GetObject<SubmitIoi>(message, "submitIoi", "data.xsd"); + return XmlHelper.GetObject<SubmitIoi>(message, "submitioi", "data.xsd"); } //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-02 01:04:06
|
Revision: 471 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=471&view=rev Author: brus07 Date: 2009-02-02 01:04:03 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Continue modify SubmitList and SubmitIoi Update XSD file. Change call property of SubmitList. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/testData/data.xsd ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsd =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-01 22:53:36 UTC (rev 470) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-02 01:04:03 UTC (rev 471) @@ -18,8 +18,9 @@ </xs:complexType> <xs:complexType name="submitIOIType"> <xs:sequence> + <xs:element name="submit" type="submitType" /> <xs:element name="name" type="xs:string" /> - <xs:element name="submit" type="submitType" /> + <xs:element name="form" type="xs:positiveInteger" /> </xs:sequence> </xs:complexType> <xs:element name="submitList"> Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-01 22:53:36 UTC (rev 470) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2009-02-02 01:04:03 UTC (rev 471) @@ -50,9 +50,9 @@ { string message = "Get submits" + Environment.NewLine; string ids = ""; - for (int i = 0; i < submitList.Items.Length; i++) + for (int i = 0; i < submitList.SubmitItems.Length; i++) { - ids += " " + submitList.Items[i].id.ToString(); + ids += " " + submitList.SubmitItems[i].id.ToString(); } message += " ID: " + ids; OnLogMessage("Receive", message); @@ -66,17 +66,17 @@ GenerateLogMessageWirhIDs(submitList); - for (int index = 0; index < submitList.Items.Length; index++) + for (int index = 0; index < submitList.SubmitItems.Length; index++) { - if (dataContainer.Add(submitList.Items[index]) == true) + if (dataContainer.Add(submitList.SubmitItems[index]) == true) { - SystemMessage sysMes = new SystemMessage(submitList.Items[index].ToString(), "TestingSubmit"); - OnLogMessage("SystemSend", submitList.Items[index].id + " to Pool"); + SystemMessage sysMes = new SystemMessage(submitList.SubmitItems[index].ToString(), "TestingSubmit"); + OnLogMessage("SystemSend", submitList.SubmitItems[index].id + " to Pool"); pool.Send(sysMes); } else { - OnLogMessage("SystemReceive", submitList.Items[index].id + "is in queue"); + OnLogMessage("SystemReceive", submitList.SubmitItems[index].id + "is in queue"); } } return true; Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2009-02-01 22:53:36 UTC (rev 470) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGetter.cs 2009-02-02 01:04:03 UTC (rev 471) @@ -107,20 +107,20 @@ { SubmitList list = SubmitList.CreateFromXml(info); List<Submit> result = new List<Submit>(); - for (int i = 0; i < list.Items.Length; i++) + for (int i = 0; i < list.SubmitItems.Length; i++) { - if (container.Contains(list.Items[i]) == false) + if (container.Contains(list.SubmitItems[i]) == false) { - result.Add(list.Items[i]); + result.Add(list.SubmitItems[i]); //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE4\xEE\xE1\xE0\xE2\xEB\xFF\xF2\xE8 \xF2\xB3\xEB\xFC\xEA\xE8 \xF2\xEE\xE4\xB3 \xEA\xEE\xEB\xE8 \xF6\xE5\xE9 \xF1\xE0\xE1\xEC\xB3\xF2 \xE2\xB3\xE4\xEF\xF0\xE0\xE2\xEB\xE5\xED\xE8\xE9 \xED\xE0 \xF2\xE5\xF1\xF2\xF3\xE2\xE0\xED\xED\xFF - container.Add(list.Items[i]); + container.Add(list.SubmitItems[i]); } } if (result.Count == 0) return new SystemMessage("Web checked: All submits in queue (queue size " + container.Count.ToString() + ")", "SystemResult"); SubmitList resultList = new SubmitList(); - resultList.Items = result.ToArray(); + resultList.SubmitItems = result.ToArray(); return new SystemMessage(resultList.ToString(), "TestingSubmitList"); } } Modified: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-01 22:53:36 UTC (rev 470) +++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/TestRunnerPlugin/TestRunnerPlugin.cs 2009-02-02 01:04:03 UTC (rev 471) @@ -96,12 +96,12 @@ SendMessageToControl("TestingSubmitList", "Receive"); SubmitList list = SubmitList.CreateFromXml(message.Message); - for (int i = 0; i < list.Items.Length; i++) + for (int i = 0; i < list.SubmitItems.Length; i++) { while (runner.IsBusy() == true) System.Threading.Thread.Sleep(50); - SendSubmitToControl(list.Items[i].ToString(), "Receive"); - runner.AddWork(list.Items[i].ToString()); + SendSubmitToControl(list.SubmitItems[i].ToString(), "Receive"); + runner.AddWork(list.SubmitItems[i].ToString()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-01 22:55:28
|
Revision: 468 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=468&view=rev Author: brus07 Date: 2009-02-01 22:13:06 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Added EmptyPlugin to Solution file. Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-01 22:04:55 UTC (rev 467) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-01 22:13:06 UTC (rev 468) @@ -37,6 +37,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWebConnector", "Library\ConcreteConnector\SampleWebConnector\SampleWebConnector.csproj", "{45B4D72E-CD81-42A7-AD46-3471380A290F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmptyPlugin", "Plugins\EmptyPlugin\EmptyPlugin.csproj", "{74FB3B7A-5D91-46B3-9F15-F38136725AED}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -95,6 +97,10 @@ {45B4D72E-CD81-42A7-AD46-3471380A290F}.Debug|Any CPU.Build.0 = Debug|Any CPU {45B4D72E-CD81-42A7-AD46-3471380A290F}.Release|Any CPU.ActiveCfg = Release|Any CPU {45B4D72E-CD81-42A7-AD46-3471380A290F}.Release|Any CPU.Build.0 = Release|Any CPU + {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -108,6 +114,7 @@ {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {69FB4176-F298-4AF7-B714-B6758AA9A58E} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} + {74FB3B7A-5D91-46B3-9F15-F38136725AED} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {9462E3BD-67AD-4887-BF4C-8B6A25048941} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {8F305004-8FB7-4F85-8063-3A7041DB840F} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-01 22:55:24
|
Revision: 467 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=467&view=rev Author: brus07 Date: 2009-02-01 22:04:55 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Added new sample EmptyPlugin to Plugin directory. Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/ ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.cs ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.csproj ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties/AssemblyInfo.cs Property changes on: ACMServer/trunk/ACMServer/Plugins/EmptyPlugin ___________________________________________________________________ Added: svn:ignore + bin obj Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.cs 2009-02-01 22:04:55 UTC (rev 467) @@ -0,0 +1,14 @@ +using System; +using AcmContester.Plugins.PluginsFramework; +using AcmContester.Library.LibraryExtention; + +namespace AcmContester.Plugins.EmptyPlugin +{ + public class EmptyPlugin : BaseMediatorPlugin + { + public override void Send(SystemMessage message) + { + throw new Exception("The method or operation is not implemented."); + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/EmptyPlugin.csproj 2009-02-01 22:04:55 UTC (rev 467) @@ -0,0 +1,57 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{74FB3B7A-5D91-46B3-9F15-F38136725AED}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AcmContester.Plugins.EmptyPlugin</RootNamespace> + <AssemblyName>EmptyPlugin</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="EmptyPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> + <ProjectReference Include="..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/EmptyPlugin/Properties/AssemblyInfo.cs 2009-02-01 22:04:55 UTC (rev 467) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("EmptyPlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("EmptyPlugin")] +[assembly: AssemblyCopyright("Copyright © Home 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e7d1eae8-b3f6-4459-8904-402377f9f52d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-01 22:53:40
|
Revision: 470 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=470&view=rev Author: brus07 Date: 2009-02-01 22:53:36 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Added new Plugin for work with information of Ioi result. At this time this plugin is empty. Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.resx ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.csproj ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties/AssemblyInfo.cs Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-01 22:46:13 UTC (rev 469) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2009-02-01 22:53:36 UTC (rev 470) @@ -39,6 +39,10 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmptyPlugin", "Plugins\EmptyPlugin\EmptyPlugin.csproj", "{74FB3B7A-5D91-46B3-9F15-F38136725AED}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IoiPlugin", "IoiPlugin", "{4BEB97A7-7AAB-42A3-B30A-B6CCF75AAD64}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoiInformerPlugin", "Plugins\IoiPlugin\IoiInformerPlugin\IoiInformerPlugin.csproj", "{F36370C3-E1EB-47E8-AFAC-F4840953D60B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -101,6 +105,10 @@ {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Debug|Any CPU.Build.0 = Debug|Any CPU {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Release|Any CPU.ActiveCfg = Release|Any CPU {74FB3B7A-5D91-46B3-9F15-F38136725AED}.Release|Any CPU.Build.0 = Release|Any CPU + {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F36370C3-E1EB-47E8-AFAC-F4840953D60B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -115,11 +123,13 @@ {69FB4176-F298-4AF7-B714-B6758AA9A58E} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {74FB3B7A-5D91-46B3-9F15-F38136725AED} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} + {4BEB97A7-7AAB-42A3-B30A-B6CCF75AAD64} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {9462E3BD-67AD-4887-BF4C-8B6A25048941} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {8F305004-8FB7-4F85-8063-3A7041DB840F} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {79EB24DD-AF0D-40D0-974E-198F4D8C92BC} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {E255910C-499D-48E2-9846-7EB24DE32C4A} = {D67E1C70-DFE6-4C3E-BCA9-DD3DB9CB4B30} {45B4D72E-CD81-42A7-AD46-3471380A290F} = {4E42F296-7321-4193-9E35-9B7202005229} + {F36370C3-E1EB-47E8-AFAC-F4840953D60B} = {4BEB97A7-7AAB-42A3-B30A-B6CCF75AAD64} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Plugins/IoiPlugin ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin ___________________________________________________________________ Added: svn:ignore + bin obj Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.Designer.cs 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,45 @@ +namespace AcmContester.Plugins.IoiPlugins.IoiInformerPlugin +{ + partial class IoiInformerControl + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.SuspendLayout(); + // + // IoiInformerControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "IoiInformerControl"; + this.Size = new System.Drawing.Size(396, 383); + this.ResumeLayout(false); + + } + + #endregion + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.cs 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace AcmContester.Plugins.IoiPlugins.IoiInformerPlugin +{ + public partial class IoiInformerControl : UserControl + { + public IoiInformerControl() + { + InitializeComponent(); + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.resx =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.resx (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerControl.resx 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.cs 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,24 @@ +using System; +using AcmContester.Plugins.PluginsFramework; +using AcmContester.Library.LibraryExtention; +using AcmContester.Library.LibraryExtention.Data; + +namespace AcmContester.Plugins.IoiPlugins.IoiInformerPlugin +{ + public class IoiInformerPlugin : BaseMediatorPlugin + { + public IoiInformerPlugin() + { + base.Control = new IoiInformerControl(); + } + + public override void Send(SystemMessage message) + { + if (message.IsType("TestingResultIoi") == true) + { + ResultIoi result = ResultIoi.CreateFromXml(message.Message); + //\xF2\xF3\xF2 \xEE\xE1\xF0\xEE\xE1\xEA\xE0 \xEF\xEE\xE2\xB3\xE4\xEE\xEC\xEB\xE5\xED\xED\xFF + } + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/IoiInformerPlugin.csproj 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,75 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{F36370C3-E1EB-47E8-AFAC-F4840953D60B}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>AcmContester.Plugins.IoiPlugins.IoiInformerPlugin</RootNamespace> + <AssemblyName>IoiInformerPlugin</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IoiInformerControl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="IoiInformerControl.Designer.cs"> + <DependentUpon>IoiInformerControl.cs</DependentUpon> + </Compile> + <Compile Include="IoiInformerPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Library\Data\Data.csproj"> + <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project> + <Name>Data</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj"> + <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> + <Name>LibraryExtention</Name> + </ProjectReference> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="IoiInformerControl.resx"> + <SubType>Designer</SubType> + <DependentUpon>IoiInformerControl.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Property changes on: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/IoiPlugin/IoiInformerPlugin/Properties/AssemblyInfo.cs 2009-02-01 22:53:36 UTC (rev 470) @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IoiInformerPlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("IoiInformerPlugin")] +[assembly: AssemblyCopyright("Copyright © Home 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8f0e4814-384c-4709-87ff-71c0204829fb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2009-02-01 22:46:18
|
Revision: 469 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=469&view=rev Author: brus07 Date: 2009-02-01 22:46:13 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Added new SubmitIoi and ResultIoi class for work with Ioi data. But now this work like mock. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Data/Data.csproj ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs ACMServer/trunk/ACMServer/Library/testData/data.xsd ACMServer/trunk/ACMServer/Library/testData/data.xsx ACMServer/trunk/ACMServer/Library/testData/submitList.xml Added Paths: ----------- ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs Modified: ACMServer/trunk/ACMServer/Library/Data/Data.csproj =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/Data.csproj 2009-02-01 22:13:06 UTC (rev 468) +++ ACMServer/trunk/ACMServer/Library/Data/Data.csproj 2009-02-01 22:46:13 UTC (rev 469) @@ -29,9 +29,12 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Data" /> <Reference Include="System.XML" /> </ItemGroup> <ItemGroup> + <Compile Include="ResultIoi.cs" /> + <Compile Include="SubmitIoi.cs" /> <Compile Include="DataMediator.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Result.cs" /> Added: ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/Data/ResultIoi.cs 2009-02-01 22:46:13 UTC (rev 469) @@ -0,0 +1,60 @@ +using System.Xml.Serialization; +using AcmContester.AcmLibraryExtention.XML; + +namespace AcmContester.Library.LibraryExtention.Data +{ + [XmlRoot("resultIoi")] + public class ResultIoi + { + [XmlElement("submitIoi", typeof(Submit))] + public SubmitIoi Submit + { + get + { + return submit; + } + set + { + submit = value; + } + } + private SubmitIoi submit; + [XmlElement("res", typeof(string))] + public string res; + [XmlElement("result", typeof(int))] + public int result; + [XmlElement("usedTime", typeof(double))] + public double usedTime; + [XmlElement("usedMemory", typeof(int))] + public int usedMemory; + + readonly string temp; + + public ResultIoi(SubmitIoi ssubmit) + { + submit = ssubmit; + } + + public ResultIoi(string message) + { + //TODO + temp = message.Substring(0, message.IndexOf('$')); + string s = message.Substring(message.IndexOf('$') + 1); + submit = new SubmitIoi(s); + } + + public static ResultIoi CreateFromXml(string message) + { + return XmlHelper.GetObject<ResultIoi>(message, "resultIoi", "data.xsd"); + } + + public override string ToString() + { + return temp; + } + public string ToStringX() + { + return XmlSerializer<ResultIoi>.Serialization(this); + } + } +} Added: ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs (rev 0) +++ ACMServer/trunk/ACMServer/Library/Data/SubmitIoi.cs 2009-02-01 22:46:13 UTC (rev 469) @@ -0,0 +1,43 @@ +using System; +using AcmContester.AcmLibraryExtention.XML; +using System.Xml.Serialization; + +namespace AcmContester.Library.LibraryExtention.Data +{ + [XmlRoot("submitIoi")] + public class SubmitIoi + { + [XmlElement("submit", typeof(Submit))] + public Submit submit; + [XmlElement("name", typeof(string))] + public int name; + + public SubmitIoi() + { + } + + public SubmitIoi(string message) + { + //TODO: + throw new Exception(); + } + + public static SubmitIoi CreateFromXml(string message) + { + return XmlHelper.GetObject<SubmitIoi>(message, "submitIoi", "data.xsd"); + } + + //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML + public override string ToString() + { + //string result = sourceCode; + string result = XmlSerializer<SubmitIoi>.Serialization(this); + return result; + } + + public override int GetHashCode() + { + return submit.GetHashCode(); + } + } +} Modified: ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2009-02-01 22:13:06 UTC (rev 468) +++ ACMServer/trunk/ACMServer/Library/Data/SubmitList.cs 2009-02-01 22:46:13 UTC (rev 469) @@ -9,10 +9,12 @@ public class SubmitList { readonly ArrayList listSubmits; + readonly ArrayList listSubmitsIoi; public SubmitList() { listSubmits = new ArrayList(); + listSubmitsIoi = new ArrayList(); } public static SubmitList CreateFromXml(string message) @@ -26,11 +28,16 @@ } [XmlElement("submit", typeof(Submit))] - public Submit[] Items + public Submit[] SubmitItems { get { - Submit[] submits = new Submit[listSubmits.Count]; + ArrayList list = new ArrayList(); + foreach (object x in listSubmits) + if (x is Submit) + list.Add(x); + + Submit[] submits = new Submit[list.Count]; listSubmits.CopyTo(submits); return submits; } @@ -43,5 +50,28 @@ listSubmits.Add(item); } } + [XmlElement("submitIoi", typeof(SubmitIoi))] + public SubmitIoi[] SubmitIoiItems + { + get + { + ArrayList list = new ArrayList(); + foreach (object x in listSubmitsIoi) + if (x is SubmitIoi) + list.Add(x); + + SubmitIoi[] submits = new SubmitIoi[list.Count]; + listSubmitsIoi.CopyTo(submits); + return submits; + } + set + { + if (value == null) return; + SubmitIoi[] submits = value; + listSubmitsIoi.Clear(); + foreach (SubmitIoi item in submits) + listSubmitsIoi.Add(item); + } + } } } Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsd =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-01 22:13:06 UTC (rev 468) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsd 2009-02-01 22:46:13 UTC (rev 469) @@ -16,6 +16,12 @@ </xs:element> </xs:sequence> </xs:complexType> + <xs:complexType name="submitIOIType"> + <xs:sequence> + <xs:element name="name" type="xs:string" /> + <xs:element name="submit" type="submitType" /> + </xs:sequence> + </xs:complexType> <xs:element name="submitList"> <xs:complexType> <xs:sequence> @@ -38,4 +44,6 @@ </xs:element> <xs:element name="submit" type="submitType"> </xs:element> + <xs:element name="submitioi" type="submitIOIType"> + </xs:element> </xs:schema> \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Library/testData/data.xsx =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/data.xsx 2009-02-01 22:13:06 UTC (rev 468) +++ ACMServer/trunk/ACMServer/Library/testData/data.xsx 2009-02-01 22:46:13 UTC (rev 469) @@ -2,28 +2,28 @@ <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout Style="LeftRight" layoutVersion="2" viewPortLeft="0" viewPortTop="0" zoom="100"> <submitType_XmlComplexType left="1317" top="1254" width="5292" height="2831" selected="0" zOrder="1" index="0" expanded="1"> - <language_XmlElement left="7243" top="2312" width="5292" height="714" selected="0" zOrder="2" index="2" expanded="1"> + <language_XmlElement left="7243" top="2312" width="5292" height="714" selected="0" zOrder="2" index="3" expanded="1"> <_x0028_language_x0029__XmlSimpleType left="13169" top="1254" width="5292" height="2831" selected="0" zOrder="5" index="0" expanded="1" /> </language_XmlElement> </submitType_XmlComplexType> <submitList_XmlElement left="1317" top="4593" width="5292" height="2831" selected="0" zOrder="8" index="1" expanded="1"> <_x0028_group1_x0029__XmlSequence left="7243" top="4593" width="5292" height="2831" selected="0" zOrder="10" index="0" expanded="1"> <submit_XmlElement left="13169" top="4593" width="5292" height="2831" selected="0" zOrder="13" index="0" expanded="1"> - <language_XmlElement left="19095" top="5651" width="5292" height="714" selected="0" zOrder="16" index="2" expanded="0" /> + <language_XmlElement left="19095" top="5651" width="5292" height="714" selected="0" zOrder="16" index="3" expanded="0" /> </submit_XmlElement> </_x0028_group1_x0029__XmlSequence> </submitList_XmlElement> <resultType_XmlComplexType left="1317" top="7932" width="5292" height="2831" selected="0" zOrder="19" index="2" expanded="1"> <submit_XmlElement left="7243" top="7932" width="5292" height="2831" selected="0" zOrder="21" index="4" expanded="1"> - <language_XmlElement left="13169" top="8990" width="5292" height="714" selected="0" zOrder="24" index="2" expanded="0" /> + <language_XmlElement left="13169" top="8990" width="5292" height="714" selected="0" zOrder="24" index="3" expanded="0" /> </submit_XmlElement> </resultType_XmlComplexType> <result_XmlElement left="1317" top="11271" width="5292" height="2831" selected="0" zOrder="27" index="3" expanded="1"> <submit_XmlElement left="7243" top="11271" width="5292" height="2831" selected="0" zOrder="29" index="4" expanded="1"> - <language_XmlElement left="13169" top="12329" width="5292" height="714" selected="0" zOrder="32" index="2" expanded="0" /> + <language_XmlElement left="13169" top="12329" width="5292" height="714" selected="0" zOrder="32" index="3" expanded="0" /> </submit_XmlElement> </result_XmlElement> <submit_XmlElement left="2910" top="14393" width="5292" height="2831" selected="0" zOrder="35" index="4" expanded="1"> - <language_XmlElement left="8836" top="15451" width="5292" height="714" selected="0" zOrder="37" index="2" expanded="0" /> + <language_XmlElement left="8836" top="15451" width="5292" height="714" selected="0" zOrder="37" index="3" expanded="0" /> </submit_XmlElement> </XSDDesignerLayout> \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Library/testData/submitList.xml =================================================================== --- ACMServer/trunk/ACMServer/Library/testData/submitList.xml 2009-02-01 22:13:06 UTC (rev 468) +++ ACMServer/trunk/ACMServer/Library/testData/submitList.xml 2009-02-01 22:46:13 UTC (rev 469) @@ -1,18 +1,49 @@ -<?xml version="1.0" encoding="utf-16"?> -<submitList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <submit> - <id>123</id> - <sourceCode>asd asd asd asd</sourceCode> - <language>2</language> - </submit> - <submit> - <id>123</id> - <sourceCode>asd asd asd asd</sourceCode> - <language>2</language> - </submit> - <submit> - <id>123</id> - <sourceCode>asd asd asd asd</sourceCode> - <language>1</language> - </submit> -</submitList> \ No newline at end of file +\xFF\xFE< |
From: <br...@us...> - 2009-02-01 19:41:05
|
Revision: 466 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=466&view=rev Author: brus07 Date: 2009-02-01 19:41:03 +0000 (Sun, 01 Feb 2009) Log Message: ----------- Added reference to SampleWebConnector Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2009-01-31 20:38:09 UTC (rev 465) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2009-02-01 19:41:03 UTC (rev 466) @@ -51,6 +51,10 @@ <Compile Include="WebGetter.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\..\Library\ConcreteConnector\SampleWebConnector\SampleWebConnector.csproj"> + <Project>{45B4D72E-CD81-42A7-AD46-3471380A290F}</Project> + <Name>SampleWebConnector</Name> + </ProjectReference> <ProjectReference Include="..\..\..\Library\Connector\Connector.csproj"> <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> <Name>Connector</Name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2009-01-31 20:38:20
|
Revision: 465 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=465&view=rev Author: panzaboi Date: 2009-01-31 20:38:09 +0000 (Sat, 31 Jan 2009) Log Message: ----------- 1) Added Zend_Paginator, to split data across pages. 2) Changed login action, to work with new design. 3) Added view user action. 4) Implemented Action pattern to calculate score of submitted problem. 5) Changed structure. Tables are in models/Table/ and Forms in models/Form 6) Layout changes in Forms 7) Implemeneted multilanguage support in Forms and etc 8) Added Tester module, to transport data between tester and site. 9) Fixed small redirect issue 10) Fixed Db_Table::get with different primary keys 11) Improved Measure helper 12) Added Admin module, including crud action + table to the library. 13) Changed forms to Dojo Forms. 14) Modified HtmlTag to library, to contain markup Modified Paths: -------------- website/application/modules/acm/controllers/ContestController.php website/application/modules/acm/controllers/IndexController.php website/application/modules/acm/controllers/UserController.php website/application/modules/acm/models/Contest.php website/application/modules/acm/models/Form/Login.php website/application/modules/acm/models/Form/Register.php website/application/modules/acm/models/Form/Submit.php website/application/modules/acm/models/Tester.php website/application/modules/acm/models/User.php website/library/Application.php website/library/Ostacium/Acl.php website/library/Ostacium/Controller/Action.php website/library/Ostacium/Controller/CrudAction.php website/library/Ostacium/Controller/Plugin/ErrorHandler.php website/library/Ostacium/Date.php website/library/Ostacium/Db/Table.php website/library/Ostacium/View/Helper/Measure.php Added Paths: ----------- website/application/modules/acm/models/Calc/ website/application/modules/acm/models/Calc/ACM.php website/application/modules/acm/models/Calc.php website/application/modules/acm/models/Form/SmallLogin.php website/application/modules/acm/models/Table/ website/application/modules/acm/models/Table/ArchiveResults.php website/application/modules/acm/models/Table/Challenges.php website/application/modules/acm/models/Table/Contests.php website/application/modules/acm/models/Table/ContestsApplicants.php website/application/modules/acm/models/Table/ContestsResults.php website/application/modules/acm/models/Table/Submits.php website/application/modules/acm/models/Table/Users.php website/application/modules/acm/models/Table/UsersDetails.php website/application/modules/acm/models/Table/UsersStats.php website/application/modules/admin/controllers/ website/application/modules/admin/controllers/IndexController.php website/application/modules/admin/controllers/SettingsController.php website/application/modules/admin/models/ website/application/modules/admin/models/Form/ website/application/modules/admin/models/Form/Settings.php website/application/modules/admin/models/Table/ website/application/modules/admin/models/Table/Settings.php website/library/Ostacium/Controller/Action/ website/library/Ostacium/Controller/Action/Crud.php website/library/Ostacium/Db/Table/Crud.php website/library/Ostacium/Dojo/ website/library/Ostacium/Dojo/Form/ website/library/Ostacium/Dojo/Form/Crud.php website/library/Ostacium/Form/Decorator/HtmlTag.php website/library/Ostacium/View/Helper/CrudList.php Modified: website/application/modules/acm/controllers/ContestController.php =================================================================== --- website/application/modules/acm/controllers/ContestController.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/controllers/ContestController.php 2009-01-31 20:38:09 UTC (rev 465) @@ -1,12 +1,27 @@ <?php class Acm_ContestController extends Ostacium_Controller_Action -{ +{ public function indexAction() { - $this->view->contests = $this->_model->getContests(); + $contests = $this->_model->getContests(); + $paginator = Zend_Paginator::factory($contests); + $paginator->setItemCountPerPage($this->_config->table->perpage); + $paginator->setCurrentPageNumber($this->_getParam('page')); + + $this->view->contests = $paginator; } + public function newAction() + { + + } + + public function addAction() + { + + } + public function registerAction() { $contestid = $this->_getParam('contestid'); @@ -43,7 +58,10 @@ { $contestid = $this->_getParam('contestid'); - // check if user is in this contest + if (!$this->_model->isInContest($contestid)) + { + return $this->render('notincontest'); + } $this->view->challenges = $this->_model->getChallenges($contestid); } Modified: website/application/modules/acm/controllers/IndexController.php =================================================================== --- website/application/modules/acm/controllers/IndexController.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/controllers/IndexController.php 2009-01-31 20:38:09 UTC (rev 465) @@ -4,24 +4,32 @@ { public function indexAction() { - $form = new Form_Login(); - echo $form; + var_dump('sadfasdf'); } public function loginAction() { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $form = new Form_Login(); + if ($this->_getParam('message')) + { + $form->setDescription($this->view->translate($this->_getParam('message'))); + $this->view->message = null; + } if (!$this->getRequest()->isPost()) { - return $this->_forward('index', null, null, $this->_getAllParams()); + echo $form; + + return; } if (!$form->isValid($this->getRequest()->getPost())) { - $this->view->form = $form; - $this->renderScript('layout/loginform.phtml', 'login'); - return $this->_forward('index'); + echo $form; + + return; } $values = $form->getValues(); @@ -30,11 +38,10 @@ if (!$result) { - $form->setDescription($this->view->translate('wrongEmailPwd')); - $this->view->form = $form; - //$this->renderScript('layout/loginform.phtml', 'login'); + $form->setDescription($this->view->translate('error_bad_login')); + echo $form; - return $this->_forward('index'); + return; } $redirect = new Zend_Session_Namespace('Redirect'); @@ -47,12 +54,12 @@ { return $this->_redirect('/acm/index/index'); } - - $this->_helper->getHelper('viewRenderer')->setNoRender(true); } public function logoutAction() { Zend_Auth::getInstance()->clearIdentity(); + + $this->_redirect('/acm/index/index'); } } \ No newline at end of file Modified: website/application/modules/acm/controllers/UserController.php =================================================================== --- website/application/modules/acm/controllers/UserController.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/controllers/UserController.php 2009-01-31 20:38:09 UTC (rev 465) @@ -71,6 +71,10 @@ public function viewAction() { + $username = $this->_getParam('username'); + $this->view->assign($this->_model->getUser($username)); + var_dump($this->_model->getUser($username)); + //var_dump($this->view->user); } } \ No newline at end of file Property changes on: website/application/modules/acm/models/Calc ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/acm/models/Calc/ACM.php =================================================================== --- website/application/modules/acm/models/Calc/ACM.php (rev 0) +++ website/application/modules/acm/models/Calc/ACM.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,39 @@ +<?php + +class Calc_ACM implements Calc +{ + public function calcCost(array $submit, array $result, array $contest) + { + if ($submit['firsttest'] == 1) return false; + + $_config = Zend_Registry::get('config'); + + if (!count($result)) + { + $result = array( + 'contestid' => $submit['contestid'], + 'username' => $submit['username'], + 'challengeid' => $submit['challengeid'], + 'tries' => 0, + 'penalty' => 0, + 'accepted' => 0, + ); + } + + if ($result['accepted']) return false; + + $result['tries']++; + + if ($submit['state'] == 1) + { + $result['accepted'] = 1; + $result['penalty'] += floor((time() - $contest['start'])/60); + } + elseif ($submit['state'] > 1) + { + $result['penalty'] += $_config->calc->acm->penalty; + } + + return $result; + } +} \ No newline at end of file Added: website/application/modules/acm/models/Calc.php =================================================================== --- website/application/modules/acm/models/Calc.php (rev 0) +++ website/application/modules/acm/models/Calc.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,6 @@ +<?php + +interface Calc +{ + public function calcCost(array $submit, array $result, array $contest); +} \ No newline at end of file Modified: website/application/modules/acm/models/Contest.php =================================================================== --- website/application/modules/acm/models/Contest.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/Contest.php 2009-01-31 20:38:09 UTC (rev 465) @@ -2,9 +2,22 @@ class Contest extends Ostacium_Model { + protected $calc = null; + + public function __construct(Calc $calc = null) + { + parent::__construct(); + if ($calc) $this->calc = $calc; + } + + public function setCalc(Calc $calc) + { + $this->calc = $calc; + } + public function getContests() { - $contests = new Contests(); + $contests = new Table_Contests(); return $contests->getAll(); } @@ -12,7 +25,7 @@ { $username = Zend_Auth::getInstance()->getStorage()->read()->username; - $ca = new ContestsApplicants(); + $ca = new Table_ContestsApplicants(); $ca->insert(array('username' => $username, 'contestid' => $id)); return true; @@ -20,28 +33,28 @@ public function isContestRunning($contestid) { - $contest = new Contests(); + $contest = new Table_Contests(); return $contest->isRunning($contestid); } public function isInContest($contestid) { $username = Zend_Auth::getInstance()->getStorage()->read()->username; - $contest = new Contests(); + $contest = new Table_Contests(); return $contest->isInContest($contestid, $username); } public function getChallenges($contestid) { - $challenges = new Challenges(); - return $challenges->getAll($contestid); + $challenges = new Table_Challenges(); + return $challenges->getAllFromContest($contestid); } public function getChallenge($id, $contestid) { - $challenges = new Challenges(); - return $challenges->get($id, $contestid); + $challenges = new Table_Challenges(); + return $challenges->getFromContest($id, $contestid); } public function addSubmit($values) @@ -55,11 +68,11 @@ 'when' => time() ); - $contest = new Contests(); + $contest = new Table_Contests(); if ($contest->isRunning($values['contestid'])) { - $submits = new Submits(); + $submits = new Table_Submits(); return $submits->insert($data); } else @@ -68,98 +81,43 @@ public function getSubmits($contestid) { - $submits = new Submits(); - return $submits->getAll($contestid); + $submits = new Table_Submits(); + return $submits->getAllFromContest($contestid); } -} - -class Challenges extends Ostacium_Db_Table -{ - protected $_name = 'challenges'; - protected $_primary = 'id'; - public function getAll($contestid) - { - return $this->selectLang(array('name', 'description')) - ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) - ->joinLeft(array('cc' => 'contests_challenges'), 'cc.contestid = c.id', 'contestid') - ->where('challenges.id = cc.challengeid') - ->query()->fetchAll(); - } - - public function get($id, $contestid) + public function updateResults($submit) { - return $this->selectLang(array('name', 'description')) - ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) - ->joinLeft(array('cc' => 'contests_challenges'), $this->getAdapter()->quoteInto('cc.contestid = c.id AND cc.challengeid = ?', $id), 'contestid') - ->where('challenges.id = cc.challengeid') - ->query()->fetch(); - } -} - -class Submits extends Ostacium_Db_Table -{ - protected $_name = 'submits'; - protected $_primary = 'id'; - - public function getAll($contestid) - { - return $this->select()->setIntegrityCheck(false) - ->from($this) - ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) - ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ?', $contestid), array()) - ->where('submits.contestid = c.id')->order('submits.id DESC') - ->query()->fetchAll(); - } -} - -class Contests extends Ostacium_Db_Table -{ - protected $_name = 'contests'; - protected $_primary = 'id'; - - public function isRunning($contestid) - { - $id = $this->select()->from($this, 'id') - ->where('id = ? AND start <= UNIX_TIMESTAMP() AND end >= UNIX_TIMESTAMP() AND enabled = 1', $contestid) - ->query()->fetchColumn('id'); + // LOG THIS/FAIL! + if (!$this->calc) return false; - if ($id && $id == $contestid) - return true; + $contests = new Table_Contests(); + $contest = $contests->get($submit['contestid'])->toArray(); + + $results = new Table_ContestsResults(); + $result = $results->get(array($submit['contestid'], $submit['username'], $submit['challengeid'])); + + if ($result) + $result = $result->toArray(); else - return false; + $result = array(); + + $newresult = $this->calc->calcCost($submit, $result, $contest); + + if (!count($result) && $newresult !== false) + { + $results->insert($newresult); + } + elseif ($newresult != $result && $newresult !== false) + { + $where = array( + $this->_db->quoteInto('contestid = ?', $newresult['contestid']), + $this->_db->quoteInto('username = ?', $newresult['username']), + $this->_db->quoteInto('challengeid = ?', $newresult['challengeid']), + ); + + $results->update($newresult, $where); + } } - - public function getAll() - { - return $this->selectLang(array('name', 'description')) - ->where('enabled = 1 AND start <= UNIX_TIMESTAMP() AND end > UNIX_TIMESTAMP()') - ->query()->fetchAll(); - } - - public function isInContest($contestid, $username) - { - $id = $this->select()->setIntegrityCheck(false) - ->from(array('c' => $this->_name), 'id') - ->joinInner(array('a' => 'contests_applicants'), 'c.id=a.contestid', array()) - ->where('c.id = ?', $contestid) - ->where('a.username = ?', $username) - ->query()->fetchColumn('username'); - - if ($id && $id == $contestid) return true; - else return false; - } } -class ContestsApplicants extends Ostacium_Db_Table -{ - protected $_name = 'contests_applicants'; - protected $_primary = array('contestid', 'username'); -} - -class Users extends Ostacium_Db_Table -{ - protected $_name = 'users'; - protected $_primaty = 'username'; -} \ No newline at end of file Modified: website/application/modules/acm/models/Form/Login.php =================================================================== --- website/application/modules/acm/models/Form/Login.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/Form/Login.php 2009-01-31 20:38:09 UTC (rev 465) @@ -5,12 +5,13 @@ public $elementDecorators = array( 'DijitElement', 'Errors', - array('Label', array('class' => 'overlabel')), - array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) + array('Label', array('class' => 'label')), + array('HtmlTag', array('tag' => 'div', 'class' => 'line')) ); public $buttonDecorators = array( 'DijitElement', + array('HtmlTag', array('tag' => 'div', 'class' => 'line tr')) ); public function init() @@ -21,6 +22,7 @@ $this->setAction($router->assemble(array('action' => 'login', 'controller' => 'index'), null)); $this->setMethod('post'); $this->setName('loginform'); + $this->setAttrib('class', 'form'); $this->addElement('ValidationTextBox', 'username', array( 'decorators' => $this->elementDecorators, @@ -32,11 +34,11 @@ 'maxlength' => 50, 'trim' => true, 'lowercase' => true, - 'style' => 'height: 18px; width: 100px;', 'regExp' => '[\w]{5,50}', 'invalidMessage' => sprintf($translate->_('wordErrorBetween'), 5, 50), - 'title' => 'Username', - 'label' => 'Username:', + 'title' => $translate->_('username'), + 'label' => $translate->_('username').':', + 'class' => 'text', )); $this->addElement('PasswordTextBox', 'password', array( @@ -48,35 +50,34 @@ ), 'required' => true, 'trim' => true, - 'style' => 'height: 18px; width: 100px;', 'regExp' => '[\S]{5,32}', 'invalidMessage' => sprintf($translate->_('errorBetween'), 5, 32), - 'title' => 'Password', - 'label' => 'Password:', + 'title' => $translate->_('password'), + 'label' => $translate->_('password').':', + 'class' => 'text', )); - - $this->addElement('SubmitButton', 'loginbutton', array( 'decorators' => $this->buttonDecorators, 'required' => false, 'ignore' => true, - 'label' => 'Login', + 'label' => $translate->_('login'), + 'class' => 'submit' )); } public function loadDefaultDecorators() { -// $this->setDecorators(array( -// 'FormElements', -// 'Form', -// array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), -// )); - + //$this->addElementPrefixPath('Ostacium/Form/Decorator', 'Ostacium_Form_Decorator', 'Decorator'); + $this->addPrefixPath('Ostacium_Form_Decorator', 'Ostacium/Form/Decorator', 'Decorator'); + $translate = Zend_Registry::get('Zend_Translate'); + $this->setDecorators(array( 'FormElements', 'DijitForm', array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), + array(array('h2' => 'HtmlTag'), array('tag' => 'h2', 'placement' => 'prepend', 'markup' => $translate->_('login'))), + array(array('div' => 'HtmlTag'), array('tag' => 'div', 'class' => 'box c')) )); } } \ No newline at end of file Modified: website/application/modules/acm/models/Form/Register.php =================================================================== --- website/application/modules/acm/models/Form/Register.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/Form/Register.php 2009-01-31 20:38:09 UTC (rev 465) @@ -5,18 +5,19 @@ public $elementDecorators = array( 'DijitElement', 'Errors', - array('Label', array('class' => 'overlabel')), + array('Label', array('class' => 'label')), array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public $simpleDecorators = array( 'Errors', - array('Label', array('class' => 'overlabel')), + array('Label', array('class' => 'label')), array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public $buttonDecorators = array( 'DijitElement', + array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer tc')) ); public function init() @@ -28,6 +29,7 @@ $this->setAction($router->assemble(array('action' => 'register'), null)); $this->setMethod('post'); $this->setName('registerform'); + $this->setAttrib('class', 'registerform c'); $this->addElement('ValidationTextBox', 'username', array( 'decorators' => $this->elementDecorators, @@ -41,6 +43,7 @@ 'invalidMessage' => sprintf($translate->_('errorBetween'), 5, 50), 'title' => $translate->_('username'), 'label' => $translate->_('username').': ', + 'id' => 'username_reg' )); $this->addElement('PasswordTextBox', 'password', array( @@ -55,6 +58,7 @@ 'invalidMessage' => sprintf($translate->_('errorBetween'), 5, 32), 'title' => $translate->_('password'), 'label' => $translate->_('password').': ', + 'id' => 'password_reg' )); $this->addElement('PasswordTextBox', 'cpassword', array( @@ -91,8 +95,8 @@ $this->addElement('Checkbox', 'hideemail', array( 'decorators' => $this->elementDecorators, 'required' => true, - 'title' => $translate->_('hideemail'), - 'label' => $translate->_('hideemail').': ', + 'title' => $translate->_('hide_email'), + 'label' => $translate->_('hide_email').': ', 'multiOptions' => array($translate->_('no'), $translate->_('yes')), )); @@ -134,8 +138,8 @@ 'required' => false, 'regExp' => '[\w ]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('study'), - 'label' => $translate->_('study').': ', + 'title' => $translate->_('edu_place'), + 'label' => $translate->_('edu_place').': ', )); $this->addElement('DateTextBox', 'birthday', array( @@ -171,8 +175,8 @@ 'required' => false, 'regExp' => '[\S]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('icq'), - 'label' => $translate->_('icq').': ', + 'title' => $translate->_('icq_handle'), + 'label' => $translate->_('icq_handle').': ', )); $this->addElement('ValidationTextBox', 'msn', array( @@ -185,8 +189,8 @@ 'required' => false, 'regExp' => '[\S]{0,100}', 'invalidMessage' => sprintf($translate->_('errorMore'), 100), - 'title' => $translate->_('msn'), - 'label' => $translate->_('msn').': ', + 'title' => $translate->_('msn_handle'), + 'label' => $translate->_('msn_handle').': ', )); $this->addElement('ValidationTextBox', 'skype', array( @@ -199,8 +203,8 @@ 'required' => false, 'regExp' => '[\S]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('skype'), - 'label' => $translate->_('skype').': ', + 'title' => $translate->_('skype_handle'), + 'label' => $translate->_('skype_handle').': ', )); $this->addElement('ValidationTextBox', 'yahoo', array( @@ -213,8 +217,8 @@ 'required' => false, 'regExp' => '[\S]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('yahoo'), - 'label' => $translate->_('yahoo').': ', + 'title' => $translate->_('yahoo_handle'), + 'label' => $translate->_('yahoo_handle').': ', )); $this->addElement('ValidationTextBox', 'web', array( @@ -227,8 +231,8 @@ 'required' => false, 'regExp' => '[\S]{0,100}', 'invalidMessage' => sprintf($translate->_('errorMore'), 100), - 'title' => $translate->_('web'), - 'label' => $translate->_('web').': ', + 'title' => $translate->_('website'), + 'label' => $translate->_('website').': ', )); $this->addElement('ValidationTextBox', 'topcoder', array( @@ -241,8 +245,8 @@ 'required' => false, 'regExp' => '[\S]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('topcoder'), - 'label' => $translate->_('topcoder').': ', + 'title' => $translate->_('tc_handle'), + 'label' => $translate->_('tc_handle').': ', )); $this->addElement('ValidationTextBox', 'timus', array( @@ -255,8 +259,8 @@ 'required' => false, 'regExp' => '[\S]{0,50}', 'invalidMessage' => sprintf($translate->_('errorMore'), 50), - 'title' => $translate->_('timus'), - 'label' => $translate->_('timus').': ', + 'title' => $translate->_('timus_handle'), + 'label' => $translate->_('timus_handle').': ', )); $offset = array(-12 => -12, -11 => -11, -10 => -10, -9 => -9, -8 => -8, -7 => -7, -6 => -6, -5 => -5, -4 => -4, -3 => -3, -2 => -2, -1 => -1, 0 => 0, '+1' => '+1', '+2' => '+2', '+3' => '+3', '+4' => '+4', '+5' => '+5', '+6' => '+6', '+7' => '+7', '+8' => '+8', '+9' => '+9', '+10' => '+10', '+11' => '+11', '+12' => '+12', '+13' => '+13'); Added: website/application/modules/acm/models/Form/SmallLogin.php =================================================================== --- website/application/modules/acm/models/Form/SmallLogin.php (rev 0) +++ website/application/modules/acm/models/Form/SmallLogin.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,85 @@ +<?php + +class Form_SmallLogin extends Zend_Dojo_Form +{ + public $elementDecorators = array( + 'DijitElement', + array('Label', array('class' => 'label2')), + array('HtmlTag', array('tag' => 'div', 'class' => 'line')) + ); + + public $buttonDecorators = array( + 'DijitElement', + array('HtmlTag', array('tag' => 'div', 'class' => 'line tr')) + ); + + public function init() + { + $translate = Zend_Registry::get('Zend_Translate'); + $router = Zend_Controller_Front::getInstance()->getRouter(); + + $this->setAction($router->assemble(array('action' => 'login', 'controller' => 'index'), null)); + $this->setMethod('post'); + $this->setName('loginform'); + $this->setAttrib('class', 'form'); + + $this->addElement('ValidationTextBox', 'username', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(5, 50)), + ), + 'required' => true, + 'maxlength' => 50, + 'trim' => true, + 'lowercase' => true, + 'regExp' => '[\w]{5,50}', + 'invalidMessage' => sprintf($translate->_('enter_username_between'), 5, 50), + 'title' => $translate->_('username'), + 'label' => $translate->_('username').':', + 'class' => 'text', + )); + + $this->addElement('PasswordTextBox', 'password', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim'), + 'validators' => array( + 'Alnum', + array('StringLength', false, array(5, 32)), + ), + 'required' => true, + 'trim' => true, + 'regExp' => '[\S]{5,32}', + 'invalidMessage' => sprintf($translate->_('enter_password_between'), 5, 32), + 'title' => $translate->_('password'), + 'label' => $translate->_('password').':', + 'class' => 'text', + )); + + $this->addElement('Button', 'signupbutton', array( + 'decorators' => $this->buttonDecorators, + 'required' => false, + 'ignore' => true, + 'label' => $translate->_('signup'), + 'class' => 'signup2', + 'onclick' => 'return goToUrl("'.$router->assemble(array('action' => 'register', 'controller' => 'user'), null).'")' + )); + + $this->addElement('SubmitButton', 'loginbutton', array( + 'decorators' => $this->buttonDecorators, + 'required' => false, + 'ignore' => true, + 'label' => $translate->_('login'), + 'class' => 'submit2' + )); + } + + public function loadDefaultDecorators() + { + $this->setDecorators(array( + 'FormElements', + 'DijitForm', + array('HtmlTag', array('tag' => 'div', 'class' => 'box2 c')) + )); + } +} \ No newline at end of file Modified: website/application/modules/acm/models/Form/Submit.php =================================================================== --- website/application/modules/acm/models/Form/Submit.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/Form/Submit.php 2009-01-31 20:38:09 UTC (rev 465) @@ -5,18 +5,19 @@ public $elementDecorators = array( 'DijitElement', 'Errors', - array('Label', array('class' => 'overlabel')), + array('Label', array('class' => 'label')), array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public $simpleDecorators = array( 'Errors', - array('Label', array('class' => 'overlabel')), + array('Label', array('class' => 'label')), array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public $buttonDecorators = array( 'DijitElement', + array('HtmlTag', array('tag' => 'div', 'class' => 'elcontainer')) ); public function init() @@ -27,16 +28,19 @@ $request = Zend_Controller_Front::getInstance()->getRequest(); $this->setAttrib('enctype', 'multipart/form-data'); + $this->setAttrib('class', 'submitform'); $this->setAction($router->assemble(array('action' => 'upload', 'id' => $request->getParam('id')), null)); $this->setMethod('post'); $this->setName('submitform'); + $this->getView()->addHelperPath('Ostacium/Dojo/View/Helper', 'Ostacium_Dojo_View_Helper'); + $this->addElement('FilteringSelect', 'languageid', array( 'decorators' => $this->elementDecorators, 'required' => true, - 'style' => 'height: 18px; width: 100px;', - 'title' => $translate->_('code_language'), - 'label' => $translate->_('code_language').': ', + 'style' => 'width: 100px;', + 'title' => $translate->_('language'), + 'label' => $translate->_('language').': ', 'multiOptions' => $db->fetchPairs($db->select()->from('code_languages', array('id', 'name'))), 'value' => (Zend_Auth::getInstance()->getStorage()->read()->codelangid) )); @@ -44,45 +48,46 @@ $this->addElement('RadioButton', 'type', array( 'decorators' => $this->elementDecorators, 'required' => true, - 'title' => $translate->_('upload_type'), - 'label' => $translate->_('upload_type ').': ', - 'multiOptions' => array($translate->_('editor'), $translate->_('file_upload')), + 'title' => $translate->_('submit_type'), + 'label' => $translate->_('submit_type').': ', + 'multiOptions' => array($translate->_('source_code'), $translate->_('file')), 'onclick' => 'changeEditor(this.value);', + 'separator' => "\n", 'value' => 0 )); $this->addElement('SimpleTextarea', 'code', array( 'decorators' => $this->elementDecorators, 'style' => 'height: 400px; width: 500px;', - 'title' => $translate->_('enter_code'), - 'label' => $translate->_('enter_code'), + 'title' => $translate->_('source_code'), + 'label' => $translate->_('source_code').': ', )); $this->addElement('File', 'codefile', array( 'decorators' => array_merge(array('File'), $this->simpleDecorators), 'validators' => array(array('Count', false, 1)), 'destination' => Application::getDocRoot().'/other/uploads/', - 'label' => $translate->_('enter_code'), + 'label' => $translate->_('choose_file').': ', )); $this->addElement('Checkbox', 'firsttest', array( 'decorators' => $this->elementDecorators, 'title' => $translate->_('first_test'), - 'label' => $translate->_('first_test ').': ' + 'label' => $translate->_('first_test').': ' )); $this->addElement('SubmitButton', 'submitbutton', array( 'decorators' => $this->buttonDecorators, 'required' => false, 'ignore' => true, - 'label' => $translate->_('submit'), + 'label' => $translate->_('submit_solution'), )); } public function loadDefaultDecorators() { $this->setDecorators(array( - 'FormElements', + 'FormElements', 'DijitForm', array('Description', array('placement' => 'prepend', 'tag' => 'div', 'class' => 'error')), )); Property changes on: website/application/modules/acm/models/Table ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/acm/models/Table/ArchiveResults.php =================================================================== --- website/application/modules/acm/models/Table/ArchiveResults.php (rev 0) +++ website/application/modules/acm/models/Table/ArchiveResults.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,7 @@ +<?php + +class Table_ArchiveResults extends Ostacium_Db_Table +{ + protected $_name = 'archive_results'; + protected $_primary = array('username', 'challengeid'); +} \ No newline at end of file Added: website/application/modules/acm/models/Table/Challenges.php =================================================================== --- website/application/modules/acm/models/Table/Challenges.php (rev 0) +++ website/application/modules/acm/models/Table/Challenges.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,50 @@ +<?php + +class Table_Challenges extends Ostacium_Db_Table +{ + protected $_name = 'challenges'; + protected $_primary = 'id'; + + public function getAllFromContest($contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), 'cc.contestid = c.id', 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetchAll(); + } + + public function getFromContest($id, $contestid) + { + return $this->selectLang(array('name', 'description')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ? AND c.start <= UNIX_TIMESTAMP() AND c.end > UNIX_TIMESTAMP()', $contestid), array()) + ->joinLeft(array('cc' => 'contests_challenges'), $this->getAdapter()->quoteInto('cc.contestid = c.id AND cc.challengeid = ?', $id), 'contestid') + ->where('challenges.id = cc.challengeid') + ->query()->fetch(); + } + + /*public function getSubmitsFromContest($contestid, $username, $ignore_id) + { + return $this->select()->from(array('c' => $this->_name), array('*', 'COUNT(s.id) as tries', 'IF(sac.state,1,0) AS accepted', 'MIN(sac.when) AS actime')) + ->joinLeft(array('cc' => 'contests_challenges'), $this->getAdapter()->quoteInto('cc.contestid = ?', $contestid), array()) + ->joinLeft(array('s' => 'submits'), $this->getAdapter()->quoteInto('s.contestid = cc.contestid AND s.challengeid = cc.challengeid AND s.state > 1 AND s.username = ?', $username), array()) + ->joinLeft(array('sac' => 'submits'), $this->getAdapter()->quoteInto('sac.contestid = cc.contestid AND sac.challengeid = cc.challengeid AND sac.state = 1 AND s.username = ?', $username), array()) + ->where('s.id <> ?', $ignore_id) + ->where('sac.id <> ?', $ignore_id) + ->group(array('s.challengeid', 'sac.challengeid'))->query()->fetchAll(); + }*/ + + public function get($id) + { + return $this->selectLang(array('name', 'description')) + ->where('challenges.id = ? AND enabled = 1', $id) + ->query()->fetch(); + } + + public function getAll() + { + return $this->selectLang(array('name', 'description')) + ->where('challenges.enabled = 1') + ->query()->fetchAll(); + } +} \ No newline at end of file Added: website/application/modules/acm/models/Table/Contests.php =================================================================== --- website/application/modules/acm/models/Table/Contests.php (rev 0) +++ website/application/modules/acm/models/Table/Contests.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,39 @@ +<?php + +class Table_Contests extends Ostacium_Db_Table +{ + protected $_name = 'contests'; + protected $_primary = 'id'; + + public function isRunning($contestid) + { + $id = $this->select()->from($this, 'id') + ->where('id = ? AND start <= UNIX_TIMESTAMP() AND end >= UNIX_TIMESTAMP() AND enabled = 1', $contestid) + ->query()->fetchColumn('id'); + + if ($id && $id == $contestid) + return true; + else + return false; + } + + public function getAll() + { + return $this->selectLang(array('name', 'description')) + ->where('enabled = 1 AND start <= UNIX_TIMESTAMP() AND end > UNIX_TIMESTAMP()') + ->query()->fetchAll(); + } + + public function isInContest($contestid, $username) + { + $id = $this->select()->setIntegrityCheck(false) + ->from(array('c' => $this->_name), 'id') + ->joinInner(array('a' => 'contests_applicants'), 'c.id=a.contestid', array()) + ->where('c.id = ?', $contestid) + ->where('a.username = ?', $username) + ->query()->fetchColumn('username'); + + if ($id && $id == $contestid) return true; + else return false; + } +} \ No newline at end of file Added: website/application/modules/acm/models/Table/ContestsApplicants.php =================================================================== --- website/application/modules/acm/models/Table/ContestsApplicants.php (rev 0) +++ website/application/modules/acm/models/Table/ContestsApplicants.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,7 @@ +<?php + +class Table_ContestsApplicants extends Ostacium_Db_Table +{ + protected $_name = 'contests_applicants'; + protected $_primary = array('contestid', 'username'); +} \ No newline at end of file Added: website/application/modules/acm/models/Table/ContestsResults.php =================================================================== --- website/application/modules/acm/models/Table/ContestsResults.php (rev 0) +++ website/application/modules/acm/models/Table/ContestsResults.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,7 @@ +<?php + +class Table_ContestsResults extends Ostacium_Db_Table +{ + protected $_name = 'contests_results'; + protected $_primary = array('contestid', 'username', 'challengeid'); +} \ No newline at end of file Added: website/application/modules/acm/models/Table/Submits.php =================================================================== --- website/application/modules/acm/models/Table/Submits.php (rev 0) +++ website/application/modules/acm/models/Table/Submits.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,47 @@ +<?php + +class Table_Submits extends Ostacium_Db_Table +{ + protected $_name = 'submits'; + protected $_primary = 'id'; + + public function getAllFromContest($contestid) + { + return $this->select()->setIntegrityCheck(false) + ->from($this) + ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) + ->joinLeft(array('c' => 'contests'), $this->getAdapter()->quoteInto('c.id = ?', $contestid), array()) + ->where('submits.contestid = c.id') + ->order('submits.id DESC') + ->query()->fetchAll(); + } + + public function getAll() + { + return $this->select()->setIntegrityCheck(false) + ->from($this) + ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) + ->where('contestid = 0') + ->order('submits.id DESC') + ->query()->fetchAll(); + } + + public function getUntested() + { + return $this->select()->setIntegrityCheck(false) + ->from($this) + ->joinLeft('code_languages', 'code_languages.id = submits.codelangid', array('codelang' => 'name')) + ->where('state = 0') + ->order('id ASC') + ->query()->fetchAll(); + } + + public function getNotAccepted($id) + { + return $this->select()->setIntegrityCheck(false) + ->from(array('s' => $this->_name)) + ->joinLeft(array('ss' => 'submits'), 'ss.challengeid = s.challengeid AND ss.contestid = s.contestid AND ss.username = s.username AND ss.state = 1', array('IF(ss.id,1,0) AS aced')) + ->where('s.id = ?', $id) + ->query()->fetch(); + } +} \ No newline at end of file Added: website/application/modules/acm/models/Table/Users.php =================================================================== --- website/application/modules/acm/models/Table/Users.php (rev 0) +++ website/application/modules/acm/models/Table/Users.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,16 @@ +<?php + +class Table_Users extends Ostacium_Db_Table +{ + protected $_name = 'users'; + protected $_primaty = 'username'; + + function getUser($username) + { + return $this->select()->setIntegrityCheck(false)->from($this) + ->joinLeft(array('r' => 'roles'), 'r.id=users.roleid', array('role' => 'name')) + ->joinLeft(array('d' => 'usersdetails'), 'd.username=users.username') + ->where('users.username = ?', $username) + ->query()->fetch(); + } +} \ No newline at end of file Added: website/application/modules/acm/models/Table/UsersDetails.php =================================================================== --- website/application/modules/acm/models/Table/UsersDetails.php (rev 0) +++ website/application/modules/acm/models/Table/UsersDetails.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,7 @@ +<?php + +class Table_UsersDetails extends Ostacium_Db_Table +{ + protected $_name = 'usersdetails'; + protected $_primaty = 'username'; +} \ No newline at end of file Added: website/application/modules/acm/models/Table/UsersStats.php =================================================================== --- website/application/modules/acm/models/Table/UsersStats.php (rev 0) +++ website/application/modules/acm/models/Table/UsersStats.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,7 @@ +<?php + +class Table_UsersStats extends Ostacium_Db_Table +{ + protected $_name = 'usersstats'; + protected $_primaty = 'username'; +} \ No newline at end of file Modified: website/application/modules/acm/models/Tester.php =================================================================== --- website/application/modules/acm/models/Tester.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/Tester.php 2009-01-31 20:38:09 UTC (rev 465) @@ -4,24 +4,35 @@ { public function getSubmits() { - $submits = new Submits(); + $submits = new Table_Submits(); return $submits->getUntested(); } public function updateSubmit($id, $data) { - $submits = new Submits(); - return $submits->update($data, $this->_db->quoteInto('id = ? AND state = 0', $id)); + $submits = new Table_Submits(); + $submit = $submits->getNotAccepted($id); + + if ($submit['state'] != 0) + return false; + + $submit = $data + $submit; + $submits->update($data, $this->_db->quoteInto('id = ? AND state = 0', $id)); + + if ($submit['aced'] == 1) + return false; + + if ($submit['contestid'] != 0) + { + $contest = new Contest(new Calc_ACM()); + $contest->updateResults($submit); + } + else + { + $archive = new Archive(); + $archive->updateResults($submit); + } + + return true; } -} - -class Submits extends Ostacium_Db_Table -{ - protected $_name = 'archieve_submits'; - protected $_primary = 'id'; - - public function getUntested() - { - return $this->select()->from($this)->setIntegrityCheck(false)->joinLeft('code_languages', 'code_languages.id = archieve_submits.codelangid', array('codelang' => 'name'))->where('state = 0')->order('id ASC')->query()->fetchAll(); - } } \ No newline at end of file Modified: website/application/modules/acm/models/User.php =================================================================== --- website/application/modules/acm/models/User.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/application/modules/acm/models/User.php 2009-01-31 20:38:09 UTC (rev 465) @@ -10,13 +10,13 @@ $data['activated'] = $code; $data['password'] = md5($data['password']); - $users = new Users(); + $users = new Table_Users(); $users->insert($data); - $usersdetails = new UsersDetails(); + $usersdetails = new Table_UsersDetails(); $usersdetails->insert($data); - $usersstats = new UsersStats(); + $usersstats = new Table_UsersStats(); $usersstats->insert($data); return true; @@ -27,25 +27,13 @@ $where = $this->_db->quoteInto('username = ?', $username).' AND activated = ?'; $where = $this->_db->quoteInto($where, $code); - $users = new Users(); + $users = new Table_Users(); return $users->update(array('activated' => null), $where); } -} - -class Users extends Ostacium_Db_Table -{ - protected $_name = 'users'; - protected $_primaty = 'username'; -} - -class UsersDetails extends Ostacium_Db_Table -{ - protected $_name = 'usersdetails'; - protected $_primaty = 'username'; -} - -class UsersStats extends Ostacium_Db_Table -{ - protected $_name = 'usersstats'; - protected $_primaty = 'username'; + + public function getUser($username) + { + $users = new Table_Users(); + return $users->getUser($username); + } } \ No newline at end of file Property changes on: website/application/modules/admin/controllers ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/admin/controllers/IndexController.php =================================================================== --- website/application/modules/admin/controllers/IndexController.php (rev 0) +++ website/application/modules/admin/controllers/IndexController.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,10 @@ +<?php + +class Admin_IndexController extends Ostacium_Controller_Action +{ + public function indexAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + echo "WORKED!"; + } +} \ No newline at end of file Added: website/application/modules/admin/controllers/SettingsController.php =================================================================== --- website/application/modules/admin/controllers/SettingsController.php (rev 0) +++ website/application/modules/admin/controllers/SettingsController.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,18 @@ +<?php + +class Admin_SettingsController extends Ostacium_Controller_Action_Crud +{ + protected function _load() + { + $this->_list = array( + 'name' => array('label' => 'name', 'sort' => true, 'helper' => false, 'align' => 'center'), + 'value' => array('label' => 'value', 'sort' => true, 'helper' => false, 'align' => 'center') + ); + + /*$this->_reference = array( + array('tablename', 'tablename.field = thisname.field', array('field1', 'field2')) + );*/ + + $this->_sort = array('name' => 'ASC'); + } +} \ No newline at end of file Property changes on: website/application/modules/admin/models ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: website/application/modules/admin/models/Form ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/admin/models/Form/Settings.php =================================================================== --- website/application/modules/admin/models/Form/Settings.php (rev 0) +++ website/application/modules/admin/models/Form/Settings.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,56 @@ +<?php + +class Form_Settings extends Ostacium_Dojo_Form_Crud +{ + protected function fillNewFields() + { + $this->addElement('ValidationTextBox', 'name', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(5, 30)), + ), + 'required' => true, + 'maxlength' => 50, + 'trim' => true, + 'lowercase' => true, + 'regExp' => '[\w]{5,50}', + 'invalidMessage' => sprintf($this->_translate->_('wordErrorBetween'), 5, 30), + 'title' => 'Name', + 'label' => 'Name:', + )); + + $this->addElement('ValidationTextBox', 'value', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim'), + 'validators' => array( + 'Alnum', + array('StringLength', false, array(0, 200)), + ), + 'required' => true, + 'trim' => true, + 'regExp' => '.{0,200}', + 'invalidMessage' => sprintf($this->_translate->_('errorBetween'), 0, 200), + 'title' => 'Value', + 'label' => 'Value:', + )); + } + + protected function fillEditFields() + { + $this->addElement('ValidationTextBox', 'value', array( + 'decorators' => $this->elementDecorators, + 'filters' => array('StringTrim'), + 'validators' => array( + 'Alnum', + array('StringLength', false, array(0, 200)), + ), + 'required' => true, + 'trim' => true, + 'regExp' => '.{0,200}', + 'invalidMessage' => sprintf($this->_translate->_('errorBetween'), 0, 200), + 'title' => 'Value', + 'label' => 'Value:', + )); + } +} \ No newline at end of file Property changes on: website/application/modules/admin/models/Table ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/admin/models/Table/Settings.php =================================================================== --- website/application/modules/admin/models/Table/Settings.php (rev 0) +++ website/application/modules/admin/models/Table/Settings.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,6 @@ +<?php + +class Table_Settings extends Ostacium_Db_Table_Crud +{ + protected $_name = 'settings'; +} \ No newline at end of file Modified: website/library/Application.php =================================================================== --- website/library/Application.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/library/Application.php 2009-01-31 20:38:09 UTC (rev 465) @@ -92,6 +92,10 @@ // Setup Helpers Ostacium_View_Helper_Truncate::setDefault($_config->truncate->toArray()); Ostacium_View_Helper_listTable::setDefaultAttribs($_config->listtable->toArray()); + Zend_View_Helper_PaginationControl::setDefaultViewPartial($_config->paginator->file); + + // Paginator + Zend_Paginator::setDefaultScrollingStyle($_config->paginator->style); // Setup Log $this->_setupLog(); Modified: website/library/Ostacium/Acl.php =================================================================== --- website/library/Ostacium/Acl.php 2009-01-31 18:14:16 UTC (rev 464) +++ website/library/Ostacium/Acl.php 2009-01-31 20:38:09 UTC (rev 465) @@ -2,9 +2,9 @@ class Ostacium_Acl extends Zend_Acl { - protected $_resources; - protected $_roles; - protected $_rolesxresources; + protected $resources; + protected $roles; + protected $rolesxresources; protected $_idtorole; @@ -34,7 +34,7 @@ $this->addRole($r); } - $roles[$role['id']] = $role['name'] == '*' ? null : $role['name']; + $roles[$role['id']] = ($role['name'] == '*' ? null : $role['name']); $this->_idtorole[(int)$role['id']] = $role['name']; } @@ -67,5 +67,4 @@ { return (isset($this->_idtorole[$id]) ? $this->_idtorole[$id] : 'guest' ); } - } \ No newline at end of file Property changes on: website/library/Ostacium/Controller/Action ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/library/Ostacium/Controller/Action/Crud.php =================================================================== --- website/library/Ostacium/Controller/Action/Crud.php (rev 0) +++ website/library/Ostacium/Controller/Action/Crud.php 2009-01-31 20:38:09 UTC (rev 465) @@ -0,0 +1,235 @@ +<?php + +abstract class Ostacium_Controller_Action_Crud extends Ostacium_Controller_Action +{ + protected $_table; + protected $_form; + + protected $_list = array(); + protected $_reference = array(); + protected $_sort = array(); + protected $_actions = array('edit' => 'edit', 'delete' => array('set', array('field' => 'delete', 'value' => 1))); + protected $_multiactions = array('deleteSelected' => 'delete'); + protected $_newaction = true; + + public function init() + { + parent::init(false); + + $name = ucfirst($this->getRequest()->getControllerName()); + + $this->_helper->getHelper('viewRenderer')->setNoController(true); + $scriptPath = $this->_helper->getHelper('viewRenderer')->getModuleDirectory() . '/views/scripts/crud'; + $this->view->addScriptPath($scriptPath); + + $table = 'Table_' . $name; + $form = 'Form_' . $name; + + $this->_table = new $table(); + $this->_form = new $form(); + + $this->_load(); + } + + protected function _load() {} + + protected function getSinglePrimaryKeys() + { + $primaries = (array)$this->_table->getPrimaryKeys(); + $values = array(); + + foreach ($primaries as $primary) + { + $values[$primary] = $this->_getParam($primary); + + $this->_setParam($primary, null); + if ($values[$primary] === null) return false; + } + + return array($values); + } + + protected function getMultiPrimaryKeys() + { + $post = $this->getRequest()->getPost(); + $primaries = (array)$this->_table->getPrimaryKeys(); + $primary = implode('-', $primaries); + $values = array(); + + $this->_setParam($primary, null); + + foreach ($post[$primary] as $key => $value) + { + $value = explode('-', $value); + + foreach ($primaries as $primary) + { + $values[$key][$primary] = array_shift($value); + + if ($values[$key][$primary] === null) return false; + } + } + + return $values; + } + + protected function getPrimaryKeys() + { + if ($this->getRequest()->isPost()) + { + if ($this->getRequest()->getParam('multiaction', null)) + { + $ids = $this->getMultiPrimaryKeys(); + } + else + return false; + } + else + { + $ids = $this->getSinglePrimaryKeys(); + } + } + + /************************************************************************************/ + + public function indexAction() + { + return $this->_forward('list', null, null, $this->_getAllParams()); + } + + public function listAction() + { + $sort = array($this->_getParam('sort') => $this->_getParam('by')); + if (!$sort) $sort = $this->_sort; + + $data = $this->_table->getData(array_keys($this->_list), $this->_reference, $sort); + + $paginator = Zend_Paginator::factory($data->toArray()); + $paginator->setItemCountPerPage($this->_config->crud->perpage); + $paginator->setCurrentPageNumber($this->_getParam('page')); + + $this->view->paginator = $paginator; + $this->view->sort = $sort; + $this->view->headers = $this->_list; + $this->view->actions = $this->_actions; + $this->view->multiactions = $this->_multiactions; + $this->view->newaction = $this->_newaction; + $this->view->primary = $this->_table->getPrimaryKeys(); + } + + public function newAction() + { + $this->_form->fillFields('new'); + + echo $this->_form; + } + + public function addAction() + { + $this->_form->fillFields('new'); + + if (!$this->getRequest()->isPost()) + { + return $this->_forward('new', null, null, $this->_getAllParams()); + } + + if ($this->_form->isValid($this->getRequest()->getPost())) + { + echo $this->_form; + + return; + } + + $values = $this->_form->getValues(); + $result = $this->_model->addData($values); + + if (!$result) + { + $this->_form->setDescription($this->_('crudAddError')); + echo $form; + + return; + } + else + { + return $this->_redirect($this->view->url(array('action' => 'list', 'message' => 'crudAddSuccess'))); + } + } + + public function editAction() + { + $this->_form->fillFields('edit'); + + echo $this->_form; + } + + public function updateAction() + { + $this->_form->fillFields('edit'); + $ids = $this->getSinglePrimaryKeys(); + + if (!$this->getRequest()->isPost()) + { + return $this->_forward('edit', null, null, $this->_getAllParams()); + } + + if ($this->_form->isValid($this->getRequest()->getPost())) + { + echo $this->_form; + + return; + } + + $values = $this->_form->getValues(); + $result = $this->_model->updateData($values, $ids); + + if (!$result) + { + $this->_form->setDescription($this->_('crudEditError')); + echo $form; + + return; + } + else + { + return $this->_redirect($this->view->url(array('action' => 'list', 'message' => 'crudEditSuccess'))); + } + } + + public function deleteAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $ids = $this->getPrimaryKeys(); + + if (!$ids) + return $this->_forward('list', null, null, $this->_getAllParams()); + + $result = $this->_table->deleteData($ids); + + if (!$result) + $msg = $translate->_('crudDeleteError'); + else + $msg = sprintf($translate->_('deletedOverall'), $result, count($ids)); + + return $this->_redirect($this->view->url(array('action' => 'list', 'message' => $msg))); + } + + public function setAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $ids = $this->getPrimaryKeys(); + +... [truncated message content] |
From: <pan...@us...> - 2009-01-31 18:14:19
|
Revision: 464 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=464&view=rev Author: panzaboi Date: 2009-01-31 18:14:16 +0000 (Sat, 31 Jan 2009) Log Message: ----------- 1) New layout 2) Spell error corrected - archieve to archive 3) Updated language files 4) Removed unneeded Ostacium library files (DB_Field, DB_Table_Rowset) 5) Added Prettify to highlight C++ Code 6) Added configurations to config.ini 7) Added Admin Modified Paths: -------------- website/application/layouts/layout.phtml website/application/modules/acm/views/scripts/contest/index.phtml website/application/modules/acm/views/scripts/contest/results.phtml website/application/modules/acm/views/scripts/index/index.phtml website/application/modules/acm/views/scripts/tester/entry.phtml website/config/config.ini website/httpdocs/scripts/main.js website/httpdocs/styles/style.css website/lang/en.csv website/lang/uk.csv Added Paths: ----------- website/application/layouts/old_layout.phtml website/application/modules/acm/controllers/ArchiveController.php website/application/modules/acm/models/Archive.php website/application/modules/acm/views/scripts/contest/notincontest.phtml website/application/modules/acm/views/scripts/logedin.phtml website/application/modules/acm/views/scripts/paginator.phtml website/application/modules/acm/views/scripts/user/view.phtml website/application/modules/admin/ website/application/modules/admin/views/ website/application/modules/admin/views/helpers/ website/application/modules/admin/views/scripts/ website/application/modules/admin/views/scripts/crud/ website/application/modules/admin/views/scripts/crud/list.phtml website/application/modules/admin/views/scripts/paginator.phtml website/httpdocs/images/acm/ website/httpdocs/images/acm/status.png website/httpdocs/images/acm/submit.png website/httpdocs/images/box_header.jpg website/httpdocs/images/header_bg.gif website/httpdocs/images/leftmenu.gif website/httpdocs/images/leftmenu_bg.jpg website/httpdocs/images/logo.png website/httpdocs/images/noavatar.png website/httpdocs/images/topmenu_bg.gif website/httpdocs/scripts/prettify.js website/httpdocs/styles/prettify.css website/httpdocs/styles/style_.css Removed Paths: ------------- website/application/modules/acm/controllers/ArchieveController.php website/httpdocs/images/0.gif website/httpdocs/images/arrow.gif website/httpdocs/images/arrow2.gif website/httpdocs/images/b_find.gif website/httpdocs/images/bg_menu.gif website/httpdocs/images/blok.png website/httpdocs/images/del.png website/httpdocs/images/disable.png website/httpdocs/images/enable.png website/httpdocs/images/fromarhive.jpg website/httpdocs/images/hide.jpg website/httpdocs/images/logo.gif website/httpdocs/images/logod.gif website/httpdocs/images/mail.jpg website/httpdocs/images/menu.gif website/httpdocs/images/menu_.gif website/httpdocs/images/pic1.jpg website/httpdocs/images/pixel.gif website/httpdocs/images/probstatus.png website/httpdocs/images/props.png website/httpdocs/images/reset.png website/httpdocs/images/rpic.gif website/httpdocs/images/show.jpg website/httpdocs/images/toarhive.jpg website/httpdocs/images/trash.gif website/httpdocs/images/unblok.png website/httpdocs/images/view.png website/httpdocs/images/visible.jpg website/httpdocs/styles/ie6.css website/library/Ostacium/Db/Field.php website/library/Ostacium/Db/Table/Rowset.php Property Changed: ---------------- website/httpdocs/images/ Modified: website/application/layouts/layout.phtml =================================================================== --- website/application/layouts/layout.phtml 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/layouts/layout.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -1,87 +1,135 @@ -<?= $this->doctype() ?> -<? $this->dojo()->enable() - ->setDjConfigOption('parseOnLoad', true) - ->registerModulePath('custom', '../custom/') - ->requireModule('dijit.form.FilteringSelect') ?> -<html> - <head> - <base href="<?= 'http://' . $_SERVER["HTTP_HOST"] . $this->baseUrl() ?>/" /> - <?= $this->headTitle($this->placeholder('title')->toString()) ?> - <?= $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8') ?> - - <?= $this->headLink()->appendStylesheet('styles/style.css') ?> - <?= /*$this->headLink()->appendStylesheet('styles/ie6.css', 'screen', 'IE 6')*/'' ?> - <?= /*$this->headLink()->appendStylesheet('styles/ie7.css', 'screen', 'IE 7')*/'' ?> - <?= $this->headScript()->appendFile('/scripts/main.js') ?> - - <? if ($this->dojo()->isEnabled()): - $this->dojo()->setLocalPath('/scripts/dojo/dojo.js') - ->addStyleSheetModule('dijit.themes.tundra'); - - echo $this->dojo(); - endif; ?> - </head> - <body class="tundra"> - <table border="0" cellpadding="0" cellspacing="0" width="100%"> - <tr bgcolor="#122a5b"> - <td><img height="43" src="images/logo.gif" width="490"></td> - </tr> - <tr bgcolor="#e1e1e1"> - <td><img height=26 src="images/logod.gif" width="490"></td> - </tr> - <tr> - <td bgcolor=#122a5b colspan=2><img height=2 src="images/0.gif" width=1></td> - </tr> - </table> - <table border=0 cellpadding=0 cellspacing=0 width="100%" summary="" height="20%"> - <tr> - <td bgcolor=#e1e1e1 valign=top width="200"> - <table width="100%" border="0" cellpadding="0" cellspacing="5"> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/about">Що це за проект</a></td></tr> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/rule">Правила</a></td></tr> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archieve/index">Набір завдань</a></td></tr> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archieve/submit">Протестувати Розв'язок</a></td></tr> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archieve/results">Результати Тестувань</a></td></tr> - <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archieve/ranks">Рейтинг Учасників</a></td></tr> - <tr><td><hr></td></tr> - </table> - - <table border=0 cellpadding=4 cellspacing=0 width="100%" summary=""> - <tr><td align=middle bgcolor=#122a5b><font color=#d4d0e2><b><small>вхід</small></b></font></td></tr> - <tr><td> - <form onsubmit="return checkform(this);" method="post" action="login.php?rid=45fed5d9b297f" style="margin:0"> - <input type="hidden" name="path" value="/"> - <table border=0 cellPadding=1 cellSpacing=0 summary="" width=100%> - <tr> - <td class=name nowrap><small><font color=#122a5b> логін:</font></small></td> - <td><input name=lgn style="height: 18px; width: 100px"></td> - <td> </td> - </tr> - <tr> - <td class=name nowrap><small><font color=#122a5b> пароль:</font></small></td> - <td><input name=pswd type=password style="height: 18px; width: 100px"></td> - <td><input name="login" src="images/b_find.gif" type="image"> - </tr> - </table> - </form> - -<CENTER><A href="register.php">Зареєструватись</a><BR><a href=createteam.php>Створити команду</a></CENTER> -</TABLE><TABLE border=0 cellPadding=4 cellSpacing=0 width="100%"> -<TR><TD align=middle bgColor=#122a5b> -<FONT color=#d4d0e2><B><SMALL>F.A.Q.</SMALL></B></FONT> -<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD><P>Мені здається що програма написана правильно, але система видає "Помилка під час виконання"... -<P>Якщо Ви використовуєте С++, і описали функцію void main(){...} - навіть якщо програма видасть -правильний результат, то система видасть "помилка під час виконання". Це пов'язано з тим, що -в такому випадку код завершення програми непердбачуваний, і практично ніколи небуває нульовим. -<BR>Для того, щоб програму Вам зарахувало (якщо все правильно), необхідно описувати основну -функцію як int main(){...} і обов'язково завершувати програму через return 0. -<TR><TD align=right><P><SMALL><A href="allfaq.php">[ Всі питання ]</p></SMALL></TABLE><TR><TD align=middle bgColor=#122a5b> -<FONT color=#d4d0e2> </FONT> -<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD align=center> - -</TABLE></TABLE><TD bgColor=#f4f3f8 vAlign=top height=100%><?= $this->placeholder('message') ?><br /><?= $this->layout()->content ?></table></table> -<TABLE> -<TR vAlign=Bottom><TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" summary=""><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1><TR bgColor=#122a5b><TD class=copyright>© 2004-2005, <a class=copyrightlink href="mailto: ac...@ia..."><B><FONT COLOR="#d1d1d1">A-S</FONT>tudio</B></A><TD align=middle><TD align=right class=copyright><A class=copyrightlink href="http://www.acm.lviv.ua">ACM Контестер</A><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1></TABLE> - <?= $this->debugInfo(true) ?> - </body> +<?php +$loggedin = Zend_Auth::getInstance()->getIdentity(); + +if ($loggedin) +{ + $form = $this->partial('logedin.phtml'); +} +elseif (!$this->dojo()->hasDijit('loginform')) +{ + $form = (new Form_SmallLogin()); + $form = $form->render(); +} +else $form = ''; +?> + +<?= $this->doctype() ?> +<? $this->dojo()->enable() + ->setDjConfigOption('parseOnLoad', true) + ->registerModulePath('custom', '../custom/') + ->requireModule('dijit.form.FilteringSelect') + ->addOnLoad('init'); +?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta name="description" content="Site description" /> + <meta name="keywords" content="key, words" /> + + <?= $this->headTitle($this->placeholder('title')->toString()) ?> + <?= $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8') ?> + <?= $this->headLink()->appendStylesheet('/styles/style.css') ?> + <?= $this->headLink()->appendStylesheet('/styles/prettify.css') ?> + <?= $this->headScript()->appendFile('/scripts/main.js') ?> + <?= $this->headScript()->appendFile('/scripts/prettify.js') ?> + + <? + if ($this->dojo()->isEnabled()): + $this->dojo()->setLocalPath('/scripts/dojo/dojo.js') + ->addStyleSheetModule('dijit.themes.tundra'); + + echo $this->dojo(); + endif; + ?> + + <base href="<?= 'http://' . $_SERVER["HTTP_HOST"] . $this->baseUrl() ?>/" /> +</head> + +<body class="tundra"> + <div id="wrapper"> + <div id="header"> + <a href="<?= $this->url(array('module' => 'acm'), null, true) ?>"><img src="images/logo.png" id="logo" /></a> + + <div id="topmenu"> + <ul> + <li><a href="#" class="current">home</a></li> + <li><a href="#">news</a></li> + <li><a href="#">forum</a></li> + <li><a href="#">links</a></li> + <li><a href="#">search</a></li> + <li><a href="#">contacts</a></li> + </ul> + </div> + </div> + + <div id="container"> + <div id="right"> + <div id="content"> + <?= ($this->placeholder('message') ? $this->placeholder('message') : '') ?> + <?= $this->layout()->content ?> + </div> + </div> + + <div id="left"> + <ul id="nav"> + <li> + <a href="#" onclick="return toggle('sub1');">Архів</a> + <ul id="sub1"> + <li><a href="<?= $this->url(array('module' => 'acm', 'controller' => 'archive'), null, true) ?>">Набір Завдань</a></li> + <li><a href="<?= $this->url(array('module' => 'acm', 'controller' => 'archive', 'action' => 'results'), null, true) ?>">Результати</a></li> + </ul> + </li> + <li> + <a href="#Archieve" onclick="return toggle('sub2');">Контести</a> + <ul id="sub2"> + <li><a href="<?= $this->url(array('module' => 'acm', 'controller' => 'contest', 'action' => 'index'), null, true) ?>">Зареєструватись</a></li> + <li><a href="#Problems">Набір Завдань</a></li> + <li><a href="#Results">Результати</a></li> + </ul> + </li> + <li> + <a href="#Archieve" onclick="return toggle('sub3');">Віртуальні Контести</a> + <ul id="sub3"> + <li><a href="#Problems">Створити</a></li> + <li><a href="#Problems">Зареєструватись</a></li> + <li><a href="#Problems">Набір Завдань</a></li> + <li><a href="#Results">Результати</a></li> + </ul> + </li> + <li><a href="#contact">Contact</a></li> + </ul> + + <!--<div class="box2 c"> + <form name="login" action="" method="post" class="form"> + <div class="line"> + <label for="username" class="label">Username:</label> + <input class="text" type="text" name="username" title="Username" value="" tabindex="1" /> + </div> + <div class="line"> + <label for="password" class="label">Password:</label> + <input class="text" type="password" name="password" title="Password" value="" tabindex="2" /> + + <input class="submit2" type="submit" name="submit" value=">" tabindex="3" /> + </div> + </form> + </div>--> + + <?= $form ?> + + <!--<div id="clear"></div>--> + </div> + </div> + + <div id="clear"></div> + + + </div> + + <div id="footer"> + <p> + Copyright 2009 ACM. Designed by <a href="#" rel="external">panza</a>. Valid <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="external">CSS</a> & <a href="http://validator.w3.org/check?uri=referer" rel="external">XHTML</a> + <br /> + <!--<?= $this->debugInfo(true) ?>--> + </p> + </div> +</body> </html> \ No newline at end of file Added: website/application/layouts/old_layout.phtml =================================================================== --- website/application/layouts/old_layout.phtml (rev 0) +++ website/application/layouts/old_layout.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,87 @@ +<?= $this->doctype() ?> +<? $this->dojo()->enable() + ->setDjConfigOption('parseOnLoad', true) + ->registerModulePath('custom', '../custom/') + ->requireModule('dijit.form.FilteringSelect') ?> +<html> + <head> + <base href="<?= 'http://' . $_SERVER["HTTP_HOST"] . $this->baseUrl() ?>/" /> + <?= $this->headTitle($this->placeholder('title')->toString()) ?> + <?= $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8') ?> + + <?= $this->headLink()->appendStylesheet('styles/style.css') ?> + <?= /*$this->headLink()->appendStylesheet('styles/ie6.css', 'screen', 'IE 6')*/'' ?> + <?= /*$this->headLink()->appendStylesheet('styles/ie7.css', 'screen', 'IE 7')*/'' ?> + <?= $this->headScript()->appendFile('/scripts/main.js') ?> + + <? if ($this->dojo()->isEnabled()): + $this->dojo()->setLocalPath('/scripts/dojo/dojo.js') + ->addStyleSheetModule('dijit.themes.tundra'); + + echo $this->dojo(); + endif; ?> + </head> + <body class="tundra"> + <table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tr bgcolor="#122a5b"> + <td><img height="43" src="images/logo.gif" width="490"></td> + </tr> + <tr bgcolor="#e1e1e1"> + <td><img height=26 src="images/logod.gif" width="490"></td> + </tr> + <tr> + <td bgcolor=#122a5b colspan=2><img height=2 src="images/0.gif" width=1></td> + </tr> + </table> + <table border=0 cellpadding=0 cellspacing=0 width="100%" summary="" height="20%"> + <tr> + <td bgcolor=#e1e1e1 valign=top width="200"> + <table width="100%" border="0" cellpadding="0" cellspacing="5"> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/about">Що це за проект</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="index/rule">Правила</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archive/index">Набір завдань</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archive/submit">Протестувати Розв'язок</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archive/results">Результати Тестувань</a></td></tr> + <tr><td><img border="0" src="images/arrow.gif" width="8" height="8" hspace="5"><a href="/acm/archive/ranks">Рейтинг Учасників</a></td></tr> + <tr><td><hr></td></tr> + </table> + + <table border=0 cellpadding=4 cellspacing=0 width="100%" summary=""> + <tr><td align=middle bgcolor=#122a5b><font color=#d4d0e2><b><small>вхід</small></b></font></td></tr> + <tr><td> + <form onsubmit="return checkform(this);" method="post" action="login.php?rid=45fed5d9b297f" style="margin:0"> + <input type="hidden" name="path" value="/"> + <table border=0 cellPadding=1 cellSpacing=0 summary="" width=100%> + <tr> + <td class=name nowrap><small><font color=#122a5b> логін:</font></small></td> + <td><input name=lgn style="height: 18px; width: 100px"></td> + <td> </td> + </tr> + <tr> + <td class=name nowrap><small><font color=#122a5b> пароль:</font></small></td> + <td><input name=pswd type=password style="height: 18px; width: 100px"></td> + <td><input name="login" src="images/b_find.gif" type="image"> + </tr> + </table> + </form> + +<CENTER><A href="register.php">Зареєструватись</a><BR><a href=createteam.php>Створити команду</a></CENTER> +</TABLE><TABLE border=0 cellPadding=4 cellSpacing=0 width="100%"> +<TR><TD align=middle bgColor=#122a5b> +<FONT color=#d4d0e2><B><SMALL>F.A.Q.</SMALL></B></FONT> +<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD><P>Мені здається що програма написана правильно, але система видає "Помилка під час виконання"... +<P>Якщо Ви використовуєте С++, і описали функцію void main(){...} - навіть якщо програма видасть +правильний результат, то система видасть "помилка під час виконання". Це пов'язано з тим, що +в такому випадку код завершення програми непердбачуваний, і практично ніколи небуває нульовим. +<BR>Для того, щоб програму Вам зарахувало (якщо все правильно), необхідно описувати основну +функцію як int main(){...} і обов'язково завершувати програму через return 0. +<TR><TD align=right><P><SMALL><A href="allfaq.php">[ Всі питання ]</p></SMALL></TABLE><TR><TD align=middle bgColor=#122a5b> +<FONT color=#d4d0e2> </FONT> +<TR><TD><TABLE border=0 cellPadding=0 cellSpacing=2 width="100%"><TR><TD align=center> + +</TABLE></TABLE><TD bgColor=#f4f3f8 vAlign=top height=100%><?= $this->placeholder('message') ?><br /><?= $this->layout()->content ?></table></table> +<TABLE> +<TR vAlign=Bottom><TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" summary=""><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1><TR bgColor=#122a5b><TD class=copyright>© 2004-2005, <a class=copyrightlink href="mailto: ac...@ia..."><B><FONT COLOR="#d1d1d1">A-S</FONT>tudio</B></A><TD align=middle><TD align=right class=copyright><A class=copyrightlink href="http://www.acm.lviv.ua">ACM Контестер</A><TR bgColor=#122a5b><TD colSpan=3><IMG alt="" height=5 src="images/pixel.gif" width=1></TABLE> + <?= $this->debugInfo(true) ?> + </body> +</html> \ No newline at end of file Deleted: website/application/modules/acm/controllers/ArchieveController.php =================================================================== --- website/application/modules/acm/controllers/ArchieveController.php 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/modules/acm/controllers/ArchieveController.php 2009-01-31 18:14:16 UTC (rev 464) @@ -1,87 +0,0 @@ -<?php - -class Acm_ArchieveController extends Ostacium_Controller_Action -{ - public function indexAction() - { - $this->view->challenges = $this->_model->getChallenges(); - } - - public function viewAction() - { - $id = $this->_getParam('id'); - $problem = $this->_model->getChallenge($id); - - if (!$problem) - return $this->_forward('index', null, null, $this->_getAllParams() + array('message' => 'noProblem')); - - $this->view->assign($problem); - } - - public function submitAction() - { - $this->_helper->getHelper('viewRenderer')->setNoRender(true); - - $form = new Form_Submit(); - - $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); - - echo $form; - } - - public function uploadAction() - { - $this->_helper->getHelper('viewRenderer')->setNoRender(true); - $form = new Form_Submit(); - - if (!$this->getRequest()->isPost()) - { - return $this->_forward('submit', null, null, $this->_getAllParams()); - } - - if ($_POST['type'] == 0) - { - $form->code->setRequired(true); - } - elseif ($_POST['type'] == 1) - { - $form->codefile->setRequired(true); - } - - $result = $form->isValid($this->getRequest()->getPost()); - $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); - - if ($form->type->getValue() == 0) - { - $form->code->setRequired(false); - } - elseif ($form->type->getValue() == 1) - { - $form->codefile->setRequired(false); - } - - if (!$result) - { - echo $form; - return; - } - - $values = $form->getValues(); - $values += $this->_getAllParams(); - $id = $this->_model->addSubmit($values); - - if ($values['type'] == 0) - { - file_put_contents(Application::getDocRoot().'/other/submits/'.$id, $values['code']); - } - elseif ($values['type'] == 1) - { - rename($form->codefile->getFileName(), Application::getDocRoot().'/other/submits/'.$id); - } - } - - public function resultsAction() - { - $this->view->submits = $this->_model->getSubmits(); - } -} \ No newline at end of file Added: website/application/modules/acm/controllers/ArchiveController.php =================================================================== --- website/application/modules/acm/controllers/ArchiveController.php (rev 0) +++ website/application/modules/acm/controllers/ArchiveController.php 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,126 @@ +<?php + +class Acm_ArchiveController extends Ostacium_Controller_Action +{ + public function indexAction() + { + $challenges = $this->_model->getChallenges(); + $paginator = Zend_Paginator::factory($challenges); + $paginator->setItemCountPerPage($this->_config->table->perpage); + $paginator->setCurrentPageNumber($this->_getParam('page')); + + $this->view->challenges = $paginator; + } + + public function viewAction() + { + $id = $this->_getParam('id'); + $problem = $this->_model->getChallenge($id); + + if (!$problem) + return $this->_forward('index', null, null, $this->_getAllParams() + array('message' => 'noProblem')); + + $this->view->assign($problem); + } + + public function sourceAction() + { + $id = $this->_getParam('id'); + $source = $this->_model->getSubmit($id); + + if (!$source) + return $this->_forward('index', null, null, $this->_getAllParams() + array('message' => 'noProblem')); + + $this->view->assign($source->toArray()); + } + + public function submitAction() + { + //$this->_helper->getHelper('viewRenderer')->setNoRender(true); + + if (!$this->_getParam('id')) + return $this->_redirect($this->view->url(array('action' => 'index'))); + + $form = new Form_Submit(); + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + $this->view->form = $form; + + //echo $form; + } + + public function uploadAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $form = new Form_Submit(); + + if (!$this->getRequest()->isPost()) + { + return $this->_forward('submit', null, null, $this->_getAllParams()); + } + + if ($_POST['type'] == 0) + { + $form->code->setRequired(true); + } + elseif ($_POST['type'] == 1) + { + $form->codefile->setRequired(true); + } + + $result = $form->isValid($this->getRequest()->getPost()); + $this->view->dojo()->addOnLoad('function(){ changeEditor('.$form->type->getValue().'); }'); + + if ($form->type->getValue() == 0) + { + $form->code->setRequired(false); + } + elseif ($form->type->getValue() == 1) + { + $form->codefile->setRequired(false); + } + + if (!$result) + { + echo $form; + return; + } + + $values = $form->getValues(); + $values += $this->_getAllParams(); + $id = $this->_model->addSubmit($values); + + if ($values['type'] == 0) + { + file_put_contents(Application::getDocRoot().'/other/submits/'.$id, $values['code']); + } + elseif ($values['type'] == 1) + { + rename($form->codefile->getFileName(), Application::getDocRoot().'/other/submits/'.$id); + } + } + + public function resultsAction() + { + $submits = $this->_model->getSubmits(); + + $paginator = Zend_Paginator::factory($submits); + $paginator->setItemCountPerPage($this->_config->table->perpage); + $paginator->setCurrentPageNumber($this->_getParam('page')); + + $this->view->submits = $paginator; + } + + public function statusAction() + { + $this->_helper->getHelper('viewRenderer')->setNoRender(true); + $id = $this->_getParam('id'); + + $challenge = $this->_model->getStatus($id); + + if ($challenge) + $challenge = $challenge->toArray(); + + var_dump($challenge); + } +} \ No newline at end of file Added: website/application/modules/acm/models/Archive.php =================================================================== --- website/application/modules/acm/models/Archive.php (rev 0) +++ website/application/modules/acm/models/Archive.php 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,92 @@ +<?php + +class Archive extends Ostacium_Model +{ + public function getChallenges() + { + $challenges = new Table_Challenges(); + return $challenges->getAll(); + } + + public function getSubmit($id) + { + $submits = new Table_Submits(); + return $submits->get($id); + } + + public function getSubmits() + { + $submits = new Table_Submits(); + return $submits->getAll(); + } + + public function getChallenge($id) + { + $challenges = new Table_Challenges(); + return $challenges->get($id); + } + + public function getStatus($id) + { + $username = Zend_Auth::getInstance()->getStorage()->read()->username; + + $archresults = new Table_ArchiveResults(); + return $archresults->get(array($username, $id)); + } + + public function addSubmit($values) + { + $data = array( + 'contestid' => 0, + 'username' => Zend_Auth::getInstance()->getStorage()->read()->username, + 'challengeid' => (int)$values['id'], + 'codelangid' => $values['languageid'], + 'firsttest' => $values['firsttest'], + 'when' => time() + ); + + $submits = new Table_Submits(); + return $submits->insert($data); + } + + public function updateResults($submit) + { + if ($submit['firsttest'] == 1) return; + + $results = new Table_ArchiveResults(); + $result = $results->get(array($submit['username'], $submit['challengeid'])); + + if ($result) + $result = $result->toArray(); + else + $result = array( + 'username' => $submit['username'], + 'challengeid' => $submit['challengeid'], + 'tries' => 0, + 'accepted' => 0 + ); + + if ($result['accepted']) + return false; + + $result['tries']++; + + if ($submit['state'] == 1) + $result['accepted'] = 1; + + if ($result['tries'] > 1) + { + $where = array( + $this->_db->quoteInto('username = ?', $result['username']), + $this->_db->quoteInto('challengeid = ?', $result['challengeid']), + ); + + $results->update($result, $where); + } + else + { + $results->insert($result); + } + + } +} \ No newline at end of file Modified: website/application/modules/acm/views/scripts/contest/index.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/index.phtml 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/modules/acm/views/scripts/contest/index.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -1,10 +1,21 @@ -<table cellspacing="1" cellpadding="8" border="0" width="100%"><tbody><tr><td width="100%" valign="top" class="name"> - -<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td bgcolor="#d0d4de" width="4" class="name"> - -<img height="18" width="4" src="http://web.archive.org/web/20070323032706/http://acm.lviv.ua/"/></td> - -<td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Набiр контестів</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:26 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <table width="60%" cellspacing="0" cellpadding="0" border="0" summary="" align="center"><tbody><tr><td bgcolor="#f4f3f8" align="middle" colspan="14"><b>Архів контестів</b></td></tr><tr bgcolor="#e1e1e1" align="middle"> -<th>Номер</th><th>Назва</th><th>Початок</th><th>Кінець</th><th>Зареєструватись</th></tr> -<?= $this->partialLoop('contest/contest.phtml', $this->contests) ?> -</table><br/></td></tr></table> \ No newline at end of file +<h2><?= $this->translate('contests_list') ?></h2> +<br /> +<table class="table"> + <tr> + <th>Номер</th> + <th>Назва</th> + <th>Початок</th> + <th>Кінець</th> + <th>Зареєструватись</th> + </tr> + <? if (count($this->contests)): ?> + <?= $this->partialLoop('contest/contest.phtml', $this->contests) ?> + <? else: ?> + <tr> + <td colspan="5" class="tc error"><?= $this->translate('no_results') ?></td> + </tr> + <? endif; ?> + <tr> + <td colspan="5" class="footer tc"><?= $this->contests ?></td> + </tr> +</table> \ No newline at end of file Added: website/application/modules/acm/views/scripts/contest/notincontest.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/notincontest.phtml (rev 0) +++ website/application/modules/acm/views/scripts/contest/notincontest.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1 @@ +You are not taking part in this contest \ No newline at end of file Modified: website/application/modules/acm/views/scripts/contest/results.phtml =================================================================== --- website/application/modules/acm/views/scripts/contest/results.phtml 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/modules/acm/views/scripts/contest/results.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -27,7 +27,7 @@ <th>Час/Пам'ять</th> </tr> -<?= $this->partialLoop('archieve/result.phtml', $this->submits) ?> +<?= $this->partialLoop('ontest/result.phtml', $this->submits) ?> </table> </td></tr></table> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/index/index.phtml =================================================================== --- website/application/modules/acm/views/scripts/index/index.phtml 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/modules/acm/views/scripts/index/index.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -1,9 +1 @@ -<table cellspacing="1" cellpadding="8" border="0" width="100%"> -<tbody> - <tr> - <td width="100%" valign="top" class="name"> - <table cellspacing="0" cellpadding="0" border="0" width="100%"> - <tbody> - <tr> - <td bgcolor="#d0d4de" width="4" class="name"> - <img height="18" width="4" src="http://web.archive.org/web/20070323032459/http://acm.lviv.ua/"/></td><td nowrap="" bgcolor="#122a5b" width="*" class="name"> <font color="#d4d0e2"><b><small>Про систему</small></b><small/></font></td><td nowrap="" bgcolor="#122a5b" align="right" class="name"> <font color="#d4d0e2"><b><small> 05:24 23 березня 2007 року </small></b><small/></font></td></tr></tbody></table> <p style="font-size: 20px; font-family: arial; text-align: center;"><b>ACM Contester</b></p><p align="justify" style="font-size: 20px; font-family: arial; text-align: justify;"><font size="3">Ми, команда розробників цієї системи, дуже раді вітати Вас - учасників цієї системи. </font></p><p align="justify" style="font-size: 20px; font-family: arial; text-align: justify;"><font size="3">Тут Ви маєте можливість спробувати свої сили у розв'язанні різних типів задач. Змагайтесь!!!</font></p><p> </p></td></tr></tbody></table> \ No newline at end of file + \ No newline at end of file Added: website/application/modules/acm/views/scripts/logedin.phtml =================================================================== --- website/application/modules/acm/views/scripts/logedin.phtml (rev 0) +++ website/application/modules/acm/views/scripts/logedin.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,4 @@ +<div class="box2 c"> + <h2><?= $this->translate('user_menu') ?></h2> + <a href="<?= $this->url(array('module' => 'acm', 'controller' => 'index', 'action' => 'logout'), null, true) ?>"><?= $this->translate('log_out') ?></a> +</div> \ No newline at end of file Added: website/application/modules/acm/views/scripts/paginator.phtml =================================================================== --- website/application/modules/acm/views/scripts/paginator.phtml (rev 0) +++ website/application/modules/acm/views/scripts/paginator.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,30 @@ +<?php if ($this->pageCount): ?> +<div class="paginationControl"> +<!-- Previous page link --> +<?php if (isset($this->previous)): ?> + <a href="<?= $this->url(array('page' => $this->previous)); ?>"> + < Previous + </a> | +<?php else: ?> + <span class="disabled">< Previous</span> | +<?php endif; ?> + +<!-- Numbered page links --> +<?php foreach ($this->pagesInRange as $page): ?> + <?php if ($page != $this->current): ?> + <a href="<?= $this->url(array('page' => $page)); ?>"><?= $page; ?></a> | + <?php else: ?> + <?= $page; ?> | + <?php endif; ?> +<?php endforeach; ?> + +<!-- Next page link --> +<?php if (isset($this->next)): ?> + <a href="<?= $this->url(array('page' => $this->next)); ?>"> + Next > + </a> +<?php else: ?> + <span class="disabled">Next ></span> +<?php endif; ?> +</div> +<?php endif; ?> \ No newline at end of file Modified: website/application/modules/acm/views/scripts/tester/entry.phtml =================================================================== --- website/application/modules/acm/views/scripts/tester/entry.phtml 2009-01-31 18:11:05 UTC (rev 463) +++ website/application/modules/acm/views/scripts/tester/entry.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -1,6 +1,6 @@ <submit> <id><?= $this->id ?></id> - <sourceCode><?= htmlentities(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?></sourceCode> + <sourceCode><?= htmlspecialchars(file_get_contents(Application::getDocRoot().'/other/submits/'.$this->id)) ?></sourceCode> <language><?= $this->codelangid ?></language> <problem><?= $this->challengeid ?></problem> </submit> \ No newline at end of file Added: website/application/modules/acm/views/scripts/user/view.phtml =================================================================== --- website/application/modules/acm/views/scripts/user/view.phtml (rev 0) +++ website/application/modules/acm/views/scripts/user/view.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,62 @@ +<table class="user c"> + <tr> + <td style="border-right: none;"><?= $this->username ?></td> + <td style="border-left: none;" colspan="2" align="right"><?= $this->translate($this->role) ?></td> + </tr> + <tr> + <td rowspan="7" width="151" valign="top"> + <img src="images/noavatar.png" /> + </td> + <td class="b"><?= $this->translate('firstname') ?></td> + <td><?= $this->name ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('surname') ?></td> + <td><?= $this->surname ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('edu_place') ?></td> + <td><?= ($this->study ? $this->study : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('birthday') ?></td> + <td><?= ($this->birthday ? $this->date($this->birthday, "j F Y") : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('icq_handle') ?></td> + <td><?= ($this->topcoder ? $this->topcoder : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('msn_handle') ?></td> + <td><?= ($this->topcoder ? $this->topcoder : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('skype_handle') ?></td> + <td><?= ($this->skype ? $this->skype : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td rowspan="6"></td> + <td class="b"><?= $this->translate('yahoo_handle') ?></td> + <td><?= ($this->yahoo ? $this->yahoo : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('skype_handle') ?></td> + <td><?= ($this->skype ? $this->skype : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('aim_handle') ?></td> + <td><?= ($this->aim ? $this->aim : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('website') ?></td> + <td><?= ($this->web ? '<a href="'.$this->web.'">'.$this->web.'</a>' : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> + <tr> + <td class="b"><?= $this->translate('timus_handle') ?></td> + <td><?= ($this->timus ? '<a href="http://acm.timus.ru/search.aspx?Str='.$this->timus.'">'.$this->timus.'</a>' : $this->translate('not_specified')) ?></a></td> + </tr> + <tr> + <td class="b"><?= $this->translate('tc_handle') ?></td> + <td><?= ($this->topcoder ? '<a href="http://www.topcoder.com/tc?module=SimpleSearch&ha='.$this->topcoder.'">'.$this->topcoder.'</a>' : '<span class="na">'.$this->translate('not_specified').'</span>') ?></td> + </tr> +</table> \ No newline at end of file Property changes on: website/application/modules/admin ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: website/application/modules/admin/views ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: website/application/modules/admin/views/helpers ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: website/application/modules/admin/views/scripts ___________________________________________________________________ Added: tsvn:logminsize + 5 Property changes on: website/application/modules/admin/views/scripts/crud ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/application/modules/admin/views/scripts/crud/list.phtml =================================================================== --- website/application/modules/admin/views/scripts/crud/list.phtml (rev 0) +++ website/application/modules/admin/views/scripts/crud/list.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,47 @@ +<? if (count($this->paginator)): ?> +<form action="<?= $this->url(array('action' => 'action')) ?>" method="POST" class="crudlistform"> +<table class="crudlisttable" width="60%" border="1" align="center" style="border-collapse: collapse; border: 1px solid #000000;"> +<tr> + <? if (count($this->multiactions)): ?> + <th><?= $this->formCheckbox('selectall', 'all', array('onclick' => 'toggleCheck(this.checked);')) ?></th> + <? endif; ?> + + <? foreach ($this->headers as $name => $options): ?> + <th><?= $options['label'] ?></th> + <? endforeach; ?> + + <? foreach ($this->actions as $name => $action): ?> + <th><?= $this->translate($name) ?></th> + <? endforeach; ?> +</tr> +<? foreach ($this->paginator as $item): ?> +<? +$values = array(); +foreach ($this->primary as $key) { + $values[$key] = $item[$key]; +} +?> +<tr> + <? if (count($this->multiactions)): ?> + <td align="center"><?= $this->formCheckbox(implode('-', array_keys($values)).'[]', implode('-', array_values($values)), array('class' => 'crudlistselect', 'id' => 'cruditems-'.implode('-', array_values($values)))) ?></td> + <? endif; ?> + <? foreach ($this->headers as $name => $options): ?> + <td><?= (isset($options['as']) ? $item[$options['as']] : $item[$name]) ?></td> + <? endforeach; ?> + + <? foreach ($this->actions as $name => $action): ?> + <? if (is_array($action)) $values += $action[1] ?> + <td align="center"><a href="<?= $this->url(array('action' => (is_array($action) ? $action[0] : $action)) + $values) ?>"><?= $this->translate($name) ?></a></td> + <? endforeach; ?> +</tr> +<? endforeach; ?> +</table> +<? if (count($this->multiactions)): ?> + <? foreach ($this->multiactions as $name => $action): ?> + <?= $this->formSubmit('multiaction', $name, array('onclick' => 'setAction("crudlistform", "'.$action.'");')) ?> + <? endforeach; ?> +<? endif; ?> +</form> +<? else: ?> +<div>No items to display</div> +<? endif; ?> \ No newline at end of file Added: website/application/modules/admin/views/scripts/paginator.phtml =================================================================== --- website/application/modules/admin/views/scripts/paginator.phtml (rev 0) +++ website/application/modules/admin/views/scripts/paginator.phtml 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,43 @@ +<?php if ($this->pageCount): ?> +<div class="paginationControl"> +<?= $this->firstItemNumber; ?> - <?= $this->lastItemNumber; ?> +of <?= $this->totalItemCount; ?> + +<!-- First page link --> +<?php if (isset($this->previous)): ?> + <a href="<?= $this->url(array('page' => $this->first)); ?>"> + First + </a> | +<?php else: ?> + <span class="disabled">First</span> | +<?php endif; ?> + +<!-- Previous page link --> +<?php if (isset($this->previous)): ?> + <a href="<?= $this->url(array('page' => $this->previous)); ?>"> + < Previous + </a> | +<?php else: ?> + <span class="disabled">< Previous</span> | +<?php endif; ?> + +<!-- Next page link --> +<?php if (isset($this->next)): ?> + <a href="<?= $this->url(array('page' => $this->next)); ?>"> + Next > + </a> | +<?php else: ?> + <span class="disabled">Next ></span> | +<?php endif; ?> + +<!-- Last page link --> +<?php if (isset($this->next)): ?> + <a href="<?= $this->url(array('page' => $this->last)); ?>"> + Last + </a> +<?php else: ?> + <span class="disabled">Last</span> +<?php endif; ?> + +</div> +<?php endif; ?> \ No newline at end of file Modified: website/config/config.ini =================================================================== --- website/config/config.ini 2009-01-31 18:11:05 UTC (rev 463) +++ website/config/config.ini 2009-01-31 18:14:16 UTC (rev 464) @@ -11,13 +11,13 @@ truncate.exact = "0" truncate.considerHtml = "1" -table.perpage = "10" +table.perpage = "25" date.format_type = "php" #auth.noauth.module = "default" auth.noauth.controller = "index" -auth.noauth.action = "index" +auth.noauth.action = "login" auth.noacl.module = "default" auth.noacl.controller = "error" @@ -28,34 +28,34 @@ auth.user = "username" auth.pass = "password" auth.passtreat = "MD5(?) AND activated IS NULL" -auth.referenceMap.0.table = "usersdetails"; -auth.referenceMap.0.reference = "usersdetails.username=users.username"; -auth.referenceMap.0.columns = "*"; -auth.referenceMap.1.table = "roles"; -auth.referenceMap.1.reference = "roles.id=users.roleid"; -auth.referenceMap.1.columns = "roles.name as role"; +auth.referenceMap.0.table = "usersdetails" +auth.referenceMap.0.reference = "usersdetails.username=users.username" +auth.referenceMap.0.columns = "*" +auth.referenceMap.1.table = "roles" +auth.referenceMap.1.reference = "roles.id=users.roleid" +auth.referenceMap.1.columns = "roles.name as role" -lang.languageKey = "language"; -lang.path = "lang/"; -lang.default = "uk"; -lang.langs[] = "uk"; -lang.langs[] = "en"; +lang.languageKey = "language" +lang.path = "lang/" +lang.default = "uk" +lang.langs[] = "uk" +lang.langs[] = "en" -layout.layoutpath = "application/layouts"; -layout.layout = "layout"; -layout.contentKey = "content"; -layout.pluginclass = "Ostacium_Controller_Plugin_Layout"; +layout.layoutpath = "application/layouts" +layout.layout = "layout" +layout.contentKey = "content" +layout.pluginclass = "Ostacium_Controller_Plugin_Layout" -view.encoding = "UTF-8"; -view.helperPathPrefix = "Ostacium_View_Helper"; -view.helperPath = "/library/Ostacium/View/Helper"; +view.encoding = "UTF-8" +view.helperPathPrefix = "Ostacium_View_Helper" +view.helperPath = "/library/Ostacium/View/Helper" -log.table = "log"; -log.columnMap.type = "priorityName"; -log.columnMap.message = "message"; -log.columnMap.username = "username"; -log.columnMap.when = "timestamp"; -log.columnMap.ip = "ip"; +log.table = "log" +log.columnMap.type = "priorityName" +log.columnMap.message = "message" +log.columnMap.username = "username" +log.columnMap.when = "timestamp" +log.columnMap.ip = "ip" email.from = "admin" @@ -70,6 +70,13 @@ general.extention = "html" general.roleid = "2" +paginator.file = "paginator.phtml" +paginator.style = "Sliding" + +crud.perpage = "25" + +calc.acm.penalty = "20" + [development: general] db.adapter = "Mysqli" Property changes on: website/httpdocs/images ___________________________________________________________________ Added: svn:ignore + *.db Deleted: website/httpdocs/images/0.gif =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/acm ___________________________________________________________________ Added: tsvn:logminsize + 5 Added: website/httpdocs/images/acm/status.png =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/acm/status.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: website/httpdocs/images/acm/submit.png =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/acm/submit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/arrow.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/arrow2.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/b_find.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/bg_menu.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/blok.png =================================================================== (Binary files differ) Added: website/httpdocs/images/box_header.jpg =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/box_header.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/del.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/disable.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/enable.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/fromarhive.jpg =================================================================== (Binary files differ) Added: website/httpdocs/images/header_bg.gif =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/header_bg.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/hide.jpg =================================================================== (Binary files differ) Added: website/httpdocs/images/leftmenu.gif =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/leftmenu.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: website/httpdocs/images/leftmenu_bg.jpg =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/leftmenu_bg.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/logo.gif =================================================================== (Binary files differ) Added: website/httpdocs/images/logo.png =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/logo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/logod.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/mail.jpg =================================================================== (Binary files differ) Deleted: website/httpdocs/images/menu.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/menu_.gif =================================================================== (Binary files differ) Added: website/httpdocs/images/noavatar.png =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/noavatar.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/pic1.jpg =================================================================== (Binary files differ) Deleted: website/httpdocs/images/pixel.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/probstatus.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/props.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/reset.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/rpic.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/show.jpg =================================================================== (Binary files differ) Deleted: website/httpdocs/images/toarhive.jpg =================================================================== (Binary files differ) Added: website/httpdocs/images/topmenu_bg.gif =================================================================== (Binary files differ) Property changes on: website/httpdocs/images/topmenu_bg.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: website/httpdocs/images/trash.gif =================================================================== (Binary files differ) Deleted: website/httpdocs/images/unblok.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/view.png =================================================================== (Binary files differ) Deleted: website/httpdocs/images/visible.jpg =================================================================== (Binary files differ) Modified: website/httpdocs/scripts/main.js =================================================================== --- website/httpdocs/scripts/main.js 2009-01-31 18:11:05 UTC (rev 463) +++ website/httpdocs/scripts/main.js 2009-01-31 18:14:16 UTC (rev 464) @@ -16,4 +16,43 @@ return false; } -function checkForm(form){if(form.lgn.value.length<3){alert('Логін повинен мати як мінімум 3 символи!');return false;}} \ No newline at end of file +function toggleCheck(value) +{ + dojo.query(".crudlistform input[type='checkbox'].crudlistselect").attr('checked', value); +} + +function setAction(form, value) +{ + form = dojo.query('.'+form); + action = form.attr('action').toString().replace('action', value); + form.attr('action', action); +} + +function toggle(id) +{ + var el = dojo.byId(id); + + if ( el.className != 'show' ) { + dojo.query("#nav .show").removeClass('show'); + + dojo.addClass(el, 'show'); + } + else { + dojo.removeClass(el, 'show'); + } + + return false; +} + +function goToUrl(url) +{ + document.location = url; + + return false; +} + +function init() +{ + if(typeof prettyPrint == 'function') + prettyPrint(); +} \ No newline at end of file Added: website/httpdocs/scripts/prettify.js =================================================================== --- website/httpdocs/scripts/prettify.js (rev 0) +++ website/httpdocs/scripts/prettify.js 2009-01-31 18:14:16 UTC (rev 464) @@ -0,0 +1,1330 @@ +// Copyright (C) 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +/** + * @fileoverview + * some functions for browser-side pretty printing of code contained in html. + * + * The lexer should work on a number of languages including C and friends, + * Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. + * It works passably on Ruby, PHP and Awk and a decent subset of Perl, but, + * because of commenting conventions, doesn't work on Smalltalk, Lisp-like, or + * CAML-like languages. + * + * If there's a language not mentioned here, then I don't know it, and don't + * know whether it works. If it has a C-like, Bash-like, or XML-like syntax + * then it should work passably. + * + * Usage: + * 1) include this source file in an html page via + * <script type="text/javascript" src="/path/to/prettify.js"></script> + * 2) define style rules. See the example page for examples. + * 3) mark the <pre> and <code> tags in your source with class=prettyprint. + * You can also use the (html deprecated) <xmp> tag, but the pretty printer + * needs to do more substantial DOM manipulations to support that, so some + * css styles may not be preserved. + * That's it. I wanted to keep the API as simple as possible, so there's no + * need to specify which language the code is in. + * + * Change log: + * cbeust, 2006/08/22 + * Java annotations (start with "@") are now captured as literals ("lit") + */ + +// JSLint declarations +/*global console, document, navigator, setTimeout, window */ + +/** + * Split {@code prettyPrint} into multiple timeouts so as not to interfere with + * UI events. + * If set to {@code false}, {@code prettyPrint()} is synchronous. + */ +window['PR_SHOULD_USE_CONTINUATION'] = true; + +/** the number of characters between tab columns */ +window['PR_TAB_WIDTH'] = 8; + +/** Walks the DOM returning a properly escaped version of innerHTML. + * @param {Node} node + * @param {Array.<string>} out output buffer that receives chunks of HTML. + */ +window['PR_normalizedHtml'] + +/** Contains functions for creating and registering new language handlers. + * @type {Object} + */ + = window['PR'] + +/** Pretty print a chunk of code. + * + * @param {string} sourceCodeHtml code as html + * @return {string} code as html, but prettier + */ + = window['prettyPrintOne'] +/** find all the < pre > and < code > tags in the DOM with class=prettyprint + * and prettify them. + * @param {Function} opt_whenDone if specified, called when the last entry + * has been finished. + */ + = window['prettyPrint'] = void 0; + +/** browser detection. @extern */ +window['_pr_isIE6'] = function () { + var isIE6 = navigator && navigator.userAgent && + /\bMSIE 6\./.test(navigator.userAgent); + window['_pr_isIE6'] = function () { return isIE6; }; + return isIE6; +}; + + +(function () { + /** Splits input on space and returns an Object mapping each non-empty part to + * true. + */ + function wordSet(words) { + words = words.split(/ /g); + var set = {}; + for (var i = words.length; --i >= 0;) { + var w = words[i]; + if (w) { set[w] = null; } + } + return set; + } + + // Keyword lists for various languages. + var FLOW_CONTROL_KEYWORDS = + "break continue do else for if return while "; + var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " + + "double enum extern float goto int long register short signed sizeof " + + "static struct switch typedef union unsigned void volatile "; + var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " + + "new operator private protected public this throw true try "; + var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " + + "concept concept_map const_cast constexpr decltype " + + "dynamic_cast explicit export friend inline late_check " + + "mutable namespace nullptr reinterpret_cast static_assert static_cast " + + "template typeid typename typeof using virtual wchar_t where "; + var JAVA_KEYWORDS = COMMON_KEYWORDS + + "boolean byte extends final finally implements import instanceof null " + + "native package strictfp super synchronized throws transient "; + var CSHARP_KEYWORDS = JAVA_KEYWORDS + + "as base by checked decimal delegate descending event " + + "fixed foreach from group implicit in interface internal into is lock " + + "object out override orderby params readonly ref sbyte sealed " + + "stackalloc string select uint ulong unchecked unsafe ushort var "; + var JSCRIPT_KEYWORDS = COMMON_KEYWORDS + + "debugger eval export function get null set undefined var with " + + "Infinity NaN "; + var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " + + "goto if import last local my next no our print package redo require " + + "sub undef unless until use wantarra... [truncated message content] |
From: <pan...@us...> - 2009-01-31 18:11:09
|
Revision: 463 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=463&view=rev Author: panzaboi Date: 2009-01-31 18:11:05 +0000 (Sat, 31 Jan 2009) Log Message: ----------- SpeSpelling mistake "archieve". Removed Paths: ------------- website/application/modules/acm/views/scripts/archieve/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |