Loading repository dataβ¦
Loading repository dataβ¦
ritikpandey01 / repository
π― Smart quiz solver for Any platform. Uses AI to automatically answer multiple choice questions and generate codes with 90% accuracy.
Automate any online course with AI-powered quiz solving!
A smart Python script that handles course navigation and quiz completion on any e-learning platform using Playwright and Groq AI. Simply configure it once for your platform and let it do the work.
π Universal Platform Support - Works with any e-learning platform
π§ AI Quiz Solver - Handles multiple-choice, text, and coding questions
π€ Smart Navigation - Automates login, course access, and quiz flow
π Secure Setup - Credentials stored safely in .env files
π Detailed Logging - Track everything in quiz_automation.log
π οΈ Fully Customizable - Adapt to any platform or course structure
git clone https://github.com/ritikpandey01/Course-Automation
cd course-automation
pip install -r requirements.txt
playwright install
Create a .env file:
PLATFORM_EMAIL=your_email@example.com
PLATFORM_PASSWORD=your_password
GROQ_API_KEY=your_groq_api_key
Edit config.json to match your platform and course:
{
"platform": "YourPlatform",
"url": "https://yourplatform.com/login",
"course_name": "Your Course Name",
"course_frame": "",
"login": {
"email": {"role": "textbox", "name": "Email"},
"password": {"role": "textbox", "name": "Password"},
"button": {"role": "button", "name": "Sign In"}
},
"course_navigation": {
"role": "link",
"name": "Start Course"
},
"contents_navigation": {
"role": "button",
"name": "Contents"
},
"back_to_contents": {
"role": "link",
"name": "Back to Course"
},
"units": [
{
"name": "Module 1",
"subtopics": [
{"name": "Introduction", "quiz": "Quiz 1"},
{"name": "Basics", "quiz": "Quiz 2"}
]
}
],
"submit_buttons": [
{"role": "button", "name": "Submit"},
{"role": "button", "name": "Next"}
],
"next_buttons": [
{"role": "button", "name": "Next"},
{"role": "button", "name": "Continue"}
],
"quiz_prompt": "You are a helpful assistant. Answer this quiz question based on the provided context. Give only the answer, no explanations.",
"code_prompt": "You are a coding assistant. Write clean, working code to solve this programming problem. Only provide the code solution."
}
python automate_platform.py
The browser will open and automate your course. Check quiz_automation.log for progress!
Use browser dev tools (F12) to find the right selectors:
role and name attributes{"role": "button", "name": "Submit"}Every platform is different! Modify these sections in config.json:
Want to handle drag-and-drop or other question types?
solve_quiz() function:if page.locator(".drag-drop-container").is_visible():
handle_drag_drop_question(page, config)
def handle_drag_drop_question(page, config):
# Your custom logic here
pass
config.json:{
"drag_drop_prompt": "Instructions for drag-and-drop questions..."
}
Everything is logged in quiz_automation.log:
Script runs with visible browser (headless=False) so you can:
quiz_prompt and code_prompt for better resultsWant to improve the script? Here's how:
git checkout -b cool-featuregit commit -m 'Add cool feature'git push origin cool-featureIdeas for contributions:
Ready to automate your courses? π
Configure config.json for your platform, run the script, and watch the magic happen. Check the logs if anything goes wrong!