Example #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;
    }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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");
        }
    }