Exemplo n.º 1
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            if (scoreTotal == _groupToggle.Count)
            {
                _controlAudio.PlayAudio(1);
                general.CalificarEjercicio(true);
            }
            else
            {
                _controlAudio.PlayAudio(2);
                general.CalificarEjercicio(false);
            }
        }

        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                general.CalificarEjercicio(true);
            }
            else
            {
                _controlAudio.PlayAudio(2);
                general.CalificarEjercicio(false);
            }
        }


        _controlPuntaje.IncreaseScore(scoreTotal);
        //_controlNavegacion.Forward(2);
    }
Exemplo n.º 2
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                lanzamiento.SetActive(true);
                lanzamiento.GetComponent <Animator>().SetInteger("x", 1);
                r.SetActive(true);
            }
            else
            {
                lanzamiento.SetActive(true);
                lanzamiento.GetComponent <Animator>().SetInteger("x", 2);
                _controlAudio.PlayAudio(2);
                w.SetActive(true);
            }
        }

        _controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);

        _controlPuntaje.IncreaseScore(scoreTotal);
        _controlNavegacion.Forward(2);
    }
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            //_controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                general.NextExcersise(true);
            }
            else
            {
                _controlAudio.PlayAudio(2);
                general.NextExcersise(false);
            }
        }


        _controlPuntaje.IncreaseScore(scoreTotal);
        //_controlNavegacion.Forward(2);
    }
    IEnumerator x()
    {
        yield return(new WaitForSeconds(2f));

        gameObject.SetActive(false);

        if (op)
        {
            if (scoreTotal == 1)
            {
                _controlPuntaje.IncreaseScore();
                isla.Calificar(true);
                //print("wq");
            }
            else
            {
                isla.Calificar(false);
            }
        }
        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlPuntaje.IncreaseScore();
                isla.Calificar(true);
                //print("wqsss");
            }
            else
            {
                isla.Calificar(false);
            }
        }
    }
Exemplo n.º 5
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            if (scoreTotal == _groupToggle.Count)
            {
                _controlAudio.PlayAudio(1);
                elemento.GetComponent <Image>().sprite = elemento.GetComponent <BehaviourSprite>()._right;
            }
            else
            {
                _controlAudio.PlayAudio(2);
                elemento.GetComponent <Image>().sprite = elemento.GetComponent <BehaviourSprite>()._wrong;
            }
        }

        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                elemento.GetComponent <Image>().sprite = elemento.GetComponent <BehaviourSprite>()._right;
            }
            else
            {
                _controlAudio.PlayAudio(2);
                elemento.GetComponent <Image>().sprite = elemento.GetComponent <BehaviourSprite>()._wrong;
            }
        }


        _controlPuntaje.IncreaseScore(scoreTotal);
        //_controlNavegacion.Forward(2);
        StartCoroutine(x());
    }
Exemplo n.º 6
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                if (bee != null)
                {
                    bee.e = true;
                    bee.GetComponent <Animator>().SetBool("x", true);
                }
            }
            else
            {
                _controlAudio.PlayAudio(2);
            }
        }
        //_controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);

        _controlPuntaje.IncreaseScore(scoreTotal);
        _controlNavegacion.Forward(2);
    }
Exemplo n.º 7
0
    void ValidarLines()
    {
        _validar.interactable = false;
        _trash.gameObject.SetActive(false);
        _controlAudio.PlayAudio(0);
        int correct = 0;

        foreach (var line in _lines)
        {
            var x = line.toggle[0].GetComponent <BehaviourDrawToggle>();
            var y = line.toggle[1].GetComponent <BehaviourDrawToggle>();

            if (x._match.Contains(line.toggle[1]) || y._match.Contains(line.toggle[0]))
            {
                switch (_typeCalification)
                {
                case TypeCalification.Onlyline: SetLineAnswer(line.lineRender.GetComponent <LineRenderer>(), true); break;

                case TypeCalification.LineToggles:
                    SetLineAnswer(line.lineRender.GetComponent <LineRenderer>(), true);
                    SetTogglesAnswer(line.toggle, true);
                    break;
                }

                correct++;
            }
            else
            {
                switch (_typeCalification)
                {
                case TypeCalification.Onlyline: SetLineAnswer(line.lineRender.GetComponent <LineRenderer>(), false); break;

                case TypeCalification.LineToggles:
                    SetLineAnswer(line.lineRender.GetComponent <LineRenderer>(), false);
                    SetTogglesAnswer(line.toggle, false);
                    break;
                }
            }
        }

        switch (_typeScoring)
        {
        case TypeScoring.EachLine: _controlPuntaje.IncreaseScore(correct); break;

        case TypeScoring.GroupLine:

            if (correct == _lines.Count)
            {
                _controlPuntaje.IncreaseScore();
            }

            break;
        }

        _controlAudio.PlayAudio(correct == _lines.Count? 1:2);
        _controlNavegacion.Forward(2);
    }
Exemplo n.º 8
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            L4A238_drag temp = answer.Key.GetComponent <L4A238_drag>();

            if (temp)
            {
                temp.enabled = false;

                if (answer.Value)
                {
                    rights++;
                }
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1) ? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                _controlAudio.PlayAudio((rights == _drags.Count) ? 1 : 2);
            }
            else
            {
                //if (rights == _customValidar) {
                //    _controlAudio.PlayAudio(1);
                //    general.NextExcersise();
                //}
                //else {
                //    _controlAudio.PlayAudio(2);
                //    general.NextExcersise();
                //}
            }


            _controlPuntaje.IncreaseScore(rights);
            //_controlNavegacion.Forward(2);
        }
    }
Exemplo n.º 9
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            M4A112_dragA1 temp = answer.Key.GetComponent <M4A112_dragA1>();

            if (temp)
            {
                temp.enabled = false;

                if (answer.Value)
                {
                    rights++;
                }
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1) ? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                _controlAudio.PlayAudio((rights == _drags.Count) ? 1 : 2);
            }
            else
            {
                _controlAudio.PlayAudio((rights == _customValidar) ? 1 : 2);
            }

            _controlPuntaje.IncreaseScore(rights);
            if (rights == _drags.Count)
            {
                napoleon.GetComponent <Image>().sprite = napoleon.GetComponent <BehaviourSprite>()._right;
            }
            else
            {
                napoleon.GetComponent <Image>().sprite = napoleon.GetComponent <BehaviourSprite>()._wrong;
            }
            _controlNavegacion.Forward(2);
        }
    }
Exemplo n.º 10
0
    void EvaluateDropDown()
    {
        foreach (var dropdown in _dropdowns)
        {
            _validar.interactable = false;
            dropdown.GetComponent <Dropdown>().interactable = false;

            switch (dropdown._type)
            {
            case L4A237_dropdown.Type.text:

                SetTextDropDown(dropdown.GetComponent <Dropdown>().captionText, dropdown._indexCurrent == dropdown._indexRight);

                break;

            case L4A237_dropdown.Type.image:

                SetSpriteDropDown(dropdown.GetComponent <Image>(), dropdown._indexCurrent == dropdown._indexRight);

                break;
            }
        }

        _controlAudio.PlayAudio(correct == _dropdowns.Count ? 1 : 2);

        if (correct == _dropdowns.Count)
        {
            moveBg = true;
            //_controlNavegacion.Forward(5);
            _controlPuntaje.IncreaseScore();
            if (ultimo)
            {
                if (_controlPuntaje._rightAnswers == _controlPuntaje.questions)
                {
                    StartCoroutine(p());
                }
                else
                {
                    _controlNavegacion.Forward(5.0f);
                }
            }
            else
            {
                _controlNavegacion.Forward(5f);
            }
        }
        else
        {
            moveBg = false;
            _controlNavegacion.Forward(2.0f);
        }
    }
Exemplo n.º 11
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            _controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);
        }

        _controlPuntaje.IncreaseScore(scoreTotal);
        general.NextExcersise();
    }
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count? 1:2);
        }
        else
        {
            _controlAudio.PlayAudio(scoreTotal == rightTotal? 1:2);
        }

        _controlPuntaje.IncreaseScore(scoreTotal);
        StartCoroutine(SetActivityType());
    }
Exemplo n.º 13
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            _controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);
        }

        _controlPuntaje.IncreaseScore(scoreTotal);
        _controlNavegacion.Forward(2);
    }
Exemplo n.º 14
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        Element.GetComponent <M10L33_element>().GetQuestion();
        if (_TypeCalification == TypeCalification.grupo)
        {
            if (rights == _groupToggle.Count)
            {
                background.SetActive(false);
                rightImage.SetActive(true);
                _controlAudio.PlayAudio(1);
                _validarBTN.gameObject.SetActive(false);
                _general.AddGifts(level);
                _controlPuntaje.IncreaseScore();
            }
            else
            {
                background.SetActive(false);
                wrongImag.SetActive(true);
                _controlAudio.PlayAudio(2);
                _validarBTN.gameObject.SetActive(false);
                _general.RestLifes();
            }
        }

        //_controlAudio.PlayAudio(rights == _groupToggle.Count ? 1 : 2);
        else
        {
            if (rights == 1)
            {
                background.SetActive(false);
                rightImage.SetActive(true);
                _controlAudio.PlayAudio(1);
                _validarBTN.gameObject.SetActive(false);
                _general.AddGifts(level);
                _controlPuntaje.IncreaseScore();
            }
            else
            {
                _controlAudio.PlayAudio(2);
                _validarBTN.gameObject.SetActive(false);
                _general.RestLifes();
            }
        }

        //_controlAudio.PlayAudio(rights == _groupToggle[0]._sizeCorrect ? 1 : 2);

        //_controlPuntaje.IncreaseScore(rights);

//        StartCoroutine(a());
    }
Exemplo n.º 15
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            _controlAudio.PlayAudio(scoreTotal == rightTotal ? 1 : 2);
        }

        _controlPuntaje.IncreaseScore(scoreTotal);
        general.correctas = general.correctas + scoreTotal;
        StartCoroutine(x());
    }
Exemplo n.º 16
0
    public void  ValidarGraficas()
    {
        _validar.interactable = false;
        for (int i = 0; i < sliders.Count; i++)
        {
            sliders[i].GetComponent <Slider>().interactable = false;
            if (sliders[i].GetComponent <Slider>().value == sliders[i].value)
            {
                controlPuntaje.IncreaseScore();
                sliders[i].gameObject.transform.GetChild(1).GetChild(0).GetComponent <Image>().color = sliders[i].correcto;
                count++;
            }
            else
            {
                sliders[i].gameObject.transform.GetChild(1).GetChild(0).GetComponent <Image>().color = sliders[i].incorrecto;
            }
        }

        if (count == sliders.Count)
        {
            controlAudio.PlayAudio(1);
        }
        else
        {
            controlAudio.PlayAudio(2);
        }
        controlNavegacion.Forward(1.5f);
    }
Exemplo n.º 17
0
    IEnumerator y(string x)
    {
        yield return(new WaitForSeconds(0.1f));

        if (x.Contains(palabra))
        {
            audio.PlayAudio(1);
            ControlPuntaje.IncreaseScore();
            input.textComponent.GetComponent <Text>().color = verde;
        }
        else
        {
            audio.PlayAudio(2);
            input.textComponent.GetComponent <Text>().color = rojo;
        }
        yield return(new WaitForSeconds(1.5f));

        gameObject.transform.parent.gameObject.SetActive(false);
        //aplico.SetActive(false);
        //        desempeno.SetActive(true);
        general.player.canMove = true;
        foreach (var item in general.enemies)
        {
            item.GetComponent <L10A190_enemy>().canMove = true;
        }
        general.pasar();
    }
Exemplo n.º 18
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            L5A259_drag temp = answer.Key.GetComponent <L5A259_drag>();

            if (temp)
            {
                temp.enabled = false;

                if (answer.Value)
                {
                    rights++;
                }
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1) ? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                _controlAudio.PlayAudio((rights == _drags.Count) ? 1 : 2);
            }
            else
            {
                _controlAudio.PlayAudio((rights == _customValidar) ? 1 : 2);
            }

            _controlPuntaje.IncreaseScore(rights);
            // _controlNavegacion.Forward(2);
            StartCoroutine(x());
        }
    }
Exemplo n.º 19
0
    /// <summary>
    /// Realiza el cambio de estado [right or wrong] para la imagen recibida
    /// </summary>
    /// <param name="select"></param>
    /// <param name="state"></param>
    void SetSpriteDropDown(Image select, bool state)
    {
        switch (state)
        {
        case true:

            select.color = _rightColor;
            correct++;
            _controlPuntaje.IncreaseScore();

            break;

        case false:

            select.color = _wrongColor;

            break;
        }
    }
Exemplo n.º 20
0
    IEnumerator delaySubmit()
    {
        yield return(new WaitForSeconds(1));

        if (ballon_1.isRight && (ballon_1.number == n))
        {
            numerator.SetActive(true);
            numerator.GetComponent <Image>().sprite = numerator.GetComponent <BehaviourSprite>()._right;
        }
        else
        {
            numerator.SetActive(true);
            numerator.GetComponent <Image>().sprite = numerator.GetComponent <BehaviourSprite>()._wrong;
        }

        if (ballon_2.isRight && ballon_2.number == d)
        {
            denomitator.SetActive(true);
            denomitator.GetComponent <Image>().sprite = denomitator.GetComponent <BehaviourSprite>()._right;
        }
        else
        {
            denomitator.SetActive(true);
            denomitator.GetComponent <Image>().sprite = denomitator.GetComponent <BehaviourSprite>()._wrong;
        }

        if (ballon_1.isRight && ballon_2.isRight && ballon_1.number == n && ballon_2.number == d)
        {
            controlAudio.PlayAudio(1);
            controlPuntaje.IncreaseScore();
            _puntaje.count += 15;
            _puntaje.textoPuntaje1.text = _puntaje.count.ToString();
            controlNavegacion.Forward(2.0f);
        }
        else
        {
            if (oportunities < 2)
            {
                oportunities++;
                stars.transform.GetChild(oportunities - 1).gameObject.SetActive(false);
                controlAudio.PlayAudio(2);
                StartCoroutine(Refresh());
            }
        }

        if (oportunities == 2)
        {
            print("next");
            foreach (var b in listBallon)
            {
                b.GetComponent <M6L85_globo>().mover = false;
            }
            controlNavegacion.Forward(2.0f);
        }
    }
Exemplo n.º 21
0
    //// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        if (_TypeCalification == TypeCalification.grupo)
        {
            _controlAudio.PlayAudio(scoreTotal == _groupToggle.Count ? 1 : 2);
        }
        else
        {
            if (scoreTotal == rightTotal)
            {
                _controlAudio.PlayAudio(1);
                for (int j = 0; j < _groupToggle.Count; j++)
                {
                    for (int i = 0; i < _groupToggle[j].transform.childCount; i++)
                    {
                        _groupToggle[j].transform.GetChild(i).gameObject.SetActive(false);
                    }
                }


                _controlPuntaje.IncreaseScore(scoreTotal);
                player.GetComponent <Animator>().enabled = true;
                player.GetComponent <M6L107_Castel>().e  = true;
                StartCoroutine(x(goT));
            }
            else
            {
                _controlAudio.PlayAudio(2);

                v--;
                if (v < vidas.transform.childCount && v != 0)
                {
                    vidas.transform.GetChild(v).gameObject.SetActive(false);
                    ResetSeleccionarToggle_1();
                }
                if (v == 0)
                {
                    StartCoroutine(x(goF));
                }
            }
        }
    }
Exemplo n.º 22
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            if (answer.Key.GetComponent <BehaviourDrag>() && answer.Value)
            {
                rights++;
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1)? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                _controlAudio.PlayAudio((rights == _drags.Count)? 1 : 2);
            }
            else
            {
                _controlAudio.PlayAudio((rights == _customValidar)? 1 : 2);
            }

            _controlPuntaje.IncreaseScore(rights);
            _controlNavegacion.Forward(2);
        }
    }
Exemplo n.º 23
0
    /// Instancia el puntaje y audio, al seleccionar validacion inmediata
    void SetPuntaje(bool answer)
    {
        evaluated++;

        if (answer)
        {
            _controlAudio.PlayAudio(1);
            _controlPuntaje.IncreaseScore();
        }
        else
        {
            _controlAudio.PlayAudio(2);
        }

        if (evaluated == _groupToggle.Count)
        {
            _controlNavegacion.Forward(2);
        }
    }
Exemplo n.º 24
0
    public void SeleccionarPalabra(string boton)
    {
        controlAudio.PlayAudio(0);
        botonFuturo.interactable     = false;
        botonImperfecto.interactable = false;
        botonPerfecto.interactable   = false;
        botonPresente.interactable   = false;
        if (palabraActual != null)
        {
            switch (boton)
            {
            case "presente":
                if (palabraActual.GetComponent <L4A234_palabra>().presente&& boton.Contains("presente"))
                {
                    controlPuntaje.IncreaseScore();
                    StartCoroutine(x(true));
                }
                else
                {
                    StartCoroutine(x(false));
                }
                break;

            case "futuro":
                if (palabraActual.GetComponent <L4A234_palabra>().futuro&& boton.Contains("futuro"))
                {
                    controlPuntaje.IncreaseScore();
                    StartCoroutine(x(true));
                }
                else
                {
                    StartCoroutine(x(false));
                }
                break;

            case "imperfecto":
                if (palabraActual.GetComponent <L4A234_palabra>().imperfecto&& boton.Contains("imperfecto"))
                {
                    controlPuntaje.IncreaseScore();
                    StartCoroutine(x(true));
                }
                else
                {
                    StartCoroutine(x(false));
                }
                break;

            case "perfecto":
                if (palabraActual.GetComponent <L4A234_palabra>().perfecto&& boton.Contains("perfecto"))
                {
                    controlPuntaje.IncreaseScore();
                    StartCoroutine(x(true));
                }
                else
                {
                    StartCoroutine(x(false));
                }
                break;
            }
        }
    }
Exemplo n.º 25
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            L4A237_drag temp = answer.Key.GetComponent <L4A237_drag>();

            if (temp)
            {
                temp.enabled = false;

                if (answer.Value)
                {
                    rights++;
                }
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1) ? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                _controlAudio.PlayAudio((rights == _drags.Count) ? 1 : 2);
            }
            else
            {
                grupo.SetActive(false);
                validar.SetActive(false);
                foreach (var x in drags)
                {
                    x.SetActive(false);
                }
                foreach (var x in drops)
                {
                    x.SetActive(false);
                }

                _controlAudio.PlayAudio((rights == _customValidar) ? 1 : 2);
                if (rights == _customValidar)
                {
                    moveBg = true;
                    _controlPuntaje.IncreaseScore(rights);
                    _controlNavegacion.Forward(5f);
                }
                else
                {
                    moveBg = false;
                    _controlNavegacion.Forward(2f);
                }
            }
        }
    }
Exemplo n.º 26
0
    public IEnumerator CalificarPregunta(bool value, GameObject g)
    {
        if (g == seleccionar)
        {
            if (value)
            {
                pregunta1 = true;
                yield return(new WaitForSeconds(1f));

                g.SetActive(false);
                input.SetActive(true);
            }
            else
            {
                pregunta1 = false;
                yield return(new WaitForSeconds(1f));

                g.SetActive(false);
                input.SetActive(true);
            }
        }

        if (g == input)
        {
            if (value)
            {
                pregunta2 = true;
                yield return(new WaitForSeconds(1f));

                g.SetActive(false);
            }
            else
            {
                pregunta2 = false;
                yield return(new WaitForSeconds(1f));

                g.SetActive(false);
            }

            if (!pregunta1 && pregunta2)
            {
                general.RestarVidas();
            }
            else if (pregunta1 && !pregunta2)
            {
                general.RestarVidas();
            }
            else if (!pregunta1 && !pregunta2)
            {
                general.RestarVidas();
            }
            else if (pregunta1 && pregunta2)
            {
                calificado = true;
                fichaPareja.SetActive(true);
                ficha.interactable = false;
                ControlPuntaje.IncreaseScore();
                general.intentos();
            }
        }
    }
Exemplo n.º 27
0
    public void CalificarInputs()
    {
        botonValidar.interactable = false;
        _controlAudio.PlayAudio(0);

        int[] contadorTemp = new int[_groupInputField.Count];
        _listAnswers = new ListAnswers[_groupInputField.Count];

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            _listAnswers[i].inputFields = new InputField[_groupInputField[i]._inputFields.Count];
            _listAnswers[i].answers     = new bool[_groupInputField[i]._inputFields.Count];

            if (_groupInputField[i]._TipoRespuestas == L7A281_groupInput.TipoRespuestas.individual)
            {
                for (int j = 0; j < _groupInputField[i]._inputFields.Count; j++)
                {
                    InputField f = _groupInputField[i]._inputFields[j];

                    f.interactable = false;
                    f.GetComponent <L7A281_input>()._isEnabled = false;

                    bool answer;
                    answer = (f.GetComponent <InputField>().text.Length >= f.GetComponent <L7A281_input>().caracteres);
                    _listAnswers[i].inputFields[j] = f;
                    _listAnswers[i].answers[j]     = answer;


                    if (answer)
                    {
                        f.GetComponent <InputField>().textComponent.color = colorTextoCorrecto;
                        contadorTemp[i]++;
                    }
                    else
                    {
                        f.GetComponent <InputField>().textComponent.color = colorTextoIncorrecto;
                    }
                }
            }
        }

        switch (calificacion)
        {
        case TipoCalificacion.texto: TipoCalificationTexto(); break;
        }

        int groupTemp = 0;

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            if (contadorTemp[i] == _groupInputField[i]._inputFields.Count)
            {
                groupTemp++;
            }
        }

        if (_TipoPuntuacion == TipoPuntuacion.grupo)
        {
            _controlPuntaje.IncreaseScore(groupTemp);
        }
        else
        {
            int total = 0;

            foreach (var grupoAnswers in contadorTemp)
            {
                total += grupoAnswers;
            }

            //print(total);

            _controlPuntaje.IncreaseScore(total);
        }


        _controlAudio.PlayAudio(groupTemp == _groupInputField.Count ? 1 : 2);
        //_controlNavegacion.Forward(2);
        general.NextExcersise();
    }
Exemplo n.º 28
0
    public void CalificarInputs()
    {
        botonValidar.interactable = false;
        _controlAudio.PlayAudio(0);

        int[] contadorTemp = new int[_groupInputField.Count];

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            foreach (var input in _groupInputField[i]._inputFields)
            {
                input.interactable = false;
                input.GetComponent <M10L33_inputField>()._isEnabled = false;
                bool answer = (input.GetComponent <M10L33_inputField>().respuestaCorrecta.Contains(input.GetComponent <InputField>().text));

                switch (calificacion)
                {
                case TipoCalificacion.texto: TipoCalificationTexto(); break;

                case TipoCalificacion.fondo: TipoCalificationFondo(); break;

                case TipoCalificacion.simbolo: TipoCalificationSimbolo(); break;

                case TipoCalificacion.multiple: _FunctionMultiple.Invoke(); break;
                }

                if (answer)
                {
                    contadorTemp[i]++;
                }
            }
        }

        int groupTemp = 0;

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            if (contadorTemp[i] == _groupInputField[i]._inputFields.Count)
            {
                groupTemp++;
            }
        }



/*
 *      if (_TipoPuntuacion == TipoPuntuacion.grupo)
 *          _controlPuntaje.IncreaseScore(groupTemp);
 *      else
 *      {
 *          int total = 0;
 *
 *          foreach (var grupoAnswers in contadorTemp)
 *              total += grupoAnswers;
 *
 *          print(total);
 *
 *          _controlPuntaje.IncreaseScore(total);
 *      }*/


        // _controlAudio.PlayAudio(groupTemp == _groupInputField.Count ? 1 : 2);

        if (groupTemp == _groupInputField.Count)
        {
            _controlAudio.PlayAudio(1);
            _general.AddGifts(level);
            _controlPuntaje.IncreaseScore();
            StartCoroutine(x(true));
        }
        else
        {
            _controlAudio.PlayAudio(2);


            StartCoroutine(x(false));
        }
    }
Exemplo n.º 29
0
    public void CalificarInputs()
    {
        botonValidar.interactable = false;
        _controlAudio.PlayAudio(0);

        int[] contadorTemp = new int[_groupInputField.Count];
        _listAnswers = new ListAnswers[_groupInputField.Count];

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            _listAnswers[i].inputFields = new InputField[_groupInputField[i]._inputFields.Count];
            _listAnswers[i].answers     = new bool[_groupInputField[i]._inputFields.Count];

            if (_groupInputField[i]._TipoRespuestas == M6A91_groupInput.TipoRespuestas.individual)
            {
                for (int j = 0; j < _groupInputField[i]._inputFields.Count; j++)
                {
                    InputField f = _groupInputField[i]._inputFields[j];

                    f.interactable = false;
                    f.GetComponent <M6A91_input>()._isEnabled = false;

                    bool answer;
                    answer = (f.GetComponent <M6A91_input>().respuestaCorrecta.Contains(f.GetComponent <InputField>().text));
                    _listAnswers[i].inputFields[j] = f;
                    _listAnswers[i].answers[j]     = answer;


                    if (answer)
                    {
                        contadorTemp[i]++;
                    }
                }
            }
            else
            {
                _groupInputField[i].EvaluateGroup();

                for (int j = 0; j < _groupInputField[i]._inputFields.Count; j++)
                {
                    InputField f = _groupInputField[i]._inputFields[j];

                    f.interactable = false;
                    f.GetComponent <M6A91_input>()._isEnabled = false;

                    bool answer;
                    answer = f.GetComponent <M6A91_input>()._isRight;

                    _listAnswers[i].inputFields[j] = f;
                    _listAnswers[i].answers[j]     = answer;


                    if (answer)
                    {
                        contadorTemp[i]++;
                    }
                }
            }
        }

        switch (calificacion)
        {
        case TipoCalificacion.texto: TipoCalificationTexto(); break;

        case TipoCalificacion.fondo: TipoCalificationFondo(); break;

        case TipoCalificacion.simbolo: TipoCalificationSimbolo(); break;

        case TipoCalificacion.multiple: _FunctionMultiple.Invoke(); break;
        }

        int groupTemp = 0;

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            if (contadorTemp[i] == _groupInputField[i]._inputFields.Count)
            {
                groupTemp++;
            }
        }

        if (_TipoPuntuacion == TipoPuntuacion.grupo)
        {
            _controlPuntaje.IncreaseScore(groupTemp);
        }
        else
        {
            int total = 0;

            foreach (var grupoAnswers in contadorTemp)
            {
                total += grupoAnswers;
            }

            //print(total);

            _controlPuntaje.IncreaseScore(total);
        }


        _controlAudio.PlayAudio(groupTemp == _groupInputField.Count ? 1 : 2);
        _controlNavegacion.Forward(2);
    }
Exemplo n.º 30
0
    public void CalificarInputs()
    {
        botonValidar.interactable = false;
        _controlAudio.PlayAudio(0);

        int[] contadorTemp = new int[_groupInputField.Count];
        _listAnswers = new ListAnswers[_groupInputField.Count];

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            _listAnswers[i].inputFields = new InputField[_groupInputField[i]._inputFields.Count];
            _listAnswers[i].answers     = new bool[_groupInputField[i]._inputFields.Count];

            if (_groupInputField[i]._TipoRespuestas == M5A115_grupoInput2.TipoRespuestas.individual)
            {
                for (int j = 0; j < _groupInputField[i]._inputFields.Count; j++)
                {
                    InputField f = _groupInputField[i]._inputFields[j];

                    f.interactable = false;
                    f.GetComponent <M5A115_input2>()._isEnabled = false;

                    bool answer;
                    answer = (f.GetComponent <M5A115_input2>().respuestaCorrecta.Contains(f.GetComponent <InputField>().text));
                    _listAnswers[i].inputFields[j] = f;
                    _listAnswers[i].answers[j]     = answer;


                    if (answer)
                    {
                        contadorTemp[i]++;
                    }
                }
            }
            else
            {
                _groupInputField[i].EvaluateGroup();

                for (int j = 0; j < _groupInputField[i]._inputFields.Count; j++)
                {
                    InputField f = _groupInputField[i]._inputFields[j];

                    f.interactable = false;
                    f.GetComponent <M5A115_input2>()._isEnabled = false;

                    bool answer;
                    answer = f.GetComponent <M5A115_input2>()._isRight;

                    _listAnswers[i].inputFields[j] = f;
                    _listAnswers[i].answers[j]     = answer;


                    if (answer)
                    {
                        contadorTemp[i]++;
                    }
                }
            }
        }

        switch (calificacion)
        {
        case TipoCalificacion.texto: TipoCalificationTexto(); break;

        case TipoCalificacion.fondo: TipoCalificationFondo(); break;

        case TipoCalificacion.simbolo: TipoCalificationSimbolo(); break;

        case TipoCalificacion.multiple: _FunctionMultiple.Invoke(); break;
        }

        int groupTemp = 0;

        for (int i = 0; i < _groupInputField.Count; i++)
        {
            if (contadorTemp[i] == _groupInputField[i]._inputFields.Count)
            {
                groupTemp++;
            }
        }

        if (_TipoPuntuacion == TipoPuntuacion.grupo)
        {
            _controlPuntaje.IncreaseScore(groupTemp);
        }
        else
        {
            int total = 0;

            foreach (var grupoAnswers in contadorTemp)
            {
                total += grupoAnswers;
            }

            //print(total);

            _controlPuntaje.IncreaseScore(total);
        }
        if (!ultimo)
        {
            if (groupTemp == _groupInputField.Count)
            {
                _controlAudio.PlayAudio(1);
                boton.GetComponent <Image>().sprite = boton.GetComponent <BehaviourSprite>()._right;
                boton.GetComponent <Image>().SetNativeSize();
                StartCoroutine(general2.CalificarPregunta(true, gameObject, ultimo));
            }
            else
            {
                _controlAudio.PlayAudio(2);
                boton.GetComponent <Image>().sprite = boton.GetComponent <BehaviourSprite>()._wrong;
                boton.GetComponent <Image>().SetNativeSize();
                StartCoroutine(general2.CalificarPregunta(false, gameObject, ultimo));
            }
        }
        else
        {
            if (groupTemp == _groupInputField.Count)
            {
                _controlAudio.PlayAudio(1);
                StartCoroutine(general2.CalificarPregunta(true, gameObject, ultimo));
            }
            else
            {
                _controlAudio.PlayAudio(2);
                StartCoroutine(general2.CalificarPregunta(false, gameObject, ultimo));
            }
        }


        //_controlNavegacion.Forward(2);
    }