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 all the assignments that the current user can see.
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 content of a single file of an assignment template.
Get the schedule for the specified Assignment.
Updates the schedule for the specified Assignment.
Get all feedbacks for all the latest submissions for a given assignment.
Get the AutoTest for this assignment.
Get all the comments threads that a user replied on.
Get the course connected to an 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.
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.
Update the given assignment editor template with new files.
Upload one or more files as Work to the given Assignment.
- get_rubric(*, assignment_id, extra_parameters=None)[source]#
Return the rubric corresponding to the given assignment_id.
- Parameters:
- Returns:
A list of RubricRow items.
- Return type:
- put_rubric(json_body, *, assignment_id, extra_parameters=None)[source]#
Add or update rubric of an assignment.
- Parameters:
json_body (
Union
[dict
,list
,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 assignmentextra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated or created rubric.
- Return type:
- delete_rubric(*, assignment_id, extra_parameters=None)[source]#
Delete the rubric for the given assignment.
- Parameters:
- Returns:
Nothing.
- Return type:
None
- patch_rubric_category_type(json_body, *, assignment_id, rubric_category_id, extra_parameters=None)[source]#
Change the type of a rubric category.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated rubric row.
- Return type:
- get(*, assignment_id, extra_parameters=None)[source]#
Get a single assignment by id.
- Parameters:
- Returns:
The requested assignment.
- Return type:
- delete(*, assignment_id, extra_parameters=None)[source]#
Delete a given Assignment.
- Parameters:
- Returns:
Nothing.
- Return type:
None
- patch(json_body, *, assignment_id, extra_parameters=None)[source]#
Update the given assignment with new values.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment.
- Return type:
- get_description(*, assignment_id, extra_parameters=None)[source]#
Get the description for this assignment.
- Parameters:
- 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, extra_parameters=None)[source]#
Stores a file containing the new description for a given Assignment.
- Parameters:
multipart_data (
Union
[dict
,list
,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 assignmentextra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response.
- Return type:
None
- delete_description(*, assignment_id, extra_parameters=None)[source]#
Deletes the description for a given Assignment.
- Parameters:
- Returns:
An empty response.
- Return type:
None
- get_template(*, assignment_id, extra_parameters=None)[source]#
Return the template corresponding to the given assignment_id.
- Parameters:
- Returns:
The template for this assignment.
- Return type:
- delete_template(*, assignment_id, extra_parameters=None)[source]#
Delete the template corresponding to the given assignment_id.
- Parameters:
- Returns:
Nothing.
- Return type:
None
- update_peer_feedback_settings(json_body, *, assignment_id, extra_parameters=None)[source]#
Enable peer feedback for an assignment.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The just created peer feedback settings.
- Return type:
- disable_peer_feedback(*, assignment_id, extra_parameters=None)[source]#
Disabled peer feedback for an assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment for which you want to disable peer feedback.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
Nothing; an empty response.
- Return type:
None
- export(json_body, *, assignment_id, extra_parameters=None)[source]#
Generate a CSV report for this assignment.
- Parameters:
json_body (
Union
[dict
,list
,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 assignmentextra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A CSV report for this assignment.
- Return type:
- get_all(*, only_with_rubric=False, extra_parameters=None)[source]#
Get all the assignments that the current user can see.
- Parameters:
only_with_rubric (
bool
) – When True only assignments that have a rubric will be returned.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
All assignments (with a rubric if specified) that the current user can see.
- Return type:
- get_all_graders(*, assignment_id, extra_parameters=None)[source]#
Gets a list of all users that can grade in the given assignment.
- Parameters:
- Returns:
A response containing the JSON serialized graders.
- Return type:
- get_submissions_by_user(*, assignment_id, user_id, extra_parameters=None)[source]#
Return all submissions by the given user in the given assignment.
This always returns extended version of the submissions.
- Parameters:
assignment_id (
int
) – The id of the assignmentuser_id (
int
) – The user of which you want to get the submissions.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized submissions.
- Return type:
- get_all_submissions(*, assignment_id, extended=False, latest_only=True, extra_parameters=None)[source]#
Return all submissions for the given assignment.
- Parameters:
assignment_id (
int
) – The id of the assignmentextended (
bool
) – Whether to get extended or normal submissions.latest_only (
bool
) – Only get the latest submission of a user. Please use this option if at all possible, as students have a tendency to submit many attempts and that can make this route quite slow. The default value was changed to True in version “O”.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized submissions.
- Return type:
- get_template_file(*, assignment_id, file_id, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The contents of the requested file.
- Return type:
- get_timeframes(*, assignment_id, extra_parameters=None)[source]#
Get the schedule for the specified Assignment.
- Parameters:
- Returns:
The assignment schedule.
- Return type:
- put_timeframes(json_body, *, assignment_id, extra_parameters=None)[source]#
Updates the schedule for the specified Assignment.
- Parameters:
json_body (
Union
[dict
,list
,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;extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment schedule.
- Return type:
- get_all_feedback(*, assignment_id, extra_parameters=None)[source]#
Get all feedbacks for all the latest submissions for a given assignment.
- Parameters:
- Returns:
A mapping between the id of the submission and a AssignmentFeeback object.
- Return type:
- get_auto_test(*, assignment_id, extra_parameters=None)[source]#
Get the AutoTest for this assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment from which you want to get the AutoTest.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The AutoTest for the given assignment, if it has an AutoTest.
- Return type:
- get_comments_by_user(*, assignment_id, user_id, extra_parameters=None)[source]#
Get all the comments threads that a user replied on.
This route is especially useful in the context of peer feedback. With this route you can get all the comments placed by the student, so you don’t have to get all the submissions (including old ones) by the peer feedback subjects.
- Parameters:
assignment_id (
int
) – The assignment from which you want to get the threads.user_id (
int
) – The id of the user from which you want to get the threads.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A list of comments that all have at least one reply by the given user. There might be replies missing from these bases if these replies where not given by the user with id user_id, however no guarantee is made that all replies are by the user with id user_id.
- Return type:
Sequence[InlineFeedbackCommentBase | GeneralFeedbackCommentBase]
- get_course(*, assignment_id, extra_parameters=None)[source]#
Get the course connected to an assignment.
- Parameters:
assignment_id (
int
) – The id of the assignment from which you want to get the course.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
A response containing the JSON serialized course.
- Return type:
- get_webhook_settings(*, assignment_id, webhook_type, author_id=Nothing, is_test_submission=False, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.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, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.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, extra_parameters=None)[source]#
Get the peer feedback subjects for a given user.
- Parameters:
assignment_id (
int
) – The id of the assignment in which you want to get the peer feedback subjects.user_id (
int
) – The id of the user from which you want to retrieve the peer feedback subjects.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The peer feedback subjects. If the deadline has not expired, or if the assignment is not a peer feedback assignment an empty list will be returned.
- Return type:
- get_all_plagiarism_runs(*, assignment_id, extra_parameters=None)[source]#
Get all plagiarism runs for the given assignment.
- Parameters:
- Returns:
A response containing the JSON serialized list of plagiarism runs.
- Return type:
- import_into(json_body, *, into_assignment_id, extra_parameters=None)[source]#
Import an assignment into another assignment.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The updated assignment, so the assignment which was imported into.
- Return type:
- copy_rubric(json_body, *, assignment_id, extra_parameters=None)[source]#
Import a rubric from a different assignment.
- Parameters:
json_body (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.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, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204
- Return type:
None
- mark_grader_as_not_done(*, assignment_id, grader_id, extra_parameters=None)[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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
An empty response with return code 204
- Return type:
None
- patch_submit_types(multipart_data, *, assignment_id, extra_parameters=None)[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 (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.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, extra_parameters=None)[source]#
Upload one or more files as Work to the given Assignment.
- Parameters:
multipart_data (
Union
[dict
,list
,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.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (AssignmentService[AuthenticatedClient]) –
- Returns:
The created work.
- Return type: