FooJiaYin / ai-quiz

Generate quiz from text input with OpenAI API

Home Page:https://deephow-ai-quiz-nn0q.onrender.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AI Quiz Generation

Demonstration of quiz generation using OpenAI's GPT-3.5 API.

Demo link: https://deephow-ai-quiz-nn0q.onrender.com

Features

  • Input text for generation
  • Select language (default to English)
  • Generate quiz questions from text
    • Main points
    • Multiple choice questions
    • True/false questions
    • Keywords and definition matching
    • Cloze questions
    • Cloze paragraph questions
    • Sort SOP steps
    • Fill in the blanks in SOP diagram

Limitations

  • The text input is limited to 1500 characters to avoid exceeding the token limit of the OpenAI API. Longer text will be truncated.

Future Work

  • Optimization for multiple choice questions
  • Retry failed generation requests

Development

Built with:

Prerequisites

  1. Node.js >= 16.10.0
  2. Yarn or npm or pnpm

Setup

  1. git clone this repository

  2. Install the dependencies:

    # yarn
    yarn install
    
    # npm
    npm install
    
    # pnpm
    pnpm install
  3. Create a .env file in the root directory and add the following environment variables:

    OPENAI_API_KEY=<your-openai-api-key>
    OPENAI_ORG_ID=<your-openai-org-id>

Development Server

Start the development server on http://localhost:3000

npm run dev #or
yarn run dev

Production

Build the application for production:

npm run build #or
yarn run build

Locally preview production build:

npm run preview

Deployment

Check out the deployment documentation for more information.

Note: Please make sure your deployment platform has sufficient timeout limit for the quiz generation API call.

For example, free plan of Vercel and Netlify are not recommended for this project as they have a 10s timeout limit for serverless functions. The quiz generation process may take longer than 10s.

Render, Heroku, Railway, DigitalOcean, AWS, Azure, Google Cloud are recommended for deployment.

About

Generate quiz from text input with OpenAI API

https://deephow-ai-quiz-nn0q.onrender.com


Languages

Language:JavaScript 64.4%Language:Vue 34.2%Language:TypeScript 1.4%