About the Site
Hello! My name is Mr Wang and I'm a Computing Science teacher at Bellahouston Academy.
This site is a side project of mine to host various educational tools and resources, alongside any personal projects.
Please email me any suggestions or feedback at timothy.wang.me.uk(at)gmail.com.
Thanks for visiting!
Site Details
This site is a Django web app, hosted on Render.
Click here to open the GitHub page for this project.
AI Quiz Generator
To this day, there is no official implementation in Microsoft Forms to generate using AI. There is however, a feature to import a Word Document which can be parsed as a quiz or survey. My quiz generator app aims to provide a way to quickly generate multiple choice quizzes (MCQs) which can be imported into Forms using its "Quick Import" feature.
This drastically speeds-up the process of generating and importing a quiz into Forms compared to copy-pasting each question and possible answer into the site.
Technical Details
The app generates a prompt from the form input, which is passed into the Azure API. Currently, the model uses the GPT-4o Mini model for response generation, which was chosen for its cost efficiency.
Pre-prompts
The prompt which is passed into the Azure API is made up of a "system prompt" and a "user prompt". First, the form data is posted into a function like so:
subject = request.POST.get("subject")
topic = request.POST.get("topic")
level = request.POST.get("level")
no_of_questions = request.POST.get("no_of_questions")
no_of_choices = request.POST.get("no_of_choices")
additional_info = request.POST.get("additional_info")
# Create prompt
text = generate_text(
subject,
topic,
level,
no_of_questions,
no_of_choices,
additional_info
)
filepath = create_quiz_doc(text)
This is combined with the system prompt which is as follows:
system_prompt = """
You are a helpful assistant that creates multiple-choice quiz documents.
Do not include any formatting symbols in your response.
Do not respond with any follow-up questions.
Your response will follow a specific format:
- For each question, begin with the question number.
- Do not use bullet points, only new lines.
- Under each question, insert a new line and then the possible answer beginning with the letter from A.
- Between each question, add an additional new line.
- Make option A the correct answer for each question.
You will be making quizzes which secondary teachers in Scotland will be using. This means that:
- Quizzes for S1-3s should contain questions which are answerable by 12-14 year olds.
- National 4/5, Higher, and Advanced Higher quizzes should contain content which is applicable for those courses.
The user prompt will contain the details for the quiz.
"""
The response from this prompt is used to create a Microsoft Word docx file with the help of Python's docx library, which is finally downloaded to the user's system.
Click here to use the quiz generator.