コード例 #1
0
    private void GenerateQuestions()
    {
        questionPool = new Queue <ALUQuestion>();

        ALUQuestion q = new ALUQuestion("0", "0", "00", "and");

        questionPool.Enqueue(q);

        q = new ALUQuestion("0", "1", "10", "subtract");
        questionPool.Enqueue(q);


        q = new ALUQuestion("0", "0", "01", "or");
        questionPool.Enqueue(q);


        q = new ALUQuestion("1", "1", "00", "nor");
        questionPool.Enqueue(q);


        q = new ALUQuestion("0", "0", "10", "add");
        questionPool.Enqueue(q);


        q = new ALUQuestion("0", "1", "11", "slt");
        questionPool.Enqueue(q);

        NextQuestion();
    }
コード例 #2
0
 private void NextQuestion()
 {
     if (questionPool.Count > 0)
     {
         currQuestion = questionPool.Dequeue();
         PrintQuesiton();
     }
     else
     {
         if (questionsRight >= questionThreshold)
         {
             goToNextQuestion = true;
             DifficultySelectManager.CURRENT_SCORE += curr_score;
             correctLabel.text = questionsRight + " questions right out " + (questionsRight + questionsWrong) + "\nPoints Earned: " + curr_score + "\nTotal Points: " + DifficultySelectManager.CURRENT_SCORE;
         }
         else
         {
             redoQuestion      = true;
             correctLabel.text = questionsRight + ". Not enough points to continue, please retake test.";
             curr_score        = 0;
         }
     }
 }