示例#1
0
        public QuizForm(Quiz quiz)
        {
            InitializeComponent();

            mQuiz = quiz;

            // Show quiz name in title bar
            this.Text = "Theme Tune Quiz - " + mQuiz.Name;
            //this.WindowState = FormWindowState.Maximized;

            cmbPlayMode.Items.Add("Normal");
            cmbPlayMode.Items.Add("Full");
            cmbPlayMode.Items.Add("Fast (20 secs)");
            cmbPlayMode.Items.Add("SuperFast (5 secs)");
            cmbPlayMode.Items.Add("UltraFast (2 secs)");
            cmbPlayMode.SelectedIndex = 0;

            // Set number of Rounds and start with Round 1
            spnRound.Maximum = mQuiz.Rounds.Count;
            spnRound.Minimum = 1;
            spnRound.Value = 1;

            mShowingAnswers = false;
            lblAnswer.Visible = false;
            lblClose.Visible = false;
            lblSong.Visible = false;
            lblAnswerPoints.Visible = false;
            lblClosePoints.Visible = false;
            lblSongPoints.Visible = false;
            lblAnswerPointsDesc.Visible = true;
            lblClosePointsDesc.Visible = true;
            lblSongPointsDesc.Visible = true;

            RefreshForRound();

            // Automation
            mAutomated = true;
            chkAutomated.Checked = mAutomated;
            //if (automated)
            //	Announcer.PlaySound("intro");
        }
示例#2
0
        private void btnAnswerQuiz_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            //Restore last filename
            if (mLastQuizFilename.Length > 0) {
                dialog.InitialDirectory = Path.GetDirectoryName(mLastQuizFilename);
                dialog.FileName = Path.GetFileName(mLastQuizFilename);
            }

            dialog.Filter = "Quiz Files (*.ttq)|*.ttq";
            if (dialog.ShowDialog() == DialogResult.OK) {
                mLastQuizFilename = dialog.FileName;

                Quiz quiz = new Quiz(mDatabase, dialog.FileName);
                QuizForm form = new QuizForm(quiz);
                form.ShowAnswers = true;

                Hide();
                form.ShowDialog();
                Show();
            }
        }
示例#3
0
        private Quiz GenerateTTQ()
        {
            Quiz quiz = new Quiz();
            quiz.Name = txtQuizName.Text;

            HashSet<Track> alltracks = new HashSet<Track>();

            for (int i = 0; i < 5; i++) {
                NumericUpDown nud = (NumericUpDown)(Controls["spnTracks" + i]);
                if (nud.Value > 0) {
                    //Create a new round instance
                    Round r = new Round();
                    TextBox namebox = (TextBox)Controls["txtRoundName" + i];
                    r.Name = namebox.Text;
                    r.PlayMode = ((ComboBox)Controls["cmbMode" + i]).SelectedIndex;

                    //Call make songs or something using rounds.ToArray
                    List<string> genres = new List<string>();
                    CheckedListBox clbox = (CheckedListBox)Controls["chkRound" + i];
                    foreach (int j in clbox.CheckedIndices)
                        genres.Add(mGenres[j]);

                    r.Tracks.AddRandomTracks(mDatabase, alltracks, genres.ToArray(), Convert.ToInt32(nud.Value), ((CheckBox)Controls["chkTheme" + i]).Checked);

                    foreach (Track t in r.Tracks)
                        alltracks.Add(t);

                    //Add this new round to list
                    quiz.Rounds.Add(r);
                }
            }

            // Increment times played for each song and save database
            foreach (Track t in alltracks)
                t.TimesPlayed++;
            mDatabase.Save();

            return quiz;
        }
 public AnswerSheet(Quiz quiz)
 {
     mQuiz = quiz;
 }