Skip to content

feat: add exercise submission and team management tools - #1

Merged
DenizAltunkapan merged 6 commits into
mainfrom
feat/exercise-submission
May 18, 2026
Merged

DenizAltunkapan merged 6 commits into
mainfrom
feat/exercise-submission

Conversation

@MaximilianRau04

Copy link
Copy Markdown
Collaborator
  • Adds ExerciseService with full exercise submission and team management support, covering the two-step Dropzone file upload flow
  • Adds 8 new MCP tools: list_exercise_assignments, submit_exercise_file, list_submitted_files, delete_submitted_files, list_team_members, add_team_member, remove_team_member, search_users
  • Adds domain models ExerciseAssignment, SubmittedFile, TeamMember
  • Updates README with new tool groups and usage notes

Copilot AI review requested due to automatic review settings May 15, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds exercise submission and team management support to the ILIAS MCP server, including new service logic, MCP tool exposure, domain models, and README updates.

Changes:

  • Introduces ExerciseService for assignment listing, submissions, submitted-file deletion, user search, and team management.
  • Registers 8 new MCP tools for exercise and team workflows.
  • Adds exercise-related models and updates README tool documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 18 comments.

File Description
src/services/exercise_service.py New service implementing ILIAS exercise submission and team management flows.
src/mcp_app/server.py Wires ExerciseService into app context and exposes new MCP tools.
src/domain/models.py Adds exercise assignment, submitted file, and team member dataclasses.
README.md Documents new exercise submission and team management tool groups.
Comments suppressed due to low confidence (7)

src/mcp_app/server.py:486

  • The spread order lets result["status"] override the tool-level "ok" status returned by the rest of this server. delete_submitted_files() returns "deleted", so successful deletes do not follow the same response contract as the other tools.
        "count": len(files),

src/services/exercise_service.py:160

  • raise_for_status() can raise requests.HTTPError, but this method does not wrap it in IliasExerciseError and the MCP tool does not catch requests.RequestException. A failed Dropzone upload can therefore bubble out as an unhandled tool exception instead of the structured error response used elsewhere.
            )
        resp.raise_for_status()
        try:
            data = resp.json()
        except Exception as exc:
            raise IliasExerciseError(
                f"Dropzone upload did not return JSON: {resp.text[:200]}"
            ) from exc

src/services/exercise_service.py:208

  • confirm_resp.raise_for_status() can raise requests.HTTPError, but this direct POST is not wrapped in IliasExerciseError and the tool handler does not catch requests.RequestException. Delete confirmation HTTP failures will escape as unhandled MCP errors instead of returning the structured error response used elsewhere.
            allow_redirects=True,
        )
        confirm_resp.raise_for_status()

        # Step 2: deleteDelivered → actual deletion
        confirm_action = self._extract_submission_form_action(
            confirm_resp.text, ref_id, ass_id

src/services/exercise_service.py:224

  • final_resp.raise_for_status() can raise requests.HTTPError, but this direct POST is not wrapped in IliasExerciseError and the tool handler does not catch requests.RequestException. Final delete HTTP failures will escape as unhandled MCP errors instead of returning the structured error response used elsewhere.
            allow_redirects=True,
        )
        final_resp.raise_for_status()

        remaining = self._extract_submitted_files(final_resp.text)
        return {
            "status": "deleted",

src/services/exercise_service.py:348

  • resp.raise_for_status() can raise requests.HTTPError, but this direct POST is not wrapped in IliasExerciseError and the tool handler does not catch requests.RequestException. Add-member HTTP failures will escape as unhandled MCP errors instead of returning the normal {status: error} payload.
        post_url, rtoken = self._team_post_url_and_rtoken(
            page_resp.text, ref_id, ass_id
        )

        payload = {
            "user_login": username,
            "cmd[addUserFromAutoComplete]": "Hinzufügen",

src/services/exercise_service.py:378

  • resp.raise_for_status() can raise requests.HTTPError, but this direct POST is not wrapped in IliasExerciseError and the tool handler does not catch requests.RequestException. Remove-member HTTP failures will escape as unhandled MCP errors instead of returning the normal {status: error} payload.
        team_url = self._team_url(ref_id, ass_id)
        page_resp = self._get(team_url, f"team page {ref_id}/{ass_id}")
        post_url, rtoken = self._team_post_url_and_rtoken(
            page_resp.text, ref_id, ass_id
        )

        payload = {

src/services/exercise_service.py:11

  • SubmittedFile is imported but never used. The repo runs ruff check . in CI, and Ruff's default checks include unused imports, so this will fail the quality job unless the import is removed or the service returns the model.
from domain.models import ExerciseAssignment, TeamMember

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/mcp_app/server.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/services/exercise_service.py Resolved
Comment thread src/mcp_app/server.py Resolved
@DenizAltunkapan
DenizAltunkapan self-requested a review May 18, 2026 20:27
@DenizAltunkapan
DenizAltunkapan merged commit aa22fd9 into main May 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants