Skip to content

feat: course package import and export#2286

Merged
pateljannat merged 15 commits intofrappe:developfrom
pateljannat:course-package-import
Apr 3, 2026
Merged

feat: course package import and export#2286
pateljannat merged 15 commits intofrappe:developfrom
pateljannat:course-package-import

Conversation

@pateljannat
Copy link
Copy Markdown
Member

@pateljannat pateljannat commented Apr 2, 2026

There was no easy way to duplicate a course from one site to another. There are just too many doctypes involved. So duplicating a course required a lot of manual effort.

This feature simplifies duplicating a course from one site to another. You can now export a course as a zip. This zip contains all the course metadata along with all its chapters, lessons, assessments, and assets.

You can then import this zip package on another site with the Learning app installed. This process would create the course along with all its dependencies on the new site.

course.package.mp4

Closes #2225

@cypress
Copy link
Copy Markdown

cypress bot commented Apr 2, 2026

lms    Run #2759

Run Properties:  status check passed Passed #2759  •  git commit e4e9e52fd7 ℹ️: Merge 7fe8d6c5003d162143a2dd9e04f6dba7af8df296 into a263ca9330d41a11663501942a17...
Project lms
Branch Review course-package-import
Run status status check passed Passed #2759
Run duration 00m 31s
Commit git commit e4e9e52fd7 ℹ️: Merge 7fe8d6c5003d162143a2dd9e04f6dba7af8df296 into a263ca9330d41a11663501942a17...
Committer Jannat Patel
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 1
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 79.68992% with 131 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.09%. Comparing base (1d2b3b0) to head (7fe8d6c).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
lms/lms/course_import_export.py 77.12% 116 Missing ⚠️
lms/lms/api.py 56.00% 11 Missing ⚠️
lms/lms/utils.py 91.17% 3 Missing ⚠️
lms/lms/test_api.py 98.43% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2286      +/-   ##
===========================================
+ Coverage    44.61%   48.09%   +3.48%     
===========================================
  Files          149      150       +1     
  Lines         5877     6508     +631     
===========================================
+ Hits          2622     3130     +508     
- Misses        3255     3378     +123     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pateljannat pateljannat changed the title Course package import feat: course package import and export Apr 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a ZIP-based course package export/import flow to make it easier to duplicate an LMS course (including its structure and related records) across sites, and wires this into the LMS API + UI.

Changes:

  • Introduces backend export/import implementation for course ZIP packages and exposes it via whitelisted API methods.
  • Adds frontend UI to import courses via ZIP (modal) and export from the course settings menu.
  • Updates automated tests (Python + Cypress) to cover the new UI/API behavior.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
lms/lms/course_import_export.py New core implementation for course ZIP export/import logic.
lms/lms/api.py Exposes new import/export API endpoints and includes minor parameter renames.
lms/lms/test_api.py Adds tests for course export/import ZIP behavior.
lms/lms/doctype/lms_quiz/lms_quiz.json Adjusts Quiz title constraints (unique removed).
frontend/src/pages/Courses/CourseImportModal.vue Adds ZIP upload/import modal.
frontend/src/pages/Courses/CourseDetail.vue Adds Export action in course settings dropdown.
frontend/src/pages/Courses/Courses.vue Adds menu option to open ZIP import modal.
frontend/src/utils/index.js Adds ZIP validation to shared file validation helper.
frontend/src/components/Modals/Event.vue Updates request param name to match backend rename.
cypress/e2e/course_creation.cy.js Updates selectors/flow for new settings dropdown UI.
lms/lms/utils.py Removes stray whitespace.
lms/lms/doctype/lms_course/lms_course.py Removes stray whitespace.
lms/lms/doctype/course_lesson/course_lesson.json Doctype metadata updates (field order / naming rule metadata).

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

@pateljannat pateljannat marked this pull request as ready for review April 3, 2026 07:56
@pateljannat pateljannat merged commit 90d4f32 into frappe:develop Apr 3, 2026
8 of 9 checks passed
@pateljannat
Copy link
Copy Markdown
Member Author

@Mergifyio backport main-hotfix

@mergify
Copy link
Copy Markdown

mergify bot commented Apr 3, 2026

backport main-hotfix

❌ No backport have been created

Details
  • Backport to branch main-hotfix failed

Git reported the following error:

error: commit 03e5bae0aa89658323182e18fbbaa493609b35fa is a merge but no -m option was given.
fatal: cherry-pick failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exporting and Importing a Course Package

3 participants