Class McqPage
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
OnQuestionCompleted
public UnityEvent<McqData, string, bool> OnQuestionCompleted
Field Value
OnQuestionStarted
public UnityEvent<McqData> OnQuestionStarted
Field Value
- UnityEvent<McqData>
OnTimeUp
public UnityEvent OnTimeUp
Field Value
- UnityEvent
Properties
CurrentQuestion
public McqData CurrentQuestion { get; }
Property Value
IsAnswered
public bool IsAnswered { get; }
Property Value
IsCorrectAnswer
public bool IsCorrectAnswer { get; }
Property Value
RemainingTime
public float RemainingTime { get; }
Property Value
SelectedAnswer
public string SelectedAnswer { get; }
Property Value
Methods
GetProgress()
Get the current question's progress as a percentage (0-1)
public float GetProgress()
Returns
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
interactablebool
SetupQuestion(McqData)
Setup and display a new MCQ question
public void SetupQuestion(McqData mcqData)
Parameters
mcqDataMcqDataThe question data to display