This script extracts text from PowerPoint slides and uses an AI model to generate multiple-choice questions in markdown, witch is then converted to a.xlsx file that can be uloaded to Kahoot.
Perfect for teachers, trainers, and anyone who wants to turn presentations into interactive quizzes with minimal effort! 🚀
- Select a PowerPoint (.pptx) file or an entire folder.
- The script scans the slides, extracts text, and sends it to an AI model.
- The AI returns multiple-choice questions in a table format.
- The script saves the questions as an Excel file, ready to upload to Kahoot.
Make sure you have Python installed. Then, install the required dependencies:
pip install python-pptx requests openpyxl tkinter-
Open a terminal or command prompt.
-
Run the script:
python "PowerPoint.to.Kahoot.Generator.py" -
A file dialog will appear. Choose a PowerPoint file or folder
-
The script processes the file(s) and saves a new Excel file with questions.
-
Alternatively, open the file in VS code, and just hit the run button. Ask copilot inside of VS code if it does not run.
- Go to Kahoot
- Click "Create new Kahoot"
- Click the Add question button on the left panel.
- In the window that pops up, find the Import spreadsheet option in the bottom right corner.
The script uses a local AI model. To change the model, update this section in process_pptx_file:
"model": "qwen2.5-7b-instruct-1m",Replace it with the desired model name.
The AI prompt is located in the data dictionary:
{"role": "system", "content": "In markdown. Language Norwegian if detected. Make 5 Questions..."}Change the text inside "content" to adjust the question format or language.
If you want to run a newer model, ask AI to help you google the formating for other models and then apply the adjusted code.
- Easy, Open LM studio. Download the suggested model. Press the turn on server button. Dubble check that port defaults to
1234. - If needed, adjust the
urlin this function:
url = "http://localhost:1234/v1/chat/completions"If you get stuck, feel free to ask for help or suggest improvements. Let's make learning fun! 🎉


