From 21971d518e46b3d8cfbd6784039e7551a442403b Mon Sep 17 00:00:00 2001 From: Martin Krulis Date: Sun, 1 Oct 2023 16:45:45 +0200 Subject: [PATCH] Adding delete-ref-solution command. --- recodex/api.py | 3 +++ recodex/plugins/exercises/cli.py | 10 ++++++++++ setup.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/recodex/api.py b/recodex/api.py index ce5f2de..4c854c3 100644 --- a/recodex/api.py +++ b/recodex/api.py @@ -123,6 +123,9 @@ def presubmit_check(self, exercise_id, files): def create_reference_solution(self, exercise_id, data): return self.post('/reference-solutions/exercise/{}/submit'.format(exercise_id), data=data) + def delete_reference_solution(self, solution_id): + self.delete('/reference-solutions/{}'.format(solution_id)) + def update_environment_configs(self, exercise_id, configs): self.post("/exercises/{}/environment-configs".format(exercise_id), data={ "environmentConfigs": configs diff --git a/recodex/plugins/exercises/cli.py b/recodex/plugins/exercises/cli.py index cbbd38a..1c38352 100644 --- a/recodex/plugins/exercises/cli.py +++ b/recodex/plugins/exercises/cli.py @@ -97,6 +97,16 @@ def get_ref_solution_evaluations(api: ApiClient, ref_solution_id, useJson): evaluation["evaluationStatus"], evaluation["isCorrect"], date)) +@cli.command() +@click.argument("solution_id") +@pass_api_client +def delete_ref_solution(api: ApiClient, solution_id): + """ + Delete referenece solution and including all its evaluations. + """ + api.delete_reference_solution(solution_id) + + @cli.command() @click.argument("evaluation_id") @pass_api_client diff --git a/setup.py b/setup.py index bafce96..f38748a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='recodex-cli', - version='0.0.23', + version='0.0.24', description='ReCodEx CLI', long_description='A command line frontend to the ReCodEx programmer evaluation system', classifiers=[