Exemplo n.º 1
0
        private void Next_Click(object sender, RoutedEventArgs e)
        {
            quizID = QuizIDTextBox.Text;
            QuizzardClass test = new QuizzardClass(quizID, uName);

            qType = test.Type;
            if (qType == "Identification")
            {
                IdentificationQuizPage QPage = new IdentificationQuizPage(quizID, test, uName);
                QPage.Show();
                this.Close();
                QPage = null;
            }
            else if (qType == "Multiple Choice")
            {
                MultipleChoiceQuizPage QPage = new MultipleChoiceQuizPage(quizID, test, uName);
                QPage.Show();
                this.Close();
                QPage = null;
            }
            else if (qType == "Enumeration")
            {
                EnumerationQuizPage QPage = new EnumerationQuizPage(quizID, test, uName);
                QPage.Show();
                this.Close();
                QPage = null;
            }

            else
            {
                Status.Text = "Quiz Not Found!";
            }
        }
Exemplo n.º 2
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            string quizID;

            quizID = QuizIDTextBox.Text;
            if (QuizIDTextBox.Text != "")
            {
                if (!QuizzardClass.QuizExists(quizID))
                {
                    bool inOrder;
                    inOrder = false;
                    if (ShuffleChk.IsChecked ?? false)
                    {
                        inOrder = true;
                    }
                    mul.QuizID    = quizID;
                    mul.IsInOrder = inOrder;
                    QuizzardClass.AddMultipleChoice(mul, uName);
                    MainMenu Menu = new MainMenu(uName);
                    Menu.Show();
                    this.Close();
                    Menu = null;
                    mul  = null;
                }
                else
                {
                    Status.Text = "ID already exists. Please enter another ID:";
                }
            }
            else
            {
                Status.Text = "Fill in the details.";
            }
        }
Exemplo n.º 3
0
 public IdentificationQuizPage(string ID, QuizzardClass Q, string a)
 {
     InitializeComponent();
     quizID                   = ID;
     uName                    = a;
     test                     = Q;
     qType                    = test.Type;
     Answer.Visibility        = Visibility.Hidden;
     AnswerTextBox.Visibility = Visibility.Hidden;
     Next.Visibility          = Visibility.Hidden;
 }
Exemplo n.º 4
0
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     qID = QuizIDTextBox.Text;
     if (QuizzardClass.DeleteQuiz(uName, qID))
     {
         MessageBox.Show("Quiz Deleted", "Successful!", MessageBoxButton.OK, MessageBoxImage.Information);
     }
     else
     {
         Status.Text = "Quiz Not Found!";
     }
 }
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            string quizID;

            quizID = QuizIDTextBox.Text;
            if (QuizIDTextBox.Text != "")
            {
                if (!QuizzardClass.QuizExists(quizID))
                {
                    bool inOrder, hintEnabled, alternateAnswersEnabled, caseSensitive;
                    inOrder = hintEnabled = alternateAnswersEnabled = caseSensitive = false;
                    if (CaseSenChk.IsChecked ?? false)
                    {
                        caseSensitive = true;
                    }
                    if (HintChk.IsChecked ?? false)
                    {
                        hintEnabled = true;
                    }
                    if (AltAnsChk.IsChecked ?? false)
                    {
                        alternateAnswersEnabled = true;
                    }
                    if (ShuffleChk.IsChecked ?? false)
                    {
                        inOrder = true;
                    }

                    iden.QuizID                    = quizID;
                    iden.IsInOrder                 = inOrder;
                    iden.IsHintEnabled             = hintEnabled;
                    iden.IsAlternateAnswersEnabled = alternateAnswersEnabled;
                    iden.IsCaseSensitive           = caseSensitive;
                    QuizzardClass.AddIdentification(iden, uName);

                    MainMenu Menu = new MainMenu(uName);
                    Menu.Show();
                    this.Close();
                    Menu = null;
                    iden = null;
                }
                else
                {
                    Status.Text = "ID already exists. Please enter another ID:";
                }
            }
            else
            {
                Status.Text = "Fill in the details.";
            }
        }
Exemplo n.º 6
0
        // Login Function

        public void LoginF(ref string username, ref string password)
        {
            if (!QuizzardClass.Login(username, password))
            {
                Status.Foreground    = new SolidColorBrush(Colors.OrangeRed);
                Status.Text          = "Error Signing In.";
                UserTextBox.Text     = "Username";
                PasswordTextBox.Text = "Password";
            }
            else
            {
                MainMenu mainMenu = new MainMenu(username);
                mainMenu.Show();
                this.Close();
                mainMenu = null;
            }
        }
Exemplo n.º 7
0
 //Signup Function
 public void SignUp(ref string un, ref string pw)
 {
     if (!QuizzardClass.SignUp(un, pw))
     {
         Status.Foreground    = new SolidColorBrush(Colors.OrangeRed);
         Status.Text          = "Error Signing Up.";
         UserTextBox.Text     = "Username";
         PasswordTextBox.Text = "Password";
     }
     else
     {
         Status.Foreground    = new SolidColorBrush(Colors.LightGreen);
         Status.Text          = "Successfully Registered!";
         UserTextBox.Text     = "Username";
         PasswordTextBox.Text = "Password";
     }
 }
 public MultipleChoiceQuizPage(string ID, QuizzardClass Q, string a)
 {
     InitializeComponent();
     quizID              = ID;
     uName               = a;
     test                = Q;
     qType               = test.Type;
     A.Visibility        = Visibility.Hidden;
     B.Visibility        = Visibility.Hidden;
     C.Visibility        = Visibility.Hidden;
     D.Visibility        = Visibility.Hidden;
     AText.Visibility    = Visibility.Hidden;
     BText.Visibility    = Visibility.Hidden;
     CText.Visibility    = Visibility.Hidden;
     DText.Visibility    = Visibility.Hidden;
     Next.Visibility     = Visibility.Hidden;
     FinAns.Visibility   = Visibility.Hidden;
     YansText.Visibility = Visibility.Hidden;
 }
Exemplo n.º 9
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            string quizID;

            quizID = QuizIDTextBox.Text;
            if (QuizIDTextBox.Text != "")
            {
                if (!QuizzardClass.QuizExists(quizID))
                {
                    bool inOrder, caseSensitive;
                    inOrder = caseSensitive = false;
                    if (CaseSenChk.IsChecked ?? false)
                    {
                        caseSensitive = true;
                    }
                    if (ShuffleChk.IsChecked ?? false)
                    {
                        inOrder = true;
                    }

                    enu.QuizID          = quizID;
                    enu.IsInOrder       = inOrder;
                    enu.IsCaseSensitive = caseSensitive;

                    QuizzardClass.AddEnumeration(enu, uName);

                    MainMenu Menu = new MainMenu(uName);
                    Menu.Show();
                    this.Close();
                    Menu = null;
                    enu  = null;
                }
                else
                {
                    Status.Text = "ID already exists. Please enter another ID:";
                }
            }
            Status.Text = "Fill in the details.";
        }