courses: course-scoped exam grading and submission management (fixes #10259) - #10260
courses: course-scoped exam grading and submission management (fixes #10259)#10260RyanS4 wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds manager-only course submissions and grading routes. Reuses ChangesCourse-scoped grading
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
src/app/submissions/submissions.component.html-56-67 (1)
56-67: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRender the new filter template explicitly.
The toolbar outlets resolve the root-level
#filterDropdownat line 43. The second#filterDropdownis scoped to the@ifblock and does not replace it. The Active/Inactive filter does not render.Use a distinct template reference and select it conditionally, or replace the original template.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/submissions/submissions.component.html` around lines 56 - 67, Update the submissions toolbar template so the Active/Inactive filter defined in the `@if` block is actually rendered instead of being shadowed by the root-level `#filterDropdown`. Give the conditional template a distinct reference and update the toolbar outlet selection to use it when filter.type is not 'survey', while preserving the existing filter for survey submissions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/courses/courses-router.module.ts`:
- Line 28: Add the existing course-manager authorization guard to the route
definition for submissions/:id in the router configuration, while preserving the
current component mapping and server-side authorization. Use the same guard
configuration pattern already used by neighboring protected course routes.
In `@src/app/courses/submissions-courses/courses-submissions.component.html`:
- Around line 1-3: Update the page-level loading spinner condition in the
template to use the required *ngIf="isLoading" directive instead of the `@if`
block, while preserving the translated “Loading submissions...” text on
planet-loading-spinner.
In `@src/app/submissions/submissions.component.ts`:
- Around line 217-219: Update the selector construction in the submissions
component’s courseId branch to escape all regex metacharacters in the route
value, then anchor the escaped value so the course ID matches the intended
course suffix exactly rather than arbitrary substrings or patterns. Preserve the
existing findDocuments and parentId query structure.
---
Other comments:
In `@src/app/submissions/submissions.component.html`:
- Around line 56-67: Update the submissions toolbar template so the
Active/Inactive filter defined in the `@if` block is actually rendered instead of
being shadowed by the root-level `#filterDropdown`. Give the conditional template
a distinct reference and update the toolbar outlet selection to use it when
filter.type is not 'survey', while preserving the existing filter for survey
submissions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: QUIET
Plan: Pro Plus
Run ID: 4220868a-23f5-4cb5-ac1c-b59f3b9b4eae
📒 Files selected for processing (11)
src/app/courses/courses-router.module.tssrc/app/courses/courses.component.htmlsrc/app/courses/courses.module.tssrc/app/courses/submissions-courses/courses-submissions.component.htmlsrc/app/courses/submissions-courses/courses-submissions.component.scsssrc/app/courses/submissions-courses/courses-submissions.component.spec.tssrc/app/courses/submissions-courses/courses-submissions.component.tssrc/app/courses/view-courses/courses-view.component.htmlsrc/app/exams/exams-view.component.tssrc/app/submissions/submissions.component.htmlsrc/app/submissions/submissions.component.ts
Fixes #10259
Summary
Addresses discussion from #10255 by introducing a dedicated course-scoped exam grading and submission management page (
/courses/submissions/:id) for Course Managers.Key Features & Implementation
/courses/submissions/:id):CoursesSubmissionsComponent(src/app/courses/submissions-courses/) providing Course Managers with a dedicated space to view and grade exam submissions scoped strictly to a specific course.SubmissionsComponent):<planet-submissions [courseId]="courseId" [hideHeader]="true">to provide full submission table sorting, pagination, and status filtering without duplicating code.@Input() courseIdtoSubmissionsComponentto filter Mango queries by course ID suffix (@${escapedCourseId}$).@Input() hideHeaderto suppress duplicate toolbar headers and redundant back navigation buttons when embedded.CoursesComponentand toolbar action button inCoursesViewComponentfor authorized course managers (canManage === true).ExamsViewComponent.setExam()to prioritizesubmissionIdinitialization overcourseId, eliminating infinite loading loops when opening a submission.setCourseListener()to skip step availability checks when viewing a specific submission, preventing false "This test is not available" alerts.courseIdand anchored patterns to@courseId$to guarantee exact course ID matching without substring collisions.Verification
courses-submissions.component.spec.ts(100% passing).npm run lintpassed with 0 errors.