Studio: Everything Quiz
Overview
Everything Quiz is an immersive app that generates complex, context-aware questions based on the objects or scenes captured through the camera. For example, if you capture an image of a book like Macbeth, the app may generate a question about recurring themes in the play. Users must select the correct answer from four options. The app challenges users' knowledge while offering a dynamic learning experience.
Controls
- Take Photo Button:
Captures an image and generates a contextually relevant quiz question. - Answer Options (A, B, C, D):
Select one of four possible answers for the question. - Leaderboard:
Tracks and displays the user's highest score (Best) and current score.
Components
Everything Quiz API
Description:
Manages the quiz generation and scoring mechanism based on the Gemini API and user interactions.
Schema:
- Question: Entity ID for displaying the generated quiz question.
- Ans1, Ans2, Ans3, Ans4: Entity IDs for the four multiple-choice answer options.
- Score: Entity ID for displaying the current score.
- Best: Entity ID for displaying the user's highest score.
Data:
- content: Stores the quiz content received from the Gemini API.
Functionality:
- Image Capture: Takes a screenshot of the AR scene and uses it to generate a quiz question.
- API Request: Sends the image and a prompt to the Gemini API to create a complex, context-aware quiz.
- Answer Validation: Compares the user's choice with the correct answer, updating the score or resetting it on incorrect answers.
- Leaderboard Update: Tracks and updates the user's highest score.
Project Setup
Main Entities:
- Take Photo Button: Initiates the quiz generation process.
- Answer Buttons: Allows users to select one of the four answer options.
- Score and Best: Displays the user's current and highest scores.
Organization:
- The component is registered using the ECS framework and manages quiz generation and user interactions.
Technical Details
Gemini API Integration:
The app uses the Gemini API to generate quiz questions based on captured images.Score Logic:
Points increase with each correct answer, but a single incorrect answer resets the score.Error Handling:
Includes robust error handling for API failures or invalid inputs.UI Updates:
Dynamically updates the question, answers, and score using ECS UI mutation functions.
Mapped Actions:
- Click:
- Binds the function to the photo button.
- Handles answer selection and validation.
Asset Attribution
- Gemini API:
Provides generative quiz content. - Niantic Studio:
Used for AR functionalities and ECS framework. Also used XR8 for screenshots
Other Work by GTXR Club