Problem: Managing and updating course materials like documents, presentations, and videos is often a manual process.
Solution: Automates the upload and management of course content, categorizing materials by type and course.
Benefits: Ensures that all course materials are easily accessible and up-to-date, reducing manual effort.
Adoption: This can be extended to automatically send content updates to students or integrate with a Learning Management System (LMS).
Code:
import os
# Function to upload course material
def upload_material(course_name, material_type, file_path):
course_dir = f"{course_name}_materials"
os.makedirs(course_dir, exist_ok=True)
material_name = os.path.basename(file_path)
destination_path = os.path.join(course_dir, material_name)
os.rename(file_path, destination_path)
print(f"{material_name} has been uploaded to {course_name}.")
# Sample file upload (assuming a file exists in the current directory)
upload_material('Python Programming', 'Lecture Notes', 'python_intro.pdf')
No comments:
Post a Comment