E2602 - Spring - Backend Changes#322
Open
ravisatyarsg wants to merge 5 commits intoexpertiza:mainfrom
Open
Conversation
Generated by 🚫 Danger |
johnmweisz
reviewed
Apr 2, 2026
| FROM ruby:3.4.5 | ||
|
|
||
| LABEL maintainer="Ankur Mundra <ankurmundra0212@gmail.com>" | ||
| # Install dependencies |
There was a problem hiding this comment.
Revisions to shared files like this are likely going to lead to conflicts and reduce the chance of this PR ever getting merged.
johnmweisz
reviewed
Apr 2, 2026
| end | ||
| collection do | ||
| get :list, action: :list | ||
| get :view |
There was a problem hiding this comment.
No. Since this is a collection route, it does not take :id in the path. It expects GET /student_tasks/view?id=:id as a query-param alias to GET /student_tasks/:id.
johnmweisz
reviewed
Apr 2, 2026
| host: <%= ENV.fetch("DB_HOST", "127.0.0.1") %> | ||
| port: <%= ENV.fetch("DB_PORT", 3306) %> | ||
| username: <%= ENV.fetch("DB_USERNAME", "root") %> | ||
| password: <%= ENV.fetch("DB_PASSWORD", "expertiza") %> |
There was a problem hiding this comment.
I do think the default changes are valid, however, if I'm deciding to merge this or not, the changes below would make me very nervous.
johnmweisz
reviewed
Apr 2, 2026
backend_implementation_report.txt
Outdated
| @@ -0,0 +1,155 @@ | |||
| Backend implementation report for the Student Task View work described in instructions.txt | |||
There was a problem hiding this comment.
I think this is what the Wiki is for, consider removing this AI generated file.
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.
This PR implements the frontend for the Student Task View (E2602) in React + TypeScript. The previous StudentTasks component was incorrectly implemented as a topic signup sheet. This PR replaces it with a correct task list view and adds a new task detail view, both fully integrated with the backend API.
Changes
New files:
src/pages/StudentTasks/StudentTasks.tsx — rewrites the list view to call GET /student_tasks and render a table of all assigned tasks
src/pages/StudentTasks/StudentTaskDetail.tsx — new detail view calling GET /student_tasks/:id, renders assignment info, team, stage timeline, reviewer feedback, submission feedback, and revision request form
src/pages/StudentTasks/StudentTaskColumns.tsx — TanStack column definitions with clickable assignment name links and colored stage badges
src/pages/StudentTasks/studentTaskTypes.ts — TypeScript interfaces matching the backend as_json response shape
src/pages/StudentTasks/tests/StudentTasks.test.tsx — 14 tests for the list view
src/pages/StudentTasks/tests/StudentTaskDetail.test.tsx — 20 tests for the detail view
Modified files:
src/App.tsx — added StudentTaskDetail import and updated the student_tasks/:participantId route to point to the new detail component
Features
Task list table with assignment, course, topic, current stage badge, stage deadline, and review grade columns
Navigation from list to detail via assignment name link or "View Details" button
Detail page with stage timeline (submission → review → feedback phases with status badges), team members, reviewer feedback, submission feedback, and revision request form
Loading state, empty state, and error state handled in both views
Redux alert dispatched on API failure
Both routes protected with ProtectedRoute
Tests (34 total, all passing)
Rendering: task table, column data, stage badges, grade display
Navigation: assignment name click, View Details button click, back button
States: loading, empty, error alert dispatch
Detail rendering: assignment title, course, stage badge, topic, team, timeline, feedback, submission feedback, revision card
Revision form: show/hide, submit disabled when empty, enabled after typing, existing status display
API: correct URL and method called on mount for both components
Testing
npm test
press 'p' then type 'StudentTask' to filter to E2602 tests
34 tests, all passing
Backend PR
Title: E2602 — Stabilize and test Student Task View backend (Rails API)
Description:
Summary
This PR stabilizes and completes the backend for the Student Task View (E2602). It hardens the StudentTasksController, implements the StudentTask model for composed task payload construction, adds revision request support, and provides comprehensive RSpec test coverage across request, model, and routing specs.
Changes
New files:
app/models/student_task.rb — composed task payload built from AssignmentParticipant and related models (assignment, course, team, topic, deadlines, timeline, feedback, revision request)
app/models/revision_request.rb — persistent revision request model linking participant, team, and assignment with status validation and pending-request uniqueness
db/migrate/20260322174500_create_revision_requests.rb — creates the revision_requests table
spec/requests/api/v1/student_tasks_controller_spec.rb — 457 lines of request specs
spec/models/student_task_spec.rb — 185 lines of model specs
spec/routing/student_tasks_routing_spec.rb — routing specs
Modified files:
app/controllers/student_tasks_controller.rb — hardened with ownership checks (403 for cross-student access), not-found handling (404), and revision request submission action
config/routes.rb — added request_revision member route, list and view collection routes, and revision_requests resource routes
Authorization
401 returned for requests without a valid JWT
403 returned when a student accesses another student's task
404 returned for invalid participant IDs
Revision approval/decline restricted to the assignment instructor
Tests (56 examples, 0 failures)
Request specs:
Successful task list retrieval with full payload validation
Empty task list for student with no assignments
Unauthorized access without token
Successful task detail retrieval
Forbidden access to another student's task
Invalid task ID (not found)
Revision request creation, duplicate rejection, and ineligible task rejection
Instructor revision review flows
Model specs:
Task payload construction from participant
JSON serialization shape
Participant lookup and nil handling
Deadline parsing
can_request_revision logic for all states
Testing
bashdocker compose exec app bundle exec rspec
spec/requests/api/v1/student_tasks_controller_spec.rb
spec/models/student_task_spec.rb
spec/routing/student_tasks_routing_spec.rb
--format documentation