Search Results for

    Show / Hide Table of Contents

    Class QuestionnaireController

    The QuestionaireController provides the functionality to control the input field questions, reqular question and question lists. The input field question opens the keyboard and recives any given string input from the user. The regular question opens a question with up to four possible pre-defined awnsers. The question list opens a list with n possible items and continues when all right items were selected.

    Inheritance
    System.Object
    QuestionnaireController
    Namespace: UI
    Assembly: Assembly-CSharp.dll
    Syntax
    public class QuestionnaireController : MonoBehaviour

    Fields

    | Improve this Doc View Source

    ButtonBlueprint

    Reference to the AnswerButtonPrefab.

    Declaration
    public Button ButtonBlueprint
    Field Value
    Type Description
    Button

    Set in inspector.

    | Improve this Doc View Source

    buttons

    References to the Buttons

    Declaration
    public List<Button> buttons
    Field Value
    Type Description
    System.Collections.Generic.List<Button>

    Set in inspector.

    | Improve this Doc View Source

    correctAnswerColor

    Color for correct answers.

    Declaration
    public Color correctAnswerColor
    Field Value
    Type Description
    Color

    Default set in inspector.

    | Improve this Doc View Source

    correctAnswerSound

    Audioclip that is played when correct answer is pressed.

    Declaration
    public AudioClip correctAnswerSound
    Field Value
    Type Description
    AudioClip

    Default is set in inspector.

    | Improve this Doc View Source

    defaultUIColor

    Color for unpressed buttons.

    Declaration
    public Color defaultUIColor
    Field Value
    Type Description
    Color

    Default set in inspector.

    | Improve this Doc View Source

    duration

    How long it takes to fade in the UI.

    Declaration
    public float duration
    Field Value
    Type Description
    System.Single

    Default is 1.0f seconds.

    | Improve this Doc View Source

    inputFieldAnswerText

    Reference to the inputFieldAnswerText.

    Declaration
    public TextMeshProUGUI inputFieldAnswerText
    Field Value
    Type Description
    TextMeshProUGUI

    Set in inspector.

    | Improve this Doc View Source

    inputFieldQuestionText

    Reference to the inputFieldQuestionText.

    Declaration
    public TextMeshProUGUI inputFieldQuestionText
    Field Value
    Type Description
    TextMeshProUGUI

    Set in inspector.

    | Improve this Doc View Source

    inputFieldQuestionUI

    Reference to the root gameObject of the inputFieldUI.

    Declaration
    public GameObject inputFieldQuestionUI
    Field Value
    Type Description
    GameObject

    Set in inspector.

    | Improve this Doc View Source

    questionList

    Reference to the root of the question list UI.

    Declaration
    public GameObject questionList
    Field Value
    Type Description
    GameObject

    Set in inspector.

    | Improve this Doc View Source

    questionListQuestionText

    Reference to the QuestionListText.

    Declaration
    public TextMeshProUGUI questionListQuestionText
    Field Value
    Type Description
    TextMeshProUGUI

    Set in inspector.

    | Improve this Doc View Source

    questionnaireUIRectTransform

    Reference to the UIRectTransform.

    Declaration
    public RectTransform questionnaireUIRectTransform
    Field Value
    Type Description
    RectTransform

    Set in inspector.

    | Improve this Doc View Source

    questionText

    Reference to the questionText.

    Declaration
    public TextMeshProUGUI questionText
    Field Value
    Type Description
    TextMeshProUGUI

    Set in inspector.

    | Improve this Doc View Source

    questionTextUI

    Reference to the questionText.

    Declaration
    public GameObject questionTextUI
    Field Value
    Type Description
    GameObject

    Set in inspector.

    | Improve this Doc View Source

    regularQuestionUI

    Reference to the root gameObject of the regularQuestionUI.

    Declaration
    public GameObject regularQuestionUI
    Field Value
    Type Description
    GameObject

    Set in inspector.

    | Improve this Doc View Source

    responseText

    Reference to the ResponseText.

    Declaration
    public GameObject responseText
    Field Value
    Type Description
    GameObject

    Set in inspector.

    | Improve this Doc View Source

    rightAnswer

    Stores right answers for endscreen UI.

    Declaration
    public List<string> rightAnswer
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>

    Set on runtime.

    | Improve this Doc View Source

    wrongAnswerColor

    Color for wrong answers.

    Declaration
    public Color wrongAnswerColor
    Field Value
    Type Description
    Color

    Default set in inspector.

    | Improve this Doc View Source

    wrongAnsweredQuestions

    Stores wrong answered questions for endscreen UI.

    Declaration
    public List<string> wrongAnsweredQuestions
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>

    Set on runtime.

    | Improve this Doc View Source

    wrongAnswers

    Stores wrong answers for endscreen UI.

    Declaration
    public List<string> wrongAnswers
    Field Value
    Type Description
    System.Collections.Generic.List<System.String>

    Set on runtime.

    | Improve this Doc View Source

    wrongAnswerSound

    Audioclip that is played when wrong answer is pressed.

    Declaration
    public AudioClip wrongAnswerSound
    Field Value
    Type Description
    AudioClip

    Default is set in inspector.

    Methods

    | Improve this Doc View Source

    ContinueButtonOnClick()

    Get's called when the continue button is pressed. When the chosen answer was correct, the statemachine gets notified. When the chosen answer was wrong, the question gets displayed again.

    Declaration
    public void ContinueButtonOnClick()
    | Improve this Doc View Source

    InitInputfield(String)

    Open the inputField question UI.

    Declaration
    public void InitInputfield(string question)
    Parameters
    Type Name Description
    System.String question

    Text of the question.

    | Improve this Doc View Source

    InitQuestion(String, List<QuestionnaireController.Answer>)

    Open the regular question UI.

    Declaration
    public void InitQuestion(string question, List<QuestionnaireController.Answer> answers)
    Parameters
    Type Name Description
    System.String question

    Text of the question.

    System.Collections.Generic.List<QuestionnaireController.Answer> answers

    List of all possible answers.

    | Improve this Doc View Source

    InitQuestionList(String, List<QuestionnaireController.Answer>)

    Open the questionList UI.

    Declaration
    public void InitQuestionList(string question, List<QuestionnaireController.Answer> answers)
    Parameters
    Type Name Description
    System.String question

    Text of the question.

    System.Collections.Generic.List<QuestionnaireController.Answer> answers

    List of all possbile answers.

    | Improve this Doc View Source

    NotifyStatemachine(String, QuestionnaireController.QuestionUITypes)

    Notify the statemachine with the result of the question UI.

    Declaration
    public void NotifyStatemachine(string value, QuestionnaireController.QuestionUITypes type = QuestionnaireController.QuestionUITypes.Question)
    Parameters
    Type Name Description
    System.String value

    Result in text form.

    QuestionnaireController.QuestionUITypes type

    Type of question.

    | Improve this Doc View Source

    QuestionInputValidate()

    Validate if given input of the inputQuestion UI was correct.

    Declaration
    public void QuestionInputValidate()
    • Improve this Doc
    • View Source
    In This Article
    Back to top TrainAR Documentation