private void btnSubmit_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtAnswer.Text)) { if (MessageBox.Show("You have typed nothing as answer", "confirm submit", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { this.Close(); } else { } } else { onlineuser.RecordUserAnswer(Online_Exam_Answers.GetUserID(), Userquestionid, txtAnswer.Text); //string[] userText; //string[] answers; //int textLength = 0; // userText = txtAnswer.Text.Split('.' , ' ' , ',' , ';'); //answers=Online_Exam_Answers.GetEssayAnswer(Userquestionid).Split(' ' , ',' , ';' , '.'); //if (userText.Length > answers.Length) // { // textLength = userText.Length; // } //else // { // textLength = answers.Length; // } this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public static int getUserScore() { return(Userscore + Convert.ToInt32(Online_Exam_Answers.GetEssayScore())); }