Skip to content

[Bugfix:TAGrading] Restrict submission view before grading#12813

Merged
bmcutler merged 8 commits into
Submitty:mainfrom
AtCloudDiwash:fix/limited-access-grader-view-11372
Jun 4, 2026
Merged

[Bugfix:TAGrading] Restrict submission view before grading#12813
bmcutler merged 8 commits into
Submitty:mainfrom
AtCloudDiwash:fix/limited-access-grader-view-11372

Conversation

@AtCloudDiwash

@AtCloudDiwash AtCloudDiwash commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Fixes #11372

Limited access graders were able to view student submissions before the grade start date. They should only be able to view submissions once grading officially opens.

What is the New Behavior?

A check is added in ElectronicGraderController.php that blocks limited access graders from viewing submissions if the current date is before the grade_start_date. They are redirected to the course home page with an error message.

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Create a gradeable with a grade start date set in the future
  2. Log in as a Limited Access Grader
  3. Attempt to view a student submission for that gradeable
  4. Before fix: submission is visible
  5. After fix: redirected with error message
Screenshot 2026-05-27 at 1 44 20 AM

Automated Testing & Documentation

No automated tests added. A new issue can be opened to track adding tests for this access control check.

Other information

No breaking changes. No migrations required.

@bmcutler

Copy link
Copy Markdown
Member

We will need to have automated tests of this feature before it can be merged

@Rkoester47 Rkoester47 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the functionality for the changes described on this PR, and can confirm that they are working properly. As a limited access grader, I cannot view a submission for a gradeable with a grading start date in the future.

Please make some cypress tests for this PR that test the functionality as well and I will approve. The tests should login as an instructor to submit for students to a future grading start date, then login as 'grader' and verify that the grader is redirected as desired.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Apr 30, 2026
@AtCloudDiwash

Copy link
Copy Markdown
Contributor Author

Hi @Rkoester47, thank you for noticing my contribution. I have added the Cypress tests as requested. The test logs in as instructor, submits on behalf of student with user id "boehmd", then logs in as the limited access grader and verifies
that they are redirected with an error message when trying to view the submission before the grade start date.

Please let me know if any changes are needed.

@AtCloudDiwash
AtCloudDiwash requested a review from Rkoester47 May 1, 2026 01:20
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development May 1, 2026
@AtCloudDiwash

Copy link
Copy Markdown
Contributor Author

Hello @Rkoester47, could you please review the following changes and the cypress test associated with the change as per requested.

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.67%. Comparing base (9fe4117) to head (533d6fb).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12813      +/-   ##
============================================
- Coverage     21.67%   21.67%   -0.01%     
- Complexity     9802     9804       +2     
============================================
  Files           268      268              
  Lines         36723    36727       +4     
  Branches        489      489              
============================================
  Hits           7960     7960              
- Misses        28278    28282       +4     
  Partials        485      485              
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.02% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.72% <0.00%> (-0.01%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GarvitKhandelwal31 GarvitKhandelwal31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the functionality everything looks good to me. Solution is well implemented.

Image Just that in the error message you can see the word grading appears broken and half of that comes in next line. Can we improve on this. Also after your changes make sure you add the screenshots in the description. I will approve the PR after that

@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development May 22, 2026
@AtCloudDiwash

Copy link
Copy Markdown
Contributor Author

@GarvitKhandelwal31. Tweaked Css to address the issue. Do review the changes. I have also attached the screenshot for the UI change.

@GarvitKhandelwal31 GarvitKhandelwal31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes and the UI warning banner looks good to me. The code looks clean as well.

@bmcutler
bmcutler merged commit 403c54a into Submitty:main Jun 4, 2026
22 of 25 checks passed
@github-project-automation github-project-automation Bot moved this from Work in Progress to Done in Submitty Development Jun 4, 2026
AtCloudDiwash added a commit to AtCloudDiwash/Submitty that referenced this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Limited Access Grader view submissions

4 participants