Skip to content

Commit

Permalink
Adding delete-ref-solution command.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Oct 1, 2023
1 parent 88e0e47 commit 21971d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions recodex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions recodex/plugins/exercises/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit 21971d5

Please sign in to comment.