Skip to content

Editor

Trivia Quiz Kit includes a complete visual editor that allows you to easily define many properties of your game without the need for programming. You can access the editor via the Tools/Trivia Quiz Kit/Editor menu option.

Game configuration tab

The game configuration tab allows you to specify many general properties of your game. Please note the kit assumes having a single game configuration asset per game.

The Asset field is where you put the GameConfiguration asset that will store the general properties of your game. We provide one by default; it is named GameConfiguration and is located in the TriviaQuizKit/Resources folder. Alternatively, you can create one from scratch by right-clicking on the project window and selecting the Create/Trivia Quiz Kit/Game configuration option.

Categories

The categories panel allows you to define the categories available in your game. Every category has a name and an associated image; both will be used at runtime in the game.

Game

The game panel allows you to define the following general game settings:

  • Question packs: The question pack set to use in the game; this defines the available questions during the game. See below to learn what a question pack set is.
  • Number of questions: The number of questions asked in a game.
  • Time limit: The time limit (in seconds) to answer a question in time limit mode.
  • Question score: The score given when answering a question correctly.
  • Bronze: The minimum number of questions to answer correctly for the player to receive a bronze trophy.
  • Silver: The minimum number of questions to answer correctly for the player to receive a silver trophy.
  • Gold: The minimum number of questions to answer correctly for the player to receive a gold trophy.

Regarding question packs: A question pack set is a group of question packs. We provide one by default; it is named QuestionPackSet and it is located in the TriviaQuizKit/Resources folder. Alternatively, you can create one from scratch by right-clicking on the project window and selecting the Create/Trivia Quiz Kit/Question pack set option. When you select a question pack set, you can set the question packs it contains in the inspector:

Game UI prefabs

The game UI prefabs panel allows you to define the UI prefabs to use for every type of question. The kit includes several ones by default (with image variations) that are located in the Trivia Quiz Kit/Resources/QuestionUI folder.

Questions tab

The questions tab allows you to create the available questions in your game.

The Question pack field is where you put the QuestionPack asset that will store a group of questions. We provide one by default; it is named QuestionPack and it is located in the TriviaQuizKit/Resources folder. Alternatively, you can create one from scratch by right-clicking on the project window and selecting the Create/Trivia Quiz Kit/Question pack option. You can create as many question packs as you want; this is useful in order to provide some logical grouping if you have a lot of questions.

In order to create a new question, click on the + sign on the Questions list and select the type of question you want to create in the dropdown that will appear. If you want to delete an existing question, just select it and click on the - sign.

When you select a question, a detail panel will appear on the right side. This panel allows you to edit the specific information of that question:

In single-choice questions, the first answer is the correct one. In multiple-choice questions, the first X answers are the correct ones, where the number X is specified in the Corrects field.

When you have many questions, it may be more convenient to use the .CSV importing functionality as opposed to entering every single question individually via the editor. This is the expected format of the .CSV file for every question type:

Single choice questions

Category,Question,Metadata,Answer,Answer,Answer,Answer

Geography,Question 1,Metadata 1,Answer 1a,Answer 1b,Answer 1c,Answer 1d

...

Multiple choice questions

Category,Question,Metadata,NumCorrects,Answer,Answer,Answer,Answer

History,Question 3,Metadata 3,1,Answer 3a,Answer 3b,Answer 3c,Answer 3d

...

True or false questions

Category,Question,Metadata,Answer

Sports,Question 5,Metadata 1,TRUE

...

Please make sure you are using a standard comma (',') as your separator character.

Please note that the first row of the .CSV file is ignored, as it is intended to showcase the names of every field. If you want to further customize the .CVS importing funcionality, you can find the code in the QuestionsTab script (located in the Scripts/Editor folder).

IMPORTANT: The kit was originally developed on Mac OS, so you will need to make sure the encoding of your .CSV file is set to Mac OS if you are running the kit on a different operating system. There are many different combinations of .CSV editors and encodings, so if you are encountering any issues chances are you just need to set your .CSV files to Mac OS encoding (or change the line endings of your .CSV files to Macintosh (CR)). We have included working example .CSV files in the QuestionDataExamples folder of the project.

If you are using Notepad++ on Windows, you can convert your .CSV files as follows:

In Notepad++ (not to be confused with ordinary Notepad), there is a function to prepare text files with UNIX-style line endings. To write your file in this way, while you have the file open, go to the Edit menu, select the "EOL Conversion" submenu, and from the options that come up select "UNIX/OSX Format". The next time you save the file, its line endings will, all going well, be saved with UNIX-style line endings. You can check what format line endings you are currently editing in by looking in the status bar at the bottom of the window. Between the range box (a box containing Ln, Col and Sel entries) and the text encoding box (which will contain UTF-8, ANSI, or some other technical string) will be a box containing the current line ending format. In most cases, this box will contain the text "DOS\Windows". In a few cases, such as the file having been prepared on a UNIX or Linux machine or a Mac, it will contain the text "UNIX". It is possible, though highly unlikely by now, that the file may have old-style (pre-OSX) Mac line endings, in which case the box will contain the text "Macintosh". Please note that if you change a file's line ending style, you must save your changes before copying the file anywhere.