-
Notifications
You must be signed in to change notification settings - Fork 329
Exam mode
: Skip access forbidden alert for instructors
#10538
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
: Skip access forbidden alert for instructors
#10538
Conversation
WalkthroughThis pull request adds a new conditional branch in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ExamAccessService
Client->>ExamAccessService: getOrCreateStudentExamElseThrow()
ExamAccessService->>ExamAccessService: Check user role
alt User is Instructor
ExamAccessService-->>Client: throw AccessForbiddenAlertException
else User is not Instructor
ExamAccessService-->>Client: Proceed with exam retrieval/creation
end
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)`src/main/java/**/*.java`: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,de...
`src/test/java/**/*.java`: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_...
🧠 Learnings (1)src/main/java/de/tum/cit/aet/artemis/exam/service/ExamAccessService.java (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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.
code
End-to-End (E2E) Test Results Summary
|
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. |
Checklist
General
Server
Motivation and Context
In the 8.0.0 testing session, an issue was discovered where instructors see an "Access Forbidden" alert when opening a normal exam. This shouldn't happen, as instructors already receive a message stating they cannot participate in a normal exam, but can proceed to the exam management page.
This PR resolves #10509.
Description
I added a check in getOrCreateStudentExamElseThrow to verify if the user is at least an instructor in the course. If they are, an AccessForbiddenAlertException is thrown, preventing the getOrCreateNormalExam method from being called, since instructors and admins cannot participate in normal exams. The alert is suppressed on the client side.
Steps for Testing
Prerequisites:
Exams
"Since you are not a student, you cannot participate in this exam."
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
Summary by CodeRabbit