Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

[Feature]: ELUSoC_2026 — Task submission modal ignores the backend links field, preventing URL-based submissions #256

Description

@Babin123456

Problem

The POST /api/tasks/:taskId/submissions backend endpoint accepts a links array field (alongside content), intended for submitters to attach reference URLs such as GitHub repositories, live demos, or video recordings. However, the SubmitTaskModal component in TasksPage.jsx only sends { content } — the links field is completely absent from the UI.

Current Behavior

  • The submit form only renders a single <textarea> for text content.
  • Members submitting tasks of type link, file, or multiple have no way to attach reference URLs via the web dashboard.
  • The links array stored in the TaskSubmission model is always empty, even when the task's submissionFormat implies URL references are expected.

Why This Improvement Is Needed

  • The backend API and database schema already support links — the gap is purely in the frontend.
  • For code challenges, participants need to submit GitHub repo links.
  • For creative tasks, participants may need to attach video/demo URLs.
  • Without this field, submitters must embed URLs inside the text area, making moderator review harder.

Proposed Solution

Extend SubmitTaskModal to include a "Reference Links" section that:

  1. Provides a type="url" input where users can paste a URL and click "Add" (or press Enter).
  2. Renders the added links as a removable chip list below the input.
  3. Validates each URL with the native URL constructor before adding.
  4. Caps the list at 5 links.
  5. Sends { content, links } to the backend when links are present.

Expected Outcome

  • Members can attach up to 5 reference URLs to any task submission.
  • Moderators reviewing submissions in the Moderation panel can see the submitted links.
  • The change is fully backward compatible — tasks without links continue to work as before.

Additional Notes

  • Only TasksPage.jsx needs changing; the backend, model, and route are already correct.
  • The field is optional — submissions without links are unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions