Skip to content

feat: let faculty create arbitrary Scratch projects, with rename and delete - #48

Open
ishad05 wants to merge 13 commits into
developfrom
feat/arbitrary-scratch-projects
Open

feat: let faculty create arbitrary Scratch projects, with rename and delete#48
ishad05 wants to merge 13 commits into
developfrom
feat/arbitrary-scratch-projects

Conversation

@ishad05

@ishad05 ishad05 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes #43.

What changed

  • Faculty can create Scratch projects, same as students. Projects link added to the faculty sidebar.
  • Owners can rename or delete a project that is not linked to an assignment. Once a project is submitted it is frozen.
  • A project now stores the assignment it was started from, so reopening it and hitting Submit goes to that assignment instead of showing a picker.
  • The "New Project" prompt was a native browser dialog. It is an in-app dialog now. Students get it too, since the page is shared.
  • Added the missing Projects breadcrumb label for both portals.

Scope

Projects were student-only in the API, the permissions, and the route guard, so a sidebar link alone would have redirected faculty away. Ownership is generalised from "student" to "profile".

Screenshot 2026-07-20 at 11 28 31 AM Screenshot 2026-07-20 at 11 28 36 AM Screenshot 2026-07-20 at 11 28 41 AM

Migrations

Two schema changes, both with patches, both run against a real site:

  • CS17 Project.student renamed to profile.
  • CS17 Project.assignment added, linking to the assignment a project was started from. Empty means standalone.

Notes

  • The project to assignment link is stored on the doctype rather than passed in a URL param. Matching on project titles would have been guesswork.
  • The link drives the submit target only, not the read only check, so sandbox projects stay editable.
  • Adding the link made Frappe block deleting an assignment once a student had started a project. delete_assignment now unlinks first. The doctype wide ignore hook would have worked too, but it would also let a profile delete orphan its projects.
  • Rename changes the title only. The record name is linked from submissions and used in editor URLs.
  • Faculty own projects but cannot submit them to assignments.
  • No new role. Faculty already carry System Manager.
  • Both project pages are reused under the faculty layout rather than duplicated. Submit is hidden for faculty in the editor.

Testing

  • New faculty projects spec. The submitted-project guards live in the student spec, since only the student flow creates a real submission.
  • 159 e2e, 18 test_cs17_project, 7 test_api. tsc and yarn build clean.

ishad05 added 6 commits July 16, 2026 20:21
- Implemented Scratch as a new submission type for assignments.
- Updated the project submission process to allow for revising existing submissions.
- Added functionality to prevent resubmission after grades are published.
- Created a new ScratchSubmissionPlayer component for faculty to preview student submissions in a read-only mode.
- Enhanced the AssignmentTable and SubmissionPreviewDialog components to support Scratch submissions.
- Updated the CreateAssignmentSheet to include Scratch as a submission option.
- Modified FacultyAssignmentDetailPage and FacultyGradingPage to handle Scratch submissions.
- Added hooks for starting Scratch submissions directly from the dashboard.
- Implemented tests for Scratch submission functionality, including UI interactions and submission confirmations.
- Updated e2e tests to cover Scratch assignment creation and submission scenarios.
…d project deletion and renaming functionality
@ishad05
ishad05 changed the base branch from develop to feat/scratch-assignment-submissions July 17, 2026 10:02
@ishad05
ishad05 requested a review from NagariaHussain July 17, 2026 10:24
Base automatically changed from feat/scratch-assignment-submissions to develop July 20, 2026 07:33
ishad05 and others added 4 commits July 20, 2026 13:16
…ratch-projects

# Conflicts:
#	cs17_portal/api.py
#	cs17_portal/patches.txt
#	dashboard/src/hooks/useScratchEditor.ts
#	dashboard/src/pages/ProjectEditorPage.tsx
#	e2e/tests/student-submission.spec.ts
Both feat and develop added a project-cleanup loop to the afterAll hook
at different positions; the merge stacked them, redeclaring `projects`
and breaking the Playwright parse. Keep the single cleanup that runs
before cleanupTestAssignments so linked projects are deleted first.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Newer Frappe develop renders the credentials submit button as
"Continue" without the .btn-login class, breaking the UI login tests
in CI while they passed against older local Frappe. Locate the button
by role + accessible name instead of the stale class selector.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

I should be able to create arbitrary scratch projects

1 participant