Ejemplo n.º 1
0
    private void CheckClicked(int index, AnnotationMode mode)
    {
        Debug.Log("Verfy clicked annotation " + index);
        if (index == lastClickedAnnotationIndex && mode != currentAnnotationMode)
        {
            buttonObjects[index].SetActive(false);
            currentAnnotations[index].SetActive(false);

            remainingQuestions--;
            Debug.Log("Correct answer! Remaining questions: " + remainingQuestions);

            if (remainingQuestions == 0)
            {
                FinishedQuiz();
            }
        }
        else
        {
            CheckButton(-1);
            MarkAnnotationObjects(-1);
            MessageBox.Show("That's not correct!", MessageBoxType.ERROR);
            Debug.Log("Clicked annotation " + index + " and lastClickedAnnotation " + lastClickedAnnotationIndex + " does not match");
        }
        lastClickedAnnotationIndex = -1;
        currentAnnotationMode      = AnnotationMode.None;
    }
Ejemplo n.º 2
0
 private void ClickedAnnotation(int index)
 {
     if (lastClickedAnnotationIndex == -1 || currentAnnotationMode == AnnotationMode.None || currentAnnotationMode == AnnotationMode.AnnotationObject)
     {
         Debug.Log("First annotation clicked");
         lastClickedAnnotationIndex = index;
         currentAnnotationMode      = AnnotationMode.AnnotationObject;
         MarkAnnotationObjects(index);
     }
     else
     {
         Debug.Log("Second Annotation clicked");
         CheckClicked(index, AnnotationMode.AnnotationObject);
     }
 }
Ejemplo n.º 3
0
 private void ClickedText(int index)
 {
     Debug.Log("Clicked Button " + index);
     if (lastClickedAnnotationIndex == -1 || currentAnnotationMode == AnnotationMode.None || currentAnnotationMode == AnnotationMode.Text)
     {
         Debug.Log("First button clicked");
         lastClickedAnnotationIndex = index;
         currentAnnotationMode      = AnnotationMode.Text;
         CheckButton(index);
     }
     else
     {
         Debug.Log("Second Button clicked");
         CheckClicked(index, AnnotationMode.Text);
     }
 }
Ejemplo n.º 4
0
    private void FinishedQuiz()
    {
        Debug.Log("Finished Quiz successfully");
        currentMenu.SetActive(false);
        currentMenu                = null;
        buttonObjects              = null;
        currentButtons             = null;
        currentAnnotations         = null;
        lastClickedAnnotationIndex = -1;
        currentAnnotationMode      = AnnotationMode.None;

        if (callback != null)
        {
            callback();
        }
        else
        {
            Debug.Log("Callback is null");
        }
    }