Skip to content

Commit

Permalink
Fixing bugs and preparing release of 0.0.30
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed May 17, 2024
1 parent d805b25 commit b48ca3f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
82 changes: 42 additions & 40 deletions recodex/plugins/groups/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def create(api: ApiClient, parent_id):
click.echo(group['id'])


@ cli.command()
@ click.argument("group_id")
@ click.option("--json/--yaml", "useJson", default=False)
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.option("--json/--yaml", "useJson", default=False)
@pass_api_client
def detail(api: ApiClient, group_id, useJson):
"""
Read detailed data about given group
Expand All @@ -82,56 +82,58 @@ def detail(api: ApiClient, group_id, useJson):
yaml.dump(group, sys.stdout)


@ cli.command()
@ click.argument("group_id")
@ click.argument("user_id")
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.argument("user_id")
@pass_api_client
def join(api: ApiClient, group_id, user_id):
"""
Add user as a member (student) of a group
"""

api.group_add_student(group_id, user_id)

@ cli.command()
@ click.argument("group_id")
@ click.argument("user_id")
@ pass_api_client
def leave(api: ApiClient, group_id, user_id):
"""

@cli.command()
@click.argument("group_id")
@click.argument("user_id")
@pass_api_client
def leave(api: ApiClient, group_id, user_id):
"""
Remove user (student) from a group
"""

api.group_remove_student(group_id, user_id)


@ cli.command()
@ click.argument("group_id")
@ click.argument("exercise_id")
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.argument("exercise_id")
@pass_api_client
def attach(api: ApiClient, group_id, exercise_id):
"""
Attach exercise to a group of residence
"""

api.group_attach_exercise(group_id, exercise_id)

@ cli.command()
@ click.argument("group_id")
@ click.argument("exercise_id")
@ pass_api_client
def detach(api: ApiClient, group_id, exercise_id):
"""

@cli.command()
@click.argument("group_id")
@click.argument("exercise_id")
@pass_api_client
def detach(api: ApiClient, group_id, exercise_id):
"""
Detach exercise from a group of residence
"""

api.group_detach_exercise(group_id, exercise_id)


@ cli.command()
@ click.argument("group_id")
@ click.option("--json/--yaml", "useJson", default=None)
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.option("--json/--yaml", "useJson", default=None)
@pass_api_client
def students(api: ApiClient, group_id, useJson):
"""
List all students of a group.
Expand All @@ -148,10 +150,10 @@ def students(api: ApiClient, group_id, useJson):
click.echo("{} {}".format(student["id"], student["fullName"]))


@ cli.command()
@ click.argument("group_id")
@ click.option("--json/--yaml", "useJson", default=None)
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.option("--json/--yaml", "useJson", default=None)
@pass_api_client
def assignments(api: ApiClient, group_id, useJson):
"""
List all (regular) assignments of a group.
Expand All @@ -170,10 +172,10 @@ def assignments(api: ApiClient, group_id, useJson):
assignment["localizedTexts"])))


@ cli.command()
@ click.argument("group_id")
@ click.option("--json/--yaml", "useJson", default=None)
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.option("--json/--yaml", "useJson", default=None)
@pass_api_client
def shadow_assignments(api: ApiClient, group_id, useJson):
"""
List all shadow assignments of a group.
Expand Down Expand Up @@ -204,10 +206,10 @@ def set_exam(api: ApiClient, group_id, unset):
api.set_group_exam_flag(group_id, not unset)


@ cli.command()
@ click.argument("group_id")
@ click.option("--json/--yaml", "useJson", default=False)
@ pass_api_client
@cli.command()
@click.argument("group_id")
@click.option("--json/--yaml", "useJson", default=False)
@pass_api_client
def stats(api: ApiClient, group_id, useJson):
"""
Get students information about solution stats (point summaries)
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.29',
version='0.0.30',
description='ReCodEx CLI',
long_description='A command line frontend to the ReCodEx programmer evaluation system',
classifiers=[
Expand Down

0 comments on commit b48ca3f

Please sign in to comment.