static void ReceivedQuestionsEvent(object sender, QuestionsFetchedEventArgs e) { QuizParameters questions = e.Parameters; QuizAnswers answers = new QuizAnswers(); answers.answers = new List<string>(); foreach(QuizQuestionRaw question in questions.questions) { answers.answers.Add("test"); } answers.hintsUsed = 0; MarkReceiver markReceiver = new MarkReceiver(serverAddr, port, username, answers); markReceiver.ClientLog += LogEvent; markReceiver.MarkReceived += MarkReceivedEvent; markReceiver.SendAnswersReceiveMark(); }
private void OnConnectComplete(object sender, QuestionsFetchedEventArgs e) { //Hide the form and remove the connection progress label this.Hide(); isConnecting = false; btnConnect.Enabled = true; lblConnectionProgress.Visible = false; txtAddress.Visible = true; lblIPAddress.Visible = true; //Create the form that would display the question to the user frmQuestions questForm = new frmQuestions(e.Parameters); //When the question form will be closed, request it to pass the user's answers back questForm.QuizCompleted += OnQuizCompleted; questForm.FormClosed += OnQuestionFormClose; questForm.Show(); }