private void Perguntas_FormClosing(object sender, FormClosingEventArgs e) { Quiz.CleanFiles(); Application.Exit(); }
static void Main(string[] args) { Quiz.Question1(); Quiz.Question2(); Quiz.Question3(); }
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(); }
static void Main(string[] args) { Quiz test = new Quiz(); test.run(); }
// 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); }
private void Inicio_Load(object sender, EventArgs e) { label2.Visible = false; Quiz.CleanFiles(); }
private void Inicio_FormClosing(object sender, FormClosingEventArgs e) { Quiz.CleanFiles(); }