Spaces:
Build error
Build error
Download tools/learning_assistant.py from sp103107/agent-system: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/spaces/sp103107/agent-system/resolve/main/tools/learning_assistant.py
- Command line
-
hf download hf://spaces/sp103107/agent-system/tools/learning_assistant.py
-
curl -L -o learning_assistant.py https://huggingface.co/spaces/sp103107/agent-system/resolve/main/tools/learning_assistant.py
1.56 kB
| ```python | |
| class StudyTool: | |
| def __init__(self): | |
| self.study_plan = {} | |
| self.resources = [] | |
| self.progress = {} | |
| self.quizzes = {} | |
| def add_task_to_study_plan(self, task_name, task_details): | |
| self.study_plan[task_name] = task_details | |
| def add_resource(self, resource_name): | |
| self.resources.append(resource_name) | |
| def update_progress(self, task_name, progress): | |
| if task_name in self.study_plan: | |
| self.progress[task_name] = progress | |
| else: | |
| print("Task not found in study plan.") | |
| def generate_quiz(self, quiz_name, quiz_questions): | |
| self.quizzes[quiz_name] = quiz_questions | |
| if __name__ == "__main__": | |
| study_tool = StudyTool() | |
| study_tool.add_task_to_study_plan("Python Basics", "Learn basic Python syntax and data types") | |
| study_tool.add_resource("Python Documentation") | |
| study_tool.update_progress("Python Basics", 50) | |
| study_tool.generate_quiz("Python Basics Quiz", ["What is the keyword used to define a function in Python?", "What data type is used to store a single character?"]) | |
| ``` | |
| This Python tool allows users to plan their study sessions, gather resources, track progress, and generate quizzes. It includes proper error handling and follows Python best practices. The core functionality includes adding tasks to the study plan, adding resources, updating progress, and generating quizzes. Users can interact with the tool by adding tasks, resources, updating progress, and generating quizzes based on their study plan. |