Example #1
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.";
            }
        }
Example #2
0
 public AddMoreQ(string A, string B, string C, string D, string questionM, string cAns, string select, string a, MultipleChoice m)
 {
     InitializeComponent();
     mul = m;
     mul.MultipleChoiceAddItem(questionM, A, B, C, D, cAns);
     selected = select;
     uName    = a;
 }
Example #3
0
        private void MChoiceB_Click(object sender, RoutedEventArgs e)
        {
            MultipleChoice          mul = new MultipleChoice();
            MultipleChoice_Question M   = new MultipleChoice_Question(uName, mul);

            this.Close();
            M.Show();
            M = null;
        }
Example #4
0
 public Quizzard(string quizID, string user)
 {
     type = XMLFileHandling.GetQuizType(quizID);
     if (type == "Identification")
     {
         Identification quiz = new Identification(quizID);
         if (!quiz.IsInOrder)
         {
             quiz.Shuffle();
         }
         questions               = new Queue <string>(quiz.Questions);
         correctAnswers          = new Queue <string>(quiz.CorrectAnswers);
         hints                   = new Queue <string>(quiz.Hints);
         alternateAnswers        = new Queue <List <string> >(quiz.AlternateAnswers);
         maxItems                = quiz.ItemCount();
         itemsLeft               = quiz.ItemCount();
         score                   = 0;
         questionOrdered         = quiz.IsInOrder;
         caseSensitive           = quiz.IsCaseSensitive;
         hintEnabled             = quiz.IsHintEnabled;
         alternateAnswersEnabled = quiz.IsAlternateAnswersEnabled;
         username                = user;
     }
     else if (type == "Multiple Choice")
     {
         MultipleChoice quiz = new MultipleChoice(quizID);
         if (!quiz.IsInOrder)
         {
             quiz.Shuffle();
         }
         questions       = new Queue <string>(quiz.Questions);
         correctAnswers  = new Queue <string>(quiz.CorrectAnswers);
         choices         = new Queue <List <string> >(quiz.Choices);
         maxItems        = quiz.ItemCount();
         itemsLeft       = quiz.ItemCount();
         score           = 0;
         questionOrdered = quiz.IsInOrder;
         username        = user;
     }
 }
Example #5
0
 public MultipleChoice_Final(string a, MultipleChoice m)
 {
     InitializeComponent();
     uName = a;
     mul   = m;
 }