autograder.api.courses.assignments.submissions.proxy.resubmit

Proxy resubmit an assignment submission to the autograder.

 1"""
 2Proxy resubmit an assignment submission to the autograder.
 3"""
 4
 5import typing
 6
 7import autograder.api.common
 8import autograder.api.config
 9import autograder.assignment
10import autograder.model.config
11
12API_ENDPOINT: str = 'courses/assignments/submissions/proxy/resubmit'
13API_WRITE: bool = True
14API_PARAMS: typing.List[autograder.api.config.APIParam] = [
15    autograder.api.config.PARAM_SERVER,
16    autograder.api.config.PARAM_USER_EMAIL,
17    autograder.api.config.PARAM_USER_PASS,
18
19    autograder.api.config.PARAM_COURSE,
20    autograder.api.config.PARAM_ASSIGNMENT,
21    autograder.api.config.PARAM_TARGET_SUBMISSION_OR_RECENT,
22
23    autograder.api.config.PARAM_PROXY_EMAIL,
24    autograder.api.config.PARAM_PROXY_TIME,
25]
26
27def send(config: autograder.model.config.Config, **kwargs: typing.Any) -> typing.Tuple[
28        typing.Dict[str, typing.Any], typing.Union[autograder.assignment.GradedAssignment, None]]:
29    """
30    Send a request to the autograder.
31    Return the raw response and graded assignment (if grading was successful).
32    """
33
34    response = autograder.api.common.make_api_request(API_ENDPOINT, config, API_PARAMS, write = API_WRITE, **kwargs)
35
36    assignment = None
37    result = response.get('result', None)
38    if (result is not None):
39        assignment = autograder.assignment.GradedAssignment.from_dict(result)
40
41    return response, assignment
API_ENDPOINT: str = 'courses/assignments/submissions/proxy/resubmit'
API_WRITE: bool = True
def send( config: autograder.model.config.Config, **kwargs: Any) -> Tuple[Dict[str, Any], Optional[autograder.assignment.GradedAssignment]]:
28def send(config: autograder.model.config.Config, **kwargs: typing.Any) -> typing.Tuple[
29        typing.Dict[str, typing.Any], typing.Union[autograder.assignment.GradedAssignment, None]]:
30    """
31    Send a request to the autograder.
32    Return the raw response and graded assignment (if grading was successful).
33    """
34
35    response = autograder.api.common.make_api_request(API_ENDPOINT, config, API_PARAMS, write = API_WRITE, **kwargs)
36
37    assignment = None
38    result = response.get('result', None)
39    if (result is not None):
40        assignment = autograder.assignment.GradedAssignment.from_dict(result)
41
42    return response, assignment

Send a request to the autograder. Return the raw response and graded assignment (if grading was successful).