//next arrow
        private void NextStudent_Click(object sender, EventArgs e)
        {
            try
            {
                button1.Image        = Properties.Resources.dark_smilly1;   //correct smily changes back
                ThinkingBright.Image = Properties.Resources.dark_thinking1; //incorrect smily changes back
                sleeping.Image       = Properties.Resources.Sleeping_Emoji2;
                String name;
                p = p + 1; // counter variable
                if (p == student.countID("COSC101") - 1)
                {
                    studentList = student.randomizeArray("COSC101");
                    Console.WriteLine("end of queue. Randomizing");
                    p = 0;
                }
                name = student.getStudent("COSC101", studentList[p]);

                //if ID shows name that doesn't exist anymore, goes to next name until pulls ID with legitimate name
                if (name == "null")
                {
                    while (name == "null")
                    {
                        p = p + 1;
                        if (p == student.countID("COSC101"))
                        {
                            p = 0;
                        }

                        name = student.getStudent("COSC101", studentList[p]);
                    }
                }
                //sets textbox in center of screen to student name
                StudentName.Text = name;

                /*queue = p - studentNumber;
                 * textBox1.Text = queue.ToString();
                 */
            }
            catch
            {
                System.Windows.Forms.MessageBox.Show("Pick A Student must be reloaded to complete database.");
            }
        }
Ejemplo n.º 2
0
        private void EditWindow_Load(object sender, EventArgs e)
        {
            ClassName.Text = PickAStudent.classNameSafe;

            Console.WriteLine(PickAStudent.className);
            for (int t = 1; t < student.countID("COSC101"); t++)
            {
                String name = student.getStudent(className, t);
                Console.WriteLine("STUDENT NAME IS " + name);
                String corr   = student.getCorrect(className, t).ToString();
                String incorr = student.getIncorrect(className, t).ToString();
                String none   = student.getMissing(className, t).ToString();

                if (name != "null")
                {
                    //all 3 editable text boxes to be added
                    TextBox Student  = new TextBox();
                    TextBox correct  = new TextBox();
                    TextBox wrong    = new TextBox();
                    TextBox thinking = new TextBox();

                    Student.Text  = name;
                    correct.Text  = corr;
                    wrong.Text    = incorr;
                    thinking.Text = none;

                    Point p = new Point(61, 82 + i);
                    Point d = new Point(369, 82 + i);
                    Point o = new Point(515, 82 + i);
                    Point l = new Point(663, 82 + i);
                    Student.Location  = p;
                    correct.Location  = d;
                    wrong.Location    = o;
                    thinking.Location = l;


                    Size s = new Size(210, 34);
                    Size q = new Size(52, 37);
                    Student.Size  = s;
                    correct.Size  = q;
                    wrong.Size    = q;
                    thinking.Size = q;

                    Student.BringToFront();
                    this.Controls.Add(Student);
                    this.Controls.Add(correct);
                    this.Controls.Add(wrong);
                    this.Controls.Add(thinking);
                }
                else
                {
                    while (name == "null")
                    {
                        t    = t + 1;
                        name = student.getStudent("COSC101", t);
                    }
                }
                i = i + 30;
                t++;
            }
        }