autograder.cli.courses.assignments.submissions.submit

Submit an assignment submission to the autograder.

usage: python3 -m autograder.cli.courses.assignments.submissions.submit
       [-h] [--version] [--server SERVER] [--user USER] [--pass PASS]
       [--course COURSE] [--assignment ASSIGNMENT] [--message MESSAGE]
       [--allow-late] [--testing-mode]
       FILE [FILE ...]

Submit an assignment submission to the autograder.

options:
    -h, --help          show this help message and exit
    --version           show program's version number and exit

command-specific options:
    --server SERVER     The URL of the autograder server to communicate with.
    --user USER         The email of the user making this request.
    --pass PASS         The password of the user making this request.
    --course COURSE     The ID of the course to make this request to.
    --assignment ASSIGNMENT
                        The ID of the assignment to make this request to.
    --message MESSAGE   An optional message to attach to the submission.
                        (default: None)
    --allow-late        Allow this submission to be graded, even if it is
                        late.
    FILE                The path to your submission file(s).

testing options:
    --testing-mode      Run as if a test is being run (default: False).
 1"""
 2Submit an assignment submission to the autograder.
 3"""
 4
 5import argparse
 6import sys
 7
 8import autograder.cli.courses.assignments.submissions.common
 9import autograder.api.courses.assignments.submissions.submit
10import autograder.cli.parser
11
12def run_cli(args: argparse.Namespace) -> int:
13    """ Run the CLI. """
14
15    config = args._config_info.application_config
16
17    api_response, grading_result = autograder.api.courses.assignments.submissions.submit.send(config, post_paths = args.files, exit_on_error = True)
18    return autograder.cli.courses.assignments.submissions.common.display_grading_result(api_response, grading_result)
19
20def main() -> int:
21    """ Get a parser, parse the args, and call run. """
22
23    return run_cli(_get_parser().parse_args())
24
25def _get_parser() -> argparse.ArgumentParser:
26    """ Get a parser for this operation. """
27
28    parser = autograder.cli.parser.get_parser(
29        __doc__.strip(),
30        autograder.api.courses.assignments.submissions.submit.API_PARAMS)
31
32    return parser
33
34if (__name__ == '__main__'):
35    sys.exit(main())
def run_cli(args: argparse.Namespace) -> int:
13def run_cli(args: argparse.Namespace) -> int:
14    """ Run the CLI. """
15
16    config = args._config_info.application_config
17
18    api_response, grading_result = autograder.api.courses.assignments.submissions.submit.send(config, post_paths = args.files, exit_on_error = True)
19    return autograder.cli.courses.assignments.submissions.common.display_grading_result(api_response, grading_result)

Run the CLI.

def main() -> int:
21def main() -> int:
22    """ Get a parser, parse the args, and call run. """
23
24    return run_cli(_get_parser().parse_args())

Get a parser, parse the args, and call run.