Development: Show saved commit in assessment editor
#11394
Closed
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.
Checklist
General
Client
Changes affecting Programming Exercises
Motivation, Context and Description
When online editor changes are saved but not submitted/committed, the server-side working copy can be left dirty or even conflicted if the student also pushes from a local clone. During assessment this can lead to the file browser showing "Unsubmitted" and, at times, stale file content (e.g., showing an unsent "2" instead of the latest committed "3"). Tutors then have to manually use "Resolve Conflicts" before assessing.
Closes #10008.
This PR ensures assessors see the latest committed code by automatically normalizing the repository working copy in tutor assessment:
UNCOMMITTED_CHANGESorCONFLICT, the client callsresetRepository()and then re-checks status before loading files.Steps for Testing
Prerequisites: 1 Instructor, 1 Tutor (or Instructor acting as Tutor), 1 Student, LocalVC/LocalCI test server.
Verify:
Review Progress
Code Review
Manual Tests
Test Coverage
Client-only behavioral change; no new code paths with complex logic to unit test. The change hooks into the existing initialization flow and reuses
resetRepository()and status checks. If preferred, we can add a small test that verifies the auto-reset branch invokesresetRepository()in tutor assessment whencommitStateis dirty/conflicted.Screenshots
No UI layout changes; status and content correctness can be verified via the Steps for Testing.
Documentation
Rationale and line-by-line explanation: see
ttt.md.