Skip to main content

Quiz Module

Create quiz for your users and let them compete against each other.

Quiz Module
Create quiz for your users and let them compete against each other.
This module is open-source.
This module is storing data in your bot's database.
This module creates one top-level Slash-Command on your server.
This module has 3 configuration files.
This module is being actively used on over 1.3K other servers on SCNX.
This module is included for free in every plan. Learn more about prices.

Features

Easily create quizzes on your server, let your members compete on a leaderboard and automatically let them answer the specified amount of questions per day.

Setup

First step is to simply enable the module in your SCNX dashboard and configure the module.

Usage

To start a public quiz, use the /quiz create or /quiz create-bool commands as described below in the commands section. Note that you need to have the role from "Role needed to create quizzes" configured in the main configuration to use this command.

If there are quizzes created in the quiz list, every user can start a private quiz using the /quiz play command.

Commands

Understand the documentation
In these docs, name:<Type> is an option of a slash-command with name name and the type Type. Options that not required, are described as [name:<Type>]. If the action of a command is vastly different between required and not-required options, we might list them separately.
Examples
  • /moderate ban user:<Member>: This command (/moderate ban) has an required option with the name "user" that only accepts one member as a value.
  • /moderate ban victim:<Member> reason:<Text>: This command (/moderate ban) has an required option with the name "victim" that only accepts one member as a value and another required option with the name "reason" that accepts any text as an value.
  • /moderate ban victim:<Member> reason:<Text> [proof:<Attachment>]: This command (/moderate ban) has an required option with the name "victim" that only accepts one member as a value, another required option with the name "reason" that accepts any text as an value and a not-required option with the name "proof" which allows one attachment as its value.
CommandDescription
/quiz create <Description> <Channel> <Quiz duration> <Option 1> <Option 2> [<Can change vote?> <Options 3 to 9>]Creates a public quiz with the given description/question in the given channel. The bot then asks you to select one or more correct answers, which the users have to choose from. This command can only be used with the "Role needed to create quizzes" configured in the main configuration.
/quiz create-bool <Description> <Channel> [<Can change vote?> <Quiz duration>]Creates a public quiz with the given description/question in the given channel. Users can only answer with the in the settings configured values, by default they are simply "Yes" or "No". This command can only be used with the "Role needed to create quizzes" configured in the main configuration.
/quiz playPlay a private quiz configured in the CustomBot configuration.
/quiz leaderboardShows the leaderboard which displays the total and daily points of the top users.

Configuration

Main config

In this configuration file, you can do most of the quiz configurations. Open it in your dashboard.

FieldDescription
EmojisWhich emojis are used by the bot for the buttons. You can configure the emojis both for normal and boolean-only quiz.
Daily quiz limitHow many quiz users can play using /quiz play per day. Defaults to five.
Quiz leaderboard channelIf set, the bot automatically updates the quiz leaderboard in the channel. The channel should only be used for the leaderboard.
Role needed to create quizzesA role which is able to create quiz using the command. Note that this permissions does not change who is able to create quiz for /quiz play, as those need to be configured in the CustomBot configuration. This could be for example an "Event manager" role.
Mode for quiz selectionHow the next /quiz play quiz for a user is choosen: If set to "Random", every time the user uses the command, they'll receive any quiz from the quiz pool created in the bot configuration. Note that this may cause repeated questions more often. The other option is "Continuous", which tells your bot to just count up in the list of quiz and always choose the next one available, until the end is reached and the bot starts over again.
Live preview of resultsWhether the answers of the users on public quiz are shown live instead of only after the quiz ended.

Strings

The strings configuration allows you to customize the output messages of the module.

FieldDescription
titleThe title of the quiz shown in the embed title.
colorThe default embed color of active quiz messages, refer to supported colors for a list of all supported values.
optionsA text introducing the possible quiz options.
liveViewDisplayed before the live view section of the quiz message, if enabled.
expiresOnThe name of the extra field displayed if a quiz has an end date set.
thisQuizExpiresOnThe extra text displayed in the extra fields value if a quiz has an end date set. The %date% displays a Discord timestamp with the end date in the current users locale.
endedQuizTitleThe title of a quiz message embed if the quiz ended.
endedQuizColorThe color of a quiz message embed if the quiz ended.
leaderboardTitleThe title of the leaderboard displayed in the embed title.
leaderboardSubtitleThe subtitle of the leaderboard displayed in the embed description.
leaderboardColorThe color of the leaderboard embed.
leaderboardButtonThe text displayed on the leaderboard button.

Available quiz

In the quiz list quiz questions are managed. You can add, edit and remove quiz questions here.

Every quiz question has the following fields:

FieldDescription
Question or statementThe title of the quiz, which should be a question like "What's your favorite game?".
Time limitAfter which time the answer of a user is deemed invalid if they've taken longer than this time to answer. Defaults to one minute.
Correct answersA list of all correct answers. The correct options are shuffled together with the wrong answers. In the above example, this could be an element with the text "Minecraft".
Wrong answersThe opposite of the correct answers - if users answer this, they lose. For example, this could contain "Fortnite".

Troubleshooting

Quiz messages not being sent
  • Make sure your configuration is valid:
    • Make sure the quiz has at least one correct and one wrong answer.
    • Make sure the quiz has a title.
    • Make sure the strings configuration is valid, this especially applies to the field values which may not be left empty. Also, make sure the used embed color is valid, you can find a full list of all accepted colors on the "Additional Custom-Bot features" page.

    Leaderboard message not being sent
  • Make sure the channel you selected is empty without any messages so the bot can display the leaderboard.
  • Wrong emoji configuration
  • Try looking at the color of the button with your choice - if it's green, you won! Otherwise, you might have to read the Rock paper scissor rules again...
  • Stored data

    The following data is being stored about every quiz created using the bot:

    • The ID of the quiz message
    • The description/question of the quiz
    • List of options
    • List of votes
    • Date of last possible answer, if any
    • The channel ID of the channel the giveaway was started in
    • Whether users can change their vote or not
    • Whether the quiz was started publicly in a channel (similar to a poll) or privately using the /quiz play command
    • Which kind of quiz it is (for yes/no questions)
    • Metadata about the entry (date when created and last updated)

    The bot also stores the following data about every user that has participated in a quiz:

    • The user ID of the user
    • The amount of experience points (correct answers) they have in total
    • The amount of experience points they have today
    • The amount of quiz they've answered today
    • If random quiz sorting is disabled, the ID of the next quiz they will be shown
    • Metadata about the entry (date when created and last updated)

    Once a day, the amount of quiz users done on the day before are removed from the database. To remove all quiz related data, purge the module database.