Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
Haloxx edited this page Jul 6, 2023 · 2 revisions

Kahoot Class Documentation

The Kahoot class represents a Kahoot quiz and provides methods to interact with the quiz data.

Class Details

Class: Kahoot

Attributes

  • uuid (str): The UUID of the Kahoot quiz.
  • data (dict or False): The loaded data of the Kahoot quiz if successful, or False if unsuccessful.

Methods

__init__(self, uuid)

Initializes a new instance of the Kahoot class.

Parameters:

  • uuid (str): The UUID of the Kahoot quiz.
  • dict: The loaded data of the Kahoot quiz.

get_quiz_details(self)

Retrieves the details of the Kahoot quiz.

Returns:

  • dict: A dictionary containing the following details:
    • uuid (str): The UUID of the quiz.
    • creator_username (str): The username of the creator.
    • title (str): The title of the quiz.
    • description (str): The description of the quiz.
    • cover (str): The cover image URL of the quiz.

get_questions(self)

Retrieves the questions of the Kahoot quiz.

Returns:

  • list: A list of dictionaries representing the questions of the quiz.

get_question_names(self)

Retrieves the names of the questions in the Kahoot quiz.

Returns:

  • list: A list of strings representing the names of the questions.

get_quiz_length(self)

Retrieves the number of questions in the Kahoot quiz.

Returns:

  • int: The number of questions in the quiz.

get_question_details(self, question)

Retrieves the details of a specific question in the Kahoot quiz.

Parameters:

  • question (int): The index of the question.

Returns:

  • dict: A dictionary containing the details of the question.

get_answer(self, question)

Retrieves the answer(s) of a specific question in the Kahoot quiz.

Parameters:

  • question (int): The index of the question.

Returns:

  • list or None: A list of answers if the question is not a content question, or None if it is a content question.