quizutility - eisclimber/ExPresS-XR GitHub Wiki
Class in ExPresSXR.Interaction.ButtonQuiz
Inherits from UnityEngine.MonoBehaviour
Helper class for the button quiz.
public class QuizUtility : MonoBehaviour| Name | Description |
|---|---|
| AllEntriesTrue(bool[]) | Checks if all values are true. |
| ArrayMatch(bool[],bool[]) | Checks if bth arrays are equal regarding their elements. |
| Can be used to check if a question was answered completely right or wrong. | |
| ExtractButtonPressStates(QuizButton[]) | Converts an array of QuizButtons to a bool array representing their pressed states. |
| Null-Buttons are considered not pressed. | |
| FirstIndexTrue(bool[]) | Extracts the first index where an entry is true. Returns -1 if none is true. |
| GameObjectArrayToNameString(GameObject[],char) | Converts a GameObject to a array representation using the GameObjects name or an empty string. |
| GenerateIdentityArray(int) | Generates an array with size equal length where every element holds its index, i.e. [0, 1, 2, ..., length] |
| GetAnswerPermutation(ButtonQuizConfig,ButtonQuizQuestion) | Get a permutation of the valid answers of a question. |
| Indices of unused answer indices will be set to -1. | |
| GetNumAnswersForQuestion(ButtonQuizConfig,ButtonQuizQuestion) | eturns the number of answers for a question. |
| MakeStreamingAssetsVideoPath(string) | Converts a relative path to a StreamingAssets-Path whilst ensuring the path refers to an .mp4 or .mov video file. |
| PermuteArray(T[],int[]) | Permutes an array using the given permutation as indices. Both arrays must be of same length. |
| Entries in the permutation array less 0 will be ignored and no entries will be added. | |
| SelectedButtonMaxTriggerTime(QuizButton[]) | Returns the maximum trigger time of pressed QuizButtons. |
| If none is pressed or the array is empty returns -1.0f. | |
| Shuffle(int[]) | Returns a shuffled copy of the given array. |
| Uses a Fisher-Yates-Shuffle. |