Class McqData
Data structure containing a multiple choice question with correct and incorrect options
[Serializable]
public class McqData
- Inheritance
-
McqData
- Inherited Members
Constructors
McqData()
public McqData()
McqData(string, string, string[], bool?, float)
Create a new MCQ data with question, correct answer, and wrong options
public McqData(string question, string correctAnswer, string[] wrongOptions, bool? shuffleOptions = null, float timeLimit = -1)
Parameters
questionstringThe question text
correctAnswerstringThe correct answer
wrongOptionsstring[]Array of incorrect options
shuffleOptionsbool?Whether to shuffle options when displayed (uses global setting if null)
timeLimitfloatTime limit in seconds (uses global setting if negative)
Properties
AllOptions
All options combined (correct + wrong) in display order
public List<string> AllOptions { get; }
Property Value
CorrectAnswer
The correct answer for this question
public string CorrectAnswer { get; }
Property Value
OptionCount
Total number of options available
public int OptionCount { get; }
Property Value
Question
The question text to display
public string Question { get; }
Property Value
ShuffleOptions
Whether to shuffle the order of options when displaying
public bool ShuffleOptions { get; }
Property Value
TimeLimit
Time limit for answering in seconds (0 = no limit)
public float TimeLimit { get; }
Property Value
WrongOptions
Array of incorrect answer options
public string[] WrongOptions { get; }
Property Value
- string[]
Methods
IsCorrectAnswer(string)
Check if a given answer is correct
public bool IsCorrectAnswer(string answer)
Parameters
answerstringThe answer to check
Returns
- bool
True if the answer matches the correct answer
IsValid()
Validate that the MCQ data is properly configured
public bool IsValid()
Returns
- bool
True if valid, false otherwise