Table of Contents

Class McqPage

Namespace
WitShells.McqUI

Main MCQ page component that manages question display and option interactions

public class McqPage : MonoBehaviour
Inheritance
McqPage

Fields

OnAnswerSelected

public UnityEvent<string, bool> OnAnswerSelected

Field Value

UnityEvent<string, bool>

OnQuestionCompleted

public UnityEvent<McqData, string, bool> OnQuestionCompleted

Field Value

UnityEvent<McqData, string, bool>

OnQuestionStarted

public UnityEvent<McqData> OnQuestionStarted

Field Value

UnityEvent<McqData>

OnTimeUp

public UnityEvent OnTimeUp

Field Value

UnityEvent

Properties

CurrentQuestion

public McqData CurrentQuestion { get; }

Property Value

McqData

IsAnswered

public bool IsAnswered { get; }

Property Value

bool

IsCorrectAnswer

public bool IsCorrectAnswer { get; }

Property Value

bool

RemainingTime

public float RemainingTime { get; }

Property Value

float

SelectedAnswer

public string SelectedAnswer { get; }

Property Value

string

Methods

GetProgress()

Get the current question's progress as a percentage (0-1)

public float GetProgress()

Returns

float

Reset()

Reset the MCQ page to initial state

public void Reset()

RevealCorrectAnswer()

Force reveal the correct answer and mark wrong answers as wrong

public void RevealCorrectAnswer()

SetOptionsInteractable(bool)

Enable or disable all option interactions

public void SetOptionsInteractable(bool interactable)

Parameters

interactable bool

SetupQuestion(McqData)

Setup and display a new MCQ question

public void SetupQuestion(McqData mcqData)

Parameters

mcqData McqData

The question data to display