Skip to content

Conversation

@theblobinthesky
Copy link
Contributor

@theblobinthesky theblobinthesky commented Sep 17, 2025

Checklist

General

Client

Changes affecting Programming Exercises

  • High priority: I tested the change with a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).

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:

  • On opening the programming assessment editor (tutor mode), if the repository status is UNCOMMITTED_CHANGES or CONFLICT, the client calls resetRepository() and then re-checks status before loading files.
  • If the repository is clean, files are loaded as before; if a genuine conflict remains after reset, the existing conflict handling still applies and blocks actions.

Steps for Testing

Prerequisites: 1 Instructor, 1 Tutor (or Instructor acting as Tutor), 1 Student, LocalVC/LocalCI test server.

  1. Create a programming exercise with manual assessment and online editor enabled; set the due date a few minutes in the future.
  2. Student: In the online editor, add "1" to any line and click Save (do NOT submit/commit).
  3. Student locally: Clone the repository, change the same line to "3", commit and push.
  4. Back in the online editor (still open): change the same spot to "2" and Save (still do NOT submit/commit).
  5. Wait until the due date is over so assessment is allowed.
  6. Tutor: Open the submission for assessment.

Verify:

  • The file browser no longer shows "Unsubmitted" for this case; status should be clean.
  • The file contents shown reflect the latest commit ("3"), not the uncommitted working copy ("2").
  • If an actual conflict persists after reset, the UI still indicates conflict and blocks actions (as before).
  • Regular student editing (non-assessment context) is unaffected.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

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 invokes resetRepository() in tutor assessment when commitState is 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.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Sep 17, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) programming Pull requests that affect the corresponding module labels Sep 17, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran200 passed3 skipped2 failed1h 13m 5s 345ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 5s 662ms
e2e/exam/test-exam/TestExamStudentExams.spec.ts
ts.Test Exam - student exams › Check exam participants and their submissions › Search for a student in exams❌ failure6m 5s 362ms

@theblobinthesky theblobinthesky changed the title Initial commit. Development: Show saved commit in assessment editor Sep 17, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran200 passed3 skipped2 failed1h 15m 8s 67ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseManagement.spec.ts
ts.Quiz Exercise Management › Quiz Exercise Creation › Creates a Quiz with Drag and Drop❌ failure2m 4s 602ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 31s 603ms

@github-actions
Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 25, 2025
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report205 ran202 passed3 skipped0 failed1h 4m 52s 11ms
TestResultTime ⏱
No test annotations available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Pull requests that update TypeScript code. (Added Automatically!) programming Pull requests that affect the corresponding module

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Programming exercises: Wrong commit shown in assessment editor

2 participants