Giter Site home page Giter Site logo

thomasnguyen244 / ai-quiz-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quentin-mckay/ai-quiz-generator

0.0 0.0 0.0 54.97 MB

GPT-powered multiple choice quiz generator built with Next.js

JavaScript 95.08% TypeScript 0.15% CSS 4.78%

ai-quiz-generator's Introduction

AI Quiz Generator

Uses OpenAI's ChatGPT API to generate multiple choice quiz with user defined language, topic, and difficulty.

Features a loading screen with random facts to give the user something to do while the data is retrieved from the API and an ending screen with score-determined gifs and sarcastic messages.

View Live App

home page

Features

  • Customisable language, topic, difficulty, and number of questions
  • Loading screen that displays the live response stream and random webdev/programming facts (gives you something to do as it can take around 20-30 seconds for the quiz to generate)
  • Multiple choice Ed-style quiz with explanations and a progress bar
  • End screen with gifs, sarcastic messages, and confetti (>= 80%) that adapt to your quiz score
  • 14 track kahoot-flavored audio player (this is the real highlight, the quiz is just something to do while you're groovin ๐Ÿ˜)

Tech Used

  • Next.js 13.4 (using the new App router)
  • Tailwind CSS
  • OpenAI's gpt-3-turbo API

Packages Used

Tools

  • create-next-app (development and building)
  • Vercel (deployment)

OpenAI Integration

A custom prompt is created by interpolating user entered form data. Crucially, the response is asked to be returned in JSON format. Light "prompt engineering" was required to ensure the response was consistently in the correct format (for example: explicitly saying what the names of the keys should be).

prompt

The API is queried. After playing with the available parameters, I found leaving most of them at their default setting worked well.

api request

Screenshots

loading screen

quiz screen

end-screen

ai-quiz-generator's People

Contributors

quentin-mckay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.