-
Notifications
You must be signed in to change notification settings - Fork 2
AB#113906 allow get assignment options to have string assignmentId #78
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
Changes from all commits
5116edb
cff3f04
2b6c117
8955cf6
242d53c
96347de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| package edu.ksu.canvas.requestOptions; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
| public class GetSingleAssignmentOptions extends BaseOptions { | ||
|
|
||
| private String courseId; | ||
| private Integer assignmentId; | ||
| private String assignmentId; | ||
|
|
||
| public enum Include { | ||
| SUBMISSION, ASSIGNMENT_VISIBILITY, OVERRIDES, OBSERVED_USERS; | ||
|
|
@@ -16,19 +17,23 @@ public String toString() { | |
| } | ||
| } | ||
|
|
||
| public GetSingleAssignmentOptions(String courseId, Integer assignmentId) { | ||
| public GetSingleAssignmentOptions(String courseId, String assignmentId) { | ||
| if(courseId == null || assignmentId == null) { | ||
| throw new IllegalArgumentException("Course and assignment IDs are required"); | ||
| } | ||
| this.courseId = courseId; | ||
| this.assignmentId = assignmentId; | ||
| } | ||
|
Comment on lines
+20
to
26
|
||
|
|
||
| public GetSingleAssignmentOptions(String courseId, Integer assignmentId) { | ||
sebastianchristopher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| this(courseId, Objects.toString(assignmentId, null)); | ||
| } | ||
|
|
||
| public String getCourseId() { | ||
| return courseId; | ||
| } | ||
|
|
||
| public Integer getAssignmentId() { | ||
| public String getAssignmentId() { | ||
| return assignmentId; | ||
| } | ||
|
|
||
|
|
||
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.
The new functionality allowing String assignment IDs (e.g., "lti_context_id:ab84f579-4442-4d4a-acd8-85c5ec6fd2b6") lacks test coverage. While existing tests will continue to work through the backward-compatible Integer constructor, there should be a test that verifies the String constructor works correctly with non-numeric IDs, ensuring the URL is properly constructed and the API call succeeds.