Table of Contents

Class McqOptionItem

Namespace
WitShells.McqUI

Individual option item for MCQ questions with selection feedback and animations

public class McqOptionItem : MonoBehaviour, IPointerClickHandler
Inheritance
McqOptionItem
Implements
IPointerClickHandler

Fields

OnAnswerConfirmed

public UnityEvent<string, bool> OnAnswerConfirmed

Field Value

UnityEvent<string, bool>

OnOptionSelected

public UnityEvent<McqOptionItem> OnOptionSelected

Field Value

UnityEvent<McqOptionItem>

Properties

IsCorrect

public bool IsCorrect { get; }

Property Value

bool

IsLocked

public bool IsLocked { get; }

Property Value

bool

IsSelected

public bool IsSelected { get; }

Property Value

bool

OptionText

public string OptionText { get; }

Property Value

string

Methods

CancelSelection()

Cancel the current selection and reset visuals

public void CancelSelection()

OnPointerClick(PointerEventData)

Handle click events on this option

public void OnPointerClick(PointerEventData eventData)

Parameters

eventData PointerEventData

RevealCorrect()

Reveal this option as correct immediately

public void RevealCorrect()

RevealWrong()

Reveal this option as wrong immediately

public void RevealWrong()

SelectOption()

Programmatically select this option

public void SelectOption()

SetInteractable(bool)

Enable or disable this option for interaction

public void SetInteractable(bool interactable)

Parameters

interactable bool

SetupOption(string, bool, bool)

Setup this option item with text and correctness

public void SetupOption(string optionText, bool isCorrect = false, bool editMode = false)

Parameters

optionText string

The text to display for this option

isCorrect bool

Whether this option is the correct answer

editMode bool

If true, clicking won't start the lock animation