Skip to content

TriviaDB #1527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

TriviaDB #1527

wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 8, 2025

Description

The TriviaDB Extension allows you to fetch trivia questions and answers, validate user responses, and reset the quiz for a new round. It simplifies the process of creating trivia games in GDevelop by handling data fetching, answer shuffling, and checking whether the selected answer is correct. Perfect for quiz-based projects!

This extension, excluding additional requirements, was written entirely using GDevelop's primary events, no JavaScript needed.

1 Example

Image

To enhance the user experience, the extension includes a feature that allows you to check if it’s working as expected by pressing Shift + I, which will display the results in the console. Additionally, the extension prevents 429 errors and unexpected behavior by using dynamic scene selection. This enables you to create multiple quizzes with random outputs. Although the extension currently supports a hardcoded selection of 5 parameters (1 question + 4 answers), TriviaDB can handle up to 50 parameters. However, the current setup is ideal for most quiz creators who don’t want to deal with custom quiz setups.

2 Example

Image

How to use the extension

TriviaDB Extension – Setup Guide

Extension Requirements

Before using the extension, you must install the following dependencies. If these are missing, data fetching will fail, resulting in blank output text.

Required Extensions:

Make sure these extensions are installed before proceeding.


Setup Guide

Step 1: Create Necessary Objects

  • Add 5 text objects:
    • 1 for the question
    • 4 for the answer choices
  • Add 4 buttons:
    • Each button represents an answer option and needs the appropriate behavior attached.

Step 2: Attach the Behavior

  • Assign the TriviaBehaviour to each PanelSpriteButton that will be used for selecting answers.

Step 3: Set Up the Event Logic

  • Follow the event structure shown in the images below to construct the correct event flow.

Event Flow Reference

Image Image Image Image Image

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

TriviaProject.zip

Extension file

TriviaDB.zip

@github-actions github-actions bot requested a review from a team as a code owner February 8, 2025 00:06
@github-actions github-actions bot added the ✨ New extension A new extension label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New extension A new extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant