Table of Contents

Class McqDataSet

Namespace
WitShells.McqUI

ScriptableObject asset for storing MCQ data sets that can be created and edited in the Unity Editor

public class McqDataSet : ScriptableObject
Inheritance
McqDataSet

Properties

Description

Description of this MCQ set

public string Description { get; }

Property Value

string

QuestionCount

Total number of questions in this set

public int QuestionCount { get; }

Property Value

int

Questions

All MCQ questions in this set

public List<McqData> Questions { get; }

Property Value

List<McqData>

RandomizeOrder

Whether questions should be randomized when retrieved

public bool RandomizeOrder { get; }

Property Value

bool

SetTitle

Title of this MCQ set

public string SetTitle { get; }

Property Value

string

Methods

AddQuestion(McqData)

Add a new question to this set

public void AddQuestion(McqData mcqData)

Parameters

mcqData McqData

ClearQuestions()

Clear all questions from this set

public void ClearQuestions()

GenerateDummyMcqSet()

Generate dummy MCQ data for testing purposes

public void GenerateDummyMcqSet()

GenerateSmallTestSet()

Generate a small sample set for quick testing

public void GenerateSmallTestSet()

GetQuestions(bool)

Get all questions, optionally randomized

public List<McqData> GetQuestions(bool randomize = true)

Parameters

randomize bool

Returns

List<McqData>

GetQuestions(int, bool)

Get a specific number of questions from this set

public List<McqData> GetQuestions(int count, bool randomize = true)

Parameters

count int
randomize bool

Returns

List<McqData>

GetRandomQuestion()

Get a random question from this set

public McqData GetRandomQuestion()

Returns

McqData

RemoveQuestion(int)

Remove a question at specified index

public void RemoveQuestion(int index)

Parameters

index int

ValidateSet(out string)

Validate all questions in this set

public bool ValidateSet(out string errorMessage)

Parameters

errorMessage string

Returns

bool