-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an endpoint for reloading a course and added the course reloadi…
…ng to the API test data verification.
- Loading branch information
1 parent
44b508d
commit 57e309a
Showing
8 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import autograder.api.common | ||
import autograder.api.config | ||
|
||
API_ENDPOINT = 'admin/course/reload' | ||
API_PARAMS = [ | ||
autograder.api.config.PARAM_COURSE_ID, | ||
autograder.api.config.PARAM_USER_EMAIL, | ||
autograder.api.config.PARAM_USER_PASS, | ||
] | ||
|
||
DESCRIPTION = 'Reload a course from its config.' | ||
|
||
def send(arguments, **kwargs): | ||
return autograder.api.common.handle_api_request(arguments, API_PARAMS, API_ENDPOINT, **kwargs) | ||
|
||
def _get_parser(): | ||
parser = autograder.api.config.get_argument_parser( | ||
description = DESCRIPTION, | ||
params = API_PARAMS) | ||
|
||
return parser |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Commands for administering an autograder course/server. | ||
""" | ||
|
||
import os | ||
import sys | ||
|
||
import autograder.util.cli | ||
|
||
THIS_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) | ||
|
||
def run(): | ||
print(__doc__.strip()) | ||
autograder.util.cli.list_dir(THIS_DIR, 'autograder.cli.admin') | ||
return 0 | ||
|
||
def main(): | ||
return run() | ||
|
||
if (__name__ == '__main__'): | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys | ||
|
||
import autograder.api.admin.coursereload | ||
|
||
def run(arguments): | ||
autograder.api.admin.coursereload.send(arguments, exit_on_error = True) | ||
print("Course reloaded.") | ||
return 0 | ||
|
||
def main(): | ||
return run(_get_parser().parse_args()) | ||
|
||
def _get_parser(): | ||
return autograder.api.admin.coursereload._get_parser() | ||
|
||
if (__name__ == '__main__'): | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"endpoint": "admin/course/reload", | ||
"arguments": {}, | ||
"output": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters