-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature to add YouTube videos with AI-generated quizzes #3794
base: main
Are you sure you want to change the base?
Add feature to add YouTube videos with AI-generated quizzes #3794
Conversation
Fixes OWASP-BLT#3769 Add feature to allow users to add educational YouTube videos with AI-generated quizzes. * Add `YouTubeVideoForm` in `website/forms.py` to handle YouTube link input and description. * Add `add_youtube_video` view function in `website/views/education.py` to handle form submission, validate YouTube link, process video transcript using OpenAI, generate quiz, and save lecture. * Update `website/templates/education/education.html` to include a form for inputting YouTube video link and description. * Add new modal for adding YouTube videos in `website/templates/education/includes/add_lecture_modal.html` with fields for YouTube link and description.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the idea is to let anyone even if they’re not logged in to post an educational YouTube video so I was thinking of having some verification on the YouTube video and will detect if it’s really an educational video and not spam so maybe we can only accept videos that have more than 100 views and we will run the transcript through open AI to detect if there is educational value as well as generate the quiz I would also like to see a new model for the quiz unless we have one already, but I don’t think we do.
<input type="url" id="youtube_url" name="youtube_url" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500" required> | ||
</div> | ||
<div class="mb-4"> | ||
<label for="description" class="block text-sm font-medium text-gray-700">Description</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove anything other than URL so remove the description here
@@ -25,6 +25,7 @@ <h5 class="text-xl font-semibold text-gray-800">Add New Lecture</h5> | |||
<option value="VIDEO" selected>Video Lecture</option> | |||
<option value="LIVE">Live Session</option> | |||
<option value="DOCUMENT">Document</option> | |||
<option value="YOUTUBE">YouTube Video</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to make any changes on this page
User description
Fixes #3769
Add feature to allow users to add educational YouTube videos with AI-generated quizzes.
YouTubeVideoForm
inwebsite/forms.py
to handle YouTube link input and description.add_youtube_video
view function inwebsite/views/education.py
to handle form submission, validate YouTube link, process video transcript using OpenAI, generate quiz, and save lecture.website/templates/education/education.html
to include a form for inputting YouTube video link and description.website/templates/education/includes/add_lecture_modal.html
with fields for YouTube link and description.PR Type
Enhancement, Tests
Description
Added functionality to upload YouTube videos with AI-generated quizzes.
Introduced
YouTubeVideoForm
for handling YouTube video input and description.Updated templates to support YouTube video addition and modal integration.
Implemented backend logic for video validation, transcript processing, and quiz generation.
Changes walkthrough 📝
education.html
Add YouTube video upload form to education page
website/templates/education/education.html
add_lecture_modal.html
Extend lecture modal to support YouTube videos
website/templates/education/includes/add_lecture_modal.html
forms.py
Add YouTube video form for input validation
website/forms.py
YouTubeVideoForm
for handling YouTube video input.education.py
Implement backend logic for YouTube video uploads
website/views/education.py
add_youtube_video
view for handling video uploads.