Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            StudentLinqDataContext quest = new StudentLinqDataContext();
            exam exm = new exam();

            exm.ques  = textBox1.Text;
            exm.ans   = ans;
            exm.marks = 1;
            quest.exams.InsertOnSubmit(exm);
            quest.SubmitChanges();
            MessageBox.Show("Question added successfully");
            textBox1.Text = null;
        }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     groupBox1.Show();
     //Random rnd = new Random();
     //int val = rnd.Next(1, 10);
     val++;
     // MessageBox.Show(val.ToString());
     try
     {
         totalmark = totalmark + 1;
         {
             using (StudentLinqDataContext ques = new StudentLinqDataContext())
             {
                 exam xm = ques.exams.Single(quiz => quiz.id == val);
                 label1.Text = (xm.ques);
                 if (xm.ans == answer)
                 {
                     achivedmark = achivedmark + 1;
                 }
                 else
                 {
                     achivedmark = achivedmark + 0;
                 }
                 //  MessageBox.Show(val.ToString());
                 //label1.Show();
                 //  MessageBox.Show("ques "+xm.question);
             }
         }
     }
     catch
     {
         MessageBox.Show("Exam is over your mark is" + achivedmark.ToString() + "out of" + totalmark.ToString());
         this.Dispose();
         //this.Show();
     }
 }
Ejemplo n.º 3
0
 partial void Updateexam(exam instance);
Ejemplo n.º 4
0
 partial void Deleteexam(exam instance);
Ejemplo n.º 5
0
 partial void Insertexam(exam instance);