AssignmentService#
- class AssignmentService[source]#
Methods
Return the rubric corresponding to the given assignment_id.
Add or update rubric of an assignment.
Delete the rubric for the given assignment.
Change the type of a rubric category.
Get a single assignment by id.
Delete a given Assignment.
Update the given assignment with new values.
Get the description for this assignment.
Stores a file containing the new description for a given Assignment.
Deletes the description for a given Assignment.
Return the template corresponding to the given assignment_id.
Delete the template corresponding to the given assignment_id.
Enable peer feedback for an assignment.
Disabled peer feedback for an assignment.
Generate a CSV report for this assignment.
Get the grades for all submissions in this assignment.
Gets a list of all users that can grade in the given assignment.
Return all submissions by the given user in the given assignment.
Return all submissions for the given assignment.
Get the data of an analytics source.
Get the content of a single file of an assignment template.
Get the schedule for the specified Assignment.
Updates the schedule for the specified Assignment.
Get the AutoTest for this assignment.
Create or get the webhook settings to hand-in submissions.
Get the LTI states for the members of a group for the given assignment.
Get the peer feedback subjects for a given user.
Get all plagiarism runs for the given assignment.
Retrieves reply counts for a specific user, grouped by submission.
Import an assignment into another assignment.
Import a rubric from a different assignment.
Indicate that the given grader is done grading the given assignment.
Indicate that the given grader is not yet done grading the given assignment.
Run a plagiarism checker for the given Assignment.
Update the given assignment editor template with new files.
Upload one or more files as Work to the given Assignment.
- get_rubric(*, assignment_id, page_size=50)[source]#
Return the rubric corresponding to the given assignment_id.
- Parameters:
assignment_id (
int
) – The id of the assignment.page_size (
int
) – The size of a single page, maximum is 100.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A list of RubricRow items.
- Return type:
Response[RubricRowBase]
- put_rubric(json_body, *, assignment_id)[source]#
Add or update rubric of an assignment.
- Parameters:
json_body (
PutRubricAssignmentData
) – The body of the request. SeePutRubricAssignmentData
for information about the possible fields. You can provide this data as aPutRubricAssignmentData
or as a dictionary.assignment_id (
int
) – The id of the assignmentself (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated or created rubric.
- Return type:
- delete_rubric(*, assignment_id)[source]#
Delete the rubric for the given assignment.
- Parameters:
assignment_id (
int
) – The id of the Assignment whose rubric should be deleted.self (AssignmentService[AuthenticatedClient]) –
- Returns:
Nothing.
- Return type:
None
- patch_rubric_category_type(json_body, *, assignment_id, rubric_category_id)[source]#
Change the type of a rubric category.
- Parameters:
json_body (
PatchRubricCategoryTypeAssignmentData
) – The body of the request. SeePatchRubricCategoryTypeAssignmentData
for information about the possible fields. You can provide this data as aPatchRubricCategoryTypeAssignmentData
or as a dictionary.assignment_id (
int
) – The assignment of the rubric category.rubric_category_id (
int
) – The rubric category you want to change the type of.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated rubric row.
- Return type:
- get(*, assignment_id)[source]#
Get a single assignment by id.
- Parameters:
assignment_id (
int
) – The id of the assignment you want to get.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The requested assignment.
- Return type:
- delete(*, assignment_id)[source]#
Delete a given Assignment.
- Parameters:
assignment_id (
int
) – The id of the assignmentself (AssignmentService[AuthenticatedClient]) –
- Returns:
Nothing.
- Return type:
None
- patch(json_body, *, assignment_id)[source]#
Update the given assignment with new values.
- Parameters:
json_body (
PatchAssignmentData
) – The body of the request. SeePatchAssignmentData
for information about the possible fields. You can provide this data as aPatchAssignmentData
or as a dictionary.assignment_id (
int
) – The id of the assignment you want to update.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment.
- Return type:
- get_description(*, assignment_id)[source]#
Get the description for this assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment;self (AssignmentService[AuthenticatedClient]) –
- Returns:
A public link that allows users to download the file or the file itself as a stream of octets
- Return type:
- put_description(multipart_data, *, assignment_id)[source]#
Stores a file containing the new description for a given Assignment.
- Parameters:
multipart_data (
PutDescriptionAssignmentData
) – The data that should form the body of the request. SeePutDescriptionAssignmentData
for information about the possible fields.assignment_id (
int
) – The id of the assignmentself (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response.
- Return type:
None
- delete_description(*, assignment_id)[source]#
Deletes the description for a given Assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response.
- Return type:
None
- get_template(*, assignment_id)[source]#
Return the template corresponding to the given assignment_id.
- Parameters:
assignment_id (
int
) – The id of the assignment.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The template for this assignment.
- Return type:
- delete_template(*, assignment_id)[source]#
Delete the template corresponding to the given assignment_id.
- Parameters:
assignment_id (
int
) – The id of the assignment.self (AssignmentService[AuthenticatedClient]) –
- Returns:
Nothing.
- Return type:
None
- update_peer_feedback_settings(json_body, *, assignment_id)[source]#
Enable peer feedback for an assignment.
- Parameters:
json_body (
UpdatePeerFeedbackSettingsAssignmentData
) – The body of the request. SeeUpdatePeerFeedbackSettingsAssignmentData
for information about the possible fields. You can provide this data as aUpdatePeerFeedbackSettingsAssignmentData
or as a dictionary.assignment_id (
int
) – The id of the assignment for which you want to enable peer feedback.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The just created peer feedback settings.
- Return type:
- disable_peer_feedback(*, assignment_id)[source]#
Disabled peer feedback for an assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment for which you want to disable peer feedback.self (AssignmentService[AuthenticatedClient]) –
- Returns:
Nothing; an empty response.
- Return type:
None
- export(json_body, *, assignment_id)[source]#
Generate a CSV report for this assignment.
- Parameters:
json_body (
Union
[ExportAssignmentCSVData
,ExportAssignmentFilesData
]) – The body of the request. SeeExportAssignmentData
for information about the possible fields. You can provide this data as aExportAssignmentData
or as a dictionary.assignment_id (
int
) – The id of the assignmentself (AssignmentService[AuthenticatedClient]) –
- Returns:
A CSV report for this assignment.
- Return type:
- get_all_grades(*, assignment_id, page_size=150)[source]#
Get the grades for all submissions in this assignment.
- Parameters:
assignment_id (
int
) – The id of assignment to export the gradebook for.page_size (
int
) – The size of a single page, maximum is 200.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The rows of the gradebook.
- Return type:
Response[AssignmentGradebookRow]
- get_all_graders(*, assignment_id, page_size=20)[source]#
Gets a list of all users that can grade in the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignmentpage_size (
int
) – The size of a single page, maximum is 50.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized graders.
- Return type:
Response[AssignmentGrader]
- get_submissions_by_user(*, assignment_id, user_id, page_size=20)[source]#
Return all submissions by the given user in the given assignment.
For group assignments this route will also include submissions by the group of the user, which are always seen as later than the submission of the user.
- Parameters:
assignment_id (
int
) – The id of the assignmentuser_id (
int
) – The user of which you want to get the submissions.page_size (
int
) – The size of a single page, maximum is 50.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized submissions.
- Return type:
Response[Work]
- get_all_submissions(*, assignment_id, q='', test_student=Nothing, page_size=50)[source]#
Return all submissions for the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignmentq (
str
) – Filter the submissions returned based on this string.test_student (
Union
[Just
[bool
],_Nothing
[bool
]]) – If give only return submissions that either are or are not of the test student.page_size (
int
) – The size of a single page, maximum is 100.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized submissions.
- Return type:
Response[Work]
- get_analytics_data(*, assignment_id, data_source_name, page_size=100)[source]#
Get the data of an analytics source.
the data. the data.
- Parameters:
assignment_id (
int
) – The id of the assignment from which you want to get the data.data_source_name (
str
) – The name of the data source of which you wan to get the data.page_size (
int
) – The size of a single page, maximum is 250.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A paginated list of the data.
- Return type:
Response[AnalyticsData]
- get_template_file(*, assignment_id, file_id)[source]#
Get the content of a single file of an assignment template.
- Parameters:
assignment_id (
int
) – The id of the assignment.file_id (
str
) – The id of the file.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The contents of the requested file.
- Return type:
- get_timeframes(*, assignment_id)[source]#
Get the schedule for the specified Assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment;self (AssignmentService[AuthenticatedClient]) –
- Returns:
The assignment schedule.
- Return type:
- put_timeframes(json_body, *, assignment_id)[source]#
Updates the schedule for the specified Assignment.
- Parameters:
json_body (
AssignmentTimeframes
) – The body of the request. SeeAssignmentTimeframes
for information about the possible fields. You can provide this data as aAssignmentTimeframes
or as a dictionary.assignment_id (
int
) – The id of the assignment;self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment schedule.
- Return type:
- get_auto_test(*, assignment_id)[source]#
Get the AutoTest for this assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment from which you want to get the AutoTest.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The AutoTest for the given assignment, if it has an AutoTest.
- Return type:
- get_webhook_settings(*, assignment_id, webhook_type, author_id=Nothing, is_test_submission=False)[source]#
Create or get the webhook settings to hand-in submissions.
You can select the user for which the webhook should hand-in using the exact same query parameters as the route to upload a submission.
- Parameters:
assignment_id (
int
) – The assignment for which the webhook should hand-in submissions.webhook_type (
Literal
['git'
]) – The webhook type, currently only git is supported, which works for both GitLab and GitHub.author_id (
Union
[Just
[int
],_Nothing
[int
]]) – The id of the user for which we should get the webhook settings. If not given defaults to the current user.is_test_submission (
bool
) – Should we get the webhook settings for the test student.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A serialized form of a webhook, which contains all data needed to add the webhook to your provider.
- Return type:
- get_member_states(*, assignment_id, group_id)[source]#
Get the LTI states for the members of a group for the given assignment.
- Parameters:
assignment_id (
int
) – The assignment for which the LTI states should be given.group_id (
int
) – The group for which the states should be returned.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A mapping between user id and a boolean indicating if we can already passback grades for this user. If the assignment is any LTI assignment and any of the values in this mapping is False trying to submit anyway will result in a failure.
- Return type:
- get_peer_feedback_subjects(*, assignment_id, user_id, page_size=20)[source]#
Get the peer feedback subjects for a given user.
This endpoint retrieves the list of subjects (i.e., other users or groups) that the specified user is assigned to review. It transparently handles both individual and group assignments.
- Parameters:
assignment_id (
int
) – The ID of the assignment.user_id (
int
) – The ID of the user whose peer feedback duties are being requested. For group assignments, providing an individual member’s ID will return the subjects assigned to their entire group.page_size (
int
) – The size of a single page, maximum is 50.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A paginated list of peer feedback subjects. Returns an empty list if the assignment’s feedback period is not active or if it is not a peer feedback assignment.
- Return type:
Response[AssignmentPeerFeedbackConnection]
- get_all_plagiarism_runs(*, assignment_id, q='', page_size=20)[source]#
Get all plagiarism runs for the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignmentq (
str
) – Search the runs based on this value.page_size (
int
) – The size of a single page, maximum is 50.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized list of plagiarism runs.
- Return type:
Response[PlagiarismRun]
- get_reply_counts_for_user(*, assignment_id, user_id, page_size=20)[source]#
Retrieves reply counts for a specific user, grouped by submission.
This endpoint provides an efficient summary of a user’s activity within an assignment. It’s useful for analytics or dashboard views where you need to see how many replies a user has contributed to each submission without fetching the full comment data.
- Parameters:
assignment_id (
int
) – The ID of the assignment to scope the search to.user_id (
int
) – The ID of the user whose replies are being counted.page_size (
int
) – The size of a single page, maximum is 50.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A paginated response. The data payload is a list of objects, each mapping a submission’s ID to the total count of replies the specified user made on it.
- Return type:
Response[WorkCommentCount]
- import_into(json_body, *, into_assignment_id)[source]#
Import an assignment into another assignment.
- Parameters:
json_body (
ImportIntoAssignmentData
) – The body of the request. SeeImportIntoAssignmentData
for information about the possible fields. You can provide this data as aImportIntoAssignmentData
or as a dictionary.into_assignment_id (
int
) – The assignment you want to import into.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment, so the assignment which was imported into.
- Return type:
- copy_rubric(json_body, *, assignment_id)[source]#
Import a rubric from a different assignment.
- Parameters:
json_body (
CopyRubricAssignmentData
) – The body of the request. SeeCopyRubricAssignmentData
for information about the possible fields. You can provide this data as aCopyRubricAssignmentData
or as a dictionary.assignment_id (
int
) – The id of the assignment in which you want to import the rubric. This assignment shouldn’t have a rubric.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The rubric rows of the assignment in which the rubric was imported, so the assignment with id assignment_id and not old_assignment_id.
- Return type:
- mark_grader_as_done(*, assignment_id, grader_id)[source]#
Indicate that the given grader is done grading the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment the grader is done grading.grader_id (
int
) – The id of the User that is done grading.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204
- Return type:
None
- mark_grader_as_not_done(*, assignment_id, grader_id)[source]#
Indicate that the given grader is not yet done grading the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment the grader is not yet done grading.grader_id (
int
) – The id of the User that is not yet done grading.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204
- Return type:
None
- create_plagiarism_run(multipart_data, *, assignment_id)[source]#
Run a plagiarism checker for the given Assignment.
- Parameters:
multipart_data (
CreatePlagiarismRunAssignmentData
) – The data that should form the body of the request. SeeCreatePlagiarismRunAssignmentData
for information about the possible fields.assignment_id (
int
) – The id of the assignmentself (AssignmentService[AuthenticatedClient]) –
- Returns:
The json serialization newly created
- Return type:
- patch_submit_types(multipart_data, *, assignment_id)[source]#
Update the given assignment editor template with new files.
How this route deals with existing editor templates when submitting is still experimental and might change in an upcoming release.
- Parameters:
multipart_data (
PatchSubmitTypesAssignmentData
) – The data that should form the body of the request. SeePatchSubmitTypesAssignmentData
for information about the possible fields.assignment_id (
int
) – The id of the assignment for which you want to update the editor template.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment.
- Return type:
- upload_submission(multipart_data, *, assignment_id, author_id=Nothing, is_test_submission=False, ignored_files=IgnoreHandling.keep)[source]#
Upload one or more files as Work to the given Assignment.
- Parameters:
multipart_data (
UploadSubmissionAssignmentData
) – The data that should form the body of the request. SeeUploadSubmissionAssignmentData
for information about the possible fields.assignment_id (
int
) – The id of the assignmentauthor_id (
Union
[Just
[int
],_Nothing
[int
]]) – The id of the user for which we should get the webhook settings. If not given defaults to the current user.is_test_submission (
bool
) – Should we get the webhook settings for the test student.ignored_files (
IgnoreHandling
) – How to handle ignored files. The options are: keep: this the default, sipmly do nothing about ignored files. delete: delete the ignored files. error: return an error when there are ignored files in the archive.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The created work.
- Return type: