Esempio n. 1
0
        private void studentEnter()
        {
            int count = enterQueue.Count;

            for (int i = 0; i < count; i++)
            {
                Student student = enterQueue.Dequeue();
                studentTable.Rows.Add(student.ID, student.Name, "");
                studentList.Add(student);
                chatPanelList.Add(new ChatPanel(customFonts, student.ID, student.Name));
                chatPanelList[chatPanelList.Count - 1].Location = new Point(18, 242);
                chatPanelList[chatPanelList.Count - 1].Visible  = false;
                this.studentListPanel.Controls.Add(this.chatPanelList[chatPanelList.Count - 1]);
                chatPanelList[chatPanelList.Count - 1].SendButton.Click += sendButton_Click_1;
                StudentWebRTCPanel studentWebRTCPanel = new StudentWebRTCPanel(customFonts, student.ID, student.Name, room_id);
                int cnt = studentScreenList.Count;
                studentWebRTCPanel.StatusButton.Click += statusButton_Click_1;
                if (cnt < 6)
                {
                    studentWebRTCPanel.Location = new Point((cnt % 3) * 300, (cnt / 3) * 230);
                }
                else
                {
                    studentWebRTCPanel.Visible = false;
                }
                studentScreenList.Add(studentWebRTCPanel);
                this.webViewPanel.Controls.Add(studentWebRTCPanel);
            }
        }
Esempio n. 2
0
        private void checkDoubtStudent()
        {
            int count = doubtQueue.Count;

            for (int i = 0; i < count; i++)
            {
                Doubt doubt       = doubtQueue.Dequeue();
                int   webRTCIndex = findWebRTCIndex(doubt.Student_id);
                StudentWebRTCPanel studentWebRTCPanel = studentScreenList[webRTCIndex];
                if (doubt.Type.Equals("Audio"))
                {
                    studentScreenList[webRTCIndex].setSoundDoubtColor();
                }
                else if (doubt.Type.Equals("Gaze"))
                {
                    studentScreenList[webRTCIndex].setGazeDoubtColor();
                }
                else if (doubt.Type.Equals("No_Face"))
                {
                    studentScreenList[webRTCIndex].setNoPersonDoubtColor();
                }
                else if (doubt.Type.Equals("SIMILAR"))
                {
                    studentScreenList[webRTCIndex].setDifferentPersonColor();
                }
                else
                {
                    studentScreenList[webRTCIndex].setFaceDoubtColor();
                }
                studentScreenList.RemoveAt(webRTCIndex);
                studentScreenList.Insert(0, studentWebRTCPanel);
            }

            sortWebRTCScreens();
        }
Esempio n. 3
0
        private void statusButton_Click_1(object sender, EventArgs e)
        {
            Button             statusButton       = (Button)sender;
            Panel              infoPanel          = (Panel)statusButton.Parent;
            StudentWebRTCPanel studentWebRTCPanel = (StudentWebRTCPanel)infoPanel.Parent;

            studentWebRTCPanel.IsBaned = !studentWebRTCPanel.IsBaned;
            studentWebRTCPanel.setButtonText();

            (new Thread(new ThreadStart(() =>
            {
                if (studentWebRTCPanel.IsBaned)
                {
                    examController.professorBanStudent(studentWebRTCPanel.Student_id);
                }
                else
                {
                    examController.professorUnBanStudent(studentWebRTCPanel.Student_id);
                }
            }))).Start();
        }