public AppealForm(TestSessionStatistics currentSession) { InitializeComponent(); _currentSession = currentSession; this.Text += String.Format(" - {0} {1} {2}", HtmlStore.GetString(_currentSession.LastName), HtmlStore.GetString(_currentSession.FirstName), HtmlStore.GetString(_currentSession.SecondName)); _questions = StaticServerProvider.TestClient.GetSessionQuestions(_currentSession.TestSessionId); _provider = new AppealProvider(_currentSession, _questions, null); TestingHttpServer.StartServer(_provider); TestingHttpServer.ServerNotStarted.WaitOne(); webBrowser.Navigate(TestingHttpServer.BaseUrl); }
public string GetAppealHtml(int sessionId) { StringBuilder retValue = new StringBuilder(); int[] questIds; questIds = GetSessionQuestions(sessionId); TestSessionStatistics statistics = GetSessionStatistics(sessionId); SystemServerProvider systemProvider = new SystemServerProvider(); AppealProvider provider = new AppealProvider(statistics, questIds, systemProvider); provider.ProviderMode = ProviderMode.WebMode; for (int i = 0; i < provider.QuestCount; i++) { var response = provider.ProcessReuqest(new string[] { }, new Dictionary <string, List <string> >()); retValue.Append(String.Format("<b>Вопрос №{0} ({1})</b>", i + 1, !String.IsNullOrEmpty(provider.CurrentQuestion.Answer) ? (provider.CurrentQuestion.AppealIsRight ? "+" : "–") : "?")); retValue.Append("<table style=\"font-family:verdana,arial,sans-serif;border-right: #7177bb 1px solid; border-top: #7177bb 1px solid; border-left: #7177bb 1px solid;border-bottom: #7177bb 1px solid;\" width=\"100%\"><tr><td>" + Encoding.UTF8.GetString(response.ResponseArr) + "</td></tr></table><br/>"); } return(retValue.ToString()); }