Repository navigation
feat(courses): course ratings and reviews - #193
Draft
FaisalMisbah23 wants to merge 2 commits into
Draft
FaisalMisbah23 wants to merge 2 commits into
FaisalMisbah23 wants to merge 2 commits into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Learners who complete a course can rate it once on a 1–5 scale with an optional written review. The ask happens at the moment of completion, can be dismissed for good, and then stays available through a small on-demand link. Ratings feed a public average, count, star distribution, and review list on the catalog, and a rating card in the course reports for instructors.
What changed
Adds the
CourseRatingmodel (unique per learner and course) with cachedCourse.ratingAverage/ratingCount, plusEnrollment.ratingDismissedAt; migrations20261106180000_add_course_ratingsand20261106200000_add_rating_dismissed_at;PUTandGET /api/v1/courses/:courseSlug/rating(completion-only, upsert, aggregate recomputed in the same transaction),POST /api/v1/courses/:courseSlug/rating/dismiss, and publicGET /api/v1/catalog/:courseSlug/reviews; rating aggregates on catalog summaries and detail plus the learner's own rating and dismissal state on the course overview; aratingsblock on the course report; and the frontend pieces —StarRating/StarRatingInput, the completion-modal rating prompt, theCourseRatingCardwith persisted "Not now", the on-demandCourseRatingLinkin the course hero (via a new optionalratingLinkslot in the shared overview components), star summaries on catalog cards and the catalog course page, and the instructor rating card.Privacy
Only learners with a completed enrollment can rate, one rating per learner per course, editable. Public reviews use a first-name-plus-initial label ("Ada M."); instructors see the same label in reports.
Out of scope
Notifications to mentors or learners, mentor replies to reviews, and a full "all reviews" page (reports shows the five most recent). Those are follow-ups.