Multiple choice quiz
Nojo23
31 Aug 2016, 04:31I want to integrate a multiple choice quiz into my TA. One question, with four possible answers. I also want it to restart if you get a question wrong. I'm using the browser based version. THis is my first project so sorry if it's a little nooby. Thanks1
hegemonkhan
31 Aug 2016, 10:57the browser/online version's GUI~Editor is a bit more limited and annoying to use, so if you can, downloading the desktop/offline version is recommended. As it also let's you get into your game code, which you can post, allowing us to help fix it up for you, if you got any issues as you try to make your game.
look into using:
- the 'show menu' (popup menu window) Script/Function, or the 'ShowMenu' (inline: as hyperlinks in the big text box / left side) Script/Function
here's an example:
<function name="q1_function">
show menu ("How many eyes does a human have?", split ("zero;one;two;three;four", ";"), false) {
// quest hidden from you, does this for you: result = YOUR_SELECTED_MENU_CHOICE
// (also for the 'get input' Script/Function, quest does the same: result = YOUR_TYPED_IN_INPUT)
if (result = "two") {
msg "(Correct, good job!")
wait {
ClearScreen
}
} else {
msg ("Incorrect, try again.")
wait {
ClearScreen
q1_function
}
}
}
</function>
- Functions (easier to do the looping with them) - using Objects and 'invoke/do' for looping their Script Attributes are a bit more difficult to explain, but they can be a much better design than using Functions
- Attributes: the 'set a variable or attribute' Script/Function: if you want to keep record/track of for example: how many questions correct, incorrect, and (out of) the quantity of questions, and etc stuff.
- conditional scripting: the 'if' Script/Function
some useful links/resources:
http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/guides/
http://docs.textadventures.co.uk/quest/guides/character_creation.html
http://docs.textadventures.co.uk/quest/tutorial/