Skip to content

dhananjaykuber/gemini-quiz-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gemini Quiz Generator

Get Questions

Endpoint

GET /api/generate-quiz?description={description}&numQuestions={numQuestions}

Request Parameters

  • description (required): A brief description of the topic to generate quiz questions for (e.g., "Basics of variables in Rust programming language").
  • numQuestions (optional): The number of questions you want in the quiz (e.g., 4) and default is 5.

Example Request

GET /api/generate-quiz?description=Basics%20of%20variables%20in%20rust%20programming%20language&numQuestions=4

Response

{
  "description": "Basics of variables in rust programming language",
  "numQuestions": "4",
  "quiz": [
    {
      "question": "What keyword is used to declare a variable in Rust?",
      "options": ["var", "let", "const", "variable"],
      "answer": "let"
    },
    {
      "question": "Which statement is true about mutability of variables in Rust?",
      "options": [
        "All variables are mutable by default.",
        "Variables are immutable by default, and can be made mutable using the `mut` keyword.",
        "Variables are always immutable.",
        "Mutability is determined at runtime."
      ],
      "answer": "Variables are immutable by default, and can be made mutable using the `mut` keyword."
    },
    {
      "question": "What will happen if you try to reassign a value to an immutable variable?",
      "options": [
        "The program will run without any errors.",
        "A runtime error will occur.",
        "A compile-time error will occur.",
        "The value will be silently overwritten."
      ],
      "answer": "A compile-time error will occur."
    },
    {
      "question": "What is the difference between `let` and `const`?",
      "options": [
        "There is no difference; they are interchangeable.",
        "`let` declares a mutable variable, `const` declares an immutable variable.",
        "`let` declares a variable that can be reassigned, `const` declares a constant whose value must be known at compile time.",
        "`const` declares a variable, `let` declares a constant."
      ],
      "answer": "`let` declares a variable that can be reassigned, `const` declares a constant whose value must be known at compile time."
    }
  ]
}

About

A Node.js API that generates context-based questions using Gemini AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published