Blueprints/Build a homework submission portal

Build a homework submission portal

Students pick an assignment, upload a file, submit. Teachers check submissions via the API or CSV export.

Updated March 2026

Collecting homework by email is a mess. Who submitted what? Did they attach the right file? Good luck finding it later. This gives students a form: pick the assignment week, upload a file, add optional notes. Teachers check submissions via the API or export as CSV. Takes about 15 minutes to set up. Sutrena Pages hosts the site -- included with your plan. One `sutrena_collect` call creates the submission form and webhooks together.

Architecture

ToolRoleCost
Sutrena PagesStatic site hosting (included)Included
SutrenaFile upload, submission storage, CSV export$0 (free) / $29/mo (Pro)

Total cost: $0-$29/mo

Pro is $29/month for 100 projects and all your other work too. Build five blueprints on Pro and it is still $29/month. That is where the value is — at scale.

A single HTML page deployed on Sutrena Pages. Students fill in their name, email, select the assignment week, upload their file, and submit. Files go through presigned URLs, so they go straight to storage without touching your server.

Teachers list submissions via the API, filter by assignment week, and export everything as CSV. File references include download URLs accessible with the API key.

Form Definition

Student name, email, assignment week (select dropdown for clean filtering), file upload (PDF, DOC, DOCX, or ZIP up to 10 MB), and optional notes.

{
  "name": "Homework Submissions",
  "fields": [
    {
      "name": "student_name",
      "label": "Student Name",
      "type": "text",
      "required": true
    },
    {
      "name": "student_email",
      "label": "Student Email",
      "type": "email",
      "required": true
    },
    {
      "name": "assignment",
      "label": "Assignment",
      "type": "select",
      "options": [
        "Week 1",
        "Week 2",
        "Week 3",
        "Week 4"
      ],
      "required": true
    },
    {
      "name": "file",
      "label": "Upload File",
      "type": "file",
      "accept": ".pdf,.doc,.docx,.zip",
      "maxFileSize": 10485760,
      "required": true
    },
    {
      "name": "notes",
      "label": "Notes (optional)",
      "type": "textarea"
    }
  ]
}

Frontend Integration

An HTML form that handles file upload via presigned URL, then submits the rest of the data. Three steps in one submit handler: get upload URL, upload file, submit form. Replace frm_YOUR_FORM_ID with yours.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>Homework Submission</title>
  <style>
    body { font-family: system-ui, sans-serif; max-width: 500px; margin: 2rem auto; }
    label { display: block; margin-top: 1rem; font-weight: 600; }
    input, select, textarea { width: 100%; padding: 0.5rem; margin-top: 0.25rem; }
    button { margin-top: 1.5rem; padding: 0.75rem 2rem; cursor: pointer; }
  </style>
</head>
<body>
  <h1>Submit Homework</h1>
  <form id="hw-form">
    <label>Student Name <input name="student_name" required /></label>
    <label>Student Email <input name="student_email" type="email" required /></label>
    <label>Assignment
      <select name="assignment" required>
        <option value="">Select week</option>
        <option>Week 1</option>
        <option>Week 2</option>
        <option>Week 3</option>
        <option>Week 4</option>
      </select>
    </label>
    <label>Upload File <input name="file" type="file" accept=".pdf,.doc,.docx,.zip" required /></label>
    <label>Notes <textarea name="notes" rows="3"></textarea></label>
    <button type="submit">Submit</button>
  </form>
  <p id="status"></p>

  <script>
    const FORM_ID = "frm_YOUR_FORM_ID";

    document.getElementById("hw-form").addEventListener("submit", async (e) => {
      e.preventDefault();
      const status = document.getElementById("status");
      status.textContent = "Uploading...";

      const fd = new FormData(e.target);
      const file = fd.get("file");

      // 1. Get presigned upload URL
      const uploadRes = await fetch(
        `https://sutrena.com/api/forms/${FORM_ID}/upload`,
        {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            field: "file",
            filename: file.name,
            contentType: file.type,
          }),
        }
      );
      const { uploadUrl, fileRef } = await uploadRes.json();

      // 2. Upload file
      await fetch(uploadUrl, {
        method: "PUT",
        headers: { "Content-Type": file.type },
        body: file,
      });

      // 3. Submit form with file reference
      const res = await fetch(
        `https://sutrena.com/api/forms/${FORM_ID}/submit`,
        {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            student_name: fd.get("student_name"),
            student_email: fd.get("student_email"),
            assignment: fd.get("assignment"),
            file: fileRef,
            notes: fd.get("notes"),
          }),
        }
      );

      status.textContent = res.ok
        ? "Submitted successfully!"
        : "Something went wrong. Please try again.";
    });
  </script>
</body>
</html>

FAQ

Can I use compound tools instead of individual API calls?

Yes. sutrena_collect creates the form and webhooks in one call. sutrena_launch deploys pages with analytics. The code examples below show primitive APIs for full control, but compound tools handle most setups faster.

What file types can students upload?

PDF, DOC, DOCX, and ZIP up to 10 MB. Change accept and maxFileSize when creating the form if you need different types or sizes.

Can students submit the same assignment twice?

By default, yes. To prevent that, add uniqueBy: ["student_email", "assignment"] to the form config. Whether you want that depends on your class.

How do teachers download the files?

File references include download URLs accessible via the API with your API key. Teachers can also export as CSV and grab the file links from there.

Can I add more assignment weeks later?

Yes. PATCH the form to add more options to the assignment field. Existing submissions stay as they are.

Do I need separate hosting?

No. Sutrena Pages hosts the HTML. Forms are also on Sutrena. One platform, one API key.

What is Sutrena?

Sutrena is the web runtime for AI agents. Forms, Pages, Analytics, Webhooks, Automations — all through 67 MCP tools and one REST API. Your agent creates web artifacts, humans interact with them, and your agent gets the data back. Use any one feature or all of them together.

Pages

Deploy HTML instantly

Forms

Collect structured data

Automations

DSL-based pipelines with 14 step types

Analytics

Privacy-first, no cookies

Webhooks

Slack, Discord, Telegram

Get started in two API calls

1. Get a trial key (no auth, no signup)

curl -X POST https://sutrena.com/api/trial

2. Create anything — a page, form, automation, or analytics site

# Create a form
curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "waitlist", "fields": [{"name": "email", "label": "Email", "type": "email", "required": true}]}'

# Or deploy a page
curl -X POST https://sutrena.com/api/pages \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"slug": "index", "title": "My Site", "html": "<h1>Live</h1>"}'

Ready to build?

Get a trial API key instantly with no signup, or create an account for the full experience.

Build a homework submission portal — Sutrena | Sutrena