Exemplo n.º 1
0
    protected void FinishQuiz()
    {
        int cCorrectAnswers = m_AirportQuiz.CorrectAnswerCount;
        int score           = Convert.ToInt32((cCorrectAnswers * 100.0) / QuestionCount);

        lblResults.Text = String.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.LocalizedText.AirportGameCompletionStatus, cCorrectAnswers, QuestionCount, score);

        QuizFinished?.Invoke(this, new EventArgs());

        if (score == 100)
        {
            lblSnark.Text = Resources.LocalizedText.AirportGameSnarkPerfect;
        }
        else if (score >= 70)
        {
            lblSnark.Text = Resources.LocalizedText.AirportGameSnark75;
        }
        else if (score >= 50)
        {
            lblSnark.Text = Resources.LocalizedText.AirportGameSnark50;
        }
        else
        {
            lblSnark.Text = Resources.LocalizedText.AirportGameSnarkPoor;
        }

        DataBind(); // needed to make results available to a quiz summary template.

        mvQuiz.SetActiveView(vwResult);
    }
Exemplo n.º 2
0
 public bool CheckIfHaveMoreQuestion(int index)
 {
     if (index >= QuestionList.Count)
     {
         QuizFinished?.Invoke(this, EventArgs.Empty);
         return(false);
     }
     else
     {
         return(true);
     }
 }