Example #1
0
        public static void SetSubjects()
        {
            MultipleChoiceDataSetTableAdapters.SubjectTableAdapter subject = new MultipleChoiceDataSetTableAdapters.SubjectTableAdapter();

            //subject.InsertQueryWithID(13, 7, "HTML");//13
            //subject.InsertQueryWithID(14, 7, "Java");//14
            //subject.InsertQueryWithID(15, 7, "C#");//13
            //subject.InsertQueryWithID(16, 7, "Python");//13
            //subject.InsertQueryWithID(17, 14, "Recursion");//14
            //subject.InsertQueryWithID(18, 13, "CSS");//13
            //subject.InsertQueryWithID(19, 9, "Stars");//9
            //subject.InsertQueryWithID(1, 0, "Root");//1
            //subject.InsertQueryWithID(2, 1, "Technology");//2
            //subject.InsertQueryWithID(3, 1, "Physics");//3
            //subject.InsertQueryWithID(4, 1, "Math");//4
            //subject.InsertQueryWithID(5, 1, "History");//5
            //subject.InsertQueryWithID(6, 1, "Chemistry");//6
            //subject.InsertQueryWithID(7, 2, "Programming");//7
            //subject.InsertQueryWithID(8, 2, "Networking");//8
            //subject.InsertQueryWithID(9, 3, "AstroPhysics");//9
            //subject.InsertQueryWithID(10, 3, "Quantum Physics");//10
            //subject.InsertQueryWithID(11, 4, "Algebra");//11
            //subject.InsertQueryWithID(12, 4, "Geometry");//12

            foreach (MultipleChoiceDataSet.SubjectRow s in subject.GetData())
            {
                Console.WriteLine("Record ID: " + s.Subject_id);
            }
        }
Example #2
0
 private void GetAllQuizes()
 {
     quiz = new List <RetreivedQuiz>();
     MultipleChoiceDataSetTableAdapters.QuizTableAdapter     q    = new MultipleChoiceDataSetTableAdapters.QuizTableAdapter();
     MultipleChoiceDataSetTableAdapters.SubjectTableAdapter  sub  = new MultipleChoiceDataSetTableAdapters.SubjectTableAdapter();
     MultipleChoiceDataSetTableAdapters.QuestionTableAdapter ques = new MultipleChoiceDataSetTableAdapters.QuestionTableAdapter();
     foreach (MultipleChoiceDataSet.QuizRow row in q.GetData())
     {
         quiz.Add(new RetreivedQuiz(row.Quiz_id, row.Title, sub.GetSubjectName(row.Subject_id), (int)ques.countQuestions(row.Quiz_id)));
         Console.WriteLine(quiz.Last <RetreivedQuiz>().ToString());
     }
 }
Example #3
0
        public static TreeNode GetSubjects()
        {
            MultipleChoiceDataSetTableAdapters.SubjectTableAdapter subject = new MultipleChoiceDataSetTableAdapters.SubjectTableAdapter();
            List <MultipleChoiceDataSet.SubjectRow> lrow = new List <MultipleChoiceDataSet.SubjectRow>();

            foreach (var d in subject.GetData())
            {
                lrow.Add(d);
            }
            SubjectStack sub  = new SubjectStack();
            SubjectStack temp = new SubjectStack();

            SortArray(lrow);
            foreach (var d in lrow)
            {
                if (d.Root_id == 0)
                {
                    sub = new SubjectStack(d.Subject_id, d.Root_id, d.S_name);
                }

                else if (d.Root_id == 1)
                {
                    sub.PushStack(new SubjectStack(d.Subject_id, d.Root_id, d.S_name));
                }
                else
                {
                    temp = sub.GetSubWithID(d.Root_id, sub.after);
                    //Console.WriteLine(temp.subId);
                    if (temp != null)
                    {
                        temp.PushStack(new SubjectStack(d.Subject_id, d.Root_id, d.S_name));
                        foreach (SubjectStack test in temp.after)
                        {
                            Console.WriteLine(test.subName);
                        }
                        sub.ReplaceSub(d.Root_id, temp, sub.after);
                    }
                }
            }
            return(SeeThroughStack(sub));
        }
Example #4
0
        private void setUserQuizes()
        {
            ResultQuizControl temp;
            int counter = 0;

            MultipleChoiceDataSetTableAdapters.SubjectTableAdapter subject = new MultipleChoiceDataSetTableAdapters.SubjectTableAdapter();
            foreach (Quiz q in SearchHandler.SearchController.GetQuizByUserID(LoginStatusData.userID))
            {
                temp      = new ResultQuizControl(q);
                temp.Dock = DockStyle.Top;
                if (counter % 2 == 0)
                {
                    temp.SetColor(Color.FromArgb(37, 46, 69));
                }
                counter++;
                temp.SetQuizNumberOfQuestions(q.getQuestions().Count);
                temp.SetQuizTitle(q.GetQuizTitle());
                temp.SetQuizSubject(subject.GetSubjectName(q.GetSubject_id()));
                temp.Click += new EventHandler(ResultQuiz_Click);
                quizPanel.Controls.Add(temp);
            }
        }
Example #5
0
        private void searchTagBtn_Click(object sender, EventArgs e)
        {
            resultsPanel.Controls.Clear();
            List <Quiz>       quizzes = SearchHandler.SearchController.GetQuizDataFromSubject(Convert.ToInt32(selectedTreeNodeID));
            ResultQuizControl temp;

            MultipleChoiceDataSetTableAdapters.SubjectTableAdapter subject = new MultipleChoiceDataSetTableAdapters.SubjectTableAdapter();
            int counter = 0;

            foreach (Quiz q in quizzes)
            {
                temp = new ResultQuizControl(q)
                {
                    Dock = DockStyle.Top
                };
                if (counter % 2 == 0)
                {
                    temp.SetColor(Color.FromArgb(37, 46, 69));
                }
                counter++;
                temp.SetQuizNumberOfQuestions(q.getQuestions().Count);
                temp.SetQuizTitle(q.GetQuizTitle());
                temp.SetQuizSubject(subject.GetSubjectName(q.GetSubject_id()));
                temp.Click += new EventHandler(ResultQuiz_Click);
                resultsPanel.Controls.Add(temp);
                if (counter == 0)
                {
                    Label l = new Label()
                    {
                        Text = "Found 0 Quizes"
                    };
                    l.ForeColor = Color.White;
                    resultsPanel.Controls.Add(l);
                }
            }
        }