Personal AI Tutor
License
—
Deps
1
Install Size
—
Vulns
✓ 0
Published
Dec 2, 2025
$ dotnet add package ScolariCoreScolariCore is a .NET library designed to generate exam questions using the Gemini LLM. It provides a simple and intuitive API to request questions based on various parameters like subject, topic, education system, and grade level.
(Instructions on how to install the NuGet package will go here once published.)
dotnet add package ScolariCore
To start generating questions, you need to instantiate the ExamQuestionsGenerator with your Gemini API key and the desired model.
using ScholariCore.ExamQuestions;
// Replace with your actual Gemini API key and desired model
string apiKey = "YOUR_GEMINI_API_KEY";
string model = "gemini-pro"; // Or another suitable Gemini model
var generator = new ExamQuestionsGenerator(apiKey, model);
Define the parameters for your desired exam questions using the ExamQuestionRequest object.
var request = new ExamQuestionRequest
{
Subject = "Mathematics",
Topic = "Algebra",
EducationSystem = "US",
Level = "High School",
NumberOfQuestions = 3
};
Call the GenerateQuestionsAsync method with your ExamQuestionRequest to get a list of ExamQuestion objects.
List<ExamQuestion> questions = await generator.GenerateQuestionsAsync(request);
foreach (var question in questions)
{
Console.WriteLine($"Question: {question.Question}");
Console.WriteLine("Answers:");
foreach (var answer in question.Answers)
{
Console.WriteLine($"- {answer}");
}
Console.WriteLine($"Correct Answer: {question.CorrectAnswer}");
Console.WriteLine($"Explanation: {question.Explanation}");
Console.WriteLine($"Brief Explanation: {question.BriefExplanation}");
Console.WriteLine("---");
}
ExamQuestionsGenerator ClassThe main class for generating exam questions.
ExamQuestionsGenerator(string apiKey, string model)
apiKey: Your Gemini API key.model: The Gemini model to use for question generation (e.g., "gemini-pro").Task<List<ExamQuestion>> GenerateQuestionsAsync(ExamQuestionRequest examQuestionRequest)
examQuestionRequest.Task that resolves to a List<ExamQuestion>.ExamQuestionRequest ClassRepresents a request for exam questions.
string? Topic: The specific topic for the questions (optional).string Subject: The subject of the questions (e.g., "Mathematics", "History").string EducationSystem: The education system context (e.g., "US", "UK").string Level: The grade or difficulty level (e.g., "High School", "University").int NumberOfQuestions: The desired number of questions to generate.ExamQuestion ClassRepresents a generated exam question.
string Question: The text of the question.List<string> Answers: A list of possible answers for multiple-choice questions.string CorrectAnswer: The correct answer to the question.string Explanation: A detailed explanation for the correct answer.string BriefExplanation: A concise explanation for the correct answer.