Skip to content

feat(courses): course ratings and reviews - #193

Draft
FaisalMisbah23 wants to merge 2 commits into
mainfrom
feat/course-ratings
Draft

FaisalMisbah23 wants to merge 2 commits into
mainfrom
feat/course-ratings

Conversation

@FaisalMisbah23

Copy link
Copy Markdown
Collaborator

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 CourseRating model (unique per learner and course) with cached Course.ratingAverage / ratingCount, plus Enrollment.ratingDismissedAt; migrations 20261106180000_add_course_ratings and 20261106200000_add_rating_dismissed_at; PUT and GET /api/v1/courses/:courseSlug/rating (completion-only, upsert, aggregate recomputed in the same transaction), POST /api/v1/courses/:courseSlug/rating/dismiss, and public GET /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; a ratings block on the course report; and the frontend pieces — StarRating / StarRatingInput, the completion-modal rating prompt, the CourseRatingCard with persisted "Not now", the on-demand CourseRatingLink in the course hero (via a new optional ratingLink slot 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant