Class McqOptionItem
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
OnOptionSelected
public UnityEvent<McqOptionItem> OnOptionSelected
Field Value
- UnityEvent<McqOptionItem>
Properties
IsCorrect
public bool IsCorrect { get; }
Property Value
IsLocked
public bool IsLocked { get; }
Property Value
IsSelected
public bool IsSelected { get; }
Property Value
OptionText
public string OptionText { get; }
Property Value
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
eventDataPointerEventData
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
interactablebool
SetupOption(string, bool, bool)
Setup this option item with text and correctness
public void SetupOption(string optionText, bool isCorrect = false, bool editMode = false)