示例#1
0
        public void OnSelectResponse(QuizPanelMCItem item, MultipleChoiceQuizMinigameDriver driver)
        {
            driver.AttemptsTried++;

            if (item.Response.IsCorrect)
            {
                driver.CorrectAnswer();

                OnResponseCorrect(item, driver);
            }
            else
            {
                driver.IncorrectAnswer();

                OnResponseWrong(item, driver);
            }

            if (item.Response.Event != null && item.Response.Event.Count() > 0)
            {
                foreach (var e in item.Response.Event)
                {
                    driver.TaskDriver.ActivationContext.FireEvent(e);
                }
            }
        }
        public void OnResponseWrong(QuizPanelMCItem item, MultipleChoiceQuizMinigameDriver driver)
        {
            item.SetCanSelect(false);

            if (driver.Quiz.MaximumAttempts > 0 && driver.AttemptsTried >= driver.Quiz.MaximumAttempts)
            {
                OnAttemptsExhausted(driver);
            }
        }
示例#3
0
        //////////////////////////////////////////////////////////////
        //      MULTIPLE CHOICE QUIZ
        //////////////////////////////////////////////////////////////
        #region
        public void Action(MultipleChoiceQuizMinigameDriver quizDriver)
        {
            if (OnAction != null)
            {
                OnAction.Invoke();
            }

            ThreadHelper.Instance.CallOnMainThread(() =>
            {
                PushQuizPanel <MultipleChoiceQuizMinigameDriver, MultipleChoiceQuizPanel>(quizDriver);
            });
        }
        //////////////////////////////////////////////////////////////
        //      MULTIPLE CHOICE QUIZ
        //////////////////////////////////////////////////////////////
        #region
        public void Action(MultipleChoiceQuizMinigameDriver quizDriver)
        {
            if (OnAction != null)
            {
                OnAction.Invoke();
            }

            ThreadHelper.Instance.CallOnMainThread(() =>
            {
                var panel = PanelManager.Instance.GetPanel <MultipleChoiceQuizPanel>();
                if (panel == null)
                {
                    m_logger.Error(typeof(MultipleChoiceQuizPanel).ToString() + " not found.");
                    return;
                }

                PanelManager.Instance.Push(k_quizStack, panel, quizDriver);
            });
        }
 public void OnAttemptsExhausted(MultipleChoiceQuizMinigameDriver driver)
 {
     // for multiple choice we don't do anything, the correct answer will reveal itself
 }
 public void OnResponseCorrect(QuizPanelMCItem item, MultipleChoiceQuizMinigameDriver driver)
 {
     PushSuccessPanel(driver.TaskDriver);
 }