コード例 #1
0
ファイル: Perguntas.cs プロジェクト: FlawlessPT/Quiz
 private void Perguntas_FormClosing(object sender, FormClosingEventArgs e)
 {
     Quiz.CleanFiles();
     Application.Exit();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: SovietNunchuck/Quiz
 static void Main(string[] args)
 {
     Quiz.Question1();
     Quiz.Question2();
     Quiz.Question3();
 }
コード例 #3
0
ファイル: Perguntas.cs プロジェクト: FlawlessPT/Quiz
        private void Resposta4_Click(object sender, EventArgs e)
        {
            Quiz quiz = new Quiz();
            int  id   = quiz.GetIdResposta(Resposta4.Text);

            connection.Open();
            string       query     = "SELECT isCorreta FROM Respostas WHERE IdResposta=" + id;
            OleDbCommand command   = new OleDbCommand(query, connection);
            bool         isCorreta = (bool)command.ExecuteScalar();

            if (isCorreta)
            {
                if (contarPergunta == 3)
                {
                    contarPergunta      = 0;
                    Resposta1.Enabled   = false;
                    Resposta2.Enabled   = false;
                    Resposta3.Enabled   = false;
                    Resposta4.Enabled   = false;
                    Resposta4.BackColor = Color.Green;
                    quiz.Seguinte(true, timer1);
                    Tempo_Label.Text = "-";
                    timer1.Stop();
                    timer2.Start();
                    //ShowScore();
                }
                else
                {
                    Resposta4.BackColor = Color.Green;
                    quiz.Seguinte(true, timer1);
                    Quiz.CarregarRespostas(Resposta1, Resposta2, Resposta3, Resposta4, respostas);
                    mudarPergunta();
                }
            }
            else
            {
                if (contarPergunta == 3)
                {
                    contarPergunta      = 0;
                    Resposta1.Enabled   = false;
                    Resposta2.Enabled   = false;
                    Resposta3.Enabled   = false;
                    Resposta4.Enabled   = false;
                    Resposta4.BackColor = Color.Red;
                    quiz.Seguinte(false, timer1);
                    Tempo_Label.Text = "-";
                    timer1.Stop();
                    timer2.Start();
                    //ShowScore();
                }
                else
                {
                    Resposta4.BackColor = Color.Red;
                    quiz.Seguinte(false, timer1);
                    Quiz.CarregarRespostas(Resposta1, Resposta2, Resposta3, Resposta4, respostas);
                    mudarPergunta();
                }
            }

            connection.Close();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: sloot13/Quiz
        static void Main(string[] args)
        {
            Quiz test = new Quiz();

            test.run();
        }
コード例 #5
0
        // Gets the quiz information for students

        public static (string[], int[], string[], int, string) OpenQuiz(string JSON)
        {
            Quiz quiz = JsonConvert.DeserializeObject <Quiz>(JSON);

            return(quiz.Questions, quiz.QuestionTypes, quiz.Answers, quiz.TimeAllocated, quiz.QuizType);
        }
コード例 #6
0
ファイル: Inicio.cs プロジェクト: FlawlessPT/Quiz
 private void Inicio_Load(object sender, EventArgs e)
 {
     label2.Visible = false;
     Quiz.CleanFiles();
 }
コード例 #7
0
ファイル: Inicio.cs プロジェクト: FlawlessPT/Quiz
 private void Inicio_FormClosing(object sender, FormClosingEventArgs e)
 {
     Quiz.CleanFiles();
 }