-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exam mode
: Fix student exam timeline page
#10350
Conversation
Exam mode
: Fix exam timeline pageExam mode
: Fix student exam timeline page
...ebapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts
Outdated
Show resolved
Hide resolved
...ming/shared/commits-info/commits-info-group/commits-info-row/commits-info-row.component.html
Show resolved
Hide resolved
src/main/webapp/app/exercises/programming/shared/commits-info/commits-info.component.ts
Show resolved
Hide resolved
WalkthroughThis pull request adjusts parts of the commit information display and exam diff functionalities. In the commit info components, a table cell is now rendered unconditionally and the component’s initialization logic is reordered to only process commit details when commits are available. In the programming exam diff component, the inheritance is updated and several new methods and properties are introduced to improve handling of exercise and submission data. Changes
Sequence Diagram(s)sequenceDiagram
participant C as CommitsInfoComponent
participant P as profileService
participant R as Commit Retrieval Flow
C->>P: getProfileInfo()
P-->>C: profile information
alt Commits are defined
C->>C: setCommitDetails()
C->>C: groupCommits()
else Commits are not defined
C->>R: Retrieve commits using participationId
R-->>C: Retrieved commits
C->>C: setCommitDetails()
C->>C: groupCommits()
end
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing otherwise LGTM
src/main/webapp/app/exercises/programming/shared/commits-info/commits-info.component.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying :D Code LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the actual cause of the getExercise()
problem.
Other changes look good.
...ebapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS2, works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on TS2
5d46237
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts (1)
143-166
: Add JSDoc comments to interface methods.While the implementation is correct, adding JSDoc comments would improve code documentation and maintainability, as mentioned in the PR objectives.
+ /** + * Returns the current exercise. + * @returns {Exercise} The current programming exercise + */ getExercise(): Exercise { return this.exercise; } + /** + * Returns the ID of the current exercise. + * @returns {number | undefined} The exercise ID if available + */ getExerciseId(): number | undefined { return this.exercise.id; } + /** + * Returns the current submission. + * @returns {Submission | undefined} The current submission if available + */ getSubmission(): Submission | undefined { return this.currentSubmission; } + /** + * Checks if there are unsaved changes. + * @returns {boolean} Always returns false as programming exercises don't support draft changes + */ hasUnsavedChanges(): boolean { return false; } + /** + * Sets the submission version. + * @param {SubmissionVersion} submissionVersion - The version to set + */ setSubmissionVersion(submissionVersion: SubmissionVersion): void { this.submissionVersion = submissionVersion; } + /** + * Updates the submission based on view changes. + * Not implemented as programming exercises don't support direct editing. + */ updateSubmissionFromView(): void {} + /** + * Updates the view based on submission changes. + * Not implemented as programming exercises don't support direct editing. + */ updateViewFromSubmission(): void {}Consider implementing view update methods.
The empty methods
updateSubmissionFromView()
andupdateViewFromSubmission()
might need implementation if view updates are required for programming exercises.Could you clarify if these methods should remain empty or if they need implementation for the exam timeline functionality?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts
(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...
src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts
🧠 Learnings (1)
src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts (1)
Learnt from: pzdr7
PR: ls1intum/Artemis#9443
File: src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts:126-129
Timestamp: 2024-11-12T12:51:40.391Z
Learning: In Angular applications using `NgbModal`, wrapping data with `signal()` when passing inputs to modal components (e.g., `GitDiffReportModalComponent`) is necessary until `NgbModal` supports signal inputs.
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Call Build Workflow / Build and Push Docker Image
- GitHub Check: Call Build Workflow / Build .war artifact
- GitHub Check: client-tests-selected
- GitHub Check: client-style
- GitHub Check: client-tests
- GitHub Check: server-style
- GitHub Check: server-tests
- GitHub Check: Analyse
🔇 Additional comments (3)
src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/programming-exam-diff/programming-exercise-exam-diff.component.ts (3)
9-9
: LGTM! The inheritance change aligns with component responsibility.The switch from
ExamPageComponent
toExamSubmissionComponent
better reflects this component's role in handling exam submissions, which is crucial for the exam timeline functionality.Also applies to: 22-23, 31-31
49-49
: LGTM! Property initialization follows Angular guidelines.The
exerciseType
property is correctly typed and initialized, following Angular naming conventions.
131-133
: LGTM! Correct implementation of NgbModal inputs.The modal inputs are properly wrapped with
signal()
as required by NgbModal, ensuring compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change, LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-aprove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reapprove
Checklist
General
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
The exam timeline view is broken currently.
I added some comments below, explaining the individual problems.
Description
This PR fixes the exam timeline view.
This issue was caused by someone (or the automatic Angular19 update) deleting the getExercise() method in the
ProgrammingExerciseExamDiffComponent
, which showed up as unused, as it inherited from theExamPageComponent
, and not from theExamSubmissionComponent
. In the ExamTimelineComponent, somehow the type system managed to use theProgrammingExerciseExamDiffComponent
as aExamSubmissionComponent
, although it did not inherit from it. But: after the deletion of the getExercise method, this broke.The fix:
Steps for Testing
Prerequisites:
You can access an exam timeline on TS2, with some submissions:
https://artemis-test2.artemis.cit.tum.de/course-management/43/exams/58/student-exams/2196/exam-timeline
(use artemis_test_user_20)
Testserver States
You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.
Review Progress
Code Review
Manual Tests
Test Coverage
Screenshots
Before fix: (nothing is displayed)




After fix (text and programming exercise):
Summary by CodeRabbit
Bug Fixes
Refactor
New Features