Skip to content

Implement and test backend student task view workflow#305

Open
XiangjunMi832 wants to merge 1 commit intoexpertiza:mainfrom
XiangjunMi832:main
Open

Implement and test backend student task view workflow#305
XiangjunMi832 wants to merge 1 commit intoexpertiza:mainfrom
XiangjunMi832:main

Conversation

@XiangjunMi832
Copy link
Copy Markdown

What was implemented

  • Hardened the student task list and detail endpoints
  • Built student task responses from existing Expertiza model relationships instead of a standalone task table
  • Enforced authentication and ownership checks so students can only access their own task data
  • Preserved the legacy student task detail endpoint for compatibility
  • Added student revision request submission
  • Added instructor revision request review flow:
    • list revision requests for an assignment
    • view a revision request
    • approve or decline a pending revision request
  • Reduced the student_tasks routing surface to the endpoints actually supported by this backend

Student task response data

The backend task payload now includes:

  • assignment and course metadata
  • team and team member data
  • topic / project topic data
  • deadlines and timeline data
  • review feedback
  • submission feedback
  • latest revision request state
  • can_request_revision for action gating

Tests added

Request specs

  • successful task list retrieval
  • successful task detail retrieval
  • empty task list
  • unauthorized access
  • forbidden access to another student's task
  • invalid task IDs
  • legacy /student_tasks/view behavior
  • successful revision request creation
  • duplicate pending revision request rejection
  • rejection when revision requests are not allowed
  • instructor listing of revision requests
  • instructor/student visibility checks for revision requests
  • instructor approval and decline flows
  • invalid revision request IDs and invalid statuses

Model specs

  • StudentTask composed payload building and serialization
  • StudentTask deadline parsing and revision eligibility rules
  • RevisionRequest validations and duplicate pending request prevention

Routing specs

  • student_tasks
  • revision_requests

Verification

docker compose run --rm app bundle exec rspec spec/requests/api/v1/student_tasks_controller_spec.rb spec/requests/api/v1/revision_requests_controller_spec.rb spec/models/student_task_spec.rb spec/models/revision_request_spec.rb spec/routing/student_tasks_routing_spec.rb spec/routing/
revision_requests_routing_spec.rb

Result:

56 examples, 0 failures

## Notes

This PR covers the backend scope only.

@github-actions
Copy link
Copy Markdown

3 Warnings
⚠️ Pull request is too big (more than 500 LoC).
⚠️ Schema changes detected without a corresponding DB migration.
⚠️ RSpec tests seem shallow (single it blocks or no context). Consider improving test structure.

Generated by 🚫 Danger

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