-
-
Notifications
You must be signed in to change notification settings - Fork 174
feat: add personalized course recommendation system for students #1039
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
Open
ayesha1145
wants to merge
1
commit into
alphaonelabs:main
Choose a base branch
from
ayesha1145:feat/course-recommendations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block title %}Course Recommendations{% endblock title %} | ||
|
|
||
| {% block content %} | ||
| <div class="container mx-auto px-4 py-8"> | ||
| <h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">Recommended for You</h1> | ||
| <p class="text-gray-500 dark:text-gray-400 mb-8">Courses picked based on your learning interests and activity.</p> | ||
| {% if recommendations %} | ||
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> | ||
| {% for course in recommendations %} | ||
| <div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg hover:shadow-xl transition duration-200 overflow-hidden flex flex-col"> | ||
| {% if course.image %} | ||
| <img src="{{ course.image.url }}" alt="{{ course.title }}" class="w-full h-36 object-cover"> | ||
| {% else %} | ||
| <div class="w-full h-36 bg-teal-100 dark:bg-teal-900 flex items-center justify-center"> | ||
| <i class="fas fa-book-open text-teal-500 dark:text-teal-300 text-3xl" aria-hidden="true"></i> | ||
| </div> | ||
| {% endif %} | ||
| <div class="p-4 flex flex-col flex-1"> | ||
| <span class="text-xs text-teal-600 dark:text-teal-400 font-medium mb-1">{{ course.subject }}</span> | ||
| <h3 class="font-semibold text-gray-900 dark:text-white text-sm mb-1 line-clamp-2">{{ course.title }}</h3> | ||
| <p class="text-xs text-gray-500 dark:text-gray-400 mb-3">by {{ course.teacher.get_full_name|default:course.teacher.username }}</p> | ||
| <div class="flex items-center justify-between mt-auto"> | ||
| <span class="text-sm font-bold text-gray-900 dark:text-white"> | ||
| {% if course.price == 0 %}Free{% else %}${{ course.price }}{% endif %} | ||
| </span> | ||
| {% if course.average_rating %} | ||
| <span class="text-xs text-yellow-500"> | ||
| <i class="fas fa-star mr-1" aria-hidden="true"></i>{{ course.average_rating|floatformat:1 }} | ||
| </span> | ||
| {% endif %} | ||
| </div> | ||
| <a href="{% url 'course_detail' course.slug %}" | ||
| class="mt-3 block text-center bg-teal-300 hover:bg-teal-400 dark:bg-teal-600 dark:hover:bg-teal-500 text-white text-sm font-semibold px-3 py-2 rounded-lg transition duration-200 focus:outline-none focus:ring-2 focus:ring-teal-300"> | ||
| View Course | ||
| </a> | ||
ayesha1145 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| {% else %} | ||
| <div class="text-center py-16"> | ||
| <i class="fas fa-search text-4xl text-gray-300 dark:text-gray-600 mb-4" aria-hidden="true"></i> | ||
| <p class="text-gray-500 dark:text-gray-400">No recommendations yet. Enroll in a course to get personalized suggestions!</p> | ||
| <a href="{% url 'course_search' %}" class="mt-4 inline-block bg-teal-300 hover:bg-teal-400 dark:bg-teal-600 dark:hover:bg-teal-500 text-white font-semibold px-6 py-2 rounded-lg transition duration-200 focus:outline-none focus:ring-2 focus:ring-teal-300"> | ||
| Browse Courses | ||
| </a> | ||
| </div> | ||
| {% endif %} | ||
| </div> | ||
| {% endblock content %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.