Quiz
Runs a quiz on the screen, with buttons or a tilt of your head to answer. Say what the quiz is about, for example American history or your personality type.
Game engines, physics, quizzes, leaderboards, and the UI controls that tie it together.
Made with this blockInputs
quizTypeintIt can only be 0 or 1.
2 values
- 0
- Multiple choice quiz where there's a quiz with a single correct answer at each round and the user sees the score at the end (e.g. a quiz about animal trivia).
- 1
- Pick and reveal quiz where you pick an answer and you're shown what type you are at the end (e.g. a quiz that shows my potential career)
quizFormatintThe physical layout of the quiz, it can only be 0, 1 or 2.
3 values
- 0
- allows 4 buttons with multiple choice options.
- 1
- 2 buttons with button presses.
- 2
- 2 options where a user tilts their head in the direction to select (left = 0, right = 1) Note: -If you have quizFormat with 4 buttons then the quizData must have 4 answers per question, if the quizFormat is 2 buttons or head tilt, then the quizData must have 2 answers per question.
quizDatastringA markup format string that defines the quiz data structure. ** Type 0 Quiz ** - Multiple choice with one correct answer Purpose: A standard quiz format where each question has exactly four answer options, and only one of them is correct. Format Rules: Each question begins with * followed by the question text. Each answer begins with - (dash and space). The first answer is always the correct one. The remaining three are incorrect. Do not randomize or reorder answers. All questions must follow this structure. Insert a \n between newlines Example: * What is the largest planet in our solar system?\n Jupiter\n Earth\n Mars\n Venus\n\n What do pandas primarily eat?\n Bamboo\n Insects\n Fish\n Grass\n ** Type 1 Quiz ** - Personality matching (What-Are-You Style) Purpose: A personality quiz where each answer adds points to one or more predefined personality types. Each question has exactly two answers. Format Rules: A fixed set of personality types must be used consistently across all questions. Each question begins with * followed by the question text. Each answer begins with - (dash and space). Each answer is followed by one or more lines starting with +, which indicate the personality types it contributes to. Each question must have exactly two answers. The two answers in a single question must not share any of the same personality types. Insert a \n between newlines Example: * What kind of weather do you prefer?\n A sunny day at the beach\n + optimist\n + explorer\n A cold, rainy evening\n + introvert\n + thinker\n\n How do you deal with stress?\n Write in a journal\n + thinker\n + introvert\n Call a friend to talk\n + explorer\n + optimist\n
endingMessagestringThe message shown at the end of the quiz before the user's score or type is shown. e.g. endingMessage+" 5/7" for multiple choice quizzes or endingMessage+" an party animal" For a multiple choice quiz about American History, it's fitting to have the endingMessage be "Your American History quiz score is ". For a pickAndReveal quiz about your dream job its fitting to have the endingMessage be "Your dream job is a " The ending message should always follow the pattern of allowing a score to be added after it instead of inside of it e.g. "Your Geography Quiz score is ".
allowRetriesbooleanIf true, allows users to retake the quiz. Only allow this to be true if a user explicitly requests for retries or if the experience is a Pick and Reveal.
Events
onQuizStartedA function called when the quiz has started, allowing the experience to respond to this event. Call it through .onQuizStarted.add(()=>{Your code here});
onQuestionAnsweredA function called when a question has been answered, allowing the experience to respond to this event. Call it through .onQuestionAnswered.add(()=>{Your code here});
onQuizEndedA function called when the quiz has ended, allowing the experience to respond to this event. Call it through .onQuizEnded.add((result,score)=>{ // Use result if you want a string // Use score if you want a numeric value });
More in Games & Interactivity
- JoystickAdds an on-screen joystick that you drag to move or steer something in the Lens. Choose where it sits, how big it is, and how it looks.
- LeaderboardSaves the scores from your Lens and shows them in a ranked list. You can compare with friends and with people around the world.
- Physics2DMakes 2D objects fall, collide and bounce off each other like real things. It draws nothing itself, so the Lens needs something else to show the objects.
- Tic Tac ToeAdds tic tac toe on a 3D board, for one player against the Lens. Choose the look of the board and the two 3D pieces.
- Turn ManagerRuns a two player game that you send to a friend. You take a turn, then your friend opens the Lens and takes the next one.
- UI ButtonAdds a button you tap on screen. You choose the label, the color, the shape, pill or circle, and where it sits on the screen.
- UI Progress BarShows a bar that fills up to track progress, for a countdown, a timer or a level. You choose the size, the colors and up to three checkpoint marks.
- UI SliderAdds a bar you drag to set a value, for example how strong an effect is. The bar is horizontal, and you choose its size and colors.
- Video Control UIPlays your videos full screen, one after another, with play, pause and a bar you can drag. You add up to five videos.
- What X Are You?Spins through options above your head and stops on one, for example a star sign or a persona. You give up to six options, as text, pictures or both.
