Exemplo n.º 1
0
    void Incorrect()
    {
        Intro.text     = "Result:";
        question1.text = "Answer " + buttonPressed + " was";
        question2.text = "incorrect. Try again";
        question3.text = "using the pencil.";
        question4.text = "(Correct answer was " + ButtonAns + ")";

        button1Obj.SetActive(false);
        button2Obj.SetActive(false);
        button3Obj.SetActive(false);
        button4Obj.SetActive(false);
        GradeF.SetActive(true);
        AnswersAndGrade.text = "Grade:";

        lessonStart = 0;
    }
Exemplo n.º 2
0
    void Init()
    {
        Bell.PlaySoundAtTransform("Bell", transform);
        lessonStart          = 1;
        Intro.text           = "Question:";
        AnswersAndGrade.text = "Answers:";
        question1.text       = "";
        question2.text       = "";
        question3.text       = "";
        question4.text       = "";
        Debug.LogFormat("[Module Homework #{0}] -----------------------------------------------------------------------------", moduleId);

        correctLibrary = 0;
        Library        = 0;
        correctIndex   = 0;
        ButtonAns      = 0;

        button1Obj.SetActive(true);
        button2Obj.SetActive(true);
        button3Obj.SetActive(true);
        button4Obj.SetActive(true);
        AnswerText.SetActive(true);
        GradeF.SetActive(false);

        LED1.material.color = new Color32(128, 128, 128, 1);
        LED2.material.color = new Color32(128, 128, 128, 1);
        LED3.material.color = new Color32(128, 128, 128, 1);
        LED4.material.color = new Color32(128, 128, 128, 1);

        correctLibrary = UnityEngine.Random.Range(0, 8);
        if (correctLibrary == 0)
        {
            Library      = 1;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 1)
        {
            Library      = 2;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 2)
        {
            Library      = 3;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 3)
        {
            Library      = 4;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 4)
        {
            Library      = 5;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 5)
        {
            Library      = 6;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 6)
        {
            Library      = 7;
            correctIndex = UnityEngine.Random.Range(0, 4);
        }
        else if (correctLibrary == 7)
        {
            Library      = 8;
            correctIndex = UnityEngine.Random.Range(0, 3);
        }
        //Who's On First
        if (correctIndex == 0 && Library == 1)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Who's on First'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: UHH", moduleId);
            question1.text = "Which of these is not";
            question2.text = "an answer in";
            question3.text = "Who's On First?";
            ButtonAns      = 2;
        }
        //Memory
        else if (correctIndex == 1 && Library == 1)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Memory'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 3: 4", moduleId);
            question1.text = "Which label must";
            question2.text = "be pressed at stage";
            question3.text = "3 when the display";
            question4.text = "is 4 in Memory?";
            ButtonAns      = 3;
        }
        //Morse Code
        else if (correctIndex == 2 && Library == 1)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Morse Code'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 1: 16", moduleId);
            question1.text = "How many inputs are";
            question2.text = "required to send 'Bombs'";
            question3.text = "in Morse Code?";
            ButtonAns      = 1;
        }
        //Complex wires
        else if (correctIndex == 3 && Library == 1)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Complicated Wires'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: ONLY WITH 2+ BATTRIES", moduleId);
            question1.text = "Should a red wire with";
            question2.text = "a LED and a star be";
            question3.text = "cut in Complex Wires?";
            ButtonAns      = 4;
        }
        //The Maze
        else if (correctIndex == 0 && Library == 2)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'The Maze'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: 9", moduleId);
            question1.text = "How many vanilla";
            question2.text = "mazes are there?";
            ButtonAns      = 2;
        }
        //Passwords
        else if (correctIndex == 1 && Library == 2)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Passwords'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 3: M", moduleId);
            question1.text = "Which of the following";
            question2.text = "letters is NOT the start";
            question3.text = "of a vanilla Password?";
            ButtonAns      = 3;
        }
        //Knob
        else if (correctIndex == 2 && Library == 2)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'The Knob'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: 12", moduleId);
            question1.text = "How many LED lights";
            question2.text = "are on a single";
            question3.text = "Knob Module?";
            ButtonAns      = 2;
        }
        //Hexamaze
        else if (correctIndex == 3 && Library == 2)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Hexamaze'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 3: 19", moduleId);
            question1.text = "How many markings";
            question2.text = "are there in";
            question3.text = "the Hexamaze?";
            ButtonAns      = 3;
        }
        //Swan
        else if (correctIndex == 0 && Library == 3)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'The Swan'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 1: 4, 8, 15, 16, 23, 42", moduleId);
            question1.text = "What are the numbers";
            question2.text = "in The Swan?";
            ButtonAns      = 1;
        }
        //Poker
        else if (correctIndex == 1 && Library == 3)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Poker'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: 3 OF CLUBS", moduleId);
            question1.text = "Which of these cards";
            question2.text = "is not a starting";
            question3.text = "card in Poker?";
            ButtonAns      = 4;
        }
        //Turn the keys
        else if (correctIndex == 2 && Library == 3)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Turn The Keys'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 1: TURN THE LEFT KEY", moduleId);
            question1.text = "Which of these actions";
            question2.text = "should not be done";
            question3.text = "before turning the";
            question4.text = "right key in TTKS?";
            ButtonAns      = 1;
        }
        //Two Bits
        else if (correctIndex == 3 && Library == 3)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Two Bits'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: TV", moduleId);
            question1.text = "What character pair";
            question2.text = "belongs to the code";
            question3.text = "'51' in Two Bits?";
            ButtonAns      = 2;
        }
        //Semaphore
        else if (correctIndex == 0 && Library == 4)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Semaphore'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: LETTERS", moduleId);
            question1.text = "What does Left Flag";
            question2.text = "North and Right Flag";
            question3.text = "East mean in";
            question4.text = "Semaphore?";
            ButtonAns      = 2;
        }
        //Souvenir
        else if (correctIndex == 1 && Library == 4)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Souvenir'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: TANGRAMS", moduleId);
            question1.text = "Which of these modules";
            question2.text = "does not have to be";
            question3.text = "remembered for";
            question4.text = "Souvenir?";
            ButtonAns      = 4;
        }
        //Random Number Generator
        else if (correctIndex == 2 && Library == 4)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Random Number Generator'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 1: 45", moduleId);
            question1.text = "If the serial has a";
            question2.text = "vowel and the last nr.";
            question3.text = "is odd, which of these";
            question4.text = "is allowed in RNG?";
            ButtonAns      = 1;
        }
        //Answering Questions
        else if (correctIndex == 3 && Library == 4)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Answering Questions'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: IF YOU HAVE JUST ONE STRIKE", moduleId);
            question1.text = "What does the";
            question2.text = "question 'Strikes?'";
            question3.text = "mean in Answering";
            question4.text = "Questions?";
            ButtonAns      = 2;
        }
        //Button Masher
        else if (correctIndex == 0 && Library == 5)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Button Masher'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: 45", moduleId);
            question1.text = "What is the maximum";
            question2.text = "amount of button mashes";
            question3.text = "in Button Masher?";
            ButtonAns      = 2;
        }
        //Hex To Decimal
        else if (correctIndex == 1 && Library == 5)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Hex To Decimal'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: 66", moduleId);
            question1.text = "What's the desired";
            question2.text = "number for the Hex code";
            question3.text = "'42' in Hex To";
            question4.text = "Decimal?";
            ButtonAns      = 4;
        }
        //QR Code
        else if (correctIndex == 2 && Library == 5)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'QR Code'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: 8", moduleId);
            question1.text = "What's the most digits";
            question2.text = "in a QR code?";
            ButtonAns      = 4;
        }
        //Astrology
        else if (correctIndex == 3 && Library == 5)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Astrology'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 3: A FOUR", moduleId);
            question1.text = "What symbol stands";
            question2.text = "for Jupiter in";
            question3.text = "Astrology?";
            ButtonAns      = 3;
        }
        //Microcontroller
        else if (correctIndex == 0 && Library == 6)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Microcontroller'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 1: INDC", moduleId);
            question1.text = "Which of these is";
            question2.text = "not a controller";
            question3.text = "in Microcontroller?";
            ButtonAns      = 1;
        }
        //Translated Modules
        else if (correctIndex == 1 && Library == 6)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Translated Modules'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: MEMORY", moduleId);
            question1.text = "Which of these is";
            question2.text = "not a Translated";
            question3.text = "Module? (Only from";
            question4.text = "Tharagon's mod)";
            ButtonAns      = 4;
        }
        //Crazy Talk
        else if (correctIndex == 2 && Library == 6)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Crazy Talk'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 3: 8/1", moduleId);
            question1.text = "At what second marks";
            question2.text = "should the lever be";
            question3.text = "pulled for '.PERIOD'";
            question4.text = "in Crazy Talk?";
            ButtonAns      = 3;
        }
        //Ice Cream
        else if (correctIndex == 3 && Library == 6)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Ice Cream'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 4: Cranberry Cream", moduleId);
            question1.text = "Which of these is";
            question2.text = "not a flavor of Ice";
            question3.text = "Cream in... Well...";
            question4.text = "Ice Cream?";
            ButtonAns      = 4;
        }
        //Light Cycle
        else if (correctIndex == 0 && Library == 7)
        {
            Debug.LogFormat("[Module Homework #{0}] The question of this module is 'Light Cycle'", moduleId);
            Debug.LogFormat("[Module Homework #{0}] Its answer would be Answer 2: ORANGE", moduleId);
            question1.text = "What color isn't";
            question2.text = "present in";
            question3.text = "Light Cycle?";
            ButtonAns      = 2;
        }

        //If any of these...
        if (ButtonAns > 0)
        {
            Calculation();
        }
        //If none of these...
        else
        {
            InitNext();
        }
    }